distributed files, to workaround Sun make VPATH munging.
This fixes subdircond2.test, subdircond3.test, and subpkg.test
on Solaris.
* tests/extra6.test, tests/lex3.test, tests/pr87.test,
tests/pr9.test, tests/target-cflags.test, tests/texinfo13.test,
tests/texinfo16.test, tests/yacc7.test, tests/yaccvpath.test:
Don't require GNU make.
2002-09-05 Alexandre Duret-Lutz <duret_g@epita.fr>
- * lib/am/distdir.am: Add missing `;'.
+ * lib/am/distdir.am (distcheck): Strip $(srcdir) prefix on
+ distributed files, to workaround Sun make VPATH munging.
+ This fixes subdircond2.test, subdircond3.test, and subpkg.test
+ on Solaris.
+ * tests/extra6.test, tests/lex3.test, tests/pr87.test,
+ tests/pr9.test, tests/target-cflags.test, tests/texinfo13.test,
+ tests/texinfo16.test, tests/yacc7.test, tests/yaccvpath.test:
+ Don't require GNU make.
+
+ * lib/am/distdir.am (distcheck): Add missing `;'.
* lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Account for
Sun make rewriting rules in VPATH builds. (Fixes gnits3.test.)
?DISTDIRS? $(mkinstalldirs) %DISTDIRS%
##
##
- @list='$(DISTFILES)'; for file in $$list; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+##
+## Yet another hack to support SUN make.
+##
+## Let's assume `foo' appears in DISTFILES and is not a built file.
+## When building with VPATH=$(srcdir), SUN make will rewrite `foo' as
+## `$(srcdir)/foo'. An attempt to install the file with
+## cp $file $(distdir)/$file
+## will thus install $(srcdir)/foo as $(distdir)/$(srcdir)/foo
+## instead of $(distdir)/foo.
+##
+## So let's strip this leading $(srcdir)/ when it exists. (As far we
+## know, only SUN make adds it.) Searching whether the file is to be
+## found in the source or build directory will be done latter.
+##
+## In case we are _not_ using SUN make, how can we be sure we are
+## not stripping a legitimate filename that starts with the same
+## pattern as $(srcdir)?
+## Well, it can't happen without the Makefile author distributing
+## something out of the distribution (which is bad). As an example,
+## consider `EXTRA_DIST = ../bar'. This is an issue if $srcdir is `..',
+## however getting this value for srcdir is impossible: `EXTRA_DIST = ../bar'
+## implies we are in a subdirectory (so `../bar' is within the package),
+## hence `$srcdir' is something like `../../subdir'.
+##
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ esac; \
##
## Always look for the file in the build directory first. That way
## for something like yacc output we will correctly pick up the latest
# Check to make sure EXTRA_DIST can contain a directory or
# a subdirectory, in $(builddir) or $(srcdir).
-# 'make distdir' + VPATH does not work with Solaris make.
-required=GNUmake
. $srcdir/defs || exit 1
set -e
# Test associated with PR 19.
# From Matthew D. Langston.
-required='GNUmake gcc gzip'
+required='gcc gzip'
. $srcdir/defs || exit 1
# Ignore user CFLAGS.
# Test for PR automake/87.
-# Require GNU make for `make distcheck'
-required='GNUmake gcc'
+required=gcc
. $srcdir/defs || exit 1
subdirs="foo bar"
# Test for bug in PR 9.
-# `distcheck' requires GNU make.
-required='GNUmake gzip'
+required=gzip
. $srcdir/defs || exit 1
cat > configure.in << 'END'
# Test to make sure target specific CFLAGS work
# Assar Westerlund <assar@sics.se>
-required='GNUmake gcc'
+required=gcc
. $srcdir/defs || exit 1
cat > configure.in << 'END'
# Check for subdir Texinfo.
# PR/343
-required='GNUmake makeinfo'
+required='makeinfo'
. $srcdir/defs || exit 1
set -e
# Check that info files are built in $(srcdir).
-required='GNUmake makeinfo'
+required='makeinfo'
. $srcdir/defs || exit 1
set -e
# Also check that the sources of the generated parser are distributed.
# PR/47.
-required=GNUmake
. $srcdir/defs || exit 1
cat >> configure.in << 'END'
# `make' and `make distdir' and check whether the version of `parse.c'
# to be distributed is up to date.
-# Require GNU make for `make distdir'
-required='GNUmake gcc bison'
+required='gcc bison'
. $srcdir/defs || exit 1
cat > configure.in << 'END'