From e5b0f53c6422def2e81aea1ac4586ac4b45de28a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 30 May 2002 06:04:09 +0000 Subject: [PATCH] Set FGREP and EGREP. --- tests/defs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/defs b/tests/defs index ef4c1d12..4fb17c76 100644 --- a/tests/defs +++ b/tests/defs @@ -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 -- 2.43.5