]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Don't prepend blanks to PATH in AC_PROG_GREP and AC_PROG_SED.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 10 May 2004 18:54:18 +0000 (18:54 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 10 May 2004 18:54:18 +0000 (18:54 +0000)
ChangeLog
configure
doc/autoconf.texi
lib/autoconf/programs.m4

index 6e799fb3dec55312b1b786e8de2634c8ea94e8f0..d1d92e644b4884d3af18d010a1e63a732c316365 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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.
index 3a833e91f964589364a7444551a847aefa69514a..b79b7135aaf9c0e438f6e8f8b2f5a57f50f9993f 100755 (executable)
--- a/configure
+++ b/configure
@@ -2399,7 +2399,7 @@ $debug ||
 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
@@ -2449,8 +2449,8 @@ fi
 
 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
 
index 500de50c5919787ebd1bc6ab29fd88baf96342ef..a2420575adcbebcbd2982d3f5254aa7e538b41be 100644 (file)
@@ -3240,10 +3240,11 @@ best implementation.
 @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
 
index 5b8b394e14cda37c14a7f591369359e294ad0e97..af1ca8f95349ca0cdba8ef241d6a674fe8e64f0a 100644 (file)
@@ -391,21 +391,25 @@ AC_CACHE_CHECK([for fgrep], ac_cv_path_FGREP,
 # 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])
 ])
 
 
@@ -717,14 +721,13 @@ adjust the code.])
 # -----------
 # 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