# HG changeset patch # User Rik # Date 1361926353 28800 # Node ID 43e6415393ffdd5e917f062a6fc55e172835871a # Parent e125db98263f26c33854f48e34727dd6cb41c440 build: check for grep in configure and then use it in build process. * configure.ac: Add call to AC_PROG_GREP. * build-aux/common.mk: substitute environment variable GREP with value from configure. Use $(GREP) in commands. * build-aux/find-files-with-tests.sh: use $(GREP) instead of grep in commands. diff -r e125db98263f -r 43e6415393ff build-aux/common.mk --- a/build-aux/common.mk Tue Feb 26 15:22:12 2013 -0800 +++ b/build-aux/common.mk Tue Feb 26 16:52:33 2013 -0800 @@ -3,12 +3,15 @@ AWK = @AWK@ export AWK -SED = @SED@ -export SED +GREP = @GREP@ +export GREP FIND = @FIND@ export FIND +SED = @SED@ +export SED + PERL = @PERL@ export PERL @@ -731,7 +734,7 @@ endef define test-file-commands -( echo "## DO NOT EDIT! Generated automatically from $( $@-t +( echo "## DO NOT EDIT! Generated automatically from $( $@-t mv $@-t $@ endef diff -r e125db98263f -r 43e6415393ff build-aux/find-files-with-tests.sh --- a/build-aux/find-files-with-tests.sh Tue Feb 26 15:22:12 2013 -0800 +++ b/build-aux/find-files-with-tests.sh Tue Feb 26 16:52:33 2013 -0800 @@ -1,6 +1,7 @@ #! /bin/sh set -e +GREP=${GREP:-grep} SED=${SED:-sed} srcdir="$1" @@ -13,7 +14,7 @@ else file="$srcdir/$arg" fi - if [ "`grep -l '^%!' $file`" ]; then + if [ "`$GREP -l '^%!' $file`" ]; then echo "$file" | $SED "s,\\$srcdir/,,"; fi done diff -r e125db98263f -r 43e6415393ff configure.ac --- a/configure.ac Tue Feb 26 15:22:12 2013 -0800 +++ b/configure.ac Tue Feb 26 16:52:33 2013 -0800 @@ -97,6 +97,7 @@ ## Programs used in Makefiles. AC_PROG_AWK +AC_PROG_GREP OCTAVE_PROG_FIND OCTAVE_PROG_SED OCTAVE_PROG_PERL