From: Stepan Kasal Date: Wed, 22 Jun 2005 12:13:59 +0000 (+0000) Subject: fix AT_CONFIG_CMP X-Git-Tag: AUTOCONF-2.59c~324 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91ac8c668f09fe665fa2a294782694cfe5eb6060;p=thirdparty%2Fautoconf.git fix AT_CONFIG_CMP --- diff --git a/ChangeLog b/ChangeLog index 2a60dcb94..155da2c70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +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. + 2005-06-22 Stepan Kasal * lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT): Use AC_SUBST/2. diff --git a/configure.ac b/configure.ac index c9fd368e4..f352e4153 100644 --- a/configure.ac +++ b/configure.ac @@ -149,10 +149,12 @@ AC_SUBST([EMACS], [$TEST_EMACS]) AM_PATH_LISPDIR -## ------ ## -## Grep. ## -## ------ ## +## ------------ ## +## Grep & sed. ## +## ------------ ## AC_PROG_GREP +AC_PROG_EGREP +AC_PROG_SED ## ------------ ## diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 9aa4b38c1..ddae41147 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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. diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index a6535a268..2395e4b39 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -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 diff --git a/tests/atlocal.in b/tests/atlocal.in index d12edc7cc..125215038 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -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@' diff --git a/tests/local.at b/tests/local.at index 5a033230e..d0c9cdf11 100644 --- a/tests/local.at +++ b/tests/local.at @@ -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