X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b62f00d8e3ec5437ab780cb3d73d299cc61e20c..a7642be106b7d31cb7eb7b55ef74ec4072dce3a2:/wxPython/setup.py?ds=sidebyside diff --git a/wxPython/setup.py b/wxPython/setup.py index 6d0138973f..fd12fe6f94 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -42,6 +42,10 @@ 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 +WX_CONFIG = "wx-config" # Usually you shouldn't need to touch this, + # but you can set it to pass an alternate + # version of wx-config or alternate flags, + # eg. as required by the .deb in-tree build. # Some MSW build settings @@ -75,8 +79,7 @@ debug = '--debug' in sys.argv or '-g' in sys.argv #---------------------------------------------------------------------- for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'CORE_ONLY', - 'USE_SWIG', 'IN_CVS_TREE', 'FINAL', 'HYBRID', - 'WXDLLVER', ]: + 'USE_SWIG', 'IN_CVS_TREE', 'FINAL', 'HYBRID', ]: for x in range(len(sys.argv)): if string.find(sys.argv[x], flag) == 0: pos = string.find(sys.argv[x], '=') + 1 @@ -84,6 +87,14 @@ for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'CORE_ONLY', vars()[flag] = eval(sys.argv[x][pos:]) sys.argv[x] = '' +for option in ['WX_CONFIG', 'WXDLLVER', ]: + for x in range(len(sys.argv)): + if string.find(sys.argv[x], option) == 0: + pos = string.find(sys.argv[x], '=') + 1 + if pos > 0: + vars()[option] = sys.argv[x][pos:] + sys.argv[x] = '' + sys.argv = filter(None, sys.argv) @@ -172,11 +183,11 @@ elif os.name == 'posix': libdirs = [] libs = [] - cflags = os.popen('wx-config --cflags', 'r').read()[:-1] + ' ' + \ + cflags = os.popen(WX_CONFIG + ' --cflags', 'r').read()[:-1] + ' ' + \ os.popen('gtk-config --cflags', 'r').read()[:-1] cflags = string.split(cflags) - lflags = os.popen('wx-config --libs', 'r').read()[:-1] + lflags = os.popen(WX_CONFIG + ' --libs', 'r').read()[:-1] lflags = string.split(lflags) @@ -316,6 +327,7 @@ if BUILD_GLCANVAS or GL_ONLY: print 'Preparing GLCANVAS...' location = 'contrib/glcanvas' swig_files = ['glcanvas.i'] + other_sources = [] swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR, USE_SWIG, swig_force, swig_args) @@ -326,9 +338,13 @@ if BUILD_GLCANVAS or GL_ONLY: gl_libs = ['wx_gtkd_gl', 'GL', 'GLU'] else: gl_libs = ['wx_gtk_gl', 'GL', 'GLU'] + else: + other_sources = [location + '/msw/myglcanvas.cpp'] + gl_libs = ['opengl32', 'glu32'] + ext = Extension('glcanvasc', - swig_sources, + swig_sources + other_sources, include_dirs = includes, define_macros = defines,