[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make dist failure with directory symlink
From: |
Martin Frydl |
Subject: |
make dist failure with directory symlink |
Date: |
Fri, 20 Jun 2003 13:08:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314 |
I have a special rule in my Makefile.am which creates symlink to one
of source directories when building to different directory tree (using
VPATH). I have this directory also in EXTRA_DIST.
Now when I run just configure and make dist, everything works fine.
However, when I first compile the package (make all) and then run make
dist, it fails:
cp: cannot overwrite directory `...' with non-directory
The problem is that make dist first copies the directory from sources
and then, if present, it copies it from build tree too. In this case it
is present in build tree, but it is not really a directory, just symlink
and cp fails.
I suggest to put extra test for symlink before the copy from build
tree. Just see attached patch file. I use "test -h" for such test. I've
tried this on Linux (RedHat 7), FreeBSD 4.8-stable, Solaris 8, HP-UX 11
and AIX 5.1 and it works on these systems.
Martin
Index: lib/am/distdir.am
===================================================================
RCS file: /cvsroot/automake/automake/lib/am/distdir.am,v
retrieving revision 1.45
diff -u -r1.45 distdir.am
--- lib/am/distdir.am 19 Feb 2003 20:06:39 -0000 1.45
+++ lib/am/distdir.am 20 Jun 2003 09:33:31 -0000
@@ -130,7 +130,7 @@
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ test -h $$d/$$file || cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
## Test for file existence because sometimes a file gets included in
## DISTFILES twice. For example this happens when a single source
- make dist failure with directory symlink,
Martin Frydl <=