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