>>>>> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes:

Alexandre> On Feb 14, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote:
>> - every macro becomes extremely picky on the quotes, since there is
>> embedded code which really depends upon [ and ].

Alexandre> Can't this be done in a way that only traced macros become
Alexandre> that picky?  This would allow for at least a soft
Alexandre> transition.

No.  I would like to avoid entering into the gory details, because it
is long, but in a couple of words:

- if you want to equip some macros only, you have to do that between
  the definition of the macro and its uses, i.e., basically between
  autoconf.m4f and configure.in.  This is also why it is bad not to
  separate definitions from uses in Autoconf.

- so you have to equip all the macros so that they launch hooks, and
  this has to be done first.

Well, we could imagine changing `define' so that it equips only the
selected macros.  But I really don't like overloading define all the
time, it is very delicate a neuron burning.  Whatever the way we
choose to implement it in m4, the observer will change the measure,
which we want to avoid.

In addition, since we will never manage to make it reflective, we
won't be able to trace the very base layer of libm4, which I would
regret a lot.

And finally, first measuring via m4 --trace, and then processing it
via m4 again is a fairly good approximation, imho.  But I trust it.


>> changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared
>> libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([,
>> ])dnl

Alexandre> Ugh!  I swear it was not me who wrote that.

:)

Honestly, it is hard to write that, this is indeed a typical case
where the [ and ] are hard to deal with.  The cleanest implementation
I know is a bit hacky:

define(the-message,
[[--enable-shared[=PKGS]        build shared libraries 
                                [default=$1]]])

and use the-message(AC_ENABLE_SHARED_DEFAULT)

because $1 etc. expansion are always performed, no matter the number
of quotes you used in the macro definition.





>> So yes, the solution I propose it to transform m4's tracing output
>> in order to re-feed m4 with that.

Alexandre> I really can't express with words how brilliant I consider
Alexandre> this idea.  :-)

(blush, red up to the ears :) Thanks.


Alexandre> Go for it!

Yeah!  Excellent!  We have to fine an interface and we'll go for it,
and we'll adapt Automake, and we'll release everybody, and we'll win
the Contest, and we'll be rich and... [djm in autoconf.texi:] And
there was much rejoicing.  And I have free time again.  I think.
Yeah, right.

:) :)



>> Now if this idea is accepted, the question will be that of the
>> format of the request.  It can be directly the definition in m4,

>> autoconf --trace AC_SUBST($1:$3)

>> to ask just for the line number and the variable, separated with a
>> colon.

Alexandre> Even though the internal tracing macros take the file name
Alexandre> and the line number as arguments $1 and $3, respectively, I
Alexandre> don't think we should expose this to the users.  $1 should
Alexandre> be the first actual argument to the macro.  We should
Alexandre> probably do the translation internally.

Yep, definitely.  In fact I suggest that we capture everything that m4
--trace can give us, including the -42- we removed, because some
people can be interested.

        $ autoconf --trace AC_SUBST:$f:$l:$0:$1

=> configure.in:42:AC_SUBST:prefix

        $ autoconf --trace AC_SUBST:$1

=> prefix

        Akim

Reply via email to