From fc0e49297d6a6818b82169d1059084770c29b9d6 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 14 Feb 2017 09:48:24 +0100 Subject: [PATCH] makefiles: use configure vars Use binaries found in configure. --- make.tmpl.in | 9 +++++++-- test/Makefile.in | 4 ++-- tools/Makefile.in | 9 ++------- udev/Makefile.in | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/make.tmpl.in b/make.tmpl.in index d418cfba2..2e7c1ba52 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -40,6 +40,11 @@ SED = @SED@ CFLOW_CMD = @CFLOW_CMD@ AWK = @AWK@ CHMOD = @CHMOD@ +EGREP = @EGREP@ +GREP = @GREP@ +SORT = @SORT@ +WC = @WC@ + PYTHON2 = @PYTHON2@ PYTHON3 = @PYTHON3@ PYCOMPILE = $(top_srcdir)/autoconf/py-compile @@ -512,9 +517,9 @@ ifeq (,$(firstword $(EXPORTED_SYMBOLS))) ) > $@ else set -e;\ - R=$$(sort $^ | uniq -u);\ + R=$$($(SORT) $^ | uniq -u);\ test -z "$$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $$R"; false; } ;\ - ( for i in $$(echo $(EXPORTED_SYMBOLS) | tr ' ' '\n' | sort -rnt_ -k5 ); do\ + ( for i in $$(echo $(EXPORTED_SYMBOLS) | tr ' ' '\n' | $(SORT) -rnt_ -k5 ); do\ echo "$${i##*.} {"; echo " global:";\ $(SED) "s/^/ /;s/$$/;/" $$i;\ echo "};";\ diff --git a/test/Makefile.in b/test/Makefile.in index f1528682f..3cb0f182d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -39,7 +39,7 @@ S ?= @ # never match anything by default VERBOSE ?= 0 ALL := $(shell find -L $(srcdir) \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) | sort) comma = , -RUN := $(shell find -L $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | sort) +RUN := $(shell find -L $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | ($SORT)) RUN_BASE = $(subst $(srcdir)/,,$(RUN)) ifeq ("@BUILD_LVMETAD@", "yes") @@ -267,7 +267,7 @@ lib/%: lib/%.o .lib-dir-stamp lib/%: $(srcdir)/lib/%.sh .lib-dir-stamp cp $< $@ - chmod +x $@ + $(CHMOD) +x $@ lib/flavour-%: $(srcdir)/lib/flavour-%.sh .lib-dir-stamp cp $< $@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 5aaba2ff2..ed359eac4 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -173,15 +173,10 @@ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX) .commands: $(srcdir)/commands.h $(srcdir)/cmdnames.h Makefile $(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \ - egrep -v '^ *(|#.*|config|devtypes|dumpconfig|formats|fullreport|help|lastlog|lvpoll|pvdata|segtypes|systemid|tags|version) *$$' > .commands + $(EGREP) -v '^ *(|#.*|config|devtypes|dumpconfig|formats|fullreport|help|lastlog|lvpoll|pvdata|segtypes|systemid|tags|version) *$$' > .commands .DELETE_ON_ERROR: -# move properly to configure -WC = /usr/bin/wc -GREP = /bin/grep -SORT = /bin/sort - command-count.h: $(srcdir)/command-lines.in Makefile set -o pipefail && \ ( cat $(top_srcdir)/doc/license.txt && \ @@ -204,7 +199,7 @@ command-lines-input.h: $(srcdir)/command-lines.in Makefile ( cat $(top_srcdir)/doc/license.txt && \ echo "/* Do not edit. This file is generated by the Makefile. */" && \ echo -en "const char _command_input[] =\n\n\"" && \ - $(GREP) -Ev '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \ + $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \ echo "\\n\";" \ ) > $@ diff --git a/udev/Makefile.in b/udev/Makefile.in index cb968dfe1..c498aa838 100644 --- a/udev/Makefile.in +++ b/udev/Makefile.in @@ -23,7 +23,7 @@ ifeq ("@BUILD_LVMETAD@", "yes") LVM_RULES+=69-dm-lvm-metad.rules endif -DM_DIR=$(shell grep "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | awk '{print $$3}') +DM_DIR=$(shell $(GREP) "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | $(AWK) '{print $$3}') ifeq ("@UDEV_RULE_EXEC_DETECTION@", "yes") SBIN=\$$env{DM_SBIN_PATH}