Author: stsp
Date: Thu Nov 18 17:08:50 2010
New Revision: 1036534
URL: http://svn.apache.org/viewvc?rev=1036534&view=rev
Log:
* Makefile.in
(swig-pl): Allow the perl swig bindings to compile within a working copy
that contains a symlink in its path.
r857892 overlooked the fact that abs_builddir and abs_srcdir may be
different paths but point to the same directory due to symlinks.
If this was the case, the ln -sf command in the swig-pl target mistakenly
symlinked the .c files in $(SWIG_PL_DIR)/native to themselves, overwriting
already generated .c files, and causing the build to abort with an error
such as "make: don't know to make core.c".
Modified:
subversion/trunk/Makefile.in
Modified: subversion/trunk/Makefile.in
URL:
http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1036534&r1=1036533&r2=1036534&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Thu Nov 18 17:08:50 2010
@@ -722,10 +722,14 @@ $(SWIG_PL_DIR)/native/Makefile.PL: $(SWI
$(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL
+# There is a "readlink -f" command on some systems for the same purpose,
+# but it's not as portable (e.g. Mac OS X doesn't have it).
+READLINK=$(PYTHON) -c 'import sys,os; print(os.path.realpath(sys.argv[1]))'
+
swig-pl_DEPS = autogen-swig-pl libsvn_swig_perl \
$(SWIG_PL_DIR)/native/Makefile
swig-pl: $(swig-pl_DEPS)
- if test "$(SWIG_PL_DIR)" != "$(SWIG_PL_SRC_DIR)"; then \
+ if test "`$(READLINK) $(SWIG_PL_DIR)`" != "`$(READLINK)
$(SWIG_PL_SRC_DIR)`"; then \
ln -sf $(SWIG_PL_SRC_DIR)/native/*.c $(SWIG_PL_DIR)/native; \
fi
cd $(SWIG_PL_DIR)/native; $(MAKE) OPTIMIZE=""
OTHERLDFLAGS="$(SWIG_LDFLAGS)"