2005-06-22 Stepan Kasal
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) : 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.
Index: configure.ac
===================================================================
RCS file: /cvsroot/autoconf/autoconf/configure.ac,v
retrieving revision 1.74
diff -u -r1.74 configure.ac
--- configure.ac 14 May 2005 07:00:39 -0000 1.74
+++ configure.ac 22 Jun 2005 12:04:49 -0000
@@ -149,10 +149,12 @@
AM_PATH_LISPDIR
-## ------ ##
-## Grep. ##
-## ------ ##
+## ------------ ##
+## Grep & sed. ##
+## ------------ ##
AC_PROG_GREP
+AC_PROG_EGREP
+AC_PROG_SED
## ------------ ##
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.916
diff -u -r1.916 autoconf.texi
--- doc/autoconf.texi 21 Jun 2005 16:03:59 -0000 1.916
+++ doc/autoconf.texi 22 Jun 2005 12:04:50 -0000
@@ -11955,6 +11955,18 @@
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:
+
address@hidden
+grep 'foo
+bar' in.txt
address@hidden 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: lib/autoconf/fortran.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/fortran.m4,v
retrieving revision 1.192
diff -u -r1.192 fortran.m4
--- lib/autoconf/fortran.m4 5 Jun 2005 18:46:03 -0000 1.192
+++ lib/autoconf/fortran.m4 22 Jun 2005 12:04:51 -0000
@@ -559,7 +559,6 @@
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: tests/atlocal.in
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/atlocal.in,v
retrieving revision 1.6
diff -u -r1.6 atlocal.in
--- tests/atlocal.in 14 May 2005 07:00:40 -0000 1.6
+++ tests/atlocal.in 22 Jun 2005 12:04:51 -0000
@@ -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: tests/local.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/local.at,v
retrieving revision 1.16
diff -u -r1.16 local.at
--- tests/local.at 25 May 2005 18:35:05 -0000 1.16
+++ tests/local.at 22 Jun 2005 12:04:51 -0000
@@ -274,7 +274,7 @@
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 @@
# - 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