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 :?@srcdir@:?, :?$(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:[EMAIL PROTECTED] 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/:*@srcdir@:*/:/;s/^\([ ]*VPATH[ ]*=[ ]*\):*/\1/;s/:*$//;/^[ ]*VPATH[ ]*=[ ]*$/d;}
/^[ ]*VPATH[ ]*=[ ]*/{ # the next three lines take out variations on srcdir substitutions s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ # 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