automake
[Top][All Lists]
Advanced

[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: Thu, 20 Oct 2005 09:43:23 +0200
User-agent: Mutt/1.4.1i

Hello,

On Thu, Oct 20, 2005 at 08:51:55AM +0200, Ralf Wildenhues wrote:
> > In other words, after the usual sed substtitutions, the following
> > sed code is executed:
> > /@address@hidden/ {
> >     s/\n/\\&/g
> >     s/@address@hidden//
> >     s/\\$/& /
> > }
> 
> Oh, ahh.  Nifty!  Only thing the user will have to keep in mind is that
> she should add another white space (besides the newline, which will be
> removed by `make') to separate values.  I guess that could be called a
> feature even!

I'm not sure I understand.  With GNU make, if you have
FOO = a\
b
BAR = a \
b

then both $(FOO) and $(BAR) seem to contain "a b".
When I try an OSF make, I get the same FOO, and BAR is "a  b".

Is there a make implementation which would have "ab" in FOO?

If yes, we should probably use
        s/\n/ \\&/g
in the above sed program.

> > > [...] it also means that any occurrence of
> > >   @FOO@ 
> > > in a Makefile.in 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.
> 
> Ah, ok.  So you also intend to have an AC_SUBST_NOFLATTEN or

There is no need, I think.  If you have

AC_SUBST([RULE], ["foo:
        echo foo"])

and you put

@RULE@

somewhere into your Makefile.am, then Makefile.in will contain:

RULE = @RULE@@\n@
...
@RULE@

and will expand to

RULE = foo:\
        echo foo
...
foo:
        echo foo

(Of course it doesn't make much sense to use $(RULE) in this case.)

Hope this explains it,
        Stepan Kasal




reply via email to

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