autoconf-patches
[Top][All Lists]
Advanced

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

Re: AIX grep limitation: coreutils build failure


From: Paul Eggert
Subject: Re: AIX grep limitation: coreutils build failure
Date: Sun, 28 May 2006 01:50:44 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> OTOH, coreutils would not
> actually need the `${LIBOBJDIR}' thingies anyway, and they cause the
> extremely long line.

That sounds like something reasonable to do in any case.

I'm a bit reluctant to rely on 'tr' given its portability hassles.
How about this patch instead?  It takes the opportunity to put
in a small plug for GNU grep.  Also, it optimizes the CEOF
test a bit (invokes sed only once on the file).

        * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE):
        Don't assume 'grep' works on long lines, since AIX grep doesn't.

--- status.m4.~1.110.~  2006-05-27 14:52:20.000000000 -0700
+++ status.m4   2006-05-28 01:44:42.000000000 -0700
@@ -401,19 +401,24 @@ m4_if(_AC_SED_CMD_LIMIT,
       m4_if(_AC_Var, address@hidden@], m4_if(_AC_SED_CMD_NUM, 2, 2, 
_AC_SED_CMD_LIMIT), _AC_SED_CMD_NUM),
 [_ACEOF
 
-  if test `grep -c "$ac_delim\$" conf$$subs.sed` = _AC_SED_DELIM_NUM; then
-    break
-  elif $ac_last_try; then
-    AC_MSG_ERROR([could not make $CONFIG_STATUS])
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
+dnl A grep -c that outputs nothing probably just has a silly length limit.
+dnl Assume conf$$subs.sed is OK, but issue a warning that plugs GNU grep.
+dnl This might go awry if in addition there is a
+dnl substitution containing $ac_delim followed by newline,
+dnl but it is not worth worrying about this unlikely possibility.
+  case `grep -c "$ac_delim\$" conf$$subs.sed`,$ac_last_try in #(
+    _AC_SED_DELIM_NUM,*) break;; #(
+    ,*) AC_MSG_WARN([please consider using GNU grep instead]); break;; #(
+    *,:) AC_MSG_ERROR([could not make $CONFIG_STATUS]);; #(
+    *) ac_delim="$ac_delim!$ac_delim _$ac_delim!! ";;
+  esac
 done
 
-ac_eof=
-if grep '^CEOF$' conf$$subs.sed >/dev/null; then
-  ac_eof=`sed -n '/^CEOF[[0-9]]*$/s/CEOF//p' conf$$subs.sed | sort -nru | sed 
1q`
-  ac_eof=`expr 0$ac_eof + 1`
+dnl Avoid grep here, since conf$$subs.sed might have long lines.
+ac_eof=`sed -n '/^CEOF[[0-9]]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
 fi
 
 dnl Increment fragment number.




reply via email to

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