]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Document AS_EXIT.
authorEric Blake <ebb9@byu.net>
Sat, 25 Oct 2008 12:29:37 +0000 (06:29 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 25 Oct 2008 12:30:06 +0000 (06:30 -0600)
* doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Document
this macro.
(Limitations of Builtins): Mention AS_EXIT.
* NEWS: Mention it.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
doc/autoconf.texi

index 70cc6fc048bd476b5b68d093bec1ce394fc6072c..a0f87ec6149e5827390662e42f76a02583cf9b06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-10-25  Eric Blake  <ebb9@byu.net>
 
+       Document AS_EXIT.
+       * doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>: Document
+       this macro.
+       (Limitations of Builtins): Mention AS_EXIT.
+       * NEWS: Mention it.
+
        Use AS_EXIT in autoconf.as.
        * bin/autoconf.as: Consistently use AS_EXIT.
 
diff --git a/NEWS b/NEWS
index 496fac711e1a9362b0ca58ecf7a807185d38d7d0..5bdff4860a16ceddcc683dada95321c8e41a07ad 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,9 +23,9 @@ GNU Autoconf NEWS - User visible changes.
    AS_LINENO_PREPARE  AS_ME_PREPARE  AS_VAR_APPEND  AS_VAR_COPY
 
 ** The following m4sh macros are documented now:
-   AS_ECHO  AS_ECHO_N  AS_LITERAL_IF  AS_UNSET  AS_VAR_IF  AS_VAR_POPDEF
-   AS_VAR_PUSHDEF  AS_VAR_SET  AS_VAR_SET_IF  AS_VAR_TEST_SET
-   AS_VERSION_COMPARE
+   AS_ECHO  AS_ECHO_N  AS_EXIT  AS_LITERAL_IF  AS_UNSET  AS_VAR_IF
+   AS_VAR_POPDEF  AS_VAR_PUSHDEF  AS_VAR_SET  AS_VAR_SET_IF
+   AS_VAR_TEST_SET  AS_VERSION_COMPARE
 
 ** The m4sh macros AS_IF and AS_CASE can now be used in shell lists.
    The responsibility for supplying a trailing newline now belongs to
index 85093229ac4962bbc71ed3677bf3ef25f14e43e2..b89ce5b7acd0e5f6549e3824416362bb3c202b64 100644 (file)
@@ -11966,6 +11966,14 @@ for portability, should not include more than one newline.  The bytes of
 Redirections can be placed outside the macro invocation.
 @end defmac
 
+@defmac AS_EXIT (@dvar{status, 1})
+@asindex{EXIT}
+Emit code to exit the shell with @var{status}.  This works around shells
+that see the exit status of the command prior to @code{exit} inside a
+@samp{trap 0} handler (@pxref{Limitations of Builtins, , Limitations of
+Shell Builtins}).
+@end defmac
+
 @defmac AS_IF (@var{test1}, @ovar{run-if-true1}, @dots{}, @ovar{run-if-false})
 @asindex{IF}
 Run shell code @var{test1}.  If @var{test1} exits with a zero status then
@@ -15433,7 +15441,8 @@ $ @kbd{bash trap.sh}
 The portable solution is then simple: when you want to @samp{exit 42},
 run @samp{(exit 42); exit 42}, the first @command{exit} being used to
 set the exit status to 42 for Zsh, and the second to trigger the trap
-and pass 42 as exit status for Bash.
+and pass 42 as exit status for Bash.  In m4sh, this is covered by using
+@code{AS_EXIT}.
 
 The shell in Free@acronym{BSD} 4.0 has the following bug: @samp{$?} is
 reset to 0 by empty lines if the code is inside @command{trap}.