autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix AC_PROG_GREP


From: Albert Chin
Subject: Fix AC_PROG_GREP
Date: Thu, 18 Mar 2004 02:36:09 -0600
User-agent: Mutt/1.4i

Against HEAD.

-- 
albert chin (address@hidden)

-- snip snip
2004-03-18  Albert Chin-A-Young  <address@hidden>

        * lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH):
        Don't assume `break 2' will break out of parent loop as
        we don't know how deeply nested we are (AC_PROG_GREP
        nests 3-deep).
        * lib/autoconf/programs.m4 (_AC_PATH_PROG_FEATURE_CHECK):
        Break out of for loop when acceptable program is found.
        * lib/autoconf/programs.m4 (AC_PROG_GREP): Cache variable
        is `ac_cv_path_GREP', not `oc_cv_path_GREP'.

Index: lib/autoconf/programs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v
retrieving revision 1.21
diff -u -3 -p -r1.21 programs.m4
--- lib/autoconf/programs.m4    30 Jan 2004 14:21:36 -0000      1.21
+++ lib/autoconf/programs.m4    18 Mar 2004 08:28:50 -0000
@@ -299,7 +299,7 @@ AC_CACHE_CHECK([for fgrep], ac_cv_path_F
 # Check for a fully functional grep program that handles
 # the longest lines possible.  Prefer GNU grep if found.
 AC_DEFUN([AC_PROG_GREP],
-[AC_CACHE_CHECK([for grep that handles long lines], oc_cv_path_GREP,
+[AC_CACHE_CHECK([for grep that handles long lines], ac_cv_path_GREP,
    [_$0(GREP, [grep ggrep])])
  GREP="$ac_cv_path_GREP"
  AC_SUBST([GREP])
@@ -318,7 +318,7 @@ m4_define([_AC_PROG_GREP],
 # $ac_cv_path_VARIABLE to the path of an acceptable program, or else
 # _AC_PATH_PROG_FEATURE_CHECK will report that no acceptable program
 # was found, and abort.  If a suitable $ac_path_VARIABLE is found,
-# `break 2' will accept it without any further checks.
+# accept it without any further checks.
 m4_define([_AC_PATH_PROG_FEATURE_CHECK],
 [# Extract the first word of "$2" to use in msg output
 if test -z "$$1"; then
@@ -327,7 +327,9 @@ AC_CACHE_VAL([ac_cv_path_$1],
 [AS_TMPDIR([$1])
 # Loop through the user's path and test for each of PROGNAME-LIST
 _AS_PATH_WALK([$4],
-[for ac_prog in $2; do
+[test "x$ac_cv_path_$1" != "x" && break
+ for ac_prog in $2; do
+  test "x$ac_cv_path_$1" != "x" && break
   for ac_exec_ext in '' $ac_executable_extensions; do
     ac_path_$1="$as_dir/$ac_prog$ac_exec_ext"
     test -f "$ac_path_$1" || continue
@@ -360,11 +362,8 @@ m4_define([_AC_FEATURE_CHECK_LENGTH],
 [if AS_EXECUTABLE_P(["$$1"]); then
   # Check for GNU $1 and select it if it is found.
   _AC_PATH_PROG_FLAVOR_GNU([$$1],
-    [$2="$$1"
-    break 2
-  ])
-
-  ac_count=0
+  [$2="$$1"],
+  [ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in"
   while :
   do
@@ -382,7 +381,7 @@ m4_define([_AC_FEATURE_CHECK_LENGTH],
     fi
     # 10*(2^10) chars as input seems more than enough
     test $ac_count -gt 10 && break
-  done
+  done])
 fi
 ])
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]