+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.
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.
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)=],
# - 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