From: Akim Demaille Date: Sat, 2 Jun 2001 15:45:32 +0000 (+0000) Subject: GNU getopt, when POSIXLY_CORRECT does not permute options and X-Git-Tag: AUTOCONF-2.50a~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eddc4ccb871aef9c89205ecb45d68b15a427fa6c;p=thirdparty%2Fautoconf.git GNU getopt, when POSIXLY_CORRECT does not permute options and arguments. So pass the options first. Fixes PR autoconf/184. * autoconf.sh (m4_prefiles, m4f_prefiles): New variables. (run_m4): Remove files. (run_m4f): Remove. Update remainder of script to use them. (for warning in): Do not use a literal comma as it will not be split by IFS. --- diff --git a/ChangeLog b/ChangeLog index 3541999f9..79cb029c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2001-06-02 Nathan Sidwell + + GNU getopt, when POSIXLY_CORRECT does not permute options and + arguments. So pass the options first. + Fixes PR autoconf/184. + + * autoconf.sh (m4_prefiles, m4f_prefiles): New variables. + (run_m4): Remove files. + (run_m4f): Remove. + Update remainder of script to use them. + (for warning in): Do not use a literal comma as it will not be + split by IFS. + 2001-06-02 Christian Marquardt * aclang.m4 (AC_PROG_F77): Add Fujitsu's "frt" to the list of diff --git a/NEWS b/NEWS index 0f13972d2..2caf3680b 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,7 @@ Now include stdint.h. ** Bug fixes - Mostly in the test suite. - +- Invocation of GNU M4 now robust to POSIXLY_CORRECT. * Major changes in Autoconf 2.50 diff --git a/autoconf.in b/autoconf.in index 08e5de871..bd0e19d50 100644 --- a/autoconf.in +++ b/autoconf.in @@ -225,7 +225,7 @@ NUMBERS='0123456789' WORDCHAR=_$alphabet$ALPHABET$NUMBERS m4_warnings= -for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | +for warning in `IFS=,; echo syntax $WARNINGS $warnings | tr $ALPHABET $alphabet` do test -n $warning || continue @@ -258,10 +258,10 @@ $debug || # Running m4. test -f "$autoconf_dir/acsite.m4" && acsite_m4="$autoconf_dir/acsite.m4" test -f "$localdir/aclocal.m4" && aclocal_m4="$localdir/aclocal.m4" -m4_common="$acsite_m4 $aclocal_m4 -I $autoconf_dir -I $localdir \ - -Dm4_tmpdir=$tmp" -run_m4="$M4 $autoconf_dir/autoconf.m4 $m4_common" -run_m4f="$M4 --reload $autoconf_dir/autoconf.m4f $m4_common" +m4_common="-I $autoconf_dir -I $localdir -Dm4_tmpdir=$tmp" +m4_prefiles=" $autoconf_dir/autoconf.m4 $acsite_m4 $aclocal_m4" +m4f_prefiles="--reload-state=$autoconf_dir/autoconf.m4f $acsite_m4 $aclocal_m4" +run_m4="$M4 $m4_common" # Find the input file. case $# in @@ -315,7 +315,8 @@ case $task in # M4 expansion. : >$tmp/forbidden.rx : >$tmp/allowed.rx - $run_m4f -Dm4_warnings=$m4_warnings $infile >$tmp/configure || + $verbose "$me: running $run_m4 -Dm4_warnings=$m4_warnings $m4f_prefiles $infile" >&2 + $run_m4 -Dm4_warnings=$m4_warnings $m4f_prefiles $infile >$tmp/configure || { (exit 1); exit 1; } if test "x$outfile" != x-; then @@ -714,15 +715,16 @@ EOF # Do we trace the initialization? # `errprint' must be silent, otherwise there can be warnings mixed # with traces in m4's stderr. + run_m4_trace="$run_m4 $trace_opt -daflq -Derrprint" if $initialization; then - run_m4_trace="$run_m4 $trace_opt -daflq -Derrprint" + trace_prefiles="$m4_prefiles" else - run_m4_trace="$run_m4f $trace_opt -daflq -Derrprint" + trace_prefiles="$m4f_prefiles" fi # Run m4 on the input file to get traces. - $verbose "$me: running $run_m4_trace $infile | $M4 $tmp/trace.m4" >&2 - $run_m4_trace $infile 2>&1 >/dev/null | + $verbose "$me: running $run_m4_trace $trace_prefiles $infile | $M4 $tmp/trace.m4" >&2 + $run_m4_trace $trace_prefiles $infile 2>&1 >/dev/null | sed -f $tmp/trace2m4.sed | # Now we are ready to run m4 to process the trace file. if $debug; then diff --git a/bin/autoconf.in b/bin/autoconf.in index 08e5de871..bd0e19d50 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -225,7 +225,7 @@ NUMBERS='0123456789' WORDCHAR=_$alphabet$ALPHABET$NUMBERS m4_warnings= -for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | +for warning in `IFS=,; echo syntax $WARNINGS $warnings | tr $ALPHABET $alphabet` do test -n $warning || continue @@ -258,10 +258,10 @@ $debug || # Running m4. test -f "$autoconf_dir/acsite.m4" && acsite_m4="$autoconf_dir/acsite.m4" test -f "$localdir/aclocal.m4" && aclocal_m4="$localdir/aclocal.m4" -m4_common="$acsite_m4 $aclocal_m4 -I $autoconf_dir -I $localdir \ - -Dm4_tmpdir=$tmp" -run_m4="$M4 $autoconf_dir/autoconf.m4 $m4_common" -run_m4f="$M4 --reload $autoconf_dir/autoconf.m4f $m4_common" +m4_common="-I $autoconf_dir -I $localdir -Dm4_tmpdir=$tmp" +m4_prefiles=" $autoconf_dir/autoconf.m4 $acsite_m4 $aclocal_m4" +m4f_prefiles="--reload-state=$autoconf_dir/autoconf.m4f $acsite_m4 $aclocal_m4" +run_m4="$M4 $m4_common" # Find the input file. case $# in @@ -315,7 +315,8 @@ case $task in # M4 expansion. : >$tmp/forbidden.rx : >$tmp/allowed.rx - $run_m4f -Dm4_warnings=$m4_warnings $infile >$tmp/configure || + $verbose "$me: running $run_m4 -Dm4_warnings=$m4_warnings $m4f_prefiles $infile" >&2 + $run_m4 -Dm4_warnings=$m4_warnings $m4f_prefiles $infile >$tmp/configure || { (exit 1); exit 1; } if test "x$outfile" != x-; then @@ -714,15 +715,16 @@ EOF # Do we trace the initialization? # `errprint' must be silent, otherwise there can be warnings mixed # with traces in m4's stderr. + run_m4_trace="$run_m4 $trace_opt -daflq -Derrprint" if $initialization; then - run_m4_trace="$run_m4 $trace_opt -daflq -Derrprint" + trace_prefiles="$m4_prefiles" else - run_m4_trace="$run_m4f $trace_opt -daflq -Derrprint" + trace_prefiles="$m4f_prefiles" fi # Run m4 on the input file to get traces. - $verbose "$me: running $run_m4_trace $infile | $M4 $tmp/trace.m4" >&2 - $run_m4_trace $infile 2>&1 >/dev/null | + $verbose "$me: running $run_m4_trace $trace_prefiles $infile | $M4 $tmp/trace.m4" >&2 + $run_m4_trace $trace_prefiles $infile 2>&1 >/dev/null | sed -f $tmp/trace2m4.sed | # Now we are ready to run m4 to process the trace file. if $debug; then