Hello,
On Wed, Jan 04, 2006 at 06:12:11PM +0100, Sander Niemeijer wrote:
> distdir: $(DISTFILES)
> $(am__remove_distdir)
> mkdir $(distdir)
> ---> $(mkdir_p) $(distdir)/$(top_srcdir)/data
The problem is caused by the following line in Makefile.am:
EXTRA_DIST = $(top_srcdir)/data/foo.txt
There are two possible answers:
1) The patch attached to this mail fixes it.
2) Please use
EXTRA_DIST = data/foo.txt
Automake finds the fine in the src tree.
If you are using this in a Makefile.am, then use
EXTRA_DIST = ../../data/foo.txt
or
EXTRA_DIST = $(top_builddir)/data/foo.txt
It is a bit counter-intuitive: top_builddir always expands to
a relative path, so the above mkdir works.
Have a nice day,
Stepan Kasal
2006-01-04 Stepan Kasal <[EMAIL PROTECTED]>
* automake.in (handle_dist) <DISTDIRS>: Replace $(top_srcdir) and
$(srcdir) by $(top_builddir) or $(builddir), respectively.
* tests/distdir.test: Test for it.
diff -urpN automake.orig/automake.in automake/automake.in
--- automake.orig/automake.in 2006-01-04 20:25:49.000000000 +0100
+++ automake/automake.in 2006-01-04 20:56:44.000000000 +0100
@@ -3635,7 +3635,7 @@ sub handle_dist ()
$transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external;
# Prepend $(distdir) to each directory given.
- my %rewritten = map { s|^\$[({](top_)?srcdir[)}]|\$($1builddir)|;
+ my %rewritten = map { s|^\$[({]((top_)?)srcdir[)}]|\$($1builddir)|;
'$(distdir)/' . "$_" => 1 } keys %dist_dirs;
$transform{'DISTDIRS'} = join (' ', sort keys %rewritten);
diff -urpN automake.orig/tests/distdir.test automake/tests/distdir.test
--- automake.orig/tests/distdir.test 2005-05-14 22:28:54.000000000 +0200
+++ automake/tests/distdir.test 2006-01-04 20:57:03.000000000 +0100
@@ -19,20 +19,21 @@
# Boston, MA 02110-1301, USA.
# Test to make sure subdirs in EXTRA_DIST work. Also tests to make
-# sure "./" is ignored.
+# sure "./" is ignored and *srcdir is replaced by *builddir.
. ./defs || exit 1
set -e
cat > Makefile.am << 'END'
-EXTRA_DIST = foo/bar ./joe
+EXTRA_DIST = foo/bar ./joe $(top_srcdir)/woo/doo $(srcdir)/dada
END
$ACLOCAL
$AUTOMAKE
grep '\$(mkdir_p).*\.' Makefile.in && exit 1
+grep '\$(mkdir_p).*srcdir' Makefile.in && exit 1
grep '\$(mkdir_p).*foo' Makefile.in
# Check to make sure `foo' isn't made in build directory.