I have two versions of SWIG installed on my RedHat 7.3 box. The one
installed via RPM which is in my PATH is too old. The following patch
teaches the top-level Makefile to use the swig binary in the directory
passed via the --with-swig configure option.
* Makefile.in
Added SWIG add variable using value from configure preprocessor.
Pass -s flag to setup.py to use the right swig binary.
* setup.py
(find_swig): Since the Makefile now always passes -s, assure that we
not only have a value for swig_location, but that we have a value
which actually points to a file.
Index: Makefile.in
===================================================================
--- Makefile.in (revision 3678)
+++ Makefile.in (working copy)
@@ -65,6 +65,7 @@
APACHE_TARGET = @APACHE_TARGET@
APACHE_LIBEXECDIR = $(DESTDIR)@APACHE_LIBEXECDIR@
+SWIG = @SWIG@
SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@
SVN_APR_INCLUDES = @SVN_APR_INCLUDES@
@@ -266,6 +267,7 @@
-I$(abs_srcdir)/subversion/include $(SVN_APR_INCLUDES) \
-S$(SWIG_SRC_DIR) \
-L$(DESTDIR)$(prefix)/lib -L$(SVN_APR_PREFIX)/lib \
+ -s$(SWIG) \
build --build-base=$(SWIG_BUILD_DIR)/python/build)
install-swig-py-ext:
Index: subversion/bindings/swig/python/setup.py
===================================================================
--- subversion/bindings/swig/python/setup.py (revision 3678)
+++ subversion/bindings/swig/python/setup.py (working copy)
@@ -94,10 +94,10 @@
def find_swig<(self):
global swig_location
- if swig_location is None:
- return build_ext.build_ext.find_swig(self)
- else:
+ if swig_location and os.path.isfile(swig_location):
return swig_location
+ else:
+ return build_ext.build_ext.find_swig(self)
def swig_sources(self, sources):
swig = self.find_swig()
Incidently, even with the above patch I can't complete a build of the
"swig-py-ext" target:
building '_client' extension
swigging /home/dlr/src/svn/subversion/bindings/swig/svn_client.i to /home/dlr/src/svn/subversion/bindings/swig/python/build/svn_client.c
/usr/local/swig/bin/swig -c -python -noproxy -I/home/dlr/src/svn/subversion/bindings/swig -I/home/dlr/src/svn/subversion/include -I/home/dlr/src/apache.org/httpd-2.0/srclib/apr/include -I/home/dlr/src/apache.org/apr/include -I/usr/include/python2.2 -o /home/dlr/src/svn/subversion/bindings/swig/python/build/svn_client.c /home/dlr/src/svn/subversion/bindings/swig/svn_client.i
:1: Unable to find 'swig.swg'
:3: Unable to find 'python.swg'
/home/dlr/src/svn/subversion/bindings/swig/svn_client.i:20: Unable to find 'typemaps.i'
error: command '/usr/local/swig/bin/swig' failed with exit status 1
make: *** [swig-py-ext] Error 1
dlr@despot:svn$ find /usr/local/swig/ -type f -name swig.swg
/usr/local/swig/lib/swig1.3/swig.swg
I curious whether this has anything to do with my SWIG version.
Anyone got any ideas?
dlr@despot:svn$ /usr/local/swig/bin/swig -version
SWIG Version 1.3.15u-20021011-1838
Copyright (c) 1995-1998
University of Utah and the Regents of the University of California
Copyright (c) 1998-2001
University of Chicago
Compiled with CC
In any case, in my environment I'm missing a -I flag,
$(SWIG_DIR)/lib/swig1.3. When I check in the Java stuff, I'll also be
missing $(SWIG_DIR)/lib/swig1.3/java.
- Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 7 08:04:30 2002