From: Akim Demaille Date: Tue, 22 Oct 2002 12:18:46 +0000 (+0000) Subject: * lib/autoconf/general.m4 (_AC_INIT_PREPARE): Avoid duplicates in X-Git-Tag: AUTOCONF-2.54a~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94ee3f9807f8337339a78f71f43db6bde7f47bf2;p=thirdparty%2Fautoconf.git * lib/autoconf/general.m4 (_AC_INIT_PREPARE): Avoid duplicates in `$ac_configure_args'. --- diff --git a/ChangeLog b/ChangeLog index 0b4542a82..1975a3a66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-10-22 Aaron M. Ucko + + * lib/autoconf/general.m4 (_AC_INIT_PREPARE): Avoid duplicates in + `$ac_configure_args'. + 2002-10-22 Akim Demaille * doc/autoconf.texi: Use AC_CONFIG_HEADERS in examples. diff --git a/NEWS b/NEWS index f830290fe..96166bc49 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,12 @@ - Parallel Builds Simultaneous executions of config.status are possible again. +- Precious variables accumulation + + config.status could stack several copies of the precious variables + assignments. + + * Major changes in Autoconf 2.54 Released September 13th, 2002. diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index cdbb85c14..9db41a2e3 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1135,34 +1135,57 @@ m4_define([_AC_INIT_PREPARE], # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= +ac_configure_args0= +ac_configure_args1= ac_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; dnl If you change this globbing pattern, test it on an old shell -- dnl it's sensitive. Putting any kind of quote in it causes syntax errors. -[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)] - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac + [ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)] + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" dnl If trying to remove duplicates, be sure to (i) keep the *last* dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only), dnl and (ii) not to strip long options (--prefix foo --prefix bar might dnl give --prefix foo bar). -dnl case " $ac_configure_args " in -dnl *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. -dnl *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" -dnl ac_sep=" " ;; -dnl esac - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in +dnl Use broad patterns, as arguments that would have already made configure +dnl exit don't matter. + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done done +AS_UNSET(ac_configure_args0) +AS_UNSET(ac_configure_args1) # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there