autoconf
[Top][All Lists]
Advanced

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

Re: Variable substitiution in help strings


From: Roger Leigh
Subject: Re: Variable substitiution in help strings
Date: Tue, 30 Dec 2003 20:06:32 +0000
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Rafael Laboissiere <address@hidden> writes:

> * Roger Leigh <address@hidden> [2003-12-30 17:04]:
>
>> Rafael Laboissiere <address@hidden> writes:
>> 
>> > Is there a way to get shell variables substituted in help strings of
>> > AC_ARG_WITH?
>> 
>> No, because the help text is generated at autoconf-time (using m4
>> diversions).  Check where your help text ends up in the generated
>> configure, and you'll see why.
>
> Thanks for your reply.  I have already noticed that in configure the help
> strings are output using:
>
>       cat <<\_ACEOF
>
>     Optional Features:
>     [...]
>     _ACEOF
>
> The problem is the backslash before _ACEOF.  This comes from the code in
> general.m4, apparently.  Is there any strong reason why the here-document
> delimiter is backslashed?

No idea, sorry.  It isn't in the bash documentation for "here"
documents.  Perhaps it's an obscure portability hack?

You can, if you take advantage of autoconf internals, initialise the
variables before the help text, and use shell variables in the help
text, which /should/ be subject to parameter expansion, at least for
Bourne/bash shells.  Have a look at the m4sugar stuff and

    m4_divert_once([DEFAULTS], [foo=bar])".

I'm not condoning this, though.  I'm sure Akim wouldn't approve ;-)


-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.




reply via email to

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