[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for autoconf/145
From: |
Pavel Roskin |
Subject: |
Re: Patch for autoconf/145 |
Date: |
Wed, 31 Jan 2001 12:31:58 -0500 (EST) |
On 31 Jan 2001, Alexandre Oliva wrote:
> On Jan 31, 2001, Ralf Corsepius <address@hidden> wrote:
>
> > Alexandre Oliva wrote:
>
> >> I suggest accepting a few other variants: $(srcdir) and ${srcdir}.
>
> > IIRC, some makes do not accept variables in VPATH?
>
> True. But, as someone else wrote, we're not Makefile police to
> dictate standards. We should adapt to standards chosen by
> developers. If they choose to have variables in their VPATH, who are
> we to say no?
Well, it were my words. After a long consideration I'm now in favor of the
Derek's patch.
I've made few modifications:
Multiline sed scripts are portable. Add line breaks.
No need to match spaces after "=" in the first pattern.
Don't delete lines - make them empty as discussed before.
Comment changes.
__________________________
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,10 @@
+2001-01-31 Pavel Roskin <address@hidden>
+
+ * acgeneral.m4 (AC_OUTPUT): Remove $(srcdir), ${srcdir} and
+ @srcdir@ from VPATH if srcdir is "." and replace blank VPATH
+ lines with empty lines to preserve line numbers.
+ Original version by Derek Price.
+
2001-01-30 Ralf Corsepius <address@hidden>
* acgeneral.m4 (_AC_OUTPUT_SUBDIRS): Remove configure.ac
--- acgeneral.m4
+++ acgeneral.m4
@@ -3500,10 +3500,19 @@
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# VPATH is dangerous, but if there is a colon in the path, we need to
-# keep it.
+# VPATH may cause troubles with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub=['/^[ ]*VPATH[ ]*=[^:]*$/d']
+ ac_vpsub=['/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:address@hidden@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}']
fi
m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
__________________________
Regards,
Pavel Roskin