[Top][All Lists]

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

Re: config files substitution with awk

From: Ralf Wildenhues
Subject: Re: config files substitution with awk
Date: Mon, 27 Nov 2006 21:35:27 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Paul Eggert wrote on Sun, Nov 26, 2006 at 06:54:36PM CET:
> Ralf Wildenhues <address@hidden> writes:
> > Since Paolo's tests define what happens with address@hidden@var2@', I added 
> > a
> > note in the manual that users should not rely on this.  (This is to
> > avoid the need to distinguish the "special substitutions" still done
> > with sed, and to allow us to change the implementation again later on.)
> If I am understanding things correctly, why not just make the 'awk'
> solution compatible with 'sed', so that @address@hidden@ subsitutes only
> var1?  Doesn't the current code do that already?

No.  With the sed code, it depends on whether AC_SUBST(var1) was seen
before AC_SUBST(var2), which one will be replaced.  And the special
variables (such as srcdir, configure_input) are treated earlier, in an
order not documented anywhere.

With the awk code, the left one (var1) will be dealt with before the
right one (except again with special variables, which are still dealt
with with sed).  I don't think anyone ever depended on the particular
order, but I also don't think that the awk code can be made compatible
easily, nor that it should be.

Short, I think people should have never relied on this ordering issue;
my patch was merely making this undefined-ness explicit.

> > An independent open question to me is that, if AC_PROG_AWK was used
> > anyway by, whether we should then prefer $AWK over awk,
> > for efficiency.  WDYT?
> I'd say so; there's little point to testing awk twice.

I don't completely understand the part after the semi-colon.  I don't
think we can assume that $AWK is more powerful than awk, so we'd have
to have the getline test anyway.  After all, the user may have used
  ./configure AWK=awk

> > Is this patch ok for Autoconf now, so I can start asking bug-gawk?
> It looks good; just a couple of minor tweaks.  Assuming the 'awk'
> solution is compatible with 'sed' with respect to @address@hidden, we
> needn't document that issue.  Second, use that auxiliary variable,
> which I called "S_is_set".  I installed this:

Thanks, that change looks good.


reply via email to

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