* lib/autoconf/programs.m4 (_AC_PROG_GREP): Take an additional

match expression argument, as different greps have different
regular expression flavours.
(AC_PROG_FGREP): Pass 'FGREP'. fgrep treats all match chars as
literals.
(AC_PROG_EGREP): Pass 'EGREP$'.
(AC_PROG_GREP): Pass 'GREP$'.
This commit is contained in:
Gary V. Vaughan 2004-04-20 19:09:22 +00:00
parent f959e7f2ed
commit 0d06ecdc76
2 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2004-04-20 Gary V. Vaughan <gary@gnu.org>
* lib/autoconf/programs.m4 (_AC_PROG_GREP): Take an additional
match expression argument, as different greps have different
regular expression flavours.
(AC_PROG_FGREP): Pass 'FGREP'. fgrep treats all match chars as
literals.
(AC_PROG_EGREP): Pass 'EGREP$'.
(AC_PROG_GREP): Pass 'GREP$'.
2004-04-20 Albert Chin-A-Young <china@thewrittenword.com>
* lib/autoconf/programs.m4 (AC_PROG_GREP): Cache variable

View File

@ -366,7 +366,7 @@ AC_CACHE_CHECK([for egrep], ac_cv_path_EGREP,
[if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
_AC_PROG_GREP(EGREP, egrep)
_AC_PROG_GREP(EGREP, egrep, [EGREP$])
fi])
EGREP="$ac_cv_path_EGREP"
AC_SUBST([EGREP])
@ -381,7 +381,7 @@ AC_CACHE_CHECK([for fgrep], ac_cv_path_FGREP,
[if echo 'ab*c' | ($GREP -F 'ab*c') >/dev/null 2>&1
then ac_cv_path_FGREP="$GREP -F"
else
_AC_PROG_GREP(FGREP, fgrep)
_AC_PROG_GREP(FGREP, fgrep, FGREP)
fi])
FGREP="$ac_cv_path_FGREP"
AC_SUBST([FGREP])
@ -394,14 +394,15 @@ AC_CACHE_CHECK([for fgrep], ac_cv_path_FGREP,
# the longest lines possible. Prefer GNU grep if found.
AC_DEFUN([AC_PROG_GREP],
[AC_CACHE_CHECK([for grep that handles long lines], ac_cv_path_GREP,
[_$0(GREP, [grep ggrep])])
[_$0(GREP, [grep ggrep], [GREP$])])
GREP="$ac_cv_path_GREP"
AC_SUBST([GREP])
])
# _AC_PROG_GREP(VARIABLE, PROGNAME-LIST, MATCH-EXPRESSION)
m4_define([_AC_PROG_GREP],
[_AC_PATH_PROG_FEATURE_CHECK([$1], [$2],
[_AC_FEATURE_CHECK_LENGTH([ac_path_$1], [ac_cv_path_$1],
["$ac_path_$1" '$1$'], [$1])])
["$ac_path_$1" '$3'], [$1])])
])