[Top][All Lists]

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

Re: AM_SUBST_IGNORE = AC_SUBST without Makefile variable definition

From: Stepan Kasal
Subject: Re: AM_SUBST_IGNORE = AC_SUBST without Makefile variable definition
Date: Wed, 19 Oct 2005 13:37:22 +0200
User-agent: Mutt/1.4.1i


On Wed, Oct 19, 2005 at 11:32:37AM +0200, Ralf Wildenhues wrote:
> I believe what Stepan meant was:
> If the status.m4 code encounters  address@hidden@@\n@', where `FOO' has been
> AC_SUBSTed, then treat the replacement of the complete string
> address@hidden@@\n@' in a special way.

not exactly.  It is like this:

1) each occurence of @VAR@ is replaced by the value of VAR, for each
   AC_SUBSTed variable VAR.
2) if the original line matched /@address@hidden/, then
        - this match is removed
        - each embedded newline is esaped by a backslash
        - if the resulting string ends with a backslash, space is appendeded

In other words, after the usual sed substtitutions, the following
sed code is executed:

/@address@hidden/ {
        s/\\$/& /

> [...] unless an actual implementation can be shown not to
> show execution time regression inside config.status.

The above proposal is suited for this.

(Having "@FOO\n@" for "flattened value of FOO" might look nicer, but
effective implementation would be more difficult, if possible.
The facts that the magical tag means "the whole line is flattened" and
that the tag is at the end of the line enable easy effective

> If you accept that fact, you might as well flatten the variable before
> substituting it.

That would be more difficult, without any hint from outside.
The @\n@ tag enables an implementation which presents only minimal
regression in terms of execution time and size of config.status.

If the makefile contains
        FOO = foo\
then the value of make macro foo contains no newline, right?
So it is almost equivalent to
        FOO = foo bar
with one subtle difference: if autoconf "flattens" the variable, it is
possible that the line would get too long, which could cause problems.

Actually, there is a report that LIBOBJ can get too long with latest
autotools and heavy gnulib usage:

I plan to solve that problem by making the value of LIBOBJS multiline,
which, of course, needs the "backslashes".

> [...] it also means that any occurrence of
>   @FOO@ 
> in a will be substituted by $FOO_FLATTENED rather than $FOO,

That doesn't sound like a good idea.  I think that one of the motivations
for multiline substitutions was that we can AC_SUBST multiline make rules.


reply via email to

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