]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Adjust to recent m4 1.6 change to support m4_debugmode(d).
authorEric Blake <ebb9@byu.net>
Mon, 25 Aug 2008 22:26:27 +0000 (16:26 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 25 Aug 2008 22:28:29 +0000 (16:28 -0600)
* lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Move
freeze-time decision of using faster 1.6 implementation...
(m4_init): ...to a runtime decision, and add use of new debugmode
flag.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/m4sugar/m4sugar.m4

index 5b45504047d319dfb44e512408babf095aeff749..51812e2e9c859f55e6598bd505efcc71cc371ab8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-25  Eric Blake  <ebb9@byu.net>
+
+       Adjust to recent m4 1.6 change to support m4_debugmode(d).
+       * lib/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine): Move
+       freeze-time decision of using faster 1.6 implementation...
+       (m4_init): ...to a runtime decision, and add use of new debugmode
+       flag.
+
 2008-08-22  Peter O'Gorman  <pogma@thewrittenword.com>
 
        Limit AC_C_BIGENDIAN univeral checks to Mac OS X.
index 6ee157cd4fa8e4495b747b858a99252b47552425..3607e4555b419ff1872518e7c8dbc2655bb065ae 100644 (file)
@@ -529,19 +529,18 @@ m4_define([m4_default],
 #
 # This macro is called frequently, so minimize the amount of additional
 # expansions by skipping m4_ifndef.  Better yet, if __m4_version__ exists,
-# (added in M4 1.6), then let m4 do the job for us.
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
 #
 # _m4_defn is for internal use only - it bypasses the wrapper, so it
 # must only be used on one argument at a time, and only on macros
 # known to be defined.  Make sure this still works if the user renames
 # m4_defn but not _m4_defn.
 m4_copy([m4_defn], [_m4_defn])
-m4_ifdef([__m4_version__], [],
-[m4_define([m4_defn],
+m4_define([m4_defn],
 [m4_if([$#], [0], [[$0]],
        [$#], [1], [m4_ifdef([$1], [_m4_defn([$1])],
                            [m4_fatal([$0: undefined macro: $1])])],
-       [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])])
+       [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])
 
 
 # _m4_dumpdefs_up(NAME)
@@ -579,18 +578,17 @@ _m4_dumpdefs_down([$1])])
 #
 # This macro is called frequently, so minimize the amount of additional
 # expansions by skipping m4_ifndef.  Better yet, if __m4_version__ exists,
-# (added in M4 1.6), then let m4 do the job for us.
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
 #
 # _m4_popdef is for internal use only - it bypasses the wrapper, so it
 # must only be used on macros known to be defined.  Make sure this
 # still works if the user renames m4_popdef but not _m4_popdef.
 m4_copy([m4_popdef], [_m4_popdef])
-m4_ifdef([__m4_version__], [],
-[m4_define([m4_popdef],
+m4_define([m4_popdef],
 [m4_if([$#], [0], [[$0]],
        [$#], [1], [m4_ifdef([$1], [_m4_popdef([$1])],
                            [m4_fatal([$0: undefined macro: $1])])],
-       [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])])
+       [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])
 
 
 # m4_shiftn(N, ...)
@@ -646,18 +644,17 @@ m4_define([_m4_shift3],
 #
 # This macro is called frequently, so minimize the amount of additional
 # expansions by skipping m4_ifndef.  Better yet, if __m4_version__ exists,
-# (added in M4 1.6), then let m4 do the job for us.
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
 #
 # _m4_undefine is for internal use only - it bypasses the wrapper, so
 # it must only be used on macros known to be defined.  Make sure this
 # still works if the user renames m4_undefine but not _m4_undefine.
 m4_copy([m4_undefine], [_m4_undefine])
-m4_ifdef([__m4_version__], [],
-[m4_define([m4_undefine],
+m4_define([m4_undefine],
 [m4_if([$#], [0], [[$0]],
        [$#], [1], [m4_ifdef([$1], [_m4_undefine([$1])],
                            [m4_fatal([$0: undefined macro: $1])])],
-       [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])])
+       [m4_foreach([_m4_macro], [$@], [$0(_m4_defn([_m4_macro]))])])])
 
 # _m4_wrap(PRE, POST)
 # -------------------
@@ -2771,12 +2768,18 @@ m4_pattern_forbid([^_?m4_])
 m4_pattern_forbid([^dnl$])
 
 # If __m4_version__ is defined, we assume that we are being run by M4
-# 1.6 or newer, and thus that $@ recursion is linear; nothing further
-# needs to be done.  But if it is missing, we assume we are being run
-# by M4 1.4.x, that $@ recursion is quadratic, and that we need
-# foreach-based replacement macros.  Use the raw builtin to avoid
-# tripping up include tracing.
-m4_ifndef([__m4_version__], [m4_builtin([include], [m4sugar/foreach.m4])])
+# 1.6 or newer, and thus that $@ recursion is linear and debugmode(d)
+# is available for faster checks of dereferencing undefined macros.
+# But if it is missing, we assume we are being run by M4 1.4.x, that
+# $@ recursion is quadratic, and that we need foreach-based
+# replacement macros.  Use the raw builtin to avoid tripping up
+# include tracing.
+m4_ifdef([__m4_version__],
+[m4_debugmode([+d])
+m4_copy([_m4_defn], [m4_defn])
+m4_copy([_m4_popdef], [m4_popdef])
+m4_copy([_m4_undefine], [m4_undefine])],
+[m4_builtin([include], [m4sugar/foreach.m4])])
 
 # _m4_divert_diversion should be defined:
 m4_divert_push([KILL])