]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
fix AT_CONFIG_CMP
authorStepan Kasal <kasal@ucw.cz>
Wed, 22 Jun 2005 12:13:59 +0000 (12:13 +0000)
committerStepan Kasal <kasal@ucw.cz>
Wed, 22 Jun 2005 12:13:59 +0000 (12:13 +0000)
ChangeLog
configure.ac
doc/autoconf.texi
lib/autoconf/fortran.m4
tests/atlocal.in
tests/local.at

index 2a60dcb947db9fbbc2840a6ef3f2580ab29fec90..155da2c7028c375bde2a0401bc783be566191a44 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2005-06-22  Stepan Kasal  <kasal@ucw.cz>
+
+       Fix AT_CONFIG_CMP for Solaris hosts; idea from Ralf Menzel.
+       * configure.ac: Call AC_PROG_EGREP and AC_PROG_SED.
+       * tests/atlocal.in: Propagate $EGREP and $SED.
+       * tests/local.at (AT_CHECK_ENV): Use $EGREP, not $GREP -E.
+       (AT_CONFIG_CMP): Use sed instead of grep plumbing.
+
+       * doc/autoconf.texi (Limitations of Usual Tools) <grep>: Mention
+       that '\|' is not allowed in BREs; recommend using newline separated
+       list of patterns instead of multiple -e options.
+
+       * lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Remove an old comment.
+
 2005-06-22  Stepan Kasal  <kasal@ucw.cz>
 
        * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT): Use AC_SUBST/2.
index c9fd368e4f8efe24bce0fb3549a05cffd56fecb6..f352e415349b383e27c1d789af4efa56f0207805 100644 (file)
@@ -149,10 +149,12 @@ AC_SUBST([EMACS], [$TEST_EMACS])
 AM_PATH_LISPDIR
 
 
-## ------ ##
-## Grep.  ##
-## ------ ##
+## ------------ ##
+## Grep & sed.  ##
+## ------------ ##
 AC_PROG_GREP
+AC_PROG_EGREP
+AC_PROG_SED
 
 
 ## ------------ ##
index 9aa4b38c14af6886ffcf0dd71bda4bc5f4f1e030..ddae41147194c7ff43167b5e48fb635e2ca5d457 100644 (file)
@@ -11955,6 +11955,18 @@ or honor only the last pattern (e.g., @acronym{IRIX} 6.5).  To
 work around these problems, invoke @code{AC_PROG_GREP} and then use
 @code{$GREP}.
 
+Another possible workaround for the multiple @samp{-e} problem is to
+separate the patterns by newlines, for example:
+
+@example
+grep 'foo
+bar' in.txt
+@end example
+
+Alternation, @samp{\|}, is common but Posix does not require its
+support in basic regular expressions, so it should be avoided in
+portable scripts.  Solaris @command{grep} does not support it.
+
 Don't rely on @option{-w}, as Irix 6.5.16m's @command{grep} does not
 support it.
 
index a6535a2683ddd07f482262ba9e27cc4d436e5269..2395e4b3947cb92d878d2dbb0b98521c4b112f1b 100644 (file)
@@ -559,7 +559,6 @@ case $ac_[]_AC_LANG_ABBREV[]_v_output in
     ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/-cmdline  *"[[^"]]*"/ /g'` ;;
 
   # If we are using Cray Fortran then delete quotes.
-  # Use "\"" instead of '"' for font-lock-mode.
   *cft90*)
     ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/"//g'` ;;
 esac
index d12edc7ccc2b505c776228611267c42a6ed24824..1252150382ac33be753d8b3b7368ef1b0766b7f9 100644 (file)
@@ -21,6 +21,8 @@
 
 PERL='@PERL@'
 GREP='@GREP@'
+EGREP='@EGREP@'
+SED='@SED@'
 
 # We need to know if sh -n is ok.
 ac_cv_sh_n_works='@ac_cv_sh_n_works@'
index 5a033230e634efbcfb0b3aa2f6ed2b812bb9f2bd..d0c9cdf11f9dc590830abab867c2dbc2d70607e2 100644 (file)
@@ -274,7 +274,7 @@ test -f state-ls.after && { AT_CMP([state-ls.before], [state-ls.after]) }
 if test -f state-env.before && test -f state-env.after; then
   for act_file in state-env.before state-env.after
   do
-    $GREP -E -v -e 'm4_join([|],
+    $EGREP -v -e 'm4_join([|],
       [^a[cs]_],
       [^((exec_)?prefix|DEFS|CONFIG_STATUS)=],
       [^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
@@ -316,21 +316,27 @@ fi
 # - SECONDS [zsh]
 # - '$' [zsh]
 #
-# Furthermore, it is okay for a variable initialized to empty in one run to be
-# unset in another run.  This happens when, for example, cache update code tries
-# a number of values in LIBS and eventually restores LIBS to its original value.
-# If LIBS was previously unset, it will have become set and empty.
+# Furthermore, it is okay for a non-cache variable initialized to empty in one
+# run to be unset in another run.  This happens when, for example, cache update
+# code tries a number of values in LIBS and eventually restores LIBS to its
+# original value. If LIBS was previously unset, it will have become set and
+# empty.  (OTOH, cache variables indicate the result of the test even if they
+# are empty, so we have to be strict about them.)
+#
+# Lines that do not look like `foo=bar' are probably latter lines of
+# multiline values; trim them.
+#
 m4_define([AT_CONFIG_CMP],
 [for act_file in $1 $2
 do
-    { $GREP -v \
-'^\(ac\|as\)_
-^\(PPID\|RANDOM\|SECONDS\|'\'\\\$\''\)=
-^[[^=]]*=$'        $act_file
-      $GREP ^ac_cv $act_file ; } |
-      # Lines that do not look like `foo=bar' are probably latter lines of
-      # multiline values; trim them.
-      $GREP '^m4_defn([m4_re_word])=' >at_config_vars-$act_file
+  $SED '/^ac_cv_/ b
+       /^m4_defn([m4_re_word])=./ !d
+       /^a[[cs]]_/ d
+       /^PPID=/ d
+       /^RANDOM=/ d
+       /^SECONDS=/ d
+       /'\'\\\$\''=/ d
+       ' $act_file >at_config_vars-$act_file
 done
 AT_CMP([at_config_vars-$1], [at_config_vars-$2])[]dnl
 ])# AT_CONFIG_CMP