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-19-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-19-g6f106cd
Date: Tue, 07 Oct 2008 18:19:49 +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=6f106cdeadea6ea32c7047247cdb800f8d105d02

The branch, master has been updated
       via  6f106cdeadea6ea32c7047247cdb800f8d105d02 (commit)
       via  7e1c6397cc302ffa93c6cd9310fcb03e3ab36ab6 (commit)
      from  a2f7e1aa97b03a5b5de68b62b1d5b7c554d6c7e2 (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 6f106cdeadea6ea32c7047247cdb800f8d105d02
Author: Eric Blake <address@hidden>
Date:   Tue Oct 7 12:00:02 2008 -0600

    Ensure _AS_CLEANUP is defined.
    
    * lib/m4sugar/m4sh.m4 (_AS_CLEANUP): Give initial definition.
    * tests/m4sh.at (AS@&address@hidden cleanup): Expose the need for this.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 7e1c6397cc302ffa93c6cd9310fcb03e3ab36ab6
Author: Eric Blake <address@hidden>
Date:   Tue Oct 7 10:55:05 2008 -0600

    Improve m4sh maintainability.
    
    * lib/m4sugar/m4sh.m4: Sort macros for sanitizing the shell; no
    code change.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog           |    8 ++
 lib/m4sugar/m4sh.m4 |  241 ++++++++++++++++++++++++++-------------------------
 tests/m4sh.at       |    1 +
 3 files changed, 133 insertions(+), 117 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5127319..f072ae4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2008-10-07  Eric Blake  <address@hidden>
 
+       Ensure _AS_CLEANUP is defined.
+       * lib/m4sugar/m4sh.m4 (_AS_CLEANUP): Give initial definition.
+       * tests/m4sh.at (AS@&address@hidden cleanup): Expose the need for this.
+
+       Improve m4sh maintainability.
+       * lib/m4sugar/m4sh.m4: Sort macros for sanitizing the shell; no
+       code change.
+
        Fix m4 quoting in previous patch.
        * lib/m4sugar/m4sh.m4 (AS_REQUIRE_SHELL_FN): Determine diversion
        name prior to invoking AS_REQUIRE.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 914987e..b49f302 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -101,66 +101,7 @@ m4_copy([_m4_divert(M4SH-INIT)], [_m4_divert(NOTICE)])
 ## ------------------------- ##
 ## 1. Sanitizing the shell.  ##
 ## ------------------------- ##
-
-
-# AS_REQUIRE(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK],
-#            [DIVERSION = M4SH-INIT])
-# -----------------------------------------------------------
-# BODY-TO-EXPAND is some initialization which must be expanded in the
-# given diversion when expanded (required or not).  This is very
-# different from m4_require.  For instance:
-#
-#      m4_defun([_FOO_PREPARE], [foo=foo])
-#      m4_defun([FOO],
-#      [m4_require([_FOO_PREPARE])dnl
-#      echo $foo])
-#
-#      m4_defun([_BAR_PREPARE], [bar=bar])
-#      m4_defun([BAR],
-#      [AS_REQUIRE([_BAR_PREPARE])dnl
-#      echo $bar])
-#
-#      AS_INIT
-#      foo1=`FOO`
-#      foo2=`FOO`
-#      bar1=`BAR`
-#      bar2=`BAR`
-#
-# gives
-#
-#      #! /bin/sh
-#      bar=bar
-#
-#      foo1=`foo=foo
-#      echo $foo`
-#      foo2=`echo $foo`
-#      bar1=`echo $bar`
-#      bar2=`echo $bar`
-#
-# Due to the simple implementation, all the AS_REQUIRE calls have to be at
-# the very beginning of the macro body, or the AS_REQUIREs may not be nested.
-# More exactly, if a macro doesn't have all AS_REQUIREs at its beginning,
-# it may not be AS_REQUIREd.
-#
-m4_define([AS_REQUIRE],
-[m4_provide_if([$1], [],
-              [m4_divert_text(m4_default_quoted([$3], [M4SH-INIT]),
-                              [m4_default([$2], [$1])])])])
-
-
-# AS_REQUIRE_SHELL_FN(NAME-TO-CHECK, BODY-TO-EXPAND,
-#                     [DIVERSION = M4SH-INIT-FN])
-# --------------------------------------------------
-# BODY-TO-EXPAND is the body of a shell function to be emitted in the
-# given diversion when expanded (required or not).  Unlike other
-# xx_REQUIRE macros, BODY-TO-EXPAND is mandatory.
-#
-m4_define([AS_REQUIRE_SHELL_FN],
-[_AS_DETECT_REQUIRED([_AS_SHELL_FN_WORK])dnl
-AS_REQUIRE([AS_SHELL_FN_$1], [m4_provide([AS_SHELL_FN_$1])$1() {
-$2
-}], m4_default_quoted([$3], [M4SH-INIT-FN]))])
-
+# Please maintain lexicographic sorting of this section, ignoring leading _.
 
 # AS_BOURNE_COMPATIBLE
 # --------------------
@@ -193,18 +134,22 @@ m4_define([_AS_BOURNE_COMPATIBLE],
 ])
 
 
-# _AS_RUN(TEST, [SHELL])
-# ----------------------
-# Run TEST under the current shell (if one parameter is used)
-# or under the given SHELL, protecting it from syntax errors.
-m4_define([_AS_RUN],
-[m4_ifval([$2],
-[{ $2 <<\_ASEOF
-_AS_BOURNE_COMPATIBLE
-$1
-_ASEOF
-}],
-[(eval "AS_ESCAPE(m4_expand([$1]))")])])
+# _AS_CLEANUP
+# -----------
+# Expanded as the last thing before m4sugar cleanup begins.  Macros
+# may append m4sh cleanup hooks to this as appropriate.
+m4_define([_AS_CLEANUP])
+
+
+# AS_COPYRIGHT(TEXT)
+# ------------------
+# Emit TEXT, a copyright notice, as a shell comment near the top of the
+# script.  TEXT is evaluated once; to accomplish that, we do not prepend
+# `# ' but address@hidden:@ '.
+m4_define([AS_COPYRIGHT],
+[m4_divert_text([HEADER-COPYRIGHT],
+[m4_bpatsubst([
+$1], [^], address@hidden:@ ])])])
 
 
 # _AS_DETECT_REQUIRED(TEST)
@@ -291,6 +236,113 @@ fi
 ])])])# _AS_DETECT_BETTER_SHELL
 
 
+# _AS_PREPARE
+# -----------
+# This macro has a very special status.  Normal use of M4sh relies
+# heavily on AS_REQUIRE, so that needed initializations (such as
+# _AS_TEST_PREPARE) are performed on need, not on demand.  But
+# Autoconf is the first client of M4sh, and for two reasons: configure
+# and config.status.  Relying on AS_REQUIRE is of course fine for
+# configure, but fails for config.status (which is created by
+# configure).  So we need a means to force the inclusion of the
+# various _AS_PREPARE_* on top of config.status.  That's basically why
+# there are so many _AS_PREPARE_* below, and that's also why it is
+# important not to forget some: config.status needs them.
+m4_defun([_AS_PREPARE],
+[_AS_LINENO_PREPARE
+
+_AS_DIRNAME_PREPARE
+_AS_ECHO_N_PREPARE[]dnl We do not need this ourselves but user code might.
+_AS_EXPR_PREPARE
+_AS_LN_S_PREPARE
+_AS_MKDIR_P_PREPARE
+_AS_TEST_PREPARE
+_AS_TR_CPP_PREPARE
+_AS_TR_SH_PREPARE
+])
+
+
+# AS_PREPARE
+# ----------
+# Output all the M4sh possible initialization into the initialization
+# diversion.
+m4_defun([AS_PREPARE],
+[m4_divert_text([M4SH-INIT], [_AS_PREPARE])])
+
+
+# AS_REQUIRE(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK],
+#            [DIVERSION = M4SH-INIT])
+# -----------------------------------------------------------
+# BODY-TO-EXPAND is some initialization which must be expanded in the
+# given diversion when expanded (required or not).  This is very
+# different from m4_require.  For instance:
+#
+#      m4_defun([_FOO_PREPARE], [foo=foo])
+#      m4_defun([FOO],
+#      [m4_require([_FOO_PREPARE])dnl
+#      echo $foo])
+#
+#      m4_defun([_BAR_PREPARE], [bar=bar])
+#      m4_defun([BAR],
+#      [AS_REQUIRE([_BAR_PREPARE])dnl
+#      echo $bar])
+#
+#      AS_INIT
+#      foo1=`FOO`
+#      foo2=`FOO`
+#      bar1=`BAR`
+#      bar2=`BAR`
+#
+# gives
+#
+#      #! /bin/sh
+#      bar=bar
+#
+#      foo1=`foo=foo
+#      echo $foo`
+#      foo2=`echo $foo`
+#      bar1=`echo $bar`
+#      bar2=`echo $bar`
+#
+# Due to the simple implementation, all the AS_REQUIRE calls have to be at
+# the very beginning of the macro body, or the AS_REQUIREs may not be nested.
+# More exactly, if a macro doesn't have all AS_REQUIREs at its beginning,
+# it may not be AS_REQUIREd.
+#
+m4_define([AS_REQUIRE],
+[m4_provide_if([$1], [],
+              [m4_divert_text(m4_default_quoted([$3], [M4SH-INIT]),
+                              [m4_default([$2], [$1])])])])
+
+
+# AS_REQUIRE_SHELL_FN(NAME-TO-CHECK, BODY-TO-EXPAND,
+#                     [DIVERSION = M4SH-INIT-FN])
+# --------------------------------------------------
+# BODY-TO-EXPAND is the body of a shell function to be emitted in the
+# given diversion when expanded (required or not).  Unlike other
+# xx_REQUIRE macros, BODY-TO-EXPAND is mandatory.
+#
+m4_define([AS_REQUIRE_SHELL_FN],
+[_AS_DETECT_REQUIRED([_AS_SHELL_FN_WORK])dnl
+AS_REQUIRE([AS_SHELL_FN_$1], [m4_provide([AS_SHELL_FN_$1])$1() {
+$2
+}], m4_default_quoted([$3], [M4SH-INIT-FN]))])
+
+
+# _AS_RUN(TEST, [SHELL])
+# ----------------------
+# Run TEST under the current shell (if one parameter is used)
+# or under the given SHELL, protecting it from syntax errors.
+m4_define([_AS_RUN],
+[m4_ifval([$2],
+[{ $2 <<\_ASEOF
+_AS_BOURNE_COMPATIBLE
+$1
+_ASEOF
+}],
+[(eval "AS_ESCAPE(m4_expand([$1]))")])])
+
+
 # _AS_SHELL_FN_WORK
 # -----------------
 # This is a spy to detect "in the wild" shells that do not support shell
@@ -332,17 +384,6 @@ test $exitcode = 0[]dnl
 ])# _AS_SHELL_FN_WORK
 
 
-# AS_COPYRIGHT(TEXT)
-# ------------------
-# Emit TEXT, a copyright notice, as a shell comment near the top of the
-# script.  TEXT is evaluated once; to accomplish that, we do not prepend
-# `# ' but address@hidden:@ '.
-m4_define([AS_COPYRIGHT],
-[m4_divert_text([HEADER-COPYRIGHT],
-[m4_bpatsubst([
-$1], [^], address@hidden:@ ])])])
-
-
 # AS_SHELL_SANITIZE
 # -----------------
 m4_defun([AS_SHELL_SANITIZE],
@@ -408,40 +449,6 @@ $as_unset CDPATH
 ])# AS_SHELL_SANITIZE
 
 
-# _AS_PREPARE
-# -----------
-# This macro has a very special status.  Normal use of M4sh relies
-# heavily on AS_REQUIRE, so that needed initializations (such as
-# _AS_TEST_PREPARE) are performed on need, not on demand.  But
-# Autoconf is the first client of M4sh, and for two reasons: configure
-# and config.status.  Relying on AS_REQUIRE is of course fine for
-# configure, but fails for config.status (which is created by
-# configure).  So we need a means to force the inclusion of the
-# various _AS_PREPARE_* on top of config.status.  That's basically why
-# there are so many _AS_PREPARE_* below, and that's also why it is
-# important not to forget some: config.status needs them.
-m4_defun([_AS_PREPARE],
-[_AS_LINENO_PREPARE
-
-_AS_DIRNAME_PREPARE
-_AS_ECHO_N_PREPARE[]dnl We do not need this ourselves but user code might.
-_AS_EXPR_PREPARE
-_AS_LN_S_PREPARE
-_AS_MKDIR_P_PREPARE
-_AS_TEST_PREPARE
-_AS_TR_CPP_PREPARE
-_AS_TR_SH_PREPARE
-])
-
-
-# AS_PREPARE
-# ----------
-# Output all the M4sh possible initialization into the initialization
-# diversion.
-m4_defun([AS_PREPARE],
-[m4_divert_text([M4SH-INIT], [_AS_PREPARE])])
-
-
 ## ----------------------------- ##
 ## 2. Wrappers around builtins.  ##
 ## ----------------------------- ##
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 33bcca5..1fc9852 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -805,6 +805,7 @@ AT_DATA_M4SH([script.as], [[dnl
 dnl Registered before AS_INIT's cleanups
 m4_wrap([echo cleanup 1
 ])
+m4_pushdef([_AS_SHELL_FN_SPY])dnl neutralize the spy, we don't care about it
 AS_INIT
 dnl Registered after AS_INIT's cleanups, thus goes to KILL diversion
 m4_wrap([echo cleanup 2


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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