Fix: Use result of AC_PROG_* when using sed / grep
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 14 Oct 2015 17:32:51 +0000 (13:32 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 19 Oct 2015 03:39:35 +0000 (23:39 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
extras/bindings/swig/python/Makefile.am
include/Makefile.am

index c8c4389125dde504f867589d57af31fdf3326996..4cefd8c90e8944c399f2123cd528f20b16d8596c 100644 (file)
@@ -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])
index 35f28d5bcbf9b0adeb57c97ab574131ad5cbb284..af1daf87c1f2fc8a7e839945e6ade224586ac404 100644 (file)
@@ -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
 
index a30002e29253a084e313719c244189518e30b74e..fd9d8d02391a8db0232b9ac0c842791fdca76df9 100644 (file)
@@ -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; \
This page took 0.027693 seconds and 4 git commands to generate.