mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-05 11:10:57 +08:00
Cleanups to previous patches.
* doc/autoconf.texi (Portable Shell): Minor edits. (Limitations of Builtins): Touch up wording. * lib/m4sugar/m4sh.m4 (AS_LINENO_PUSH): Nuke trailing whitespace. (_AS_SHELL_SANITIZE): Wrap comments less than 80 columns. Signed-off-by: Eric Blake <ebb9@byu.net>
This commit is contained in:
parent
2079086ce2
commit
6edff90b47
@ -1,3 +1,11 @@
|
||||
2008-10-15 Eric Blake <ebb9@byu.net>
|
||||
|
||||
Cleanups to previous patches.
|
||||
* doc/autoconf.texi (Portable Shell): Minor edits.
|
||||
(Limitations of Builtins): Touch up wording.
|
||||
* lib/m4sugar/m4sh.m4 (AS_LINENO_PUSH): Nuke trailing whitespace.
|
||||
(_AS_SHELL_SANITIZE): Wrap comments less than 80 columns.
|
||||
|
||||
2008-10-15 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
Updates to shell portability documentation.
|
||||
|
@ -12794,10 +12794,11 @@ while not in Unix version 7, were retrofitted in the original Bourne
|
||||
shell and can be assumed to be part of the least common denominator.
|
||||
|
||||
On the other hand, if you're using M4sh you can assume that the shell
|
||||
has the features that were added in SVR2, including shell functions,
|
||||
has the features that were added in SVR2 (circa 1984), including shell
|
||||
functions,
|
||||
@command{return}, @command{unset}, and I/O redirection for builtins. For
|
||||
more information, refer to @uref{http://@/www.in-ulm.de/@/~mascheck/@/bourne/}.
|
||||
However, some pitfalls have to be avoided for portable use of this
|
||||
However, some pitfalls have to be avoided for portable use of these
|
||||
constructs; these will be documented in the rest of this chapter.
|
||||
See in particular @ref{Shell Functions} and @ref{Limitations of
|
||||
Builtins, , Limitations of Shell Builtins}.
|
||||
@ -14555,10 +14556,11 @@ EOF
|
||||
@end example
|
||||
|
||||
New applications which are not aiming at portability should use
|
||||
@samp{printf} instead of @samp{echo}. M4sh provides the @code{AS_ECHO}
|
||||
and @code{AS_ECHO_N} macros (corresponding to @samp{echo -n} which use
|
||||
@samp{printf} if it is available, or otherwise resort to various creative
|
||||
tricks in order to work around the above problems.
|
||||
@command{printf} instead of @command{echo}. M4sh provides the
|
||||
@code{AS_ECHO} and @code{AS_ECHO_N} macros, which choose between
|
||||
@samp{echo -n} on implementations where that works, @command{printf} if
|
||||
it is available, or other creative tricks in order to work around the
|
||||
above problems.
|
||||
|
||||
|
||||
@item @command{eval}
|
||||
@ -14799,7 +14801,7 @@ fi
|
||||
@noindent
|
||||
Or, especially if the @dfn{else} branch is short, you can use @code{||}.
|
||||
In M4sh, the @code{AS_IF} macro provides an easy way to write these kinds
|
||||
of conditionals as;
|
||||
of conditionals:
|
||||
|
||||
@example
|
||||
AS_IF([cmp -s file file.new], [], [mv file.new file])
|
||||
|
@ -420,9 +420,10 @@ if test ! -f "$as_myself"; then
|
||||
AS_EXIT
|
||||
fi
|
||||
|
||||
# Unset variables that we do not need and cause bugs (e.g. in pre-3.0 UWIN ksh).
|
||||
# But do not cause bugs in bash 2.01; the "|| exit 1" suppresses any
|
||||
# "Segmentation fault" message there. '((' could trigger a bug in pdksh 5.2.14.
|
||||
# Unset variables that we do not need and which cause bugs (e.g. in
|
||||
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
|
||||
# suppresses any "Segmentation fault" message there. '((' could
|
||||
# trigger a bug in pdksh 5.2.14.
|
||||
for as_var in BASH_ENV ENV MAIL MAILPATH
|
||||
do eval test x\${$as_var+set} = xset && dnl
|
||||
( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
|
||||
@ -698,7 +699,7 @@ m4_define([AS_ERROR],
|
||||
# ------------------------
|
||||
# If this is the outermost call to AS_LINENO_PUSH, make sure that
|
||||
# AS_MESSAGE will print LINENO as the line number.
|
||||
m4_defun([AS_LINENO_PUSH],
|
||||
m4_defun([AS_LINENO_PUSH],
|
||||
[as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user