From 18ecc6aedf929c6aeba25aa1f1c06d246f349c2b Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 14 Oct 2015 13:32:51 -0400 Subject: [PATCH] Fix: Use result of AC_PROG_* when using sed / grep MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- configure.ac | 12 ++++++------ extras/bindings/swig/python/Makefile.am | 2 +- include/Makefile.am | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index c8c438912..4cefd8c90 100644 --- a/configure.ac +++ b/configure.ac @@ -10,9 +10,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Compute minor/major/patchlevel version numbers AC_PROG_SED -major_version=$(echo AC_PACKAGE_VERSION | sed 's/^\([[0-9]]\)*\.[[0-9]]*\.[[0-9]]*.*$/\1/') -minor_version=$(echo AC_PACKAGE_VERSION | sed 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*.*$/\1/') -patchlevel_version=$(echo AC_PACKAGE_VERSION | sed 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*$/\1/') +major_version=$(echo AC_PACKAGE_VERSION | $SED 's/^\([[0-9]]\)*\.[[0-9]]*\.[[0-9]]*.*$/\1/') +minor_version=$(echo AC_PACKAGE_VERSION | $SED 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*.*$/\1/') +patchlevel_version=$(echo AC_PACKAGE_VERSION | $SED 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*$/\1/') AC_SUBST([MAJOR_VERSION], [$major_version]) AC_SUBST([MINOR_VERSION], [$minor_version]) AC_SUBST([PATCHLEVEL_VERSION], [$patchlevel_version]) @@ -22,7 +22,7 @@ AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [LTTng-Tools patch version_name="Herbe à Détourne" version_description='Brewed with unrestrained amounts of Citra hop, the Herbe à Détourne is a fantastic New World Tripel brewed by "Dieu du Ciel!". Aromas of mango, cantaloupe melon and passion fruit, combined with a controlled bitter finish, unite in making this smooth golden-orange beer stand apart.' -version_description_c=$(echo $version_description | sed 's/"/\\"/g') +version_description_c=$(echo $version_description | $SED 's/"/\\"/g') AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "") AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description_c"], "") @@ -42,12 +42,12 @@ AS_IF([test "x$libtool_fixup" = "xyes"], libtool_m4="$srcdir/config/libtool.m4" libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) - libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) + libtool_flag_pattern_count=$($GREP -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) AS_IF([test $libtool_flag_pattern_count -ne 0], [ AC_MSG_RESULT([$libtool_flag_pattern_count]) AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) - sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 + SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 ], [ AC_MSG_RESULT([none]) diff --git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am index 35f28d5bc..af1daf87c 100644 --- a/extras/bindings/swig/python/Makefile.am +++ b/extras/bindings/swig/python/Makefile.am @@ -1,5 +1,5 @@ lttng.i: lttng.i.in - sed "s/LTTNG_VERSION_STR/LTTng $(PACKAGE_VERSION)/g" < $(srcdir)/lttng.i.in >lttng.i + $(SED) "s/LTTNG_VERSION_STR/LTTng $(PACKAGE_VERSION)/g" < $(srcdir)/lttng.i.in >lttng.i AM_CFLAGS = $(PYTHON_INCLUDE) -I$(top_srcdir)/include diff --git a/include/Makefile.am b/include/Makefile.am index a30002e29..fd9d8d023 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -42,10 +42,10 @@ version.h: ## want to update the file if it is already up to date. ## version_match='^#define GIT_VERSION.*'; \ - old_version=$$(grep "$${version_match}" "$${version_h}"); \ + old_version=$$($(GREP) "$${version_match}" "$${version_h}"); \ new_version="#define GIT_VERSION \"$${git_version}\""; \ if [ x"$${old_version}" != x"$${new_version}" ]; then \ - sed -i "s'$${version_match}'$${new_version}'" "$${version_h}"; \ + $(SED) -i "s'$${version_match}'$${new_version}'" "$${version_h}"; \ else \ echo -n " (cached)"; \ fi; \ -- 2.34.1