]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/setup.py
Some fixes for wxURLDataObject when wxUSE_UNICODE==1
[wxWidgets.git] / wxPython / setup.py
index f224408ece65033255e94f6161e14749c8fa92c4..59f662d0e90f8df4a29ed549dcfe5fcbc3f0b43b 100755 (executable)
@@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree
 # flags and values that affect this script
 #----------------------------------------------------------------------
 
-VERSION          = "2.3.3rc"
+VERSION          = "2.3.3pre"
 DESCRIPTION      = "Cross platform GUI toolkit for Python"
 AUTHOR           = "Robin Dunn"
 AUTHOR_EMAIL     = "Robin Dunn <robin@alldunn.com>"
@@ -33,7 +33,8 @@ BUILD_OGL = 1      # If true, build the contrib/ogl extension module
 BUILD_STC = 1      # If true, build the contrib/stc extension module
 BUILD_XRC = 1      # XML based resource system
 BUILD_GIZMOS = 1   # Build a module for the gizmos contrib library
-BUILD_DLLWIDGET = 1# Build a module for the gizmos contrib library
+BUILD_DLLWIDGET = 1# Build a module for that enables unknown wx widgets
+                   # to be loaded from a DLL to be used from Python.
 
 BUILD_IEWIN = 0    # Internet Explorer wrapper (experimental)
 
@@ -46,6 +47,9 @@ GL_ONLY = 0        # Only used when making the -gl RPM.  See the "b" script
 USE_SWIG = 0       # Should we actually execute SWIG, or just use the
                    # files already in the distribution?
 
+USE_UNICODE = 0    # This will pass the 'wxUSE_UNICODE' flag to SWIG.
+                   # At the moment only tested for 'CORE_ONLY = 1'
+
 IN_CVS_TREE = 0    # Set to true if building in a full wxWindows CVS
                    # tree, otherwise will assume all needed files are
                    # available in the wxPython source distribution
@@ -83,11 +87,14 @@ def opj(*args):
 
 def libFlag():
     if FINAL:
-        return ''
+        rv = ''
     elif HYBRID:
-        return 'h'
+        rv = 'h'
     else:
-        return 'd'
+        rv = 'd'
+    if USE_UNICODE:
+        rv = 'u' + rv
+    return rv
 
 
 #----------------------------------------------------------------------
@@ -116,7 +123,7 @@ if bcpp_compiling:
 
 for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
              'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
-             'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
+             'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE', 'USE_UNICODE',
              'FINAL', 'HYBRID', ]:
     for x in range(len(sys.argv)):
         if string.find(sys.argv[x], flag) == 0:
@@ -136,6 +143,10 @@ for option in ['WX_CONFIG', 'WXDLLVER', ]:
 sys.argv = filter(None, sys.argv)
 
 
+
+#----------------------------------------------------------------------
+# sanity checks
+
 if CORE_ONLY:
     BUILD_GLCANVAS = 0
     BUILD_OGL = 0
@@ -145,6 +156,10 @@ if CORE_ONLY:
     BUILD_DLLWIDGET = 0
 
 
+if USE_UNICODE and os.name != 'nt':
+    print "UNICODE is currently only supported on Win32"
+    sys.exit()
+
 #----------------------------------------------------------------------
 # Setup some platform specific stuff
 #----------------------------------------------------------------------
@@ -218,7 +233,9 @@ if os.name == 'nt':
             'advapi32', 'wsock32']
 
 
-    cflags = [] #['/GX-']  # workaround for internal compiler error in MSVC on some machines
+    cflags = [
+             # '/GX-'  # workaround for internal compiler error in MSVC on some machines
+             ]
     lflags = None
 
 
@@ -310,6 +327,9 @@ swig_args = ['-c++', '-shadow', '-python', '-keyword',
              #'-docstring', '-Sbefore',
              '-I./src', '-D'+WXPLAT,
              ]
+if USE_UNICODE:
+    swig_args.append('-DwxUSE_UNICODE')
+
 swig_deps = ['src/my_typemaps.i']
 
 
@@ -323,8 +343,7 @@ if not GL_ONLY:
                    'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
                    'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
                    'printfw.i', 'sizers.i', 'clip_dnd.i',
-                   'filesys.i', 'streams.i',
-                   ##'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
+                   'filesys.i', 'streams.i', 'utils.i'
                    ]
 
     swig_sources = run_swig(swig_files, 'src', GENDIR, PKGDIR,
@@ -390,20 +409,6 @@ if not GL_ONLY:
     wxpExtensions.append(ext)
 
 
-    # Extension for the utils module
-    swig_sources = run_swig(['utils.i'], 'src', GENDIR, PKGDIR,
-                            USE_SWIG, swig_force, swig_args, swig_deps)
-    ext = Extension('utilsc', swig_sources,
-                    include_dirs =  includes,
-                    define_macros = defines,
-                    library_dirs = libdirs,
-                    libraries = libs,
-                    extra_compile_args = cflags,
-                    extra_link_args = lflags,
-                    )
-    wxpExtensions.append(ext)
-
-
     # Extension for the calendar module
     swig_sources = run_swig(['calendar.i'], 'src', GENDIR, PKGDIR,
                             USE_SWIG, swig_force, swig_args, swig_deps)
@@ -731,13 +736,8 @@ if not GL_ONLY and BUILD_XRC:
 
                                 '%s/xh_unkwn.cpp' % XMLLOC,
                                 '%s/xml.cpp' % XMLLOC,
-                                '%s/xmlbin.cpp' % XMLLOC,
-                                '%s/xmlbinz.cpp' % XMLLOC,
-                                '%s/xmlexpat.cpp' % XMLLOC,
-
                                 '%s/xmlres.cpp' % XMLLOC,
                                 '%s/xmlrsall.cpp' % XMLLOC,
-                                '%s/xmlwrite.cpp' % XMLLOC,
 
                              ] + swig_sources,