bug-gnulib
[Top][All Lists]
Advanced

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

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


From: Gary V. Vaughan
Subject: [Bug-gnulib] Re: Docs for gnulib-tool --import
Date: Tue, 12 Oct 2004 14:45:59 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

Hi Simon,

Simon Josefsson wrote:
> "Gary V. Vaughan" <address@hidden> writes:
>>The style used by M4's own macros, and m4sugar.m4 in Autoconf is to shift()
>>away the first batch of arguments and call ourselves again recursively.  The
>>invocation would then be (swapping arg order for readability, and using []
>>to accept the defaults):
>>
>>  gl_INIT([lgl], [lgl/m4], [liblgl], [LGPL],
>>               [strdup dummy ...],
>>          [gl],  [gl/m4],  [libgl],  [],
>>               [error getopt progname ...])
> 
> 
> The problem is that this is inflexible.  I suspect we may need more
> parameters later on; the directory names, license, library name and
> modules are what is needed now.  Another useful parameter could
> (theoretically) be whether libtool should be used, per directory.

If you want to retain the possibility of adding additional arguments, then
it is easy to take advantage of the fact that the macro is simply writing
some shell code into configure for us.  So we could invoke gl_INIT thus:

gl_INIT([strdup dummy ...],
            [source_base=lgl; m4_base=lgl/m4; lib=liblgl; license=LGPL],
        [error getopt progname ...],
            [source_base=gl; m4_base=gl/m4; lib=libgl])

And in the implementation emit first the default value setting, and then
the shell code block which will override only those settings listed.  As
long as the variable values are either saved or no longer used before
calling m4_shiftn and recursing there will be no problem in the generated
configure code, and adding new options is a snap.

This method also lends itself well to the rewriting for parsing hint I
gave earlier in the thread.

> So I might end up with the multiple gl_INIT approach.

I still think you will cause yourself unnecessary pain by taking that approach.

> I'll look into this during the next few days.

Cool.  Let me know if you need any help, or review.

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]