[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Building swig bindings outside the source tree

From: Morten Ludvigsen <morten_at_2ps.dk>
Date: 2002-10-19 17:53:29 CEST

My first patch :-)

In the INSTALL doc there is a description for building in a different
directory. This works for the main program, but not for the swig bindings.

This patch should fix that.

Regards,

Morten Ludvigsen
2-People Software
Denmark

Log:

Fixed configuration so that SWIG python bindings can be built outside
the source tree.

* Makefile.in
  Created new variables for swig directories:
  SWIG_SRC_DIR - the swig source directory in the source tree.
  SWIG_DIRS - the swig direcotries in the build tree.

  (mkdir-init): Make the directories in SWIG_DIRS.

  (swig-py-ext): Use symbolic directory references using SWIG_SRC_DIR.
                 Also specify the source dir for swig.

  (install-swig-py-ext): Use symbolic directory references using
SWIG_SRC_DIR.
                         Also specify the source dir for swig.

* subversion/bindings/swig/python/setup.py
  Added command line argument (-S) to specify the source directory.

Patch:

Index: Makefile.in
===================================================================
--- Makefile.in
+++ Makefile.in Sat Oct 19 16:40:10 2002
@@ -9,6 +9,11 @@

 DOC_DIRS = doc/programmer/design doc/handbook
doc/handbook/translations/french

+SWIG_SRC_DIR = $(top_srcdir)/subversion/bindings/swig
+SWIG_DIRS = subversion/bindings/swig \
+ subversion/bindings/swig/python \
+ subversion/bindings/swig/python/svn
+
 EXTERNAL_PROJECT_DIRS = @SVN_SUBDIRS@

 NEON_LIBS = @NEON_LIBS@
@@ -158,7 +163,7 @@
                 tests.log

 mkdir-init:
- @list='$(BUILD_DIRS) $(DOC_DIRS)'; for i in $$list doc; do \
+ @list='$(BUILD_DIRS) $(DOC_DIRS) $(SWIG_DIRS)'; for i in $$list doc; do \
             echo "mkdir $$i" ; \
             $(MKDIR) $$i ; \
         done
@@ -209,15 +214,19 @@
         done

 swig-py-ext:
- (cd subversion/bindings/swig/python; \
- $(PYTHON) setup.py \
- -I.. -I../../../include $(SVN_APR_INCLUDES) \
- -L$(prefix)/lib -L$(SVN_APR_PREFIX)/lib \
+ (cd subversion/bindings/swig/python; \
+ $(PYTHON) $(SWIG_SRC_DIR)/python/setup.py \
+ -I$(SWIG_SRC_DIR) \
+ -I$(top_srcdir)/subversion/include $(SVN_APR_INCLUDES) \
+ -S$(SWIG_SRC_DIR) \
+ -L$(prefix)/lib -L$(SVN_APR_PREFIX)/lib \
             build)

 install-swig-py-ext:
         (cd subversion/bindings/swig/python; \
- $(PYTHON) setup.py install --prefix $(prefix))
+ $(PYTHON) $(SWIG_SRC_DIR)/python/setup.py \
+ -S$(SWIG_SRC_DIR) \
+ install --prefix $(prefix))

 ### Build a tarball.
 dist:
Index: subversion/bindings/swig/python/setup.py
===================================================================
--- subversion/bindings/swig/python/setup.py
+++ subversion/bindings/swig/python/setup.py Sat Oct 19 14:58:53 2002
@@ -32,6 +32,8 @@
         "search DIR for includes (multiple instances allowed)"
   print " -L dir " + \
         "search DIR for libraries (multiple instances allowed)"
+ print " -S dir " + \
+ "the DIR for the source of the subversion swig bindings"
   print " -s path " + \
         "use the swig binary found at PATH"
   sys.exit(0)
@@ -52,13 +54,15 @@
 # all the options that we allow (which is FAR less than the set of
 # distutils options). If we find that people actually care, we can
 # revisit this.
-options, leftovers = getopt.getopt(sys.argv[1:], "I:L:s:",
+options, leftovers = getopt.getopt(sys.argv[1:], "I:L:S:s:",
                                    ["prefix=", "install-dir="])
 for option in options:
   if option[0] == '-I':
     include_dirs.append(option[1])
   if option[0] == '-L':
     library_dirs.append(option[1])
+ if option[0] == '-S':
+ source_dir = option[1]
   if option[0] == '-s':
     swig_location = option[1]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 19 17:54:17 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.