From 49a83eacb989ddba18e0a2d50df92a97fb5448da Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 30 Sep 2002 12:32:20 +0000 Subject: [PATCH] Fix for PR automake/366: * automake.in (handle_dist): Strip $(srcdir) and replace $(top_srcdir) when computing DIST_COMMON directories. * tests/include2.test: Use an obsolute $(srcdir), and check for spurious directories in $(distdir)/sub. * lib/am/distdir.am: Rewrite $(top_srcdir) as $(top_builddir). Reported by Kevin Ryde. --- ChangeLog | 10 ++++++++++ automake.in | 3 +++ lib/am/distdir.am | 5 +++++ tests/include2.test | 5 ++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e4d8cf5a..2b637ba6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-09-30 Alexandre Duret-Lutz + + Fix for PR automake/366: + * automake.in (handle_dist): Strip $(srcdir) and replace + $(top_srcdir) when computing DIST_COMMON directories. + * tests/include2.test: Use an obsolute $(srcdir), and check + for spurious directories in $(distdir)/sub. + * lib/am/distdir.am: Rewrite $(top_srcdir) as $(top_builddir). + Reported by Kevin Ryde. + 2002-09-29 Alexandre Duret-Lutz * lib/Automake/Channels.pm (%_default_options): Add 'partial'. diff --git a/automake.in b/automake.in index d8dda372..9ce323e5 100755 --- a/automake.in +++ b/automake.in @@ -4145,9 +4145,12 @@ sub handle_dist # We have to check DIST_COMMON for extra directories in case the # user put a source used in AC_OUTPUT into a subdir. + my $topsrcdir = backname ($relative_dir); foreach (&variable_value_as_list_recursive ('DIST_COMMON', 'all')) { next if /^\@.*\@$/; + s/\$\(top_srcdir\)/$topsrcdir/; + s/\$\(srcdir\)/./; next unless s,/+[^/]+$,,; $dist_dirs{$_} = 1 unless $_ eq '.'; diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 946a96d1..da624073 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -63,6 +63,7 @@ endif %?TOPDIR_P% ## ## @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ ## ## Yet another hack to support SUN make. @@ -90,6 +91,10 @@ endif %?TOPDIR_P% ## case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ +## Also rewrite $(top_srcdir) (which sometimes appears in DISTFILES, and can +## be absolute) by $(top_builddir) (which is always relative). $(srcdir) will +## be prepended latter. + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ ## ## Always look for the file in the build directory first. That way diff --git a/tests/include2.test b/tests/include2.test index 4f61f75a..2f3ccc0a 100755 --- a/tests/include2.test +++ b/tests/include2.test @@ -34,6 +34,7 @@ SUBDIRS = sub test: distdir test -f $(distdir)/foo test -f $(distdir)/bar + test 2 -gt `find $(distdir)/sub -type d | wc -l` END : > foo @@ -48,5 +49,7 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE -./configure +# Use --srcdir with an obsolute path because it's harder +# to support in `distdir'. +./configure --srcdir `pwd` $MAKE test -- 2.43.5