[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VPATH elimination by configure
From: |
Derek R. Price |
Subject: |
Re: VPATH elimination by configure |
Date: |
Mon, 22 Jan 2001 11:58:33 -0500 |
Akim Demaille wrote:
> So, I think I'm slowly starting to understand this VPATH stuff:
> configure wants to remove it only when useless, right? I.e., when
> VPATH is just set to srcdir? So then, I'm in favor of Derek's patch
> which seems finer that the current one, and updating the Autoconf
> documentation to explain exactly what happens.
Here's an even slightly better version. It will remove :address@hidden@:?,
:?$(srcdir):?, and :?${srcdir}:? from VPATH and then remove blank VPATH
lines.
The first file is the squished, unreadable, but portable version. The
second file is the expanded and commented version of the _exact same sed
script_ and the third file is a test makefile so you can see that the
sed scripts work.
I separated the three srcdir variants into separate commands so that
constructions like $(srcdir@ wouldn't be removed and maintainers that
didn't test their $(builddir) operation will hopefully notice this sort
of problem with VPATH before distribution.
Derek
--
Derek Price CVS Solutions Architect ( http://CVSHome.org )
mailto:address@hidden OpenAvenue ( http://OpenAvenue.com )
--
I've never made a mistake in my life. I thought I had once, but it turned
out that I hadn't.
/^[ ]*VPATH[ ]*=[
]*/{s/:*\$(srcdir):*/:/;s/:*\${srcdir}:*/:/;s/:address@hidden@:*/:/;s/^\([
]*VPATH[ ]*=[ ]*\):*/\1/;s/:*$//;/^[ ]*VPATH[ ]*=[ ]*$/d;}
/^[ ]*VPATH[ ]*=[ ]*/{
# the next three lines take out variations on srcdir substitutions
s/:*\$(srcdir):*/:/
s/:*\${srcdir}:*/:/
s/:address@hidden@:*/:/
# next two lines remove leading and trailing ':'s from VPATH
s/^\([ ]*VPATH[ ]*=[ ]*\):*/\1/
s/:*$//
# remove an empty VPATH
/^[ ]*VPATH[ ]*=[ ]*$/d
}
# first two VPATH lines should be deleted, next ten should be missing @srcdir@
definitions
VPATH = @srcdir@
VPATH = @srcdir@
VPATH = @srcdir@:anotherpath
VPATH = @srcdir@:anotherpath
VPATH = apath:@srcdir@:anotherpath
VPATH = apath:@srcdir@:anotherpath
VPATH = apath:@srcdir@
VPATH = apath:@srcdir@
VPATH = apath:yapath:@srcdir@:anotherpath
VPATH = apath:yapath:@srcdir@:anotherpath
# the next two lines should appear identical to the previous two
VPATH = apath:@srcdir@:yapath:anotherpath
VPATH = apath:@srcdir@:yapath:anotherpath
# again for $(srcdir)
VPATH = $(srcdir)
VPATH = $(srcdir)
VPATH = $(srcdir):anotherpath
VPATH = $(srcdir):anotherpath
VPATH = apath:$(srcdir):anotherpath
VPATH = apath:$(srcdir):anotherpath
VPATH = apath:$(srcdir)
VPATH = apath:$(srcdir)
VPATH = apath:yapath:$(srcdir):anotherpath
VPATH = apath:yapath:$(srcdir):anotherpath
# the next two lines should appear identical to the previous two
VPATH = apath:$(srcdir):yapath:anotherpath
VPATH = apath:$(srcdir):yapath:anotherpath
# again for ${srcdir}
VPATH = ${srcdir}
VPATH = ${srcdir}
VPATH = ${srcdir}:anotherpath
VPATH = ${srcdir}:anotherpath
VPATH = apath:${srcdir}:anotherpath
VPATH = apath:${srcdir}:anotherpath
VPATH = apath:${srcdir}
VPATH = apath:${srcdir}
VPATH = apath:yapath:${srcdir}:anotherpath
VPATH = apath:yapath:${srcdir}:anotherpath
# the next two lines should appear identical to the previous two
VPATH = apath:${srcdir}:yapath:anotherpath
VPATH = apath:${srcdir}:yapath:anotherpath
# shouldn't touch the rest of the file
VPATH = junk
VPATH = junk
VPATH = $(srcdir@
VPATH = $(srcdir@
# a comment
AVAR = @srcdir@
ANOTHERVAR = garbage
YAVAR = text:$(srcdir):garbage
atarget:
# some commands
touch ${srcdir}/atarget
Re: VPATH elimination by configure, Tom Tromey, 2001/01/17