Set FGREP and EGREP.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 May 2002 06:04:09 +0000 (06:04 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 May 2002 06:04:09 +0000 (06:04 +0000)
tests/defs

index ef4c1d1..4fb17c7 100644 (file)
@@ -127,6 +127,23 @@ esac
 # generated for the tests do not use the installed tools.
 export AUTOMAKE ACLOCAL
 
+# POSIX no longer requires 'egrep' and 'fgrep',
+# but some hosts lack 'grep -E' and 'grep -F'.
+if test -z "$EGREP"; then
+   if echo a | (grep -E '(a|b)') >/dev/null 2>&1; then
+      EGREP='grep -E'
+   else
+      EGREP='egrep'
+   fi
+fi
+if test -z "$FGREP"; then
+   if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1; then
+      FGREP='grep -F'
+   else
+      FGREP='fgrep'
+   fi
+fi
+
 # The tests call `make -e' but we do not want $srcdir from the evironment
 # to override the definition from the Makefile.
 testsrcdir=$srcdir