[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] add and document AS_INIT_GENERATED
From: |
Paolo Bonzini |
Subject: |
[PATCH 3/3] add and document AS_INIT_GENERATED |
Date: |
Fri, 10 Oct 2008 09:02:36 +0200 |
Finally, here is AS_INIT_GENERATED. Unfortunately it does not do
really everything as it does not include the she-bang line, but that's
good enough for now and it can be used already in status.m4.
2008-10-10 Paolo Bonzini <address@hidden>
* lib/m4sugar/m4sh.m4 (AS_INIT_GENERATED): New.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Use it.
* doc/autoconf.texi (Initialization macros): Document it.
---
ChangeLog | 6 ++++++
doc/autoconf.texi | 9 +++++++++
lib/autoconf/status.m4 | 6 +-----
lib/m4sugar/m4sh.m4 | 10 ++++++++++
4 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3efc2f2..c91dc10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-10-10 Paolo Bonzini <address@hidden>
+ * lib/m4sugar/m4sh.m4 (AS_INIT_GENERATED): New.
+ * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Use it.
+ * doc/autoconf.texi (Initialization macros): Document it.
+
+2008-10-10 Paolo Bonzini <address@hidden>
+
* bin/autoconf.as: Invoke AS_ME_PREPARE.
* lib/m4sugar/m4sh.m4 (AS_ME_PREPARE, AS_LINENO_PREPARE): New.
* doc/autoconf.texi (Initialization macros): Document them.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 1256f97..f7a06c9 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -11943,6 +11943,15 @@ 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
address@hidden AS_INIT_GENERATED
address@hidden
+Initialize the M4sh environment. This macro emits again all the
+code that is generated by @code{AS_INIT}, including the expansion of
address@hidden and @code{AS_SHELL_SANITIZE}. It is meant
+to be used in a here document when generating other shell scripts,
+after having output the @code{#! /bin/sh} line using @code{#! $SHELL.}
address@hidden defmac
+
@defmac AS_LINENO_PREPARE
@asindex{LINENO_PREPARE}
Find a shell that supports the special variable @code{$LINENO}, which
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index ddc5f47..6d622b9 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -1332,11 +1332,7 @@ SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-AS_SHELL_SANITIZE
-dnl Watch out, this is directly the initializations, do not use
-dnl AS_PREPARE, otherwise you'd get it output in the initialization
-dnl of configure, not config.status.
-_AS_PREPARE
+AS_INIT_GENERATED
exec AS_MESSAGE_FD>&1
# Save the log message, to keep $[0] and so on meaningful, and to
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index b9db92d..bbf9a25 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1676,6 +1676,16 @@ m4_define([AS_VAR_POPDEF],
## ----------------- ##
+# AS_INIT_GENERATED
+# -----------------
+# Emit m4sh initialization code in a suitable form for a here document.
+# Does not emit the `#!' sequence, which should be generated with
+# `#! $SHELL'.
+m4_defun([AS_INIT_GENERATED],
+[m4_require([AS_PREPARE])dnl
+AS_SHELL_SANITIZE
+_AS_PREPARE])
+
# AS_INIT
# -------
# Initialize m4sh.
--
1.5.5
[PATCH 3/3] add and document AS_INIT_GENERATED,
Paolo Bonzini <=
Re: [PATCH 1/3] extract "Programming in M4sh" into its own chapter, Eric Blake, 2008/10/10