[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: automake/366: spurious directories in dist with include
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: automake/366: spurious directories in dist with include |
Date: |
30 Sep 2002 14:31:27 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
>>> "Kevin" == Kevin Ryde <address@hidden> writes:
[...]
Kevin> and a distribution made when configured with an absolute source path,
Kevin> /my/directory/configure
Kevin> make dist
Kevin> ends up putting a spurious "mypackage-1.0/my/directory/" into
Kevin> mypackage-1.0.tar.gz.
Kevin> Perhaps this is related to the way automake "include"d files are added
Kevin> to the dist, it doesn't seem to occur if there's no include in
Kevin> Makefile.am.
Kevin> I guess in the distdir rule,
Kevin> $(mkinstalldirs) $(distdir)/$(srcdir)
Kevin> is not quite right when srcdir is an absolute path.
Indeed :( Thanks for reporting this. I introduced this bug in
2002-09-24 Alexandre Duret-Lutz <address@hidden>
* automake.in (read_am_file): Prefix included files with
$(top_srcdir) or $(srcdir) in DIST_COMMON. Fixes
subdircond2.test, and subdircond3.test on OSF1.
We do need `$(top_srcdir)' or `$(srcdir)' here otherwise OSF
make automatically copy included files in the build-tree, and this
creates distcheck failures... I hadn't realized the consequence
it would have with absolute paths.
I'm installing the following patch on HEAD and branch-1-7.
The mkinstalldir command was easily fixed in handle_dist.
Tweaking include2.test to use an absolute path revealed another
issue in distdir: if `file=$(top_srcdir)/foo' and
`$(top_srcdir)' is absolute , then `cp $d/$file $(distdir)/$file'
is unlikely to work.
2002-09-30 Alexandre Duret-Lutz <address@hidden>
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.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1370
diff -u -r1.1370 automake.in
--- automake.in 29 Sep 2002 14:51:24 -0000 1.1370
+++ automake.in 30 Sep 2002 12:14:35 -0000
@@ -4145,9 +4145,12 @@
# 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 /address@hidden@$/;
+ s/\$\(top_srcdir\)/$topsrcdir/;
+ s/\$\(srcdir\)/./;
next unless s,/+[^/]+$,,;
$dist_dirs{$_} = 1
unless $_ eq '.';
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.40
diff -u -r1.40 distdir.am
--- lib/am/distdir.am 25 Sep 2002 13:25:55 -0000 1.40
+++ lib/am/distdir.am 30 Sep 2002 12:14:36 -0000
@@ -63,6 +63,7 @@
##
##
@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 @@
##
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: tests/include2.test
===================================================================
RCS file: /cvs/automake/automake/tests/include2.test,v
retrieving revision 1.3
diff -u -r1.3 include2.test
--- tests/include2.test 8 Sep 2002 13:07:55 -0000 1.3
+++ tests/include2.test 30 Sep 2002 12:14:37 -0000
@@ -34,6 +34,7 @@
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 @@
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure
+# Use --srcdir with an obsolute path because it's harder
+# to support in `distdir'.
+./configure --srcdir `pwd`
$MAKE test
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: automake/366: spurious directories in dist with include,
Alexandre Duret-Lutz <=