* lib/am/distdir.am (distdir): Handle subdirectories.
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 13 Jan 2002 19:49:22 +0000 (19:49 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 13 Jan 2002 19:49:22 +0000 (19:49 +0000)
* tests/extra6.test: New file.
* tests/Makefile.am (TESTS): Add it.

ChangeLog
Makefile.in
lib/am/distdir.am
tests/Makefile.am
tests/Makefile.in
tests/extra6.test [new file with mode: 0755]

index 8cef9c9..274dfa0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2002-01-13  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
+       * lib/am/distdir.am (distdir): Handle subdirectories.
+       * tests/extra6.test: New file.
+       * tests/Makefile.am (TESTS): Add it.
+
+2002-01-13  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
        * tests/extra2.test: Run $ACLOCAL.
 
 2002-01-12  Alexandre Duret-Lutz  <duret_g@epita.fr>
index d0439fd..afc74d6 100644 (file)
@@ -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 \
index 0093f2a..c3f7067 100644 (file)
@@ -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 \
index 8fed3b4..5bd4ed5 100644 (file)
@@ -143,6 +143,7 @@ extra.test \
 extra3.test \
 extra4.test \
 extra5.test \
+extra6.test \
 flibs.test \
 fnoc.test \
 fo.test        \
index 3f655d0..0a8f21d 100644 (file)
@@ -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 (executable)
index 0000000..73a68e7
--- /dev/null
@@ -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