+2004-05-10 Eric Sunshine <sunshine@sunshineco.com>
+
+ * programs.m4 (_AC_PROG_GREP): Fixed bug where PATH argument handed to
+ _AC_PATH_PROG_FEATURE_CHECK contained leading whitespace (i.e.
+ " $PATH:/usr/xpg4/bin"). This resulted in bogus tests, such as
+ `test -f " /usr/bin/grep"', which _always_ failed.
+ (AC_PROG_SED): Ditto bogus PATH fix.
+ * autoconf.texi (AC_PROG_GREP): Properly document that this macro
+ requires that grep correctly supports _multiple_ `-e' options, rather
+ than stating only that grep should accept `-e'.
+
2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
Port to C99, which requires that 'exit' be declared.
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy=" $PATH:/usr/xpg4/bin"
+as_dummy="$PATH:/usr/xpg4/bin"
for as_dir in $as_dummy
do
IFS=$as_save_IFS
GREP="$ac_cv_path_GREP"
if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&2;}
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&2;}
{ (exit 1); exit 1; }; }
fi
@ovindex GREP
On AIX the default @code{grep} silently truncates long lines on the
input before matching. On Solaris 9 @code{/usr/bin/grep} does not
-understand the @option{-e} option. This macro looks for @sc{gnu} Grep or
+understand the @option{-e} option. On NeXT, @code{grep} understands only a
+single @option{-e} option. This macro looks for @sc{gnu} Grep or
else the best available @code{grep} or @code{ggrep} in the user's
-@code{$PATH}, which accepts the longest input lines possible and which
-accepts @option{-e}. Set the
+@code{$PATH} which accepts the longest input lines possible, and which
+accepts and respects multiple @option{-e} options. Set the
output variable @code{GREP} to whatever is chosen.
@end defmac
# AC_PROG_GREP
# ------------
# Check for a fully functional grep program that handles
-# the longest lines possible. Prefer GNU grep if found.
+# the longest lines possible and which respects multiple -e options.
+# Prefer GNU grep if found.
AC_DEFUN([AC_PROG_GREP],
[AC_CACHE_CHECK([for grep that handles long lines and -e], ac_cv_path_GREP,
[_$0(GREP, [grep ggrep], [-e 'GREP$' -e '-(cannot match)-'])])
GREP="$ac_cv_path_GREP"
AC_SUBST([GREP])
])
+
+
# _AC_PROG_GREP(VARIABLE, PROGNAME-LIST, PROG-ARGUMENTS)
+# ------------------------------------------------------
+# Solaris 9 /usr/xpg4/bin/*grep is suitable, but /usr/bin/*grep lacks -e.
+# AIX silently truncates long lines before matching.
+# NeXT understands only one -e and truncates long lines.
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" $3], [$1])],
- dnl Add /usr/xpg4/bin/*grep as it is typically found on Solaris
- dnl along with a /usr/bin/*grep that lacks -e.
- [$PATH:/usr/xpg4/bin])
+ ["$ac_path_$1" $3], [$1])], [$PATH:/usr/xpg4/bin])
])
# -----------
# Check for a fully functional sed program that truncates
# as few characters as possible. Prefer GNU sed if found.
+#
+# Solaris /usr/xpg4/bin/sed is suitable, but /usr/bin/sed truncates output.
AC_DEFUN([AC_PROG_SED],
[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
[_AC_PATH_PROG_FEATURE_CHECK(SED, [sed gsed],
[_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED],
- ["$ac_path_SED" -e 's/a$//'])],
- dnl Add /usr/xpg4/bin/sed as it is typically found on Solaris
- dnl along with a /usr/bin/sed that truncates output.
- [$PATH:/usr/xpg4/bin])])
+ ["$ac_path_SED" -e 's/a$//'])], [$PATH:/usr/xpg4/bin])])
SED="$ac_cv_path_SED"
AC_SUBST([SED])
])# AC_PROG_SED