diff --git a/Makefile.am b/Makefile.am index d490f6f2b..3da8021e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -301,7 +301,7 @@ dist-hook: $(top_srcdir)/update-bugs.sh > BUGS-t mv BUGS-t BUGS cp BUGS $(distdir)/BUGS - git shortlog -s | awk -F'\t' '{print $$2}' | sort -f > AUTHORS-t + git shortlog -s | $(AWK) -F'\t' '{print $$2}' | sort -f > AUTHORS-t mv AUTHORS-t AUTHORS cp AUTHORS $(distdir)/AUTHORS diff --git a/configure.ac b/configure.ac index 8b11088a2..263e9142d 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,17 @@ AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number.]) AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number.]) AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],["$libguestfs_extra"],[Extra version string.]) +# Define $(SED). +m4_ifdef([AC_PROG_SED],[ + AC_PROG_SED +],[ + dnl ... else hope for the best + AC_SUBST([SED], "sed") +]) + +# Define $(AWK). +AC_PROG_AWK + dnl Default backend. AC_MSG_CHECKING([if the user specified a default backend]) AC_ARG_WITH([default-backend], @@ -121,14 +132,6 @@ AC_PROG_LN_S dnl Define the host CPU architecture (defines 'host_cpu') AC_CANONICAL_HOST -# Define $(SED). -m4_ifdef([AC_PROG_SED],[ - AC_PROG_SED -],[ - dnl ... else hope for the best - AC_SUBST([SED], "sed") -]) - dnl Check for basic C environment. AC_PROG_CC_STDC AC_PROG_INSTALL @@ -495,8 +498,8 @@ if test "x$ENABLE_APPLIANCE" = "xyes"; then AC_MSG_CHECKING([supermin is new enough]) $SUPERMIN --version >&AS_MESSAGE_LOG_FD 2>&1 || AC_MSG_ERROR([supermin >= $supermin_min must be installed, your version is too old]) - supermin_major="`$SUPERMIN --version | awk '{print $2}' | awk -F. '{print $1}'`" - supermin_minor="`$SUPERMIN --version | awk '{print $2}' | awk -F. '{print $2}'`" + supermin_major="`$SUPERMIN --version | $AWK '{print $2}' | $AWK -F. '{print $1}'`" + supermin_minor="`$SUPERMIN --version | $AWK '{print $2}' | $AWK -F. '{print $2}'`" AC_MSG_RESULT([$supermin_major.$supermin_minor]) if test "$supermin_major" -lt "$supermin_major_min" || \ @@ -1346,9 +1349,9 @@ if test "x$with_java" != "xno"; then fi dnl JNI version. - jni_major_version=`echo "$VERSION" | awk -F. '{print $1}'` - jni_minor_version=`echo "$VERSION" | awk -F. '{print $2}'` - jni_micro_version=`echo "$VERSION" | awk -F. '{print $3}'` + jni_major_version=`echo "$VERSION" | $AWK -F. '{print $1}'` + jni_minor_version=`echo "$VERSION" | $AWK -F. '{print $2}'` + jni_micro_version=`echo "$VERSION" | $AWK -F. '{print $3}'` JNI_VERSION_INFO=`expr "$jni_major_version" + "$jni_minor_version"`":$jni_micro_version:$jni_minor_version" fi @@ -1420,7 +1423,7 @@ AS_IF([test "x$enable_lua" != "xno"],[ AC_CHECK_PROG([LUA],[lua],[lua],[no]) AS_IF([test "x$LUA" != "xno"],[ AC_MSG_CHECKING([for Lua version]) - LUA_VERSION=`$LUA -e 'print(_VERSION)' | awk '{print $2}'` + LUA_VERSION=`$LUA -e 'print(_VERSION)' | $AWK '{print $2}'` AC_MSG_RESULT([$LUA_VERSION]) dnl On Debian it's 'lua5.1', 'lua5.2' etc. On Fedora, just 'lua'. PKG_CHECK_MODULES([LUA], [lua$LUA_VERSION],[ diff --git a/run.in b/run.in index f49ab6ed6..db2945176 100755 --- a/run.in +++ b/run.in @@ -196,7 +196,7 @@ export G_DEBUG=gc-friendly # This is a cheap way to find some use-after-free and uninitialized # read problems when using glibc. -random_val="$(awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)" +random_val="$(@AWK@ 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)" export MALLOC_PERTURB_=$random_val # Do we have libtool? If we have it then we can use it to make diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am index 6a02c98ae..d363ea51d 100644 --- a/tests/guests/Makefile.am +++ b/tests/guests/Makefile.am @@ -65,9 +65,9 @@ display = \ -@echo -n '$(1): file size bytes: '; \ stat -c %s $(1); \ echo -n '$(1): allocated bytes: '; \ - du -B 1 $(1) | awk '{print $$1}'; \ + du -B 1 $(1) | $(AWK) '{print $$1}'; \ echo -n '$(1): MD5 hash: '; \ - md5sum $(1) | awk '{print $$1}' + md5sum $(1) | $(AWK) '{print $$1}' # Make several different blank images. These are not guests, but we # include them in the libvirt fake XML to make sure that virt-df and