Index: tools/swig/swig.py |
=================================================================== |
--- tools/swig/swig.py (revision 40643) |
+++ tools/swig/swig.py (working copy) |
@@ -13,6 +13,7 @@ |
""" |
import os |
+import subprocess |
import sys |
@@ -25,10 +26,19 @@ |
'darwin': 'mac', |
'linux2': 'linux', |
'win32': 'win', |
- 'cygwin': 'win', |
} |
+ # Swig documentation lies that platform macros are provided to swig |
+ # preprocessor. Provide them ourselves. |
+ platform_flags = { |
+ 'darwin': '-DSWIGMAC', |
+ 'linux2': '-DSWIGLINUX', |
+ 'win32': '-DSWIGWIN', |
+ } |
swig_bin = os.path.join(swig_dir, dir_map[sys.platform], 'swig') |
- os.execv(swig_bin, [swig_bin] + sys.argv[1:]) |
+ args = [swig_bin, platform_flags[sys.platform]] + sys.argv[1:] |
+ args = [x.replace('/', os.sep) for x in args] |
+ print "Executing", args |
+ sys.exit(subprocess.call(args)) |
if __name__ == "__main__": |