From: Alexandre Duret-Lutz Date: Thu, 5 Sep 2002 14:29:45 +0000 (+0000) Subject: * lib/am/distdir.am (distcheck): Strip $(srcdir) prefix on X-Git-Tag: Release-1-6d~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b677574ae43644c042a4ad616e70d729a47f45ae;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 0c4d8648d..5ba0c727c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,15 @@ 2002-09-05 Alexandre Duret-Lutz - * 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.) diff --git a/lib/am/distdir.am b/lib/am/distdir.am index c0e38367e..c3ff33629 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -62,7 +62,35 @@ endif %?TOPDIR_P% ?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 diff --git a/tests/extra6.test b/tests/extra6.test index ed4a9fcc6..0380dec4c 100755 --- a/tests/extra6.test +++ b/tests/extra6.test @@ -3,8 +3,6 @@ # 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 diff --git a/tests/lex3.test b/tests/lex3.test index f92f8599d..633044c60 100755 --- a/tests/lex3.test +++ b/tests/lex3.test @@ -3,7 +3,7 @@ # Test associated with PR 19. # From Matthew D. Langston. -required='GNUmake gcc gzip' +required='gcc gzip' . $srcdir/defs || exit 1 # Ignore user CFLAGS. diff --git a/tests/pr87.test b/tests/pr87.test index 798ad52e0..9beffb01f 100755 --- a/tests/pr87.test +++ b/tests/pr87.test @@ -2,8 +2,7 @@ # Test for PR automake/87. -# Require GNU make for `make distcheck' -required='GNUmake gcc' +required=gcc . $srcdir/defs || exit 1 subdirs="foo bar" diff --git a/tests/pr9.test b/tests/pr9.test index 9a9455fa5..e2c100ef5 100755 --- a/tests/pr9.test +++ b/tests/pr9.test @@ -2,8 +2,7 @@ # Test for bug in PR 9. -# `distcheck' requires GNU make. -required='GNUmake gzip' +required=gzip . $srcdir/defs || exit 1 cat > configure.in << 'END' diff --git a/tests/target-cflags.test b/tests/target-cflags.test index 59850da18..40f9f3046 100755 --- a/tests/target-cflags.test +++ b/tests/target-cflags.test @@ -3,7 +3,7 @@ # Test to make sure target specific CFLAGS work # Assar Westerlund -required='GNUmake gcc' +required=gcc . $srcdir/defs || exit 1 cat > configure.in << 'END' diff --git a/tests/texinfo13.test b/tests/texinfo13.test index 737ef0b6f..9b8530b57 100755 --- a/tests/texinfo13.test +++ b/tests/texinfo13.test @@ -3,7 +3,7 @@ # Check for subdir Texinfo. # PR/343 -required='GNUmake makeinfo' +required='makeinfo' . $srcdir/defs || exit 1 set -e diff --git a/tests/texinfo16.test b/tests/texinfo16.test index ac928513b..e519c0c74 100755 --- a/tests/texinfo16.test +++ b/tests/texinfo16.test @@ -2,7 +2,7 @@ # Check that info files are built in $(srcdir). -required='GNUmake makeinfo' +required='makeinfo' . $srcdir/defs || exit 1 set -e diff --git a/tests/yacc7.test b/tests/yacc7.test index 66828fa7e..771726d73 100755 --- a/tests/yacc7.test +++ b/tests/yacc7.test @@ -6,7 +6,6 @@ # Also check that the sources of the generated parser are distributed. # PR/47. -required=GNUmake . $srcdir/defs || exit 1 cat >> configure.in << 'END' diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test index b7b275fd4..ef7ee6626 100755 --- a/tests/yaccvpath.test +++ b/tests/yaccvpath.test @@ -6,8 +6,7 @@ # `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'