[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] use m4_require to implement AS_REQUIRE
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] use m4_require to implement AS_REQUIRE |
Date: |
Mon, 13 Oct 2008 14:42:46 +0200 |
User-agent: |
Thunderbird 2.0.0.17 (Macintosh/20080914) |
>> ver usertime size
>> 2.61 18.154s 1037578
>> 2.63 13.192s 1055693
>> +funcs1 13.907s 886574
>> +funcs2 11.467s 780238
>
> I take it these are speedups in 'autoconf' time, and not in 'configure' time?
Yes, of course.
>> # BODY-TO-EXPAND is some initialization which must be expanded in the
>> -# given diversion when expanded (required or not). This is very
>> -# different from m4_require. For instance:
>> +# given diversion when expanded (required or not). The expansion
>> +# goes in the named diversion or an earlier one.
>
> Hmmm. M4SH-INIT is at diversion 6. If this is identical to m4_require,
> then it doesn't take very many nested AS_REQUIRES before we have dropped
> to diversion 0, or even worse to diversion -1.
No, the required macros are built into the _m4_divert_grow diversions,
that count down from 10000, and dumped "atomically" into the
_m4_divert_dump diversion (for m4_require) or into the specified
diversion (for m4_divert_require).
>> +m4_defun([AS_REQUIRE],
>> +[m4_define([_m4_divert_desired], m4_default_quoted([$3], [M4SH-INIT]))dnl
>> +m4_if(m4_eval(_m4_divert(_m4_divert_dump) <=
>> _m4_divert(_m4_divert_desired)), 1,
>
> Or maybe this eval is trying to guarantee just that? Again, I'm typing
> this without a thorough review; it is just first impressions.
The eval is basically subsuming 926ed6a97561e0a77de18011b29c6bcaaff4c365
(place _AS_UNSET_PREPARE in the right diversion): if the outermost macro
is expanded before the requested diversion, we do not move its shell
requirements to M4SH-INIT or M4SH-INIT-FN.
>> @@ -1698,7 +1713,7 @@ m4_provide_if([$1],
>> [],
>> [m4_warn([syntax],
>> [$1 is m4_require'd but not m4_defun'd])])]],
>> - [[m4_divert(_m4_defn([_m4_divert_dump]))]],
>> + [[m4_divert($3)]],
>
> Underquoted?
Assuming that the existing code was not underquoted, then either I
underquote here, or I do that in m4_require. I chose to underquote
here. I can try the other version, underquoting the _m4_defn in
m4_require and using [$3] here.
Paolo