]> sourceware.org Git - automake.git/commitdiff
Fix for PR automake/366:
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 30 Sep 2002 12:32:20 +0000 (12:32 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 30 Sep 2002 12:32:20 +0000 (12:32 +0000)
* 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
automake.in
lib/am/distdir.am
tests/include2.test

index e4d8cf5ac0133d1800566c4396e15cf36666b359..2b637ba6ac63b0d889fc904b025d966ac87c37f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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'.
index d8dda372ee5bd8047cf5c6e498b3aa762c624d6d..9ce323e5a331c69667330a78235f661bdbd5de57 100755 (executable)
@@ -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 '.';
index 946a96d15fb71084b9a0fa695447497e6e6016c2..da6240738cc57e3d2a5454c1dde90fac41aca685 100644 (file)
@@ -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
index 4f61f75a05b3ace82404d5a53b8240e4c5d458eb..2f3ccc0a5f149891e9cb31697fba5735560f4a56 100755 (executable)
@@ -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
This page took 0.041585 seconds and 5 git commands to generate.