[Commits] (vajda) Added a patch to improve support for SWIG in distutils. I submitted this

commits at osafoundation.org commits at osafoundation.org
Wed Oct 13 12:55:49 PDT 2004


Commit by: vajda
Modified files:
external/python/patches 1.3 1.4

Log message:
Added a patch to improve support for SWIG in distutils. I submitted this
patch to the python distutils list and there is a good chance at the moment
for this patch be integrated into python 2.4.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/external/python/patches.diff?r1=text&tr1=1.3&r2=text&tr2=1.4

Index: external/python/patches
diff -u external/python/patches:1.3 external/python/patches:1.4
--- external/python/patches:1.3	Mon May 10 14:32:15 2004
+++ external/python/patches	Wed Oct 13 12:55:47 2004
@@ -76,3 +76,68 @@
                                                    list(dbd['libdirs']))
                      if (db_incs or dbkey == std_dbinc) and \
                             dblib_dir is not None:
+--- Python-2.3.3/Lib/distutils/command/build_ext.py	Tue Nov 19 05:12:28 2002
++++ Python-2.3.3-patched/Lib/distutils/command/build_ext.py	Tue Oct  5 14:24:48 2004
+@@ -79,11 +79,13 @@
+          "forcibly build everything (ignore file timestamps)"),
+         ('compiler=', 'c',
+          "specify the compiler type"),
+-        ('swig-cpp', None,
+-         "make SWIG create C++ files (default is C)"),
++        ('swig-opts=', None,
++         "list of SWIG command line options"),
++        ('swig=', None,
++         "path to the SWIG executable"),
+         ]
+ 
+-    boolean_options = ['inplace', 'debug', 'force', 'swig-cpp']
++    boolean_options = ['inplace', 'debug', 'force']
+ 
+     help_options = [
+         ('help-compiler', None,
+@@ -107,8 +109,8 @@
+         self.debug = None
+         self.force = None
+         self.compiler = None
+-        self.swig_cpp = None
+-
++        self.swig_opts = None
++        self.swig = None
+ 
+     def finalize_options (self):
+         from distutils import sysconfig
+@@ -205,6 +207,11 @@
+         if self.undef:
+             self.undef = string.split(self.undef, ',')
+ 
++        if self.swig_opts is None:
++            self.swig_opts = []
++        else:
++            self.swig_opts = self.swig_opts.split(' ')
++
+     # finalize_options ()
+ 
+ 
+@@ -509,7 +516,7 @@
+         # source -- but there should be an option to put SWIG output in
+         # the temp dir.
+ 
+-        if self.swig_cpp:
++        if '-c++' in self.swig_opts:
+             target_ext = '.cpp'
+         else:
+             target_ext = '.c'
+@@ -526,10 +533,9 @@
+         if not swig_sources:
+             return new_sources
+ 
+-        swig = self.find_swig()
+-        swig_cmd = [swig, "-python"]
+-        if self.swig_cpp:
+-            swig_cmd.append("-c++")
++        swig = self.swig or self.find_swig()
++        swig_cmd = [swig, '-python']
++        swig_cmd.extend(self.swig_opts)
+ 
+         for source in swig_sources:
+             target = swig_targets[source]



More information about the Commits mailing list