autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] add and document AS_INIT_GENERATED


From: Eric Blake
Subject: Re: [PATCH 3/3] add and document AS_INIT_GENERATED
Date: Mon, 13 Oct 2008 06:17:31 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paolo Bonzini on 10/10/2008 1:02 AM:
> 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.

I'm still not understanding your comments in other mail about why
AS_INIT_GENERATED must involve m4_require.  I think we need another round
of email discussion before this is ready to go.

> 
> 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.
>  
> address@hidden AS_INIT_GENERATED
> address@hidden

s/INIT/INIT_GENERATED/

> +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,

s/a here document/a quoted here document/

> +after having output the @code{#! /bin/sh} line using @code{#! $SHELL.}

An example would be nice.  It takes two here documents, one unquoted, to
expand $SHELL, and a second quoted, so that no text produced by
AS_INIT_GENERATED is mistakenly expanded early.  But it seems like this
recommendation is incomplete.  Both autoconf's status.m4 and libtool's
libtool.m4 use the two-step sequence:
| #!$SHELL
| SHELL=\${CONFIG_SHELL-$SHELL}
needed so that if /bin/sh is inadequate, the shell attempts to re-exec
with the same shell learned during configure.

Also, there is the matter that if AS_MESSAGE_LOG_FD is currently defined,
it must either be temporarily suppressed in m4 so that any AS_MESSAGE
usage to the child script does not attempt to access a non-existent log,
or else reopened in shell immediately after AS_INIT_GENERATED.  This is
probably worth a mention in the manual.

>  
>  
> +# AS_INIT_GENERATED
> +# -----------------
> +# Emit m4sh initialization code in a suitable form for a here document.

s/a here document/a quoted here document/

> +# Does not emit the `#!' sequence, which should be generated with
> +# `#! $SHELL'.

Again, I'd be more comfortable also mentioning the SHELL= line, and the
prefix lines occur in an unquoted here-doc.

> +m4_defun([AS_INIT_GENERATED],
> +[m4_require([AS_PREPARE])dnl

Why is the m4_require needed?  Just because the child script is given all
m4sh features still doesn't explain why we have to blindly enable all m4sh
features in the parent; isn't an as-needed preparation in the parent
script still possible?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjzPFsACgkQ84KuGfSFAYDmaACfbfKqsTTpvsfzvHhvEYfCxCDg
Ln8AnivUumT54fEEjVM00SMA2zwYeaGA
=MrNf
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]