# 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
#----------------------------------------------------------------------
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
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)
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)
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)
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,