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