]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
GNU getopt, when POSIXLY_CORRECT does not permute options and
authorAkim Demaille <akim@epita.fr>
Sat, 2 Jun 2001 15:45:32 +0000 (15:45 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 2 Jun 2001 15:45:32 +0000 (15:45 +0000)
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.

ChangeLog
NEWS
autoconf.in
bin/autoconf.in

index 3541999f95e0a6308ba94109355a9d8e840dbb10..79cb029c32c4a77b069a6d4c539d1fe8818f3e9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-06-02  Nathan Sidwell  <nathan@codesourcery.com>
+
+       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  <marq@gfz-potsdam.de>
 
        * aclang.m4 (AC_PROG_F77): Add Fujitsu's "frt" to the list of
diff --git a/NEWS b/NEWS
index 0f13972d236c167904838df2203817899a6a4dd5..2caf3680bbc487c3bacf0e67377b7ab0c299ba13 100644 (file)
--- 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.
 \f
 * Major changes in Autoconf 2.50
 
index 08e5de871460fe21efee5b174c23ebb99b2afda9..bd0e19d5058410fe956b8ed8075902ce2fa5fece 100644 (file)
@@ -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
index 08e5de871460fe21efee5b174c23ebb99b2afda9..bd0e19d5058410fe956b8ed8075902ce2fa5fece 100644 (file)
@@ -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