]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* 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 8cef9c94c384726fba6690dc1959fa1ed9d16b2c..274dfa0e10050be137b89d2db758e7e4b264d8dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index d0439fd84e757d51003f041958c89670771a0368..afc74d607dcfd720ffa78d27190ad13f160135b0 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 0093f2afe3c2c40b8a106b27ac5ac199dd418990..c3f70671eb84c61188bd586f93c282e235e1a262 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 8fed3b4aafe7fa752280a7b778a21d4160b8a579..5bd4ed5963954e2422e7858b7c8e964359e4ac82 100644 (file)
@@ -143,6 +143,7 @@ extra.test \
 extra3.test \
 extra4.test \
 extra5.test \
+extra6.test \
 flibs.test \
 fnoc.test \
 fo.test        \
index 3f655d0820daf9fe19930be97cccdf5ea15087d8..0a8f21dfb3b8cfa7c027c8954a704f3f2482a6fc 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