]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/setup.py
Updates for wxToolbook class
[wxWidgets.git] / wxPython / setup.py
index 6a1b7fe998fbafe2f5c901f0307fbc3a608485be..d672a441966889431c0c7a3c056cc5548b30fd44 100755 (executable)
@@ -34,8 +34,9 @@ import sys, os
 # We happen to be doing that here in this script, so make sure to
 # remove the build_options.py file, so that config.py will recreate it.
 
-if os.path.exists("build_options.py"):
-    os.remove("build_options.py")
+for bo_name in ["build_options.py", "build_options.pyc"]:
+    if os.path.exists(bo_name):
+        os.remove(bo_name)
 
 sys.setup_is_main =  __name__ == "__main__"  # an icky hack!
 from config import *
@@ -75,6 +76,32 @@ RELEASE_NUMBER = RELEASE_VERSION  # for compatibility
 CLEANUP.append('wx/__version__.py')
 
 
+#----------------------------------------------------------------------
+# Write the SWIG version to a header file
+#----------------------------------------------------------------------
+
+if USE_SWIG:
+    try:
+        # It may come on either stdout or stderr, depending on the
+        # version, so read both.
+        i, o, e = os.popen3(SWIG + ' -version', 't')
+        stext = o.read() + e.read()
+        import re
+        match = re.search(r'[0-9]+\.[0-9]+\.[0-9]+$', stext, re.MULTILINE)
+        if not match:
+            raise 'NotFound'
+        SVER = match.group(0)
+        open('include/wx/wxPython/swigver.h', 'w').write('''\
+// This file was generated by setup.py
+
+#define wxPy_SWIG_VERSION "SWIG-%s"
+''' % SVER)
+        msg('Using SWIG-' + SVER)
+
+    except:
+        msg('\nUnable to get SWIG version number\n')
+
+
 #----------------------------------------------------------------------
 # patch distutils if it can't cope with the "classifiers" or
 # "download_url" keywords 
@@ -120,6 +147,7 @@ swig_sources = run_swig(['core.i'], 'src', GENDIR, PKGDIR,
                           'src/_validator.i',
                           'src/_window.i',
                           'src/_control.i',
+                          'src/_swigtype.i',
                           ],
                         True)
 
@@ -726,7 +754,7 @@ else:
 
 
 if INSTALL_MULTIVERSION:
-    EXTRA_PATH = getExtraPath(addOpts=EP_ADD_OPTS)
+    EXTRA_PATH = getExtraPath(addOpts=EP_ADD_OPTS, shortVer=not EP_FULL_VER)
     open("src/wx.pth", "w").write(EXTRA_PATH)
     CLEANUP.append("src/wx.pth")
 else: