[Top][All Lists]

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

Re: config files substitution with awk

From: Paul Eggert
Subject: Re: config files substitution with awk
Date: Mon, 27 Nov 2006 14:50:54 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> 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

For that invocation we should just use the Awk that the user told us,
and not second-guess the choice; that is the Autoconf tradition.

Perhaps it'd be simpler if Autoconf always invoked AC_PROG_AWK,
in all cases where Awk is used by Autoconf?

The idea here is that the installer shouldn't have to worry about
'configure' invoking two Awk implementations to do real work.  There
should be only one Awk implementation to worry about.  That will
simplify the installer's job.

It'd be OK to issue a diagnostic and exit if the Awk is substandard,
but that'd be gravy.

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

Thanks, I didn't understand the issue until you explained it.

This is such a low-level detail that I think it's better to document
it in the gory-detail section, which would be "Setting Output
Variables".  But it's an incompatible behavior change, so it's worth a
mention in NEWS.  I installed the following patch:

2006-11-27  Paul Eggert  <address@hidden>

        * doc/autoconf.texi (Setting Output Variables): Mention that
        @address@hidden has unspecified behavior.  Problem reported by
        Ralf Wildenhues.
        * NEWS: Mention this.

--- doc/autoconf.texi   26 Nov 2006 17:53:10 -0000      1.1110
+++ doc/autoconf.texi   27 Nov 2006 22:47:09 -0000
@@ -8349,6 +8349,9 @@
 replaces instances of @samp{@@@var{variable}@@} in input files with the
 value that the shell variable @var{variable} has when @code{AC_OUTPUT}
 is called.  The value can contain newlines.
+Variable occurrences should not overlap: e.g., an input file should
+not contain @samp{@@@var{var1}@@@var{var2}@@} if @var{var1} and @var{var2}
+are variable names.
 The substituted value is not rescanned for more output variables;
 occurrences of @samp{@@@var{variable}@@} in the value are inserted
 literally into the output file.  (The algorithm uses the special marker
--- NEWS        26 Nov 2006 17:53:10 -0000      1.414
+++ NEWS        27 Nov 2006 22:47:09 -0000
@@ -1,6 +1,10 @@
 * Major changes in Autoconf 2.61a (??)

 ** config.status now uses awk instead of sed for most substitutions, for speed.
+   It is now documented that should not contain
+   overlapping variable occurrences, e.g., @address@hidden@.  Autoconf's
+   behavior was always iffy in such cases, and the awk implementation
+   has changed the behavior.

 * Major changes in Autoconf 2.61 (2006-11-17)

reply via email to

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