* automake.in (handle_dist): Distribute common files which
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 5 Dec 2001 17:13:41 +0000 (17:13 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 5 Dec 2001 17:13:41 +0000 (17:13 +0000)
do not exist but are target of a Makefile rule.
* automake.texi (Dist): Update.
* test/builtcommon3.test: New file.
* test/Makefile.am (TESTS): Add distcommon3.test.

ChangeLog
automake.in
automake.texi
tests/Makefile.am
tests/Makefile.in
tests/distcommon3.test [new file with mode: 0755]

index 4d85c72..163e0cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-12-05  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * automake.in (handle_dist): Distribute common files which
+       do not exist but are target of a Makefile rule.
+       * automake.texi (Dist): Update.
+       * test/builtcommon3.test: New file.
+       * test/Makefile.am (TESTS): Add distcommon3.test.
+
 2001-12-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * automake.in (macro_define): Fix misuse of chomp introduced on
index 2f6092e..7f075c8 100755 (executable)
@@ -3375,7 +3375,9 @@ sub handle_dist
     }
     foreach my $cfile (@common_files)
     {
-       if (-f ($relative_dir . "/" . $cfile))
+       if (-f ($relative_dir . "/" . $cfile)
+           # The file might be absent, but if it can be built it's ok.
+           || exists $targets{$cfile})
        {
            &push_dist_common ($cfile);
        }
index 7f1d8f5..1682e9e 100644 (file)
@@ -3600,8 +3600,9 @@ is run.  The default setting is @samp{--best}.
 For the most part, the files to distribute are automatically found by
 Automake: all source files are automatically included in a distribution,
 as are all @file{Makefile.am}s and @file{Makefile.in}s.  Automake also
-has a built-in list of commonly used files which, if present in the
-current directory, are automatically included.  This list is printed by
+has a built-in list of commonly used files which are automatically
+included if they are found in the current directory (either physically,
+or as the target of a @file{Makefile.am} rule).  This list is printed by
 @samp{automake --help}.  Also, files which are read by @code{configure}
 (i.e. the source files corresponding to the files specified in the
 @code{AC_OUTPUT} invocation) are automatically distributed.
index a03a866..22b21dd 100644 (file)
@@ -118,6 +118,7 @@ dirname.test \
 discover.test \
 distcommon.test \
 distcommon2.test \
+distcommon3.test \
 distdir.test \
 distname.test \
 double.test \
index 4f97e86..b453462 100644 (file)
@@ -191,6 +191,7 @@ dirname.test \
 discover.test \
 distcommon.test \
 distcommon2.test \
+distcommon3.test \
 distdir.test \
 distname.test \
 double.test \
diff --git a/tests/distcommon3.test b/tests/distcommon3.test
new file mode 100755 (executable)
index 0000000..f093b10
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+# Test to make sure that non-existing common files are distributed
+# if they are buildable.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+README:
+       echo 'I bet you are reading me.' > README
+END
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+sed -n -e '/^DIST_COMMON =.*\\$/ {
+   :loop
+   p
+   n
+   /\\$/ b loop
+   p
+   n
+   }' -e '/^DIST_COMMON =/ p' Makefile.in | grep README || exit 1