From 1330e4dae8348e4d6a1eceaabafa30087bae60f8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 19 Aug 2002 22:48:39 +0000 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ automake.in | 15 ++++++++++----- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/include.test | 12 +++++++++++- tests/include2.test | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 6 deletions(-) create mode 100755 tests/include2.test diff --git a/ChangeLog b/ChangeLog index 08e8e9f..3e9bcd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-08-19 Tom Tromey + + 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 Fix for PR automake/345: diff --git a/automake.in b/automake.in index def0500..58bc1d1 100755 --- a/automake.in +++ b/automake.in @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index addf303..e6b2f2f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -184,6 +184,7 @@ gnits3.test \ header.test \ implicit.test \ include.test \ +include2.test \ info.test \ insh.test \ insh2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index ed91ebd..b9fe320 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -271,6 +271,7 @@ gnits3.test \ header.test \ implicit.test \ include.test \ +include2.test \ info.test \ insh.test \ insh2.test \ diff --git a/tests/include.test b/tests/include.test index 0f0d8e5..decdc94 100755 --- a/tests/include.test +++ b/tests/include.test @@ -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 index 0000000..b04306e --- /dev/null +++ b/tests/include2.test @@ -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) -- 2.7.4