From: Alexandre Duret-Lutz Date: Sun, 13 Jan 2002 19:49:22 +0000 (+0000) Subject: * lib/am/distdir.am (distdir): Handle subdirectories. X-Git-Tag: Release-1-5d~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f3cb5c98feefdb4fa8e3b8c484186a7c0cc4270;p=thirdparty%2Fautomake.git * lib/am/distdir.am (distdir): Handle subdirectories. * tests/extra6.test: New file. * tests/Makefile.am (TESTS): Add it. --- diff --git a/ChangeLog b/ChangeLog index 8cef9c94c..274dfa0e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-01-13 Alexandre Duret-Lutz + + * lib/am/distdir.am (distdir): Handle subdirectories. + * tests/extra6.test: New file. + * tests/Makefile.am (TESTS): Add it. + 2002-01-13 Alexandre Duret-Lutz * tests/extra2.test: Run $ACLOCAL. diff --git a/Makefile.in b/Makefile.in index d0439fd84..afc74d607 100644 --- a/Makefile.in +++ b/Makefile.in @@ -361,10 +361,13 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - $(mkinstalldirs) "$(distdir)/$$dir"; \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir) \ + cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 0093f2afe..c3f70671e 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -76,7 +76,10 @@ endif %?TOPDIR_P% ## dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - $(mkinstalldirs) "$(distdir)/$$dir"; \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ fi; \ ## ## In loop, test for file existence because sometimes a file gets @@ -90,7 +93,7 @@ endif %?TOPDIR_P% ## Don't mention $$file in destination argument, since this fails if ## destination directory already exists. Also, use `-R' and not `-r'. ## `-r' is almost always incorrect. - cp -pR $$d/$$file $(distdir) \ + cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 8fed3b4aa..5bd4ed596 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -143,6 +143,7 @@ extra.test \ extra3.test \ extra4.test \ extra5.test \ +extra6.test \ flibs.test \ fnoc.test \ fo.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 3f655d082..0a8f21dfb 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -215,6 +215,7 @@ extra.test \ extra3.test \ extra4.test \ extra5.test \ +extra6.test \ flibs.test \ fnoc.test \ fo.test \ @@ -507,10 +508,13 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - $(mkinstalldirs) "$(distdir)/$$dir"; \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir) \ + cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ diff --git a/tests/extra6.test b/tests/extra6.test new file mode 100755 index 000000000..73a68e714 --- /dev/null +++ b/tests/extra6.test @@ -0,0 +1,43 @@ +#! /bin/sh + +# Check to make sure EXTRA_DIST can contain a directory or +# a subdirectory, in $(builddir) or $(srcdir). + +. $srcdir/defs || exit 1 + +set -e + +echo AC_OUTPUT >> configure.in + +cat > Makefile.am << 'END' +EXTRA_DIST=foo/bar baz foo2/bar2 baz2 + +check: distdir + test -f $(distdir)/foo/bar/baz + test -f $(distdir)/baz/foo + test -f $(distdir)/foo2/bar2/baz2 + test -f $(distdir)/baz2/foo2 +END + +# Create some files in $(srcdir) +mkdir foo +mkdir foo/bar +touch foo/bar/baz +mkdir baz +touch baz/foo + +$ACLOCAL +$AUTOMAKE +$AUTOCONF +mkdir build +cd build +../configure + +# Create some files in $(builddir) +mkdir foo2 +mkdir foo2/bar2 +touch foo2/bar2/baz2 +mkdir baz2 +touch baz2/foo2 + +make check