]> git.saurik.com Git - wxWidgets.git/blame - wxPython/setup.py
use "..." instead of <...> for wx includes
[wxWidgets.git] / wxPython / setup.py
CommitLineData
c368d904
RD
1#!/usr/bin/env python
2#----------------------------------------------------------------------
3
4import sys, os, string
5from distutils.core import setup, Extension
6from distutils.file_util import copy_file
7from distutils.dir_util import mkpath
8from distutils.dep_util import newer
9
10from my_distutils import run_swig, contrib_copy_tree
11
12#----------------------------------------------------------------------
13# flags and values that affect this script
14#----------------------------------------------------------------------
15
78e8819c 16VERSION = "2.3.2b7+"
c368d904
RD
17DESCRIPTION = "Cross platform GUI toolkit for Python"
18AUTHOR = "Robin Dunn"
b166c703 19AUTHOR_EMAIL = "Robin Dunn <robin@alldunn.com>"
c368d904
RD
20URL = "http://wxPython.org/"
21LICENCE = "wxWindows (LGPL derivative)"
22LONG_DESCRIPTION = """\
23wxPython is a GUI toolkit for Python that is a wrapper around the
24wxWindows C++ GUI library. wxPython provides a large variety of
1b62f00d 25window types and controls, all implemented with a native look and
c368d904
RD
26feel (and native runtime speed) on the platforms it is supported
27on.
28"""
29
30
5c0282d5 31BUILD_GLCANVAS = 1 # If true, build the contrib/glcanvas extension module
c368d904
RD
32BUILD_OGL = 1 # If true, build the contrib/ogl extension module
33BUILD_STC = 1 # If true, build the contrib/stc extension module
d56cebe7 34BUILD_XRC = 1 # XML based resource system
ebf4302c 35BUILD_GIZMOS = 1 # Build a module for the gizmos contrib library
4a61305d 36BUILD_DLLWIDGET = 1# Build a module for the gizmos contrib library
d56cebe7 37
78e8819c
RD
38BUILD_IEWIN = 0 # Internet Explorer wrapper (experimental)
39
c368d904 40CORE_ONLY = 0 # if true, don't build any of the above
4a61305d
RD
41
42
7326dbf8 43GL_ONLY = 0 # Only used when making the -gl RPM. See the "b" script
1b62f00d 44 # for the ugly details
c368d904
RD
45
46USE_SWIG = 0 # Should we actually execute SWIG, or just use the
47 # files already in the distribution?
48
49IN_CVS_TREE = 0 # Set to true if building in a full wxWindows CVS
50 # tree, otherwise will assume all needed files are
51 # available in the wxPython source distribution
52
afa3e1ed
RL
53WX_CONFIG = "wx-config" # Usually you shouldn't need to touch this,
54 # but you can set it to pass an alternate
55 # version of wx-config or alternate flags,
56 # eg. as required by the .deb in-tree build.
c368d904
RD
57
58# Some MSW build settings
59
60FINAL = 1 # Mirrors use of same flag in wx makefiles,
61 # (0 or 1 only) should probably find a way to
62 # autodetect this...
63
64HYBRID = 0 # If set and not debug or FINAL, then build a
65 # hybrid extension that can be used by the
66 # non-debug version of python, but contains
67 # debugging symbols for wxWindows and wxPython.
68 # wxWindows must have been built with /MD, not /MDd
69 # (using FINAL=hybrid will do it.)
70
ebf4302c 71WXDLLVER = '232' # Version part of DLL name
c368d904
RD
72
73
cfe766c3
RD
74#----------------------------------------------------------------------
75
76def msg(text):
77 if __name__ == "__main__":
78 print text
79
55c020cf
RD
80def opj(*args):
81 path = apply(os.path.join, args)
82 return os.path.normpath(path)
cfe766c3 83
a4fbdd76
RD
84def libFlag():
85 if FINAL:
86 return ''
87 elif HYBRID:
88 return 'h'
89 else:
90 return 'd'
91
92
c368d904
RD
93#----------------------------------------------------------------------
94# Some other globals
95#----------------------------------------------------------------------
96
97PKGDIR = 'wxPython'
98wxpExtensions = []
99
100force = '--force' in sys.argv or '-f' in sys.argv
101debug = '--debug' in sys.argv or '-g' in sys.argv
102
22d08289
RD
103bcpp_compiling = '-c' in sys.argv and 'my_bcpp' in sys.argv # Bad heuristic
104
105if bcpp_compiling:
cfe766c3 106 msg("Compiling wxPython by Borland C/C++ Compiler")
22d08289
RD
107 HYBRID=0
108 WXBCPPLIBVER = string.replace(WXDLLVER,"_","")
109 # Version part of BCPP build LIBRARY name
110 WXDLLVER="" # no dll ver path avaible
111
c368d904
RD
112
113#----------------------------------------------------------------------
114# Check for build flags on the command line
115#----------------------------------------------------------------------
116
b166c703 117for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
4a61305d 118 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
b166c703
RD
119 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
120 'FINAL', 'HYBRID', ]:
c368d904
RD
121 for x in range(len(sys.argv)):
122 if string.find(sys.argv[x], flag) == 0:
123 pos = string.find(sys.argv[x], '=') + 1
124 if pos > 0:
125 vars()[flag] = eval(sys.argv[x][pos:])
126 sys.argv[x] = ''
127
afa3e1ed
RL
128for option in ['WX_CONFIG', 'WXDLLVER', ]:
129 for x in range(len(sys.argv)):
130 if string.find(sys.argv[x], option) == 0:
131 pos = string.find(sys.argv[x], '=') + 1
132 if pos > 0:
133 vars()[option] = sys.argv[x][pos:]
134 sys.argv[x] = ''
135
c368d904
RD
136sys.argv = filter(None, sys.argv)
137
138
139if CORE_ONLY:
7326dbf8 140 BUILD_GLCANVAS = 0
c368d904
RD
141 BUILD_OGL = 0
142 BUILD_STC = 0
b166c703 143 BUILD_XRC = 0
c368d904
RD
144
145#----------------------------------------------------------------------
146# Setup some platform specific stuff
147#----------------------------------------------------------------------
148
149if os.name == 'nt':
150 # Set compile flags and such for MSVC. These values are derived
151 # from the wxWindows makefiles for MSVC, others will probably
152 # vary...
153 WXDIR = os.environ['WXWIN']
154 WXPLAT = '__WXMSW__'
155 GENDIR = 'msw'
156
c368d904
RD
157 if debug:
158 FINAL = 0
159 HYBRID = 0
160
161 if HYBRID:
162 FINAL = 0
163
c368d904 164 includes = ['src',
a4fbdd76 165 opj(WXDIR, 'lib', 'mswdll' + libFlag()),
55c020cf 166 opj(WXDIR, 'include'),
c368d904
RD
167 ]
168
169 defines = [ ('WIN32', None), # Some of these are no longer
170 ('__WIN32__', None), # necessary. Anybody know which?
171 ('_WINDOWS', None),
172 ('__WINDOWS__', None),
173 ('WINVER', '0x0400'),
174 ('__WIN95__', None),
175 ('STRICT', None),
176
177 (WXPLAT, None),
178 ('WXUSINGDLL', '1'),
179
180 ('SWIG_GLOBAL', None),
181 ('HAVE_CONFIG_H', None),
182 ('WXP_USE_THREAD', '1'),
183 ]
184
22d08289
RD
185 if bcpp_compiling: # overwrite it
186 defines = [
187 ('_WINDOWS', None),
188 ('WINVER', '0x0400'),
189 ('STRICT', None),
190
191 ('WXUSINGDLL', '1'),
192
193 ('SWIG_GLOBAL', None),
194 ('HAVE_CONFIG_H', None),
195 ('WXP_USE_THREAD', '1'),
196
197 ('WXUSE_DEFINE','1'),
198 ('_RTLDLL',None),
199 ]
200
201
c368d904
RD
202 if not FINAL or HYBRID:
203 defines.append( ('__WXDEBUG__', None) )
204
55c020cf 205 libdirs = [opj(WXDIR, 'lib'), 'build\\ilib']
a4fbdd76 206 wxdll = 'wxmsw' + WXDLLVER + libFlag()
22d08289 207 libs = [wxdll]
a4fbdd76 208
22d08289
RD
209 if bcpp_compiling:
210 libs = ['wx'+WXBCPPLIBVER]
211
212 libs = libs + ['kernel32', 'user32', 'gdi32', 'comdlg32',
c368d904
RD
213 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
214 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
215 'advapi32', 'wsock32']
216
22d08289 217
c7e7022c 218 cflags = [] #['/GX-'] # workaround for internal compiler error in MSVC on some machines
c368d904
RD
219 lflags = None
220
22d08289
RD
221
222 if bcpp_compiling: # overwrite it
dbd3685c 223 cflags = ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
22d08289 224 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
55c020cf
RD
225 '-Hc', '-H=' + opj(WXDIR, '\src\msw\wx32.csm'),
226 '@' + opj(WXDIR, '\src\msw\wxwin32.cfg')
22d08289
RD
227 ]
228
229
230 if not FINAL and HYBRID and not bcpp_compiling:
e7d63784
RD
231 cflags = cflags + ['/Od', '/Z7']
232 lflags = ['/DEBUG', ]
c368d904 233
22d08289
RD
234 elif bcpp_compiling and not FINAL:
235 cflags = cflags + ['/Od', '/v', '/y']
236 lflags = lflags + ['/v', ] ## '/PDB:NONE']
237
238
c368d904 239
dbd3685c 240elif os.name == 'posix' and sys.platform[:6] == "darwin":
e6056257
RD
241 # Flags and such for a Darwin (Max OS X) build of Python
242
243 WXDIR = '..' # assumes IN_CVS_TREE
244 WXPLAT = '__WXMAC__'
245 GENDIR = 'mac'
246
247 includes = ['src']
248 defines = [('SWIG_GLOBAL', None),
249 ('HAVE_CONFIG_H', None),
250 ('WXP_USE_THREAD', '1'),
251 ]
252 libdirs = []
253 libs = []
254
255 cflags = os.popen(WX_CONFIG + ' --cxxflags', 'r').read()[:-1]
256 cflags = string.split(cflags)
257
258 lflags = os.popen(WX_CONFIG + ' --libs', 'r').read()[:-1]
259 lflags = string.split(lflags)
260
261
262
c368d904
RD
263elif os.name == 'posix':
264 # Set flags for Unix type platforms
265
266 WXDIR = '..' # assumes IN_CVS_TREE
267 WXPLAT = '__WXGTK__' # and assumes GTK...
268 GENDIR = 'gtk' # Need to allow for Motif eventually too
269
270 includes = ['src']
271 defines = [('SWIG_GLOBAL', None),
272 ('HAVE_CONFIG_H', None),
273 ('WXP_USE_THREAD', '1'),
274 ]
275 libdirs = []
276 libs = []
277
e8bf92fd 278 cflags = os.popen(WX_CONFIG + ' --cxxflags', 'r').read()[:-1] + ' ' + \
c368d904
RD
279 os.popen('gtk-config --cflags', 'r').read()[:-1]
280 cflags = string.split(cflags)
281
afa3e1ed 282 lflags = os.popen(WX_CONFIG + ' --libs', 'r').read()[:-1]
c368d904
RD
283 lflags = string.split(lflags)
284
285
286else:
287 raise 'Sorry Charlie...'
288
289
290#----------------------------------------------------------------------
291# Check if the version file needs updated
292#----------------------------------------------------------------------
293
294if IN_CVS_TREE and newer('setup.py', 'src/__version__.py'):
295 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION)
296
1b62f00d
RD
297
298
c368d904 299#----------------------------------------------------------------------
1b62f00d 300# SWIG defaults
c368d904
RD
301#----------------------------------------------------------------------
302
c368d904 303swig_force = force
00b6c4e3
RD
304swig_args = ['-c++', '-shadow', '-python', '-keyword',
305 '-dnone',
306 #'-dascii',
307 #'-docstring', '-Sbefore',
e6056257
RD
308 '-I./src', '-D'+WXPLAT,
309 ]
185d7c3e 310swig_deps = ['src/my_typemaps.i']
c368d904 311
c368d904 312
1b62f00d
RD
313#----------------------------------------------------------------------
314# Define the CORE extension module
315#----------------------------------------------------------------------
316
317if not GL_ONLY:
cfe766c3 318 msg('Preparing CORE...')
1b62f00d
RD
319 swig_files = [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
320 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
321 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
322 'printfw.i', 'sizers.i', 'clip_dnd.i',
323 'filesys.i', 'streams.i',
324 ##'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
325 ]
c368d904 326
1b62f00d
RD
327 swig_sources = run_swig(swig_files, 'src', GENDIR, PKGDIR,
328 USE_SWIG, swig_force, swig_args, swig_deps)
c368d904 329
1b62f00d
RD
330 copy_file('src/__init__.py', PKGDIR, update=1, verbose=0)
331 copy_file('src/__version__.py', PKGDIR, update=1, verbose=0)
c368d904 332
c368d904 333
1b62f00d
RD
334 if IN_CVS_TREE: # update the licence files
335 mkpath('licence')
336 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
55c020cf 337 copy_file(opj(WXDIR, 'docs', file), opj('licence',file), update=1, verbose=0)
c368d904 338
1b62f00d
RD
339
340 if os.name == 'nt':
341 rc_file = ['src/wxc.rc']
342 else:
343 rc_file = []
344
345
346 ext = Extension('wxc', ['src/helpers.cpp',
347 'src/libpy.c',
348 ] + rc_file + swig_sources,
349
350 include_dirs = includes,
351 define_macros = defines,
352
353 library_dirs = libdirs,
354 libraries = libs,
355
356 extra_compile_args = cflags,
357 extra_link_args = lflags,
358 )
359 wxpExtensions.append(ext)
360
361
362 # Extension for the grid module
363 swig_sources = run_swig(['grid.i'], 'src', GENDIR, PKGDIR,
364 USE_SWIG, swig_force, swig_args, swig_deps)
365 ext = Extension('gridc', swig_sources,
366 include_dirs = includes,
367 define_macros = defines,
368 library_dirs = libdirs,
369 libraries = libs,
370 extra_compile_args = cflags,
371 extra_link_args = lflags,
372 )
373 wxpExtensions.append(ext)
374
375
376 # Extension for the html modules
377 swig_sources = run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR, PKGDIR,
378 USE_SWIG, swig_force, swig_args, swig_deps)
379 ext = Extension('htmlc', swig_sources,
380 include_dirs = includes,
381 define_macros = defines,
382 library_dirs = libdirs,
383 libraries = libs,
384 extra_compile_args = cflags,
385 extra_link_args = lflags,
386 )
387 wxpExtensions.append(ext)
388
389
390 # Extension for the utils module
391 swig_sources = run_swig(['utils.i'], 'src', GENDIR, PKGDIR,
392 USE_SWIG, swig_force, swig_args, swig_deps)
393 ext = Extension('utilsc', swig_sources,
394 include_dirs = includes,
395 define_macros = defines,
396 library_dirs = libdirs,
397 libraries = libs,
398 extra_compile_args = cflags,
399 extra_link_args = lflags,
400 )
401 wxpExtensions.append(ext)
402
403
404 # Extension for the calendar module
405 swig_sources = run_swig(['calendar.i'], 'src', GENDIR, PKGDIR,
406 USE_SWIG, swig_force, swig_args, swig_deps)
407 ext = Extension('calendarc', swig_sources,
408 include_dirs = includes,
409 define_macros = defines,
410 library_dirs = libdirs,
411 libraries = libs,
412 extra_compile_args = cflags,
413 extra_link_args = lflags,
414 )
415 wxpExtensions.append(ext)
c368d904 416
c368d904 417
4f3449b4
RD
418 # Extension for the help module
419 swig_sources = run_swig(['help.i'], 'src', GENDIR, PKGDIR,
420 USE_SWIG, swig_force, swig_args, swig_deps)
421 ext = Extension('helpc', swig_sources,
422 include_dirs = includes,
423 define_macros = defines,
424 library_dirs = libdirs,
425 libraries = libs,
426 extra_compile_args = cflags,
427 extra_link_args = lflags,
428 )
429 wxpExtensions.append(ext)
430
431
c368d904
RD
432#----------------------------------------------------------------------
433# Define the GLCanvas extension module
434#----------------------------------------------------------------------
435
55c020cf
RD
436CTRB_SRC = opj(WXDIR, 'contrib/src')
437CTRB_INC = opj(WXDIR, 'contrib/include/wx')
438
1b62f00d 439if BUILD_GLCANVAS or GL_ONLY:
cfe766c3 440 msg('Preparing GLCANVAS...')
c368d904
RD
441 location = 'contrib/glcanvas'
442 swig_files = ['glcanvas.i']
19cf4f80 443 other_sources = []
c368d904
RD
444
445 swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR,
1e7ecb7b 446 USE_SWIG, swig_force, swig_args)
c368d904
RD
447
448 gl_libs = []
449 if os.name == 'posix':
f32afe1c
RD
450 gl_config = os.popen(WX_CONFIG + ' --gl-libs', 'r').read()[:-1]
451 gl_lflags = string.split(gl_config) + lflags
452 gl_libs = libs
19cf4f80 453 else:
55c020cf 454 other_sources = [opj(location, 'msw/myglcanvas.cpp')]
f32afe1c
RD
455 gl_libs = libs + ['opengl32', 'glu32']
456 gl_lflags = lflags
c368d904 457
1e7ecb7b 458 ext = Extension('glcanvasc',
19cf4f80 459 swig_sources + other_sources,
1e7ecb7b
RD
460
461 include_dirs = includes,
462 define_macros = defines,
463
464 library_dirs = libdirs,
f32afe1c 465 libraries = gl_libs,
1e7ecb7b
RD
466
467 extra_compile_args = cflags,
f32afe1c 468 extra_link_args = gl_lflags,
1e7ecb7b
RD
469 )
470
471 wxpExtensions.append(ext)
c368d904
RD
472
473
474#----------------------------------------------------------------------
475# Define the OGL extension module
476#----------------------------------------------------------------------
477
1b62f00d 478if not GL_ONLY and BUILD_OGL:
cfe766c3 479 msg('Preparing OGL...')
c368d904 480 location = 'contrib/ogl'
55c020cf
RD
481 OGLLOC = opj(location, 'contrib/src/ogl')
482 OGLINC = opj(location, 'contrib/include')
c368d904
RD
483
484 swig_files = ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
485 'oglcanvas.i']
486
487 swig_sources = run_swig(swig_files, location, '', PKGDIR,
1e7ecb7b 488 USE_SWIG, swig_force, swig_args)
c368d904 489
c368d904 490 if IN_CVS_TREE:
55c020cf
RD
491 # make sure local copy of contrib files are up to date
492 contrib_copy_tree(opj(CTRB_INC, 'ogl'), opj(OGLINC, 'wx/ogl'))
493 contrib_copy_tree(opj(CTRB_SRC, 'ogl'), OGLLOC)
c368d904 494
1e7ecb7b
RD
495 ext = Extension('oglc', ['%s/basic.cpp' % OGLLOC,
496 '%s/bmpshape.cpp' % OGLLOC,
497 '%s/composit.cpp' % OGLLOC,
498 '%s/divided.cpp' % OGLLOC,
499 '%s/lines.cpp' % OGLLOC,
500 '%s/misc.cpp' % OGLLOC,
501 '%s/basic2.cpp' % OGLLOC,
502 '%s/canvas.cpp' % OGLLOC,
503 '%s/constrnt.cpp' % OGLLOC,
504 '%s/drawn.cpp' % OGLLOC,
505 '%s/mfutils.cpp' % OGLLOC,
506 '%s/ogldiag.cpp' % OGLLOC,
507 ] + swig_sources,
508
509 include_dirs = [OGLINC] + includes,
510 define_macros = defines,
511
512 library_dirs = libdirs,
513 libraries = libs,
514
515 extra_compile_args = cflags,
516 extra_link_args = lflags,
517 )
518
519 wxpExtensions.append(ext)
520
521
c368d904
RD
522
523#----------------------------------------------------------------------
524# Define the STC extension module
525#----------------------------------------------------------------------
526
1b62f00d 527if not GL_ONLY and BUILD_STC:
cfe766c3 528 msg('Preparing STC...')
c368d904 529 location = 'contrib/stc'
55c020cf
RD
530 STCLOC = opj(location, 'contrib/src/stc')
531 STCINC = opj(location, 'contrib/include')
532 STC_H = opj(location, 'contrib/include/wx/stc')
c368d904 533
c368d904 534 if IN_CVS_TREE:
55c020cf
RD
535 # Check if gen_iface needs to be run for the wxSTC sources
536 if (newer(opj(CTRB_SRC, 'stc/stc.h.in'), opj(CTRB_INC, 'stc/stc.h' )) or
537 newer(opj(CTRB_SRC, 'stc/stc.cpp.in'), opj(CTRB_SRC, 'stc/stc.cpp')) or
538 newer(opj(CTRB_SRC, 'stc/gen_iface.py'), opj(CTRB_SRC, 'stc/stc.cpp'))):
539
540 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
541 cwd = os.getcwd()
542 os.chdir(opj(CTRB_SRC, 'stc'))
543 import gen_iface
544 gen_iface.main([])
545 os.chdir(cwd)
546
547
548 # make sure local copy of contrib files are up to date
549 contrib_copy_tree(opj(CTRB_INC, 'stc'), opj(STCINC, 'wx/stc'))
550 contrib_copy_tree(opj(CTRB_SRC, 'stc'), STCLOC)
551
c368d904
RD
552
553
554 swig_files = ['stc_.i']
74933d75 555 swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR,
c368d904
RD
556 USE_SWIG, swig_force,
557 swig_args + ['-I'+STC_H, '-I'+location],
55c020cf 558 [opj(STC_H, 'stc.h')])
c368d904 559
4a61305d 560 # copy a contrib project specific py module to the main package dir
55c020cf 561 copy_file(opj(location, 'stc.py'), PKGDIR, update=1, verbose=0)
c368d904
RD
562
563 # add some include dirs to the standard set
1e7ecb7b
RD
564 stc_includes = includes[:]
565 stc_includes.append('%s/scintilla/include' % STCLOC)
566 stc_includes.append('%s/scintilla/src' % STCLOC)
567 stc_includes.append(STCINC)
c368d904
RD
568
569 # and some macro definitions
1e7ecb7b
RD
570 stc_defines = defines[:]
571 stc_defines.append( ('__WX__', None) )
572 stc_defines.append( ('SCI_LEXER', None) )
c368d904
RD
573
574
1e7ecb7b
RD
575 ext = Extension('stc_c',
576 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC,
c368d904
RD
577 '%s/scintilla/src/CallTip.cxx' % STCLOC,
578 '%s/scintilla/src/CellBuffer.cxx' % STCLOC,
579 '%s/scintilla/src/ContractionState.cxx' % STCLOC,
580 '%s/scintilla/src/Document.cxx' % STCLOC,
55c020cf 581 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC,
c368d904
RD
582 '%s/scintilla/src/Editor.cxx' % STCLOC,
583 '%s/scintilla/src/Indicator.cxx' % STCLOC,
584 '%s/scintilla/src/KeyMap.cxx' % STCLOC,
585 '%s/scintilla/src/KeyWords.cxx' % STCLOC,
586 '%s/scintilla/src/LineMarker.cxx' % STCLOC,
587 '%s/scintilla/src/PropSet.cxx' % STCLOC,
55c020cf 588 '%s/scintilla/src/RESearch.cxx' % STCLOC,
c368d904
RD
589 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC,
590 '%s/scintilla/src/Style.cxx' % STCLOC,
fe0aca37 591 '%s/scintilla/src/StyleContext.cxx' % STCLOC,
55c020cf 592 '%s/scintilla/src/UniConversion.cxx' % STCLOC,
c368d904 593 '%s/scintilla/src/ViewStyle.cxx' % STCLOC,
55c020cf
RD
594 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC,
595
596 '%s/scintilla/src/LexAda.cxx' % STCLOC,
597 '%s/scintilla/src/LexAVE.cxx' % STCLOC,
c368d904 598 '%s/scintilla/src/LexCPP.cxx' % STCLOC,
fe0aca37
RD
599 '%s/scintilla/src/LexConf.cxx' % STCLOC,
600 '%s/scintilla/src/LexCrontab.cxx' % STCLOC,
55c020cf 601 '%s/scintilla/src/LexEiffel.cxx' % STCLOC,
c368d904 602 '%s/scintilla/src/LexHTML.cxx' % STCLOC,
55c020cf 603 '%s/scintilla/src/LexLisp.cxx' % STCLOC,
c368d904
RD
604 '%s/scintilla/src/LexLua.cxx' % STCLOC,
605 '%s/scintilla/src/LexOthers.cxx' % STCLOC,
55c020cf 606 '%s/scintilla/src/LexPascal.cxx' % STCLOC,
c368d904
RD
607 '%s/scintilla/src/LexPerl.cxx' % STCLOC,
608 '%s/scintilla/src/LexPython.cxx' % STCLOC,
55c020cf 609 '%s/scintilla/src/LexRuby.cxx' % STCLOC,
c368d904
RD
610 '%s/scintilla/src/LexSQL.cxx' % STCLOC,
611 '%s/scintilla/src/LexVB.cxx' % STCLOC,
c368d904
RD
612
613 '%s/PlatWX.cpp' % STCLOC,
614 '%s/ScintillaWX.cpp' % STCLOC,
615 '%s/stc.cpp' % STCLOC,
1e7ecb7b
RD
616 ] + swig_sources,
617
618 include_dirs = stc_includes,
619 define_macros = stc_defines,
620
621 library_dirs = libdirs,
622 libraries = libs,
c368d904 623
1e7ecb7b
RD
624 extra_compile_args = cflags,
625 extra_link_args = lflags,
626 )
627
628 wxpExtensions.append(ext)
c368d904
RD
629
630
631
926bb76c
RD
632#----------------------------------------------------------------------
633# Define the IEWIN extension module (experimental)
634#----------------------------------------------------------------------
635
636if not GL_ONLY and BUILD_IEWIN:
cfe766c3 637 msg('Preparing IEWIN...')
926bb76c
RD
638 location = 'contrib/iewin'
639
640 swig_files = ['iewin.i', ]
641
642 swig_sources = run_swig(swig_files, location, '', PKGDIR,
643 USE_SWIG, swig_force, swig_args)
644
645
646 ext = Extension('iewinc', ['%s/IEHtmlWin.cpp' % location,
647 ] + swig_sources,
648
649 include_dirs = includes,
650 define_macros = defines,
651
652 library_dirs = libdirs,
653 libraries = libs,
654
655 extra_compile_args = cflags,
656 extra_link_args = lflags,
657 )
658
659 wxpExtensions.append(ext)
660
661
d56cebe7
RD
662#----------------------------------------------------------------------
663# Define the XRC extension module
664#----------------------------------------------------------------------
665
666if not GL_ONLY and BUILD_XRC:
cfe766c3 667 msg('Preparing XRC...')
d56cebe7 668 location = 'contrib/xrc'
55c020cf
RD
669 XMLLOC = opj(location, 'contrib/src/xrc')
670 XMLINC = opj(location, 'contrib/include')
d56cebe7
RD
671
672 swig_files = ['xrc.i']
673
674 swig_sources = run_swig(swig_files, location, '', PKGDIR,
675 USE_SWIG, swig_force, swig_args)
676
677 xmlres_includes = includes[:]
678 xmlres_includes.append('%s/expat/xmlparse' % XMLLOC)
679 xmlres_includes.append('%s/expat/xmltok' % XMLLOC)
680 xmlres_includes.append(XMLINC)
681
682
683 # make sure local copy of contrib files are up to date
684 if IN_CVS_TREE:
55c020cf
RD
685 contrib_copy_tree(opj(CTRB_INC, 'xrc'), opj(XMLINC, 'wx/xrc'))
686 contrib_copy_tree(opj(CTRB_SRC, 'xrc'), XMLLOC)
d56cebe7
RD
687
688 ext = Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC,
689 '%s/expat/xmltok/xmlrole.c' % XMLLOC,
690 '%s/expat/xmltok/xmltok.c' % XMLLOC,
691
692 '%s/xh_bmp.cpp' % XMLLOC,
693 '%s/xh_bmpbt.cpp' % XMLLOC,
694 '%s/xh_bttn.cpp' % XMLLOC,
695 '%s/xh_cald.cpp' % XMLLOC,
696 '%s/xh_chckb.cpp' % XMLLOC,
697
698 '%s/xh_chckl.cpp' % XMLLOC,
699 '%s/xh_choic.cpp' % XMLLOC,
700 '%s/xh_combo.cpp' % XMLLOC,
701 '%s/xh_dlg.cpp' % XMLLOC,
702 '%s/xh_frame.cpp' % XMLLOC,
703
704 '%s/xh_gauge.cpp' % XMLLOC,
705 '%s/xh_html.cpp' % XMLLOC,
706 '%s/xh_listb.cpp' % XMLLOC,
707 '%s/xh_listc.cpp' % XMLLOC,
708 '%s/xh_menu.cpp' % XMLLOC,
709
710 '%s/xh_notbk.cpp' % XMLLOC,
711 '%s/xh_panel.cpp' % XMLLOC,
712 '%s/xh_radbt.cpp' % XMLLOC,
713 '%s/xh_radbx.cpp' % XMLLOC,
714 '%s/xh_scrol.cpp' % XMLLOC,
715
716 '%s/xh_sizer.cpp' % XMLLOC,
717 '%s/xh_slidr.cpp' % XMLLOC,
718 '%s/xh_spin.cpp' % XMLLOC,
719 '%s/xh_stbmp.cpp' % XMLLOC,
720 '%s/xh_stbox.cpp' % XMLLOC,
721
722 '%s/xh_stlin.cpp' % XMLLOC,
723 '%s/xh_sttxt.cpp' % XMLLOC,
724 '%s/xh_text.cpp' % XMLLOC,
725 '%s/xh_toolb.cpp' % XMLLOC,
726 '%s/xh_tree.cpp' % XMLLOC,
727
728 '%s/xh_unkwn.cpp' % XMLLOC,
729 '%s/xml.cpp' % XMLLOC,
730 '%s/xmlbin.cpp' % XMLLOC,
731 '%s/xmlbinz.cpp' % XMLLOC,
732 '%s/xmlexpat.cpp' % XMLLOC,
733
734 '%s/xmlres.cpp' % XMLLOC,
735 '%s/xmlrsall.cpp' % XMLLOC,
736 '%s/xmlwrite.cpp' % XMLLOC,
737
738 ] + swig_sources,
739
740 include_dirs = xmlres_includes,
741 define_macros = defines,
742
743 library_dirs = libdirs,
744 libraries = libs,
745
746 extra_compile_args = cflags,
747 extra_link_args = lflags,
748 )
749
750 wxpExtensions.append(ext)
751
752
753
ebf4302c
RD
754#----------------------------------------------------------------------
755# Define the GIZMOS extension module
756#----------------------------------------------------------------------
757
758if not GL_ONLY and BUILD_GIZMOS:
759 msg('Preparing GIZMOS...')
760 location = 'contrib/gizmos'
761 GIZMOLOC = opj(location, 'contrib/src/gizmos')
762 GIZMOINC = opj(location, 'contrib/include')
763
764 swig_files = ['gizmos.i']
765
766 swig_sources = run_swig(swig_files, location, '', PKGDIR,
767 USE_SWIG, swig_force, swig_args)
768
769 gizmos_includes = includes[:]
770 gizmos_includes.append(GIZMOINC)
771
772
773 # make sure local copy of contrib files are up to date
774 if IN_CVS_TREE:
775 contrib_copy_tree(opj(CTRB_INC, 'gizmos'), opj(GIZMOINC, 'wx/gizmos'))
776 contrib_copy_tree(opj(CTRB_SRC, 'gizmos'), GIZMOLOC)
777
778 ext = Extension('gizmosc', [
779 '%s/dynamicsash.cpp' % GIZMOLOC,
2f4e9287 780 '%s/editlbox.cpp' % GIZMOLOC,
950e7faf 781 #'%s/multicell.cpp' % GIZMOLOC,
ebf4302c 782 '%s/splittree.cpp' % GIZMOLOC,
950e7faf 783 '%s/ledctrl.cpp' % GIZMOLOC,
ebf4302c
RD
784 ] + swig_sources,
785
786 include_dirs = gizmos_includes,
787 define_macros = defines,
788
789 library_dirs = libdirs,
790 libraries = libs,
791
792 extra_compile_args = cflags,
793 extra_link_args = lflags,
794 )
795
796 wxpExtensions.append(ext)
797
798
799
4a61305d
RD
800#----------------------------------------------------------------------
801# Define the DLLWIDGET extension module
802#----------------------------------------------------------------------
803
804if not GL_ONLY and BUILD_DLLWIDGET:
805 msg('Preparing DLLWIDGET...')
806 location = 'contrib/dllwidget'
807 swig_files = ['dllwidget_.i']
808
809 swig_sources = run_swig(swig_files, location, '', PKGDIR,
810 USE_SWIG, swig_force, swig_args)
811
812 # copy a contrib project specific py module to the main package dir
813 copy_file(opj(location, 'dllwidget.py'), PKGDIR, update=1, verbose=0)
814
815 ext = Extension('dllwidget_c', [
816 '%s/dllwidget.cpp' % location,
817 ] + swig_sources,
818
819 include_dirs = includes,
820 define_macros = defines,
821
822 library_dirs = libdirs,
823 libraries = libs,
824
825 extra_compile_args = cflags,
826 extra_link_args = lflags,
827 )
828
829 wxpExtensions.append(ext)
830
831
832
926bb76c 833
c368d904
RD
834#----------------------------------------------------------------------
835# Do the Setup/Build/Install/Whatever
836#----------------------------------------------------------------------
837
1b62f00d
RD
838if __name__ == "__main__":
839 if not GL_ONLY:
840 setup(name = PKGDIR,
841 version = VERSION,
842 description = DESCRIPTION,
843 long_description = LONG_DESCRIPTION,
844 author = AUTHOR,
845 author_email = AUTHOR_EMAIL,
846 url = URL,
847 licence = LICENCE,
848
849 packages = [PKGDIR,
850 PKGDIR+'.lib',
851 PKGDIR+'.lib.editor',
edd03296 852 PKGDIR+'.lib.mixins'
1b62f00d
RD
853 ],
854
855 ext_package = PKGDIR,
856 ext_modules = wxpExtensions,
857 )
c368d904 858
1b62f00d 859 else:
c368d904 860
1b62f00d
RD
861 setup(name = "wxPython-gl",
862 version = VERSION,
863 description = "wxGLCanvas class for wxPython",
864 author = AUTHOR,
865 author_email = AUTHOR_EMAIL,
866 url = URL,
867 licence = LICENCE,
c368d904 868
1b62f00d 869 py_modules = [ "wxPython.glcanvas" ],
c368d904 870
1b62f00d
RD
871 ext_package = PKGDIR,
872 ext_modules = wxpExtensions,
873 )
c368d904 874
c368d904
RD
875
876
877
878#----------------------------------------------------------------------
879#----------------------------------------------------------------------