+2002-09-30 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ 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 <duret_g@epita.fr>
* lib/Automake/Channels.pm (%_default_options): Add 'partial'.
# 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 '.';
##
##
@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.
##
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
test: distdir
test -f $(distdir)/foo
test -f $(distdir)/bar
+ test 2 -gt `find $(distdir)/sub -type d | wc -l`
END
: > foo
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure
+# Use --srcdir with an obsolute path because it's harder
+# to support in `distdir'.
+./configure --srcdir `pwd`
$MAKE test