]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Add and document AS_ME_PREPARE and AS_LINENO_PREPARE
authorPaolo Bonzini <bonzini@gnu.org>
Fri, 10 Oct 2008 06:40:52 +0000 (08:40 +0200)
committerPaolo Bonzini <bonzini@gnu.org>
Sat, 11 Oct 2008 11:30:38 +0000 (13:30 +0200)
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.

* bin/autoconf.as: Invoke AS_ME_PREPARE.
* lib/autotest/general.m4: Likewise.

ChangeLog
NEWS
bin/autoconf.as
doc/autoconf.texi
lib/autotest/general.m4
lib/m4sugar/m4sh.m4

index ea444600fb17d98209b3bdbe5e4afee5a617ef89..76dc4f58e29704cd2079e6b403291fef8018ded8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
diff --git a/NEWS b/NEWS
index 97bcb6ac86f693cb91143beb11a72a7725b32388..31e58c633a1e578f2d8b537ea6c981991c89ce76 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,8 +15,12 @@ GNU Autoconf NEWS - User visible changes.
 ** 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]
index 3a2532246d880c444a8858016166c64ae44efc47..6eab32a9df311d8eb0481f907571ab3cdee31ced 100644 (file)
@@ -22,6 +22,7 @@ m4_divert_push([HEADER-COPYRIGHT])dnl
 # 02110-1301, USA.
 
 m4_divert_pop([HEADER-COPYRIGHT])dnl back to BODY
+AS_ME_PREPARE[]dnl
 
 usage=["\
 Usage: $0 [OPTION]... [TEMPLATE-FILE]
index 96fdc5b938286104bbd18ae4bac85d6acf8cdeab..d9d82aa7c353390fea7de012c1542aed0c286c11 100644 (file)
@@ -11943,6 +11943,21 @@ generated from, and code to sanitize the environment for the rest of the
 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
@@ -14002,12 +14017,13 @@ etc.)@: as described above.
 @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
index d19f9d9ccd7c45593467320ffb2a7250b4ce7ca0..e39aee1ccc70aff61b8a007c52f55f817326efab 100644 (file)
@@ -216,6 +216,7 @@ m4_define([AT_help_all], [])
 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
index 369d27a424fb53851142d811fbbc2b201d89c9b5..ef3d93b5732c3fe21025b6133a54558a77616c5e 100644 (file)
@@ -914,6 +914,7 @@ fi
 # _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]")`
@@ -942,6 +943,7 @@ 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.
+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