bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Re: Docs for gnulib-tool --import


From: Gary V. Vaughan
Subject: Re: [Bug-gnulib] Re: Docs for gnulib-tool --import
Date: Wed, 06 Oct 2004 17:58:46 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

Hi Simon,

Simon Josefsson wrote:
> "Gary V. Vaughan" <address@hidden> writes:
>>>I don't think we can get rid of gl_EARLY, though, unless it is
>>>possible to hook into AC_PROG_CC automatically somehow.
>>
>>AC_PROVIDE_IFELSE([AC_PROG_CC], [gl_EARLY],
>>    [m4_define([AC_PROG_CC], defn([AC_PROG_CC])[gl_EARLY])])
>>
>>That is: If AC_PROG_CC has been expanded at this point, expand gl_EARLY right
>>now, otherwise hook it onto the end of AC_PROG_CC so that it will be expanded
>>right after the next call to AC_PROG_CC.
> 
> Where would this snippet go?  gnulib.m4?  Would it have the proper
> effect, then?  I.e., run before the C compiler has been used for real
> tests?

Ideally it would need to be evaluated at the top level, that is not from
inside another macro definition which might not be expanded until it is too
late.  So you would need to arrange to have it expanded as aclocal.m4 is
evaluated (while the other macro definitions are being read).  I'm not
sure of the order of definition of autoconf macros vs. aclocal.m4 macros,
but I'm reasonably sure that m4 will read in the frozen definitions from
autoconf and then read aclocal.m4.  If that isn't the case, then you would
need to put the snippet above in a diversion that is reread between aclocal.m4
and the expansion of configure.ac.

The reason for having both branches on the AC_PROVIDE_IFELSE is to make sure
gl_EARLY is expanded after AC_PROG_CC, preferably immediately afterwards.

>  Is it good style to do this?  Could it break something?

Libtool has been hooking code onto autoconf macros like this since 2.5x
with no problems.  And I think that it is a nice idiom.  I wouldn't presume
to rule on good vs bad style though ;-)

>>gl_INIT([module=getopt progname strdup ...], [sourcebase=gl], [license=LGPL])
> 
> Nice!
> 
>>I might be able to tweak the syntax table implementation to allow a lispier
>>notation too...
>  
> I'm not sure, but it is probably better to only support one scheme.
> Easier to match using sed expressions.  More room for future
> expansion.  Etc.

You can't reliably use sed over m4 input.  changecom and changequote already
make that too unreliable.  Use autoconf --trace if you want to see what is
happening inside a configure run.  However, you can't do that from tools that
change the contents of aclocal.m4 (libtoolize, autopoint, gnulib-tool) for
obvious reasons.  A future revision of autoconf will read its macros directly
without any need for the aclocal hack, and then --trace will be useful to
those tools again.

Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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