autoconf-patches
[Top][All Lists]
Advanced

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

Re: more M4sh documentation


From: Ralf Wildenhues
Subject: Re: more M4sh documentation
Date: Wed, 29 Mar 2006 09:10:30 +0200
User-agent: Mutt/1.5.11

Clarifying this: Stepan and I discussed this a bit off-list, and it
turned out I misunderstood him; also, I had another new idea on this
(definitely post 2.60) issue.  So please excuse me for replying to
myself:

* Ralf Wildenhues wrote on Sun, Mar 26, 2006 at 11:57:51PM CEST:
> * Stepan Kasal wrote on Wed, Mar 22, 2006 at 07:51:12PM CET:
> > On Tue, Mar 21, 2006 at 07:44:37PM +0100, Ralf Wildenhues wrote:
> > 
> > First, the question of _AS_PREPARE.  I agree this hack shall not be
> > documented---the right thing would be to implement the following:
> > 
> > cat >"$CONFIG_LT" <<\_LTEOF
> > AS_SUBSCRIPT_INIT
> > AS_FOO
> > AS_BAR
> > ...
> > AS_SUBSCRIPT_END
> > _LTEOF
> > 
> > And all the AS_REQUIREs and AS_PREPAREs from AS_FOO, AS_BAR, etc. would
> > go right after AS_SUBSCRIPT_INIT, not to the global M4SH-INIT diversion.
> 
> Just so it isn't forgotten when/if we go back to this eventually: I
> think the above has several flaws.  First, a macro-like approach would
> seem preferable in any case in the long run (and then of course we go
> for M4 lists right away ;-):
> 
>   AS_SUBSCRIPT_INIT([[AS_FOO], [AS_BAR], ...])

OK, this comment of mine was based on a misunderstanding.  So, what I
thought was this: it would be better to wrap the script as the argument
of another macro, like this:

  cat >"$CONFIG_LT" <<\_LTEOF
  AS_SUB_SCRIPT(
  [#sub script code that uses
   AS_FOO
   AS_BAR
   AC_FOOBAR
   #and what not else
  ])
  _LTEOF

because that would leave more flexibility to the implementation
(note the AS_SUB_SCRIPT would be responsible for putting expansions of
some *_PREPARE macros at the beginning of the sub script).

Please also note that we should really write SUB_SCRIPT instead of
SUBSCRIPT (the latter reminds me of `$a_b$', in TeX notation).

But I think we could do even a bit better: let's allow multiple sub
scripts (this is what Libtool needs anyway: config.lt and
config.status), so associate them with a key and an eof marker
(and maybe a couple more things I haven't thought of yet):

  AS_SUB_SCRIPT_DECLARE([AC_CONFIG_STATUS],
                        ["$CONFIG_STATUS"], [_LTEOF])
  AS_SUB_SCRIPT_DECLARE([LT_CONFIG_LT], ["$CONFIG_LT"])

and then above code snippet would be written as

  AS_SUB_SCRIPT_PUSH([LT_CONFIG_LT],
  [#sub script code that uses
   AS_FOO
   AS_BAR
   AC_FOOBAR
   #and what not else
  ])

and the push would do the `cat >.. <<..EOF' as well.
I'm not totally convinced yet that this is possible, but pretty much.

Cheers,
Ralf




reply via email to

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