bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS automake testsuite failures


From: Alexandre Duret-Lutz
Subject: Re: CVS automake testsuite failures
Date: 25 Mar 2002 21:30:56 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

[...]

 >> Bleah.  Maybe we could live with this and teach distdir how to
 >> merge the two directories, i.e., install all the files from
 >> $(srcdir)/foo/ in $(distdir) and overwrite them with all the
 >> files from $(builddir)/foo/.  We discussed this in the past, but
 >> it seemed useless.  Now we have a case where it would be helpful
 >> (although $(builddir)/foo/ is empty).

I think this patch fix the extra6.test failure on Tru64.
Nicolas, could you test it?

Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,10 @@
+2002-03-25  Alexandre Duret-Lutz  <address@hidden>
+
+       * tests/extra7.test: New file.
+       * tests/Makefile.am: Add it.
+       * lib/am/distdir.an (distdir): When a distribuable directory
+       exists both in `.' and $(srcdir), merge both directories.  This
+       should work around a failure of extra6.test on Tru64 reported by
+       Nicolas Joly.
+

Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.31
diff -u -r1.31 distdir.am
--- lib/am/distdir.am 2002/01/13 20:33:39 1.31
+++ lib/am/distdir.am 2002/03/25 22:09:56
@@ -82,20 +82,30 @@
            dir=''; \
          fi; \
 ##
-## In loop, test for file existence because sometimes a file gets
-## included in DISTFILES twice.  For example this happens when a single
-## source file is used in building more than one program.  Also, there
-## are situations in which "ln" can fail.  For instance a file to
-## distribute could actually be a cross-filesystem symlink -- this can
-## easily happen if "gettextize" was run on the distribution.
+## Use cp, not ln.  There are situations in which "ln" can fail.  For
+## instance a file to distribute could actually be a cross-filesystem
+## symlink -- this can easily happen if "gettextize" was run on the
+## distribution.
 ##
          if test -d $$d/$$file; then \
 ## 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)$$dir \
-           || exit 1; \
+##
+## If a directory exists both in `.' and $(srcdir), then
+## We copy the files from $(srcdir) first and then install those from
+## `.'.  This can help people who distribute directories made of
+## source files _and_ generated files.  It is also important when the
+## directory exists only in $(srcdir), because some vendor Make (such
+## as Tru64) will magically create an empty directory in `.'
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
          else \
+## Test for file existence because sometimes a file gets included in
+## DISTFILES twice.  For example this happens when a single source
+## file is used in building more than one program.
            test -f $(distdir)/$$file \
            || cp -p $$d/$$file $(distdir)/$$file \
            || exit 1; \
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.381
diff -u -r1.381 Makefile.am
--- tests/Makefile.am 2002/03/20 22:27:11 1.381
+++ tests/Makefile.am 2002/03/25 22:09:56
@@ -149,6 +149,7 @@
 extra4.test \
 extra5.test \
 extra6.test \
+extra7.test \
 flibs.test \
 fnoc.test \
 fo.test        \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.495
diff -u -r1.495 Makefile.in
--- tests/Makefile.in 2002/03/21 09:11:55 1.495
+++ tests/Makefile.in 2002/03/25 22:09:57
@@ -225,6 +225,7 @@
 extra4.test \
 extra5.test \
 extra6.test \
+extra7.test \
 flibs.test \
 fnoc.test \
 fo.test        \
@@ -533,8 +534,10 @@
            dir=''; \
          fi; \
          if test -d $$d/$$file; then \
-           cp -pR $$d/$$file $(distdir)$$dir \
-           || exit 1; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
          else \
            test -f $(distdir)/$$file \
            || cp -p $$d/$$file $(distdir)/$$file \
Index: tests/extra7.test
===================================================================
RCS file: extra7.test
diff -N extra7.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ tests/extra7.test Mon Mar 25 14:09:57 2002
@@ -0,0 +1,52 @@
+#! /bin/sh
+
+# Check to make sure that when distdir is invoked in a VPATH
+# configuration and has to distribute directory X, it actually merge
+# $(srcdir)/X and ./X, with the files from the later overriding the
+# files from the former.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+EXTRA_DIST=foo/bar baz
+
+check: distdir
+       test -f $(distdir)/foo/bar/baz
+       test -f $(distdir)/foo/bar/baz2
+       test -f $(distdir)/baz/foo
+       test -f $(distdir)/baz/foo2
+       grep source $(distdir)/foo/bar/baz
+       grep build $(distdir)/foo/bar/baz2
+       grep source $(distdir)/baz/foo
+       grep build $(distdir)/baz/foo2
+END
+
+# Create some files in $(srcdir)
+mkdir foo
+mkdir foo/bar
+echo source > foo/bar/baz
+echo source > foo/bar/baz2
+mkdir baz
+echo source > baz/foo
+echo source > baz/foo2
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+mkdir build
+cd build
+../configure
+
+# Create some files in $(builddir) that will override part of the
+# files if $(srcdir) when the distribution is made.
+mkdir foo
+mkdir foo/bar
+echo build > foo/bar/baz2
+mkdir baz
+echo build > baz/foo2
+
+$MAKE check
-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]