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


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-225-g48d8391
Date: Fri, 21 Nov 2008 20:59:34 +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=48d8391ff3fe67729ae4131691e5aef827edb500

The branch, master has been updated
       via  48d8391ff3fe67729ae4131691e5aef827edb500 (commit)
      from  a8a9b2148de0afc053ded2b3f9edc232a0d1aa96 (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 48d8391ff3fe67729ae4131691e5aef827edb500
Author: Eric Blake <address@hidden>
Date:   Fri Nov 21 10:15:20 2008 -0700

    Use shell function for AS_ERROR.
    
    * lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): New macro, defining a
    new shell function.
    (AS_ERROR): Use it.
    (_AS_LINENO_PREPARE): Break circular dependency.
    (AS_PREPARE, _AS_PREPARE): Initialize for child scripts.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog           |    9 +++++++
 lib/m4sugar/m4sh.m4 |   65 +++++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 64 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 81d9dcf..ec79176 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-11-21  Eric Blake  <address@hidden>
 
+       Use shell function for AS_ERROR.
+       * lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): New macro, defining a
+       new shell function.
+       (AS_ERROR): Use it.
+       (_AS_LINENO_PREPARE): Break circular dependency.
+       (AS_PREPARE, _AS_PREPARE): Initialize for child scripts.
+
+2008-11-21  Eric Blake  <address@hidden>
+
        Fix typos in recent testsuite improvements.
        * lib/autotest/general.m4 (AT_INIT) <at_fn_check_prepare_dynamic>:
        Fix typo.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 1cdc06a..f3dc4ac 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -295,10 +295,17 @@ _m4_popdef([AS_EXIT])])# _AS_DETECT_BETTER_SHELL
 # Special case: we do not need _AS_LINENO_PREPARE, because the
 # parent will have substituted $LINENO for us when processing its
 # own invocation of _AS_LINENO_PREPARE.
+#
+# Special case: the full definition of _AS_ERROR_PREPARE is not output
+# unless AS_MESSAGE_LOG_FD is non-empty, although the value of
+# AS_MESSAGE_LOG_FD is not relevant.
 m4_defun([_AS_PREPARE],
 [m4_pushdef([AS_REQUIRE])]dnl
 [m4_pushdef([AS_REQUIRE_SHELL_FN], _m4_defn([_AS_REQUIRE_SHELL_FN])
 )]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD], [-1])]dnl
+[_AS_ERROR_PREPARE
+_m4_popdef([AS_MESSAGE_LOG_FD])]dnl
 [_AS_EXIT_PREPARE
 _AS_UNSET_PREPARE
 _AS_VAR_APPEND_PREPARE
@@ -325,6 +332,8 @@ _m4_popdef([AS_REQUIRE], [AS_REQUIRE_SHELL_FN])])
 # shell functions are placed in M4SH-INIT-FN.
 m4_defun([AS_PREPARE],
 [m4_divert_push([KILL])
+m4_append_uniq([_AS_CLEANUP],
+  [m4_divert_text([M4SH-INIT-FN], [_AS_ERROR_PREPARE[]])])
 AS_REQUIRE([_AS_EXPR_PREPARE])
 AS_REQUIRE([_AS_BASENAME_PREPARE])
 AS_REQUIRE([_AS_DIRNAME_PREPARE])
@@ -767,20 +776,51 @@ _AS_ECHO([$as_me: $1], [$2]);}],
 
 # AS_WARN(PROBLEM)
 # ----------------
-# Output "`basename $0`: WARNING: "STRING to stderr.
+# Output "`basename $0`: WARNING: PROBLEM" to stderr.
 m4_define([AS_WARN],
 [AS_MESSAGE([WARNING: $1], [2])])# AS_WARN
 
 
+# _AS_ERROR_PREPARE
+# -----------------
+# Output the shell function used by AS_ERROR.  This is designed to be
+# expanded during the m4_wrap cleanup.
+#
+# If AS_MESSAGE_LOG_FD is non-empty at the end of the script, then
+# make this function take optional parameters that use LINENO at the
+# points where AS_ERROR was expanded with non-empty AS_MESSAGE_LOG_FD;
+# otherwise, assume the entire script does not do logging.
+m4_define([_AS_ERROR_PREPARE],
+[AS_REQUIRE_SHELL_FN([as_fn_error],
+  [AS_FUNCTION_DESCRIBE([as_fn_error], [ERROR]m4_ifset([AS_MESSAGE_LOG_FD],
+      [[ [[LINENO LOG_FD]]]]),
+    [Output "`basename @S|@0`: error: ERROR" to stderr.]
+m4_ifset([AS_MESSAGE_LOG_FD],
+    [[If LINENO and LOG_FD are provided, also output the error to LOG_FD,
+      referencing LINENO.]])
+    [Then exit the script with status $?, using 1 if that was 0.])],
+[  as_status=$?; test $as_status -eq 0 && as_status=1
+m4_ifset([AS_MESSAGE_LOG_FD],
+[m4_pushdef([AS_MESSAGE_LOG_FD], [$[3]])dnl
+  if test "$[3]"; then
+    AS_LINENO_PUSH([$[2]])
+    _AS_ECHO_LOG([error: $[1]])
+  fi
+m4_define([AS_MESSAGE_LOG_FD])], [m4_pushdef([AS_MESSAGE_LOG_FD])])dnl
+  AS_MESSAGE([error: $[1]], [2])
+_m4_popdef([AS_MESSAGE_LOG_FD])dnl
+  AS_EXIT([$as_status])])])
+
 # AS_ERROR(ERROR, [EXIT-STATUS = max($?/1)])
 # ------------------------------------------
-# Output "`basename $0`: error: "STRING to stderr, then exit the
+# Output "`basename $0`: error: ERROR" to stderr, then exit the
 # script with EXIT-STATUS.
-m4_define([AS_ERROR],
-[{ m4_ifval([$2], [], [as_status=$?; test $as_status -eq 0 && as_status=1
-   ]) AS_MESSAGE([error: $1], [2])
-    AS_EXIT(m4_default([$2], [$as_status])); }])# AS_ERROR
-
+m4_defun_init([AS_ERROR],
+[m4_append_uniq([_AS_CLEANUP],
+  [m4_divert_text([M4SH-INIT-FN], [_AS_ERROR_PREPARE[]])])],
+[m4_ifvaln([$2], [{ AS_SET_STATUS([$2])])]dnl
+[as_fn_error "_AS_QUOTE([$1])"m4_ifset([AS_MESSAGE_LOG_FD],
+  [ "$LINENO" AS_MESSAGE_LOG_FD])[]m4_ifval([$2], [; }])])
 
 
 # AS_LINENO_PUSH([LINENO])
@@ -1050,14 +1090,19 @@ m4_define([_AS_LINENO_WORKS],
 # the case of embedded executables (such as config.status within
 # configure) you'd compare LINENO wrt config.status vs. _oline_ wrt
 # configure.
+#
+# AS_ERROR normally uses LINENO if logging, but AS_LINENO_PREPARE uses
+# AS_ERROR.  Besides, if the logging fd is open, we don't want to use
+# $LINENO in the log complaining about broken LINENO.  We break the
+# circular require by changing AS_ERROR and AS_MESSAGE_LOG_FD.
 m4_defun([AS_LINENO_PREPARE], [AS_REQUIRE([_$0])])
 m4_defun([_AS_LINENO_PREPARE],
 [AS_REQUIRE([_AS_CR_PREPARE])]dnl
 [AS_REQUIRE([_AS_ME_PREPARE])]dnl
 [_AS_DETECT_SUGGESTED([_AS_LINENO_WORKS])]dnl
-dnl Even if the logging fd is open, we don't want to use $LINENO in the
-dnl AS_ERROR complaining that LINENO is broken.
 [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[m4_pushdef([AS_ERROR],
+  [{ AS_MESSAGE(]m4_dquote([error: $][1])[, [2]); AS_EXIT([1]); }])]dnl
 dnl Create $as_me.lineno as a copy of $as_myself, but with $LINENO
 dnl uniformly replaced by the line number.  The first 'sed' inserts a
 dnl line-number line after each line using $LINENO; the second 'sed'
@@ -1093,7 +1138,7 @@ dnl Eggert wrote the scripts with optimization help from 
Paolo Bonzini).
   # Exit status is that of the last command.
   exit
 }
-_m4_popdef([AS_MESSAGE_LOG_FD])])# _AS_LINENO_PREPARE
+_m4_popdef([AS_MESSAGE_LOG_FD], [AS_ERROR])])# _AS_LINENO_PREPARE
 
 
 # _AS_LN_S_PREPARE


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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