For PR automake/348:
authorTom Tromey <tromey@redhat.com>
Mon, 19 Aug 2002 22:48:39 +0000 (22:48 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 19 Aug 2002 22:48:39 +0000 (22:48 +0000)
* tests/Makefile.am (TESTS): Added include2.test.
* tests/include2.test: New file.
* tests/include.test: Check to make sure include file is
distributed.
* automake.in (read_am_file): Distribute included files.

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

index 08e8e9f..3e9bcd4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-08-19  Tom Tromey  <tromey@redhat.com>
+
+       For PR automake/348:
+       * tests/Makefile.am (TESTS): Added include2.test.
+       * tests/include2.test: New file.
+       * tests/include.test: Check to make sure include file is
+       distributed.
+       * automake.in (read_am_file): Distribute included files.
+
 2002-08-19  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        Fix for PR automake/345:
index def0500..58bc1d1 100755 (executable)
@@ -7517,15 +7517,20 @@ sub read_am_file ($)
             my $path = $1;
 
             if ($path =~ s/^\$\(top_srcdir\)\///)
-            {
+             {
                 push (@include_stack, "\$\(top_srcdir\)/$path");
-            }
+               # Distribute any included file.
+               my $distname = backname ($relative_dir) . '/' . $path;
+               push_dist_common ($distname);
+             }
             else
-            {
+             {
                 $path =~ s/\$\(srcdir\)\///;
                 push (@include_stack, "\$\(srcdir\)/$path");
-                $path = $relative_dir . "/" . $path;
-            }
+               push_dist_common (($relative_dir eq '.')
+                                 ? $path : ($relative_dir . '/' . $path));
+               $path = $relative_dir . "/" . $path;
+             }
             &read_am_file ($path);
         }
        else
index addf303..e6b2f2f 100644 (file)
@@ -184,6 +184,7 @@ gnits3.test \
 header.test \
 implicit.test \
 include.test \
+include2.test \
 info.test \
 insh.test \
 insh2.test \
index ed91ebd..b9fe320 100644 (file)
@@ -271,6 +271,7 @@ gnits3.test \
 header.test \
 implicit.test \
 include.test \
+include2.test \
 info.test \
 insh.test \
 insh2.test \
index 0f0d8e5..decdc94 100755 (executable)
@@ -15,4 +15,14 @@ $ACLOCAL || exit 1
 $AUTOMAKE || exit 1
 len="`grep '^srcdir' Makefile.in | wc -l`"
 echo "len = $len"
-test $len -eq 1
+test $len -eq 1 || exit 1
+
+# Also make sure include file is distributed.
+(sed -n -e '/^DIST_COMMON =.*\\$/ {
+   :loop
+   p
+   n
+   /\\$/ b loop
+   p
+   n
+   }' -e '/^DIST_COMMON =/ p' Makefile.in | grep foo)
diff --git a/tests/include2.test b/tests/include2.test
new file mode 100755 (executable)
index 0000000..b04306e
--- /dev/null
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+# Make sure header in parent directory is included.
+
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+END
+
+: > foo
+
+mkdir sub
+cat > sub/Makefile.am << 'END'
+include $(top_srcdir)/foo
+END
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+# Also make sure include file is distributed.
+(sed -n -e '/^DIST_COMMON =.*\\$/ {
+   :loop
+   p
+   n
+   /\\$/ b loop
+   p
+   n
+   }' -e '/^DIST_COMMON =/ p' sub/Makefile.in | fgrep ../foo)