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


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.63-223-g83ad597
Date: Fri, 21 Nov 2008 18:20:26 +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=83ad597b889044dd2a870bb67746a06c551ee26e

The branch, master has been updated
       via  83ad597b889044dd2a870bb67746a06c551ee26e (commit)
       via  bbc3dc81cce49f892b3345c4c1cfa9737eefcd61 (commit)
      from  26ba3d53187631bd8febe617a957df5063ed2fe6 (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 83ad597b889044dd2a870bb67746a06c551ee26e
Author: Eric Blake <address@hidden>
Date:   Fri Nov 21 08:31:17 2008 -0700

    Use modern m4sh constructs in autoconf.
    
    * bin/autoconf.as (exit_missing_arg, getopt): Use AS_ERROR, rather
    than AS_EXIT.
    
    Signed-off-by: Eric Blake <address@hidden>

commit bbc3dc81cce49f892b3345c4c1cfa9737eefcd61
Author: Eric Blake <address@hidden>
Date:   Fri Nov 21 08:12:12 2008 -0700

    Change the semantics of AS_EXIT without argument.
    
    * lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE): When defaulting, use $?
    even if it is 0.
    (AS_ERROR): Guarantee non-zero status.
    * bin/autoconf.as (exit_missing_arg, getopt): Revert prior change;
    we want non-zero status.
    * tests/m4sh.at (AS@&address@hidden): Update test accordingly.
    * doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Update
    the documentation.
    <AS_SET_STATUS>: Don't overly restrict implementation.
    (Printing Messages) <AC_MSG_ERROR>: Describe better default.
    Suggestions by Paolo Bonzini and Ralf Wildenhues.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog           |   19 +++++++++++++++++++
 bin/autoconf.as     |   22 ++++++++--------------
 doc/autoconf.texi   |   20 ++++++++++----------
 lib/m4sugar/m4sh.m4 |   24 +++++++++++++-----------
 tests/m4sh.at       |   10 ++++++----
 5 files changed, 56 insertions(+), 39 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a1b8a46..37ecf00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2008-11-21  Eric Blake  <address@hidden>
 
+       Use modern m4sh constructs in autoconf.
+       * bin/autoconf.as (exit_missing_arg, getopt): Use AS_ERROR, rather
+       than AS_EXIT.
+
+       Change the semantics of AS_EXIT without argument.
+       * lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE): When defaulting, use $?
+       even if it is 0.
+       (AS_ERROR): Guarantee non-zero status.
+       * bin/autoconf.as (exit_missing_arg, getopt): Revert prior change;
+       we want non-zero status.
+       * tests/m4sh.at (AS@&address@hidden): Update test accordingly.
+       * doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Update
+       the documentation.
+       <AS_SET_STATUS>: Don't overly restrict implementation.
+       (Printing Messages) <AC_MSG_ERROR>: Describe better default.
+       Suggestions by Paolo Bonzini and Ralf Wildenhues.
+
+2008-11-21  Eric Blake  <address@hidden>
+
        Add @anchors within Builtins and Usual Tools lists.
        * doc/autoconf.texi (Limitations of Builtins)
        (Limitatations of Usual Tools): Add anchors for tools called out
diff --git a/bin/autoconf.as b/bin/autoconf.as
index c6bb0f6..dcd8ae0 100644
--- a/bin/autoconf.as
+++ b/bin/autoconf.as
@@ -79,10 +79,9 @@ help="\
 Try \`$as_me --help' for more information."
 
 exit_missing_arg='
-  AS_ECHO(["$as_me: option \`$[1]'\'' requires an argument"]) >&2
-  AS_ECHO(["$help"]) >&2
-  AS_EXIT
-' # restore font-lock: "
+  m4_bpatsubst([AS_ERROR([option `$[1]' requires an argument$as_nl$help])],
+    ['], ['\\''])'
+# restore font-lock: '
 
 # Variables.
 : ${AUTOM4TE='@bindir@/@autom4te-name@'}
@@ -113,7 +112,7 @@ while test $# -gt 0 ; do
     --prepend-include=* | -B?* | \
     --warnings=* | -W?* )
        case $1 in
-        *\'*) arg=`AS_ECHO(["$1"]) | sed "s/'/'\\\\\\\\''/g"` ;;
+        *\'*) arg=`AS_ECHO(["$1"]) | sed "s/'/'\\\\\\\\''/g"` ;; #'
         *) arg=$1 ;;
        esac
        autom4te_options="$autom4te_options '$arg'"; shift ;;
@@ -123,7 +122,7 @@ while test $# -gt 0 ; do
     --warnings | -W )
        test $# = 1 && eval "$exit_missing_arg"
        case $2 in
-        *\'*) arg=`AS_ECHO(["$2"]) | sed "s/'/'\\\\\\\\''/g"` ;;
+        *\'*) arg=`AS_ECHO(["$2"]) | sed "s/'/'\\\\\\\\''/g"` ;; #'
         *) arg=$2 ;;
        esac
        autom4te_options="$autom4te_options $option '$arg'"
@@ -154,9 +153,7 @@ while test $# -gt 0 ; do
        break ;;
     -* )
        exec >&2
-       AS_ECHO(["$as_me: invalid option $[1]"])
-       AS_ECHO(["$help"])
-       AS_EXIT ;;
+       AS_ERROR([invalid option `$[1]'$as_nl$help]) ;; #`
     * )
        break ;;
   esac
@@ -174,16 +171,13 @@ case $# in
     elif test -f configure.in; then
       infile=configure.in
     else
-      AS_ECHO(["$as_me: no input file"]) >&2
-      AS_EXIT
+      AS_ERROR([no input file])
     fi
     test -z "$traces" && test -z "$outfile" && outfile=configure;;
   1)
     infile=$1 ;;
   *) exec >&2
-     AS_ECHO(["$as_me: invalid number of arguments."])
-     AS_ECHO(["$help"])
-     AS_EXIT ;;
+     AS_ERROR([invalid number of arguments$as_nl$help]) ;;
 esac
 
 # Unless specified, the output is stdout.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index e5e2b3a..e8cab41 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -9223,11 +9223,12 @@ This macro prints nothing if @command{configure} is run 
with the
 @end defmac
 
 @anchor{AC_MSG_ERROR}
address@hidden AC_MSG_ERROR (@var{error-description}, @ovar{exit-status})
address@hidden AC_MSG_ERROR (@var{error-description}, @dvar{exit-status, $?/1})
 @acindex{MSG_ERROR}
 Notify the user of an error that prevents @command{configure} from
 completing.  This macro prints an error message to the standard error
-output and exits @command{configure} with @var{exit-status} (1 by default).
+output and exits @command{configure} with @var{exit-status} (@samp{$?}
+by default, except that @samp{0} is converted to @samp{1}).
 @var{error-description} should be something like @samp{invalid value
 $HOME for \$HOME}.
 
@@ -12165,12 +12166,10 @@ for portability, should not include more than one 
newline.  The bytes of
 Redirections can be placed outside the macro invocation.
 @end defmac
 
address@hidden AS_EXIT (@dvar{status, max($?/1)})
address@hidden AS_EXIT (@dvar{status, $?})
 @asindex{EXIT}
-Emit code to exit the shell with @var{status}.  If @var{status} is
-omitted, then @samp{$?} is used, except that a status of zero is
-converted to @samp{1}.  To exit with successful status, it is necessary
-to supply an explicit @var{status} that expands to @samp{0}.  This macro
+Emit code to exit the shell with @var{status}, defaulting to @samp{$?}.
+This macro
 works around shells that see the exit status of the command prior to
 @code{exit} inside a @samp{trap 0} handler (@pxref{trap, , Limitations
 of Shell Builtins}).
@@ -12213,9 +12212,10 @@ Also see the @code{AC_PROG_MKDIR_P} macro 
(@pxref{Particular Programs}).
 
 @defmac AS_SET_STATUS (@var{status})
 @asindex{SET_STATUS}
-Emit shell code to set the value of @samp{$?} to @var{status} without
-forking.  However, this is not guaranteed to abort a shell running with
address@hidden -e} (@pxref{set, , Limitations of Shell Builtins}).
+Emit shell code to set the value of @samp{$?} to @var{status}, as
+efficiently as possible.  However, this is not guaranteed to abort a
+shell running with @code{set -e} (@pxref{set, , Limitations of Shell
+Builtins}).
 @end defmac
 
 @defmac AS_TR_CPP (@var{expression})
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 4364387..1cdc06a 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -539,21 +539,19 @@ m4_defun([_AS_EXIT_PREPARE],
   [AS_FUNCTION_DESCRIBE([as_fn_set_status], [STATUS],
     [Set $? to STATUS, without forking.])], [  return $[]1])]dnl
 [AS_REQUIRE_SHELL_FN([as_fn_exit],
-  [AS_FUNCTION_DESCRIBE([as_fn_exit], [[[STATUS]]],
-    [Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-     If STATUS is omitted, use the maximum of $? and 1.])],
+  [AS_FUNCTION_DESCRIBE([as_fn_exit], [[[STATUS=$?]]],
+    [Exit the shell with STATUS, even in a "trap 0" or "set -e" context.])],
 [  as_status=$?
   set +e
-  test $as_status = 0 && as_status=1
   as_fn_set_status ${1-$as_status}
   exit ${1-$as_status}])])#_AS_EXIT_PREPARE
 
 
-# AS_EXIT([EXIT-CODE = $?/1])
-# ---------------------------
+# AS_EXIT([EXIT-CODE = $?])
+# -------------------------
 # Exit, with status set to EXIT-CODE in the way that it's seen
 # within "trap 0", and without interference from "set -e".  If
-# EXIT-CODE is omitted, then use $?, except use 1 if $? is 0.
+# EXIT-CODE is omitted, then use $?.
 m4_defun([AS_EXIT],
 [AS_REQUIRE([_AS_EXIT_PREPARE])[]as_fn_exit[]m4_ifval([$1], [ $1])])
 
@@ -769,15 +767,19 @@ _AS_ECHO([$as_me: $1], [$2]);}],
 
 # AS_WARN(PROBLEM)
 # ----------------
+# Output "`basename $0`: WARNING: "STRING to stderr.
 m4_define([AS_WARN],
 [AS_MESSAGE([WARNING: $1], [2])])# AS_WARN
 
 
-# AS_ERROR(ERROR, [EXIT-STATUS = 1])
-# ----------------------------------
+# AS_ERROR(ERROR, [EXIT-STATUS = max($?/1)])
+# ------------------------------------------
+# Output "`basename $0`: error: "STRING to stderr, then exit the
+# script with EXIT-STATUS.
 m4_define([AS_ERROR],
-[{ AS_MESSAGE([error: $1], [2])
-   AS_EXIT([$2]); }])# 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
 
 
 
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 1f39bb1..e85aabe 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -308,6 +308,7 @@ test x${1} = xb && AS_EXIT([${2}])
 test x${1} = xc && { AS_SET_STATUS([${2}]); AS_EXIT; }
 test x${1} = xd && trap 's=$?; echo $s; AS_EXIT([$s])' 0
 test x${2} = xe && set -e
+test $[#] -gt 0 || AS_EXIT
 AS_SET_STATUS([3])
 dnl Solaris /bin/sh 'set -e' doesn't react to failed function calls
 test x${2} = xe \
@@ -316,12 +317,13 @@ AS_SET_STATUS([4])
 ]])
 
 AT_CHECK_M4SH
-AT_CHECK([./script], [4])
-AT_CHECK([./script a], [1])
-AT_CHECK([./script b], [1])
+AT_CHECK([./script], [1])
+AT_CHECK([./script ''], [4])
+AT_CHECK([./script a], [0])
+AT_CHECK([./script b], [0])
 AT_CHECK([./script b 0], [0])
 AT_CHECK([./script b 2], [2])
-AT_CHECK([./script c 0], [1])
+AT_CHECK([./script c 0], [0])
 AT_CHECK([./script c 2], [2])
 AT_CHECK([./script d], [4], [[4
 ]])


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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