autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.63-248-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-248-g5f85192
Date: Wed, 24 Dec 2008 04:22:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=5f85192b8081c9f6f4d6912785dad9b6a78c9f8d

The branch, master has been updated
       via  5f85192b8081c9f6f4d6912785dad9b6a78c9f8d (commit)
      from  0b31661907b165a639ae5965ba1d81dda967f283 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5f85192b8081c9f6f4d6912785dad9b6a78c9f8d
Author: Eric Blake <address@hidden>
Date:   Tue Dec 23 14:29:48 2008 -0700

    Make m4_dumpdef more useful with M4 1.6.
    
    * lib/m4sugar/m4sugar.m4 (_m4_dumpdef): New macro.
    (m4_init): Install it for new enough m4.
    * tests/m4sugar.at (m4@&address@hidden): Enhance test.
    * doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Mention
    lack of sorting.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |    9 +++++++++
 doc/autoconf.texi      |    3 ++-
 lib/m4sugar/m4sugar.m4 |   20 ++++++++++++++++----
 tests/m4sugar.at       |   24 ++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f7a7d3a..099c19e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-23  Eric Blake  <address@hidden>
+
+       Make m4_dumpdef more useful with M4 1.6.
+       * lib/m4sugar/m4sugar.m4 (_m4_dumpdef): New macro.
+       (m4_init): Install it for new enough m4.
+       * tests/m4sugar.at (m4@&address@hidden): Enhance test.
+       * doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Mention
+       lack of sorting.
+
 2008-12-24  Bruno Haible  <address@hidden>
 
        Improve INSTALL for HP-UX.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 004ddb2..2d8d3c7 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -10558,7 +10558,8 @@ diversion stack.
 @msindex{dumpdefs}
 @code{m4_dumpdef} is like the M4 builtin, except that this version
 requires at least one argument, output always goes to standard error
-rather than the current debug file, and an error is issued if any
+rather than the current debug file, no sorting is done on multiple
+arguments, and an error is issued if any
 @var{name} is undefined.  @code{m4_dumpdefs} is a convenience macro that
 calls @code{m4_dumpdef} for all of the
 @code{m4_pushdef} stack of definitions, starting with the current, and
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index 05e357a..f64ef16 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -603,13 +603,23 @@ m4_define([m4_defn],
 # always dumps to stderr, regardless of the current debugfile; it also
 # provides m4symbols as a way to grab all current macro names.  But
 # dumpdefs is not frequently called, so we don't need to worry about
-# conditionally using these newer features.
+# conditionally using these newer features.  Also, this version
+# doesn't sort multiple arguments.
+#
+# If we detect m4 1.6 or newer, then provide an alternate definition,
+# installed during m4_init, that allows builtins through.
+# Unfortunately, there is no nice way in m4 1.4.x to dump builtins.
 m4_define([m4_dumpdef],
 [m4_if([$#], [0], [m4_fatal([$0: missing argument])],
        [$#], [1], [m4_ifdef([$1], [m4_errprintn(
   [$1: ]m4_dquote(_m4_defn([$1])))], [m4_fatal([$0: undefined macro: $1])])],
        [m4_map_args([$0], $@)])])
 
+m4_define([_m4_dumpdef],
+[m4_if([$#], [0], [m4_fatal([$0: missing argument])],
+       [$#], [1], [m4_builtin([dumpdef], [$1])],
+       [m4_map_args_sep([m4_builtin([dumpdef],], [)], [], $@)])])
+
 
 # m4_dumpdefs(NAME...)
 # --------------------
@@ -3053,8 +3063,9 @@ 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 and debugmode(d)
-# is available for faster checks of dereferencing undefined macros.
+# 1.6 or newer, thus $@ recursion is linear, and debugmode(+do)
+# is available for faster checks of dereferencing undefined macros
+# and forcing dumpdef to print to stderr regardless of debugfile.
 # 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.  Also, m4 prior to 1.4.8 loses track of location
@@ -3063,8 +3074,9 @@ m4_pattern_forbid([^dnl$])
 # Use the raw builtin to avoid tripping up include tracing.
 # Meanwhile, avoid m4_copy, since it temporarily undefines m4_defn.
 m4_ifdef([__m4_version__],
-[m4_debugmode([+d])
+[m4_debugmode([+do])
 m4_define([m4_defn], _m4_defn([_m4_defn]))
+m4_define([m4_dumpdef], _m4_defn([_m4_dumpdef]))
 m4_define([m4_popdef], _m4_defn([_m4_popdef]))
 m4_define([m4_undefine], _m4_defn([_m4_undefine]))],
 [m4_builtin([include], [m4sugar/foreach.m4])
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index 4938027..0d90ca2 100644
--- a/tests/m4sugar.at
+++ b/tests/m4sugar.at
@@ -194,6 +194,30 @@ a: [2]
 a:     [1]
 ]])
 
+# Check behavior when dumping builtins.  Unfortunately, when using M4 1.4.x
+# (or more precisely, when __m4_version__ is undefined), builtins get
+# flattened to an empty string.  It takes M4 1.6 to work around this.
+AT_DATA_M4SUGAR([script.4s],
+[[m4_ifdef([__m4_version__], [_m4_undefine([__m4_version__])])
+m4_init
+m4_dumpdef([m4_define])
+]])
+
+AT_CHECK_M4SUGAR([-o-], [0], [],
+[[m4_define:   []
+]])
+
+AT_DATA_M4SUGAR([script.4s],
+[[m4_init
+m4_ifdef([__m4_version__],
+[m4_dumpdef([m4_define])],
+[m4_errprintn([m4_define:      <define>])])
+]])
+
+AT_CHECK_M4SUGAR([-o-], [0], [],
+[[m4_define:   <define>
+]])
+
 AT_CLEANUP
 
 


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

[Prev in Thread] Current Thread [Next in Thread]