]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Don't let frozen __m4_version__ break downgrade to m4 1.4.x.
authorEric Blake <ebb9@byu.net>
Tue, 26 Aug 2008 15:07:01 +0000 (09:07 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 26 Aug 2008 15:07:01 +0000 (09:07 -0600)
* bin/autom4te.in: Adjust comments, now that we rely on 1.4.5+.
(files_to_options): Avoid inheriting __m4_version__ from frozen
file if current M4 does not support it.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
bin/autom4te.in

index 51812e2e9c859f55e6598bd505efcc71cc371ab8..e39b20221999d616c42fa87f1cde5b9784e89c4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-26  Eric Blake  <ebb9@byu.net>
+
+       Don't let frozen __m4_version__ break downgrade to m4 1.4.x.
+       * bin/autom4te.in: Adjust comments, now that we rely on 1.4.5+.
+       (files_to_options): Avoid inheriting __m4_version__ from frozen
+       file if current M4 does not support it.
+
 2008-08-25  Eric Blake  <ebb9@byu.net>
 
        Adjust to recent m4 1.6 change to support m4_debugmode(d).
index 685df41a327210b1ed8836a1998f557bfa73016a..055abcedeb7c42ae4c7361dbeb717058497c3942 100644 (file)
@@ -111,29 +111,8 @@ map { s/:.*//;s/\W// } @m4_builtin;
 # Some macros don't follow this scheme: be sure to properly map to their
 # alternate name too.
 #
-# This is because GNU M4 1.4's tracing of builtins is buggy.  When run on
-# this input:
-#
-# | divert(-1)
-# | changequote([, ])
-# | define([m4_eval], defn([eval]))
-# | eval(1)
-# | m4_eval(2)
-# | undefine([eval])
-# | m4_eval(3)
-#
-# it behaves this way:
-#
-# | % m4 input.m4 -da -t eval
-# | m4trace: -1- eval(1)
-# | m4trace: -1- m4_eval(2)
-# | m4trace: -1- m4_eval(3)
-# | %
-#
-# Conversely:
-#
-# | % m4 input.m4 -da -t m4_eval
-# | %
+# FIXME: Trace status of renamed builtins was fixed in M4 1.4.5, which
+# we now depend on; do we still need to do this mapping?
 #
 # So we will merge them, i.e., tracing `BUILTIN' or tracing
 # `m4_BUILTIN' will be the same: tracing both, but honoring the
@@ -245,6 +224,8 @@ EOF
 # ------------------------
 # Transform Autom4te conventions (e.g., using foo.m4f to designate a frozen
 # file) into a suitable command line for M4 (e.g., using --reload-state).
+# parse_args guarantees that we will see at most one frozen file, and that
+# if a frozen file is present, it is the first argument.
 sub files_to_options (@)
 {
   my (@file) = @_;
@@ -255,6 +236,12 @@ sub files_to_options (@)
       if ($file =~ /\.m4f$/)
        {
          $arg = "--reload-state=$arg";
+         # If the user downgraded M4 from 1.6 to 1.4.x after freezing
+         # the file, then we ensure the frozen __m4_version__ will
+         # not cause m4_init to make the wrong decision about the
+         # current M4 version.
+         $arg .= " --undefine=__m4_version__"
+           unless grep {/__m4_version__/} @m4_builtin;
        }
       push @res, $arg;
     }
@@ -416,6 +403,7 @@ Try `$me --help' for more information."
     }
 
   # Work around the M4 builtins tracing problem for @PRESELECT.
+  # FIXME: Is this still needed, now that we rely on M4 1.4.5?
   push (@preselect,
        map { $m4_builtin_alternate_name{$_} }
        grep { exists $m4_builtin_alternate_name{$_} } @preselect);