From 9e3f96e6c6e8a705e5e8b1c005d6026e7515e996 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 13 Jan 2002 20:33:40 +0000 Subject: [PATCH] For PR automake/287: * lib/am/distdir.am (distdir): Use `$$list' trick when looping over subdirs. * tests/Makefile.am (TESTS): Added pr287.test. * tests/pr287.test: New file. --- ChangeLog | 8 ++++++++ lib/Automake/Makefile.in | 7 +++++-- lib/Makefile.in | 7 +++++-- lib/am/Makefile.in | 7 +++++-- lib/am/distdir.am | 2 +- m4/Makefile.in | 7 +++++-- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/pr287.test | 36 ++++++++++++++++++++++++++++++++++++ 9 files changed, 67 insertions(+), 9 deletions(-) create mode 100755 tests/pr287.test diff --git a/ChangeLog b/ChangeLog index 274dfa0e1..8da694837 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-01-13 Tom Tromey + + For PR automake/287: + * lib/am/distdir.am (distdir): Use `$$list' trick when looping + over subdirs. + * tests/Makefile.am (TESTS): Added pr287.test. + * tests/pr287.test: New file. + 2002-01-13 Alexandre Duret-Lutz * lib/am/distdir.am (distdir): Handle subdirectories. diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 14e8809b8..070ba4429 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -121,10 +121,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/Makefile.in b/lib/Makefile.in index 8a0bac022..656e91c96 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -247,10 +247,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/Makefile.in b/lib/am/Makefile.in index eb7b268d3..f3e22bbbd 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -129,10 +129,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 c3f70671e..f8b1dff0a 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -111,7 +111,7 @@ endif %?TOPDIR_P% ## us work correctly with an enclosing package. ## if %?SUBDIRS% - for subdir in $(%DIST_SUBDIR_NAME%); do \ + list='$(%DIST_SUBDIR_NAME%)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ diff --git a/m4/Makefile.in b/m4/Makefile.in index c11923204..66684aa84 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -150,10 +150,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/Makefile.am b/tests/Makefile.am index 5bd4ed596..0ccf4aada 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -253,6 +253,7 @@ pr243.test \ pr266.test \ pr279.test \ pr279-2.test \ +pr287.test \ pr9.test \ pr72.test \ pr87.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 0a8f21dfb..082dbf5fa 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -325,6 +325,7 @@ pr243.test \ pr266.test \ pr279.test \ pr279-2.test \ +pr287.test \ pr9.test \ pr72.test \ pr87.test \ diff --git a/tests/pr287.test b/tests/pr287.test new file mode 100755 index 000000000..a827a3b14 --- /dev/null +++ b/tests/pr287.test @@ -0,0 +1,36 @@ +#! /bin/sh + +# Test for PR 287: empty SUBDIRS. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT(foo, 0.1, dev@null) +AM_INIT_AUTOMAKE +AC_PROG_CC +AC_CONFIG_FILES(Makefile) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +SUBDIRS = +bin_SCRIPTS = foo +END + +cat > foo << 'END' +#! /bin/sh +echo Maude +END + +chmod +x foo + +set -e + +mkdir install + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a +./configure --prefix=`cd install && pwd` +make +make distdir -- 2.47.2