[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch: PR 348
From: |
Tom Tromey |
Subject: |
Patch: PR 348 |
Date: |
17 Aug 2002 18:56:42 -0600 |
This patch attempts to fix PR 348.
Alexandre, what do you think of this? It isn't ideal, since it uses a
heuristic to decide when to distribute an include file.
Do we have a mechanism for ensuring an arbitrary
file is distributed (even a file in top_srcdir when relative_dir is
not `.')? If we do I'll change the patch to use that.
Tom
Index: ChangeLog
from Tom Tromey <address@hidden>
For PR automake/348:
* tests/include.test: Check to make sure include file is
distributed.
* automake.in (read_am_file): Distribute included files.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1336
diff -u -r1.1336 automake.in
--- automake.in 30 Jul 2002 20:15:31 -0000 1.1336
+++ automake.in 18 Aug 2002 00:54:33 -0000
@@ -7512,15 +7512,25 @@
my $path = $1;
if ($path =~ s/^\$\(top_srcdir\)\///)
- {
+ {
push (@include_stack, "\$\(top_srcdir\)/$path");
- }
+ # At the top level, distribute any included file.
+ # Also, at any level in the tree, distribute a file
+ # that happens to be in this directory. This isn't
+ # perfect, but it does ok.
+ if ($relative_dir eq '.' || $relative_dir eq dirname ($path))
+ {
+ push_dist_common ($path);
+ }
+ }
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: tests/include.test
===================================================================
RCS file: /cvs/automake/automake/tests/include.test,v
retrieving revision 1.2
diff -u -r1.2 include.test
--- tests/include.test 20 Oct 2001 11:17:17 -0000 1.2
+++ tests/include.test 18 Aug 2002 00:54:33 -0000
@@ -15,4 +15,14 @@
$AUTOMAKE || exit 1
len="`grep '^srcdir' Makefile.in | wc -l`"
echo "len = $len"
-test $len -eq 1
+test $len -eq 1 || exit 1
+
+# 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)
- Patch: PR 348,
Tom Tromey <=