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-123-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-123-g2376807
Date: Tue, 28 Oct 2008 20:10:01 +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=2376807bbdf93208068dc4febfba2bda003b1f1a

The branch, master has been updated
       via  2376807bbdf93208068dc4febfba2bda003b1f1a (commit)
       via  0b08f40fc7956f03209e8c8d7fa72c0e4a3bf32b (commit)
       via  0a951c9da7d85ad896d10d7ac723c958521e2a3a (commit)
      from  1415907c2d8a008fa2e6e443c491006029f43bde (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 2376807bbdf93208068dc4febfba2bda003b1f1a
Author: Eric Blake <address@hidden>
Date:   Tue Oct 28 13:44:53 2008 -0600

    Use m4_map_args in more places.
    
    * lib/m4sugar/m4sugar.m4 (m4_defn, m4_dumpdef, m4_popdef)
    (m4_undefine, m4_combine): Use m4_map_args, rather than
    m4_foreach.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 0b08f40fc7956f03209e8c8d7fa72c0e4a3bf32b
Author: Eric Blake <address@hidden>
Date:   Tue Oct 28 12:14:06 2008 -0600

    Override m4 1.4.x dumpdef, as it breaks autom4te.
    
    * lib/m4sugar/m4sugar.m4 (m4_dumpdef): New implementation.
    * doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Mention
    semantic differences as well as m4_dumpdefs.
    * NEWS: Likewise.
    * tests/m4sugar.at (m4@&address@hidden): New test.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 0a951c9da7d85ad896d10d7ac723c958521e2a3a
Author: Eric Blake <address@hidden>
Date:   Tue Oct 28 10:28:04 2008 -0600

    Allow m4sugar to be used without autom4te, such as in bison.
    
    * lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that
    alternate escape sequences can be used.
    (m4_text_box): Likewise.  Don't output quadrigraphs.
    (m4_qdelta): Delete unused macro.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog              |   27 ++++++++++++++++++-
 NEWS                   |    2 +-
 doc/autoconf.texi      |   15 +++++++++-
 lib/m4sugar/m4sugar.m4 |   67 ++++++++++++++++++++++++++++++-----------------
 tests/m4sugar.at       |   36 +++++++++++++++++++++++++
 5 files changed, 119 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d0296c0..0451fa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2008-10-28  Eric Blake  <address@hidden>
+
+       Use m4_map_args in more places.
+       * lib/m4sugar/m4sugar.m4 (m4_defn, m4_dumpdef, m4_popdef)
+       (m4_undefine, m4_combine): Use m4_map_args, rather than
+       m4_foreach.
+
+2008-10-28  Eric Blake  <address@hidden>
+
+       Override m4 1.4.x dumpdef, as it breaks autom4te.
+       * lib/m4sugar/m4sugar.m4 (m4_dumpdef): New implementation.
+       (m4_copy): Formatting touchup.
+       * doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Mention
+       semantic differences as well as m4_dumpdefs.
+       * NEWS: Likewise.
+       * tests/m4sugar.at (m4@&address@hidden): New test.
+
+2008-10-28  Eric Blake  <address@hidden>
+
+       Allow m4sugar to be used without autom4te, such as in bison.
+       * lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that
+       alternate escape sequences can be used.
+       (m4_text_box): Likewise.  Don't output quadrigraphs.
+       (m4_qdelta): Delete unused macro.
+
 2008-10-28  Paolo Bonzini  <address@hidden>
 
        Add m4_stack_foreach and m4_stack_foreach_lifo.
@@ -9,7 +34,7 @@
        * tests/m4sugar.at (m4_stack_foreach): New test.
 
 2008-10-28  Paolo Bonzini  <address@hidden>
-    
+
        use a shell function for AC_TYPE_INTx_T
        * lib/autoconf/types.m4 (_AC_TYPE_INT_BODY, _AC_TYPE_UNSIGNED_INT_BODY):
        New.
diff --git a/NEWS b/NEWS
index 1f969b1..e22559f 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,7 @@ GNU Autoconf NEWS - User visible changes.
    m4_set_map
 
 ** The following m4sugar macros are documented now:
-   m4_copy  m4_rename
+   m4_copy  m4_dumpdefs  m4_rename
 
 ** The following documented m4sh macros are new:
    AS_LINENO_PREPARE  AS_ME_PREPARE  AS_VAR_APPEND  AS_VAR_ARITH
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index c1427a6..d315ebb 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -10272,7 +10272,6 @@ define your own macros into these namespaces.
 @msindex{decr}
 @msindex{define}
 @msindex{divnum}
address@hidden
 @msindex{errprint}
 @msindex{esyscmd}
 @msindex{eval}
@@ -10304,7 +10303,6 @@ The list of macros unchanged from M4, except for their 
name, is:
 @item m4_decr
 @item m4_define
 @item m4_divnum
address@hidden m4_dumpdef
 @item m4_errprint
 @item m4_esyscmd
 @item m4_eval
@@ -10404,6 +10402,19 @@ m4_divert_pop()m4_divert_push(address@hidden)
 diversion stack.
 @end defmac
 
address@hidden m4_dumpdef (@address@hidden)
address@hidden m4_dumpdefs (@var{name})
address@hidden
address@hidden
address@hidden 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
address@hidden is undefined.  @code{m4_dumpdefs} is a convenience macro that
+takes exactly one @var{name}, and calls @code{m4_dumpdef} for all of the
address@hidden stack of definitions, starting with the current, and
+silently does nothing if @var{name} is undefined.
address@hidden defmac
+
 @defmac m4_exit (@var{exit-status})
 @msindex{exit}
 This macro corresponds to @code{m4exit}.
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index eb5d426..9c24dac 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -539,8 +539,8 @@ m4_define([_m4_bpatsubsts],
 # involved in the implementation of m4_stack_foreach and m4_curry.
 m4_define([m4_copy],
 [m4_ifdef([$2], [m4_fatal([$0: won't overwrite defined macro: $2])],
-         [m4_stack_foreach([$1], [m4_curry([m4_pushdef], 
[$2])])m4_ifdef([m4_location($1)],
-[m4_define([m4_location($2)], m4_location)])])])
+         [m4_stack_foreach([$1], [m4_curry([m4_pushdef], [$2])])])]dnl
+[m4_ifdef([m4_location($1)], [m4_define([m4_location($2)], m4_location)])])
 
 
 # m4_define_default(MACRO, VALUE)
@@ -593,7 +593,25 @@ 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], address@hidden, 
[$0(_m4_defn([_m4_macro]))])])])
+       [m4_map_args([$0], $@)])])
+
+
+# m4_dumpdef(NAME...)
+# -------------------
+# In m4 1.4.x, dumpdef writes to the current debugfile, rather than
+# stderr.  This in turn royally confuses autom4te; so we follow the
+# lead of newer m4 and always dump to stderr.  Unlike the original,
+# this version requires an argument, since there is no convenient way
+# in m4 1.4.x to grab the names of all defined macros.  Newer m4
+# 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.
+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_dumpdefs(NAME)
@@ -603,8 +621,7 @@ m4_define([m4_defn],
 #
 # This macro cheats, because it relies on the current definition of NAME
 # while the second argument of m4_stack_foreach_lifo is evaluated (which
-# would be undefined according to the API).  If m4_dumpdef is ever rewritten
-# not to use the builtin, revisit this.
+# would be undefined according to the API).
 m4_define([m4_dumpdefs],
 [m4_stack_foreach_lifo([$1], [m4_dumpdef([$1])m4_ignore])])
 
@@ -621,7 +638,7 @@ 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], address@hidden, 
[$0(_m4_defn([_m4_macro]))])])])
+       [m4_map_args([$0], $@)])])
 
 
 # m4_shiftn(N, ...)
@@ -682,7 +699,7 @@ 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], address@hidden, 
[$0(_m4_defn([_m4_macro]))])])])
+       [m4_map_args([$0], $@)])])
 
 # _m4_wrap(PRE, POST)
 # -------------------
@@ -2127,9 +2144,9 @@ m4_define([m4_combine],
        [m4_pushdef([m4_Separator], [m4_define([m4_Separator],
                                    _m4_defn([m4_echo]))])]]dnl
 [[m4_foreach([m4_Prefix], [$2],
-            [m4_foreach([m4_Suffix], ]m4_dquote(m4_dquote(m4_shift3($@)))[,
-       [m4_Separator([$1])[]_m4_defn([m4_Prefix])[$3]_m4_defn(
-                                                     [m4_Suffix])])])]]dnl
+   [m4_map_args([m4_Separator([$1])]m4_dquote(_m4_defn(
+        [m4_Prefix]))[[$3]m4_echo],
+               ]]m4_dquote(m4_dquote(m4_shift3($@)))[[)])]]dnl
 [[_m4_popdef([m4_Separator])])])
 
 
@@ -2232,7 +2249,9 @@ m4_define([m4_append_uniq_w],
 # FIRST-PREFIX will be left alone on the first line.
 #
 # No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX,
-# although quadrigraphs are correctly recognized.
+# although quadrigraphs are correctly recognized.  More precisely,
+# you may redefine m4_qlen to recognize whatever escape sequences that
+# you will post-process.
 #
 # Typical outputs are:
 #
@@ -2311,20 +2330,29 @@ dnl finally, clean up the local variables
 #  ## MESSAGE ##
 #  ## ------- ##
 # using FRAME-CHARACTER in the border.
+#
+# Quadrigraphs are correctly recognized.  More precisely, you may
+# redefine m4_qlen to recognize whatever escape sequences that you
+# will post-process.
 m4_define([m4_text_box],
 [m4_pushdef([m4_Border],
            m4_translit(m4_format([%*s], m4_qlen(m4_expand([$1])), []),
                        [ ], m4_default_quoted([$2], [-])))dnl
address@hidden:@@%:@ m4_Border @%:@@%:@
address@hidden:@@%:@ $1 @%:@@%:@
address@hidden:@@%:@ m4_Border @%:@@%:@_m4_popdef([m4_Border])dnl
-])
+[##] m4_Border [##]
+[##] $1 [##]
+[##] m4_Border [##]_m4_popdef([m4_Border])])
 
 
 # m4_qlen(STRING)
 # ---------------
 # Expands to the length of STRING after autom4te converts all quadrigraphs.
 #
+# If you use some other means of post-processing m4 output rather than
+# autom4te, then you may redefine this macro to recognize whatever
+# escape sequences your post-processor will handle.  For that matter,
+# m4_define([m4_qlen], m4_defn([m4_len])) is sufficient if you don't
+# do any post-processing.
+#
 # Avoid bpatsubsts for the common case of no quadrigraphs.  Cache
 # results, as configure scripts tend to ask about lengths of common
 # strings like `/*' and `*/' rather frequently.  Minimize the number
@@ -2340,15 +2368,6 @@ m4_if(m4_index([$1], address@hidden), [-1], 
[m4_len([$1])],
                           [\3]))]))_m4_defn([m4_qlen-$1])])
 
 
-# m4_qdelta(STRING)
-# -----------------
-# Expands to the net change in the length of STRING from autom4te converting 
the
-# quadrigraphs in STRING.  This number is always negative or zero.
-m4_define([m4_qdelta],
-[m4_eval(m4_qlen([$1]) - m4_len([$1]))])
-
-
-
 ## ----------------------- ##
 ## 13. Number processing.  ##
 ## ----------------------- ##
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index 10ebbd8..af4c4d5 100644
--- a/tests/m4sugar.at
+++ b/tests/m4sugar.at
@@ -151,6 +151,42 @@ a b c
 AT_CLEANUP
 
 
+## ------------ ##
+## m4_dumpdef.  ##
+## ------------ ##
+
+AT_SETUP([m4@&address@hidden)
+
+AT_KEYWORDS([m4@&address@hidden)
+
+# Ensure that m4sugar dies when dereferencing undefined macros.
+
+AT_DATA_M4SUGAR([script.4s],
+[[m4_define([good], [yep])
+m4_dumpdef([good], [oops])
+]])
+
+AT_CHECK_M4SUGAR([-o-], 1, [], [stderr])
+AT_CHECK([grep '^good: \[[yep\]]$' stderr], [0], [ignore])
+AT_CHECK([grep 'm4@&address@hidden: undefined.*oops' stderr], [0], [ignore])
+
+# Check that pushdef stacks can be dumped.
+AT_CHECK_M4SUGAR_TEXT([[m4_divert_push([KILL])
+m4_pushdef([a], [1])
+m4_pushdef([a], [2])
+m4_dumpdef([a])
+m4_dumpdefs([a])
+m4_dumpdefs([oops])
+m4_divert_pop([KILL])dnl
+]], [],
+[[a:   [2]
+a:     [2]
+a:     [1]
+]])
+
+AT_CLEANUP
+
+
 ## --------- ##
 ## m4_warn.  ##
 ## --------- ##


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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