automake
[Top][All Lists]
Advanced

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

Re: using VPATH in depend2.am?


From: Stepan Kasal
Subject: Re: using VPATH in depend2.am?
Date: Fri, 21 Oct 2005 11:58:41 +0200
User-agent: Mutt/1.4.1i

Hello,

On Fri, Oct 21, 2005 at 09:49:58AM +0200, Harald Dunkel wrote:
> Something like
> 
>       IFS=:; for d in a:b; do echo $d; done
> 
> works for Sun's /bin/sh, but not for Bash 2.05b (even if you
> use --posix). The Bash folks say that this has been done to
> fix a security hole.

I've just checked POSIX: it seems that word splitting is not allowed there.
So my code was wrong, sorry.

> I have another concern: In your version $(srcdir) gets
> a higher priority than the $(VPATH) set in Makefile.am.

Yes, you are right: we should simply obey VPATH.

(I think that VPATH should always start with @srcdir@, otherwise the VPATH
and non-VPATH builds wouldn't be consistent.  But there is no good to try
to enforce the rule here.)

> So how about this?

Your proposal looks good, except I think it might be better to use single
quotes around $(VPATH).
And the quoting around $d, which I introduced, is redundant.

That yields:

        `IFS=:; x=':$(VPATH)'; \
        for d in $$x; do \
                test -n $$d && d=$$d/; \
                test -f $${d}%SOURCE% && echo $$d && break;
        done`%SOURCE%

Have a nice day,
        Stepan Kasal




reply via email to

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