+2008-10-10 Paolo Bonzini <bonzini@gnu.org>
+
+ * lib/m4sugar/m4sh.m4 (AS_ME_PREPARE, AS_LINENO_PREPARE): New.
+ * doc/autoconf.texi (Initialization macros): Document them.
+ (Portable Shell): Refer to AS_LINENO_PREPARE.
+ * NEWS: Mention them.
+
+ * bin/autoconf.as: Invoke AS_ME_PREPARE.
+ * lib/autotest/general.m4: Likewise.
+
2008-10-10 Paolo Bonzini <bonzini@gnu.org>
* doc/autoconf.texi (Programming in M4sh): Make its own chapter.
** The following m4sugar macros are new:
m4_default_quoted
+** The following documented m4sh macros are new:
+ AS_LINENO_PREPARE
+ AS_ME_PREPARE
+
** The following m4sh macros are documented now:
- AS_VERSION_COMPARE.
+ AS_VERSION_COMPARE
\f
* Major changes in Autoconf 2.63 (2008-09-09) [stable]
# 02110-1301, USA.
m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
+AS_ME_PREPARE[]dnl
usage=["\
Usage: $0 [OPTION]... [TEMPLATE-FILE]
script. Finally, it changes the current diversion to @code{BODY}.
@end defmac
+@defmac AS_LINENO_PREPARE
+@asindex{LINENO_PREPARE}
+@evindex LINENO
+Find a shell that supports the special variable @env{LINENO}, which
+contains the number of the currently executing line. This macro is
+automatically invoked by @code{AC_INIT} in configure scripts.
+@end defmac
+
+@defmac AS_ME_PREPARE
+@asindex{ME_PREPARE}
+Set up variable @env{as_me} to be the basename of the currently executing
+script. This macro is automatically invoked by @code{AC_INIT} in
+configure scripts.
+@end defmac
+
@defmac AS_SHELL_SANITIZE
@asindex{SHELL_SANITIZE}
Initialize the shell suitably for @command{configure} scripts. This has
@item LINENO
Most modern shells provide the current line number in @code{LINENO}.
Its value is the line number of the beginning of the current command.
-Autoconf attempts to execute @command{configure} with a shell that
-supports @code{LINENO}.
-If no such shell is available, it attempts to implement @code{LINENO}
-with a Sed prepass that replaces each instance of the string
-@code{$LINENO} (not followed by an alphanumeric character) with the
-line's number.
+M4sh, and hence Autoconf, attempts to execute @command{configure} with
+a shell that supports @code{LINENO}. If no such shell is available, it
+attempts to implement @code{LINENO} with a Sed prepass that replaces each
+instance of the string @code{$LINENO} (not followed by an alphanumeric
+character) with the line's number. In M4sh scripts you should execute
+@code{AS_LINENO_PREPARE} so that these workarounds are included in
+your script; configure scripts do this automatically in @code{AC_INIT}.
You should not rely on @code{LINENO} within @command{eval}, as the
behavior differs in practice. Also, the possibility of the Sed
m4_foreach([AT_name], [_AT_DEFINE_INIT_LIST], [m4_popdef(m4_defn([AT_name]))])
m4_wrap([_AT_FINISH])
AS_INIT[]dnl
+AS_ME_PREPARE[]dnl
m4_divert_push([DEFAULTS])dnl
AT_COPYRIGHT(
[Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# _AS_ME_PREPARE
# --------------
# Define $as_me to the basename of the executable file's name.
+m4_defun([AS_ME_PREPARE], [AS_REQUIRE([_$0])])
m4_defun([_AS_ME_PREPARE],
[AS_REQUIRE([_AS_BASENAME_PREPARE])dnl
as_me=`AS_BASENAME("$[0]")`
# the case of embedded executables (such as config.status within
# configure) you'd compare LINENO wrt config.status vs. _oline_ wrt
# configure.
+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