+2001-02-07 Pavel Roskin <proski@gnu.org>
+
+ * 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-02-07 +2001-02-06 Derek Price <derek.price@openavenue.com>
* acgeneral.m4 (_AC_LIBOBJ): Call AC_LIBSOURCE with '.c' extension
# 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 trouble 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/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}']
fi
m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
# 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 trouble 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/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}']
fi
m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])