get rid of annoying makeversion.py, install.py
[divverent/netradiant.git] / SConscript
1 import os, sys, commands, string
2 from makeversion import get_version
3 # OS Detection:
4 OS = commands.getoutput('uname')
5
6 Import('GLOBALS')
7 Import(GLOBALS)
8
9 def build_list(s_prefix, s_string):
10   s_list = Split(s_string)
11   for i in range(len(s_list)):
12     s_list[i] = s_prefix + '/' + s_list[i]
13   return s_list
14
15 # common code ------------------------------------------------------
16
17 cmdlib_lib = g_env.StaticLibrary(target='libs/cmdlib', source='libs/cmdlib/cmdlib.cpp')
18
19 xml_env = g_env.Copy()
20 xml_env.Prepend(CPPPATH = 'include')
21 xml_env.Append(CXXFLAGS='`pkg-config glib-2.0 --cflags` `xml2-config --cflags`')
22 xml_src = 'ixml.cpp xmlparser.cpp xmlwriter.cpp xmlelement.cpp xmltextags.cpp'
23 xml_lib = xml_env.StaticLibrary(target='libs/xmllib', source=build_list('libs/xml', xml_src))
24
25 mathlib_src = 'mathlib.c bbox.c line.c m4x4.c ray.c'
26 mathlib_lib = g_env.StaticLibrary(target='libs/mathlib', source=build_list('libs/mathlib', mathlib_src))
27
28 md5lib_lib = g_env.StaticLibrary(target='libs/md5lib', source='libs/md5lib/md5lib.c')
29
30 ddslib_lib = g_env.StaticLibrary(target='libs/ddslib', source='libs/ddslib/ddslib.c')
31
32 jpeg_env = g_env.Copy()
33 jpeg_env.Prepend(CPPPATH = 'libs/jpeg6')
34 jpeg_src = 'jcomapi.cpp jdcoefct.cpp jdinput.cpp jdpostct.cpp jfdctflt.cpp jpgload.cpp jdapimin.cpp jdcolor.cpp jdmainct.cpp jdsample.cpp jidctflt.cpp jutils.cpp jdapistd.cpp jddctmgr.cpp jdmarker.cpp jdtrans.cpp jmemmgr.cpp jdatasrc.cpp jdhuff.cpp jdmaster.cpp jerror.cpp jmemnobs.cpp'
35 jpeg_lib = jpeg_env.StaticLibrary(target='libs/jpeg6', source=build_list('libs/jpeg6', jpeg_src))
36
37 l_net_lib = g_env.StaticLibrary(target='libs/l_net', source=['libs/l_net/l_net.c', 'libs/l_net/l_net_berkley.c'])
38
39 picomodel_src = 'picointernal.c picomodel.c picomodules.c pm_3ds.c pm_ase.c pm_md3.c pm_obj.c\
40   pm_ms3d.c pm_mdc.c pm_fm.c pm_md2.c pm_lwo.c pm_terrain.c lwo/clip.c lwo/envelope.c lwo/list.c lwo/lwio.c\
41   lwo/lwo2.c lwo/lwob.c lwo/pntspols.c lwo/surface.c lwo/vecmath.c lwo/vmap.c'
42 picomodel_lib = g_env.StaticLibrary(target='libs/picomodel', source=build_list('libs/picomodel', picomodel_src))
43
44 #splines_env = g_env.Copy()
45 #splines_src = build_list('libs/splines', 'math_angles.cpp math_matrix.cpp math_quaternion.cpp math_vector.cpp q_parse.cpp q_shared.cpp splines.cpp util_str.cpp')
46 #splines_env['CPPPATH'].append('include')
47 #splines_lib = splines_env.StaticLibrary(target='libs/splines', source=splines_src)
48
49 profile_env = g_env.Copy();
50 profile_env['CPPPATH'].append('include')
51 profile_src = 'profile.cpp file.cpp'
52 profile_lib = profile_env.StaticLibrary(target='libs/profile', source=build_list('libs/profile', profile_src))
53
54 gtkutil_env = g_env.Copy();
55 gtkutil_env['CPPPATH'].append('include')
56 gtkutil_env.useGlib2()
57 gtkutil_env.useGtk2()
58 gtkutil_env.useGtkGLExt()
59
60 gtkutil_src = '\
61   accelerator.cpp\
62   button.cpp\
63   clipboard.cpp\
64   closure.cpp\
65   container.cpp\
66   cursor.cpp\
67   dialog.cpp\
68   entry.cpp\
69   frame.cpp\
70   filechooser.cpp\
71   glfont.cpp\
72   glwidget.cpp\
73   image.cpp\
74   idledraw.cpp\
75   menu.cpp\
76   messagebox.cpp\
77   nonmodal.cpp\
78   paned.cpp\
79   pointer.cpp\
80   toolbar.cpp\
81   widget.cpp\
82   window.cpp\
83   xorrectangle.cpp\
84 '
85
86 gtkutil_lib = gtkutil_env.StaticLibrary(target='libs/gtkutil', source=build_list('libs/gtkutil', gtkutil_src))
87
88 # end static / common libraries ---------------------------------------------------
89
90 # q3map ---------------------------------------------------------------------------
91
92 q3map_env = g_env.Copy()
93 q3map_env['CPPPATH'].append('include')
94 q3map_env.useXML2()
95 q3map_env.useGlib2()
96 q3map_env.usePNG()
97 q3map_env.useMHash()
98 q3map_env.usePThread()
99 q3map_env.Prepend(CPPPATH='tools/quake3/common')
100
101 q3map_common_src = [
102   'common/cmdlib.c',
103   'common/imagelib.c',
104   'common/inout.c',
105   'common/mutex.c',
106   'common/polylib.c',
107   'common/scriplib.c',
108   'common/threads.c',
109   'common/unzip.c',
110   'common/vfs.c' ]
111
112 q3map_src = [
113   'q3map2/brush.c',
114   'q3map2/brush_primit.c',
115   'q3map2/bsp.c',
116   'q3map2/facebsp.c',
117   'q3map2/fog.c',
118   'q3map2/leakfile.c',
119   'q3map2/map.c',
120   'q3map2/model.c',
121   'q3map2/patch.c',
122   'q3map2/portals.c',
123   'q3map2/prtfile.c',
124   'q3map2/surface.c',
125   'q3map2/surface_fur.c',
126   'q3map2/surface_meta.c',
127   'q3map2/tjunction.c',
128   'q3map2/tree.c',
129   'q3map2/writebsp.c',
130   'q3map2/image.c',
131   'q3map2/light.c',
132   'q3map2/light_bounce.c',
133   'q3map2/light_trace.c',
134   'q3map2/light_ydnar.c',
135   'q3map2/lightmaps_ydnar.c',
136   'q3map2/vis.c',
137   'q3map2/visflow.c',
138   'q3map2/bspfile_abstract.c',
139   'q3map2/bspfile_ibsp.c',
140   'q3map2/bspfile_rbsp.c',
141   'q3map2/decals.c',
142   'q3map2/main.c',
143   'q3map2/mesh.c',
144   'q3map2/path_init.c',
145   'q3map2/shaders.c',
146   'q3map2/surface_extra.c',
147   'q3map2/surface_foliage.c',
148   'q3map2/convert_ase.c',
149   'q3map2/convert_map.c' ]
150
151 q3map_full_src = [ ]
152 for i in q3map_common_src + q3map_src:
153   q3map_full_src.append('tools/quake3/' + i)
154
155 q3map_libs = ['mathlib', 'l_net', 'jpeg6', 'picomodel', 'ddslib']
156
157 q3map_prog = q3map_env.Program(target='q3map2.' + g_cpu, source=q3map_full_src, LIBS=q3map_libs, LIBPATH='libs')
158 q3map_env.Depends(q3map_prog, mathlib_lib)
159 q3map_env.Depends(q3map_prog, l_net_lib)
160 q3map_env.Depends(q3map_prog, jpeg_lib)
161 q3map_env.Depends(q3map_prog, picomodel_lib)
162 q3map_env.Depends(q3map_prog, ddslib_lib)
163 q3map_env.Install(INSTALL, q3map_prog)
164
165 # end q3map2 ----------------------------------------------------------------------
166
167 # q3data ---------------------------------------------------------------------------
168
169 q3data_env = q3map_env.Copy()
170
171 q3data_common_src = [
172   'common/aselib.c',
173   'common/bspfile.c',
174   'common/cmdlib.c',
175   'common/imagelib.c',
176   'common/inout.c',
177   'common/md4.c',
178   'common/scriplib.c',
179   'common/trilib.c',
180   'common/unzip.c',
181   'common/vfs.c'
182   ]
183
184 q3data_src = [
185   'q3data/3dslib.c',
186   'q3data/compress.c',
187   'q3data/images.c',
188   'q3data/md3lib.c',
189   'q3data/models.c',
190   'q3data/p3dlib.c',
191   'q3data/polyset.c',
192   'q3data/q3data.c',
193   'q3data/stripper.c',
194   'q3data/video.c' ]
195
196 q3data_full_src = [ ]
197 for i in q3data_common_src + q3data_src:
198   q3data_full_src.append('tools/quake3/' + i)
199
200 q3data_prog = q3data_env.Program( target = 'q3data.' + g_cpu, source = q3data_full_src, LIBS=['mathlib', 'l_net'], LIBPATH='libs' )
201 q3data_env.Depends(q3data_prog, mathlib_lib)
202 q3data_env.Depends(q3data_prog, l_net_lib)
203 q3data_env.Install( INSTALL, q3data_prog )
204
205 # end q3data ----------------------------------------------------------------------
206
207 # q2_tools ---------------------------------------------------------------------------
208
209 q2_tools_env = g_env.Copy()
210 q2_tools_env['CPPPATH'].append('include')
211 q2_tools_env.useXML2()
212 q2_tools_env.usePThread()
213 q2_tools_env.Prepend(CPPPATH='tools/quake2/common')
214
215 q2_tools_common_src = [
216   'common/bspfile.c',
217   'common/cmdlib.c',
218   'common/inout.c',
219   'common/l3dslib.c',
220   'common/lbmlib.c',
221   'common/mathlib.c',
222   'common/md4.c',
223   'common/path_init.c',
224   'common/polylib.c',
225   'common/scriplib.c',
226   'common/threads.c',
227   'common/trilib.c'
228 ]
229
230
231 q2_tools_q2map_src = [
232   'q2map/brushbsp.c',
233   'q2map/csg.c',
234   'q2map/faces.c',
235   'q2map/flow.c',
236   'q2map/glfile.c',
237   'q2map/leakfile.c',
238   'q2map/lightmap.c',
239   'q2map/main.c',
240   'q2map/map.c',
241   'q2map/nodraw.c',
242   'q2map/patches.c',
243   'q2map/portals.c',
244   'q2map/prtfile.c',
245   'q2map/qbsp.c',
246   'q2map/qrad.c',
247   'q2map/qvis.c',
248   'q2map/textures.c',
249   'q2map/trace.c',
250   'q2map/tree.c',
251   'q2map/writebsp.c'
252 ]
253
254 q2_tools_qdata3_common_src = [
255   'common/bspfile.c',
256   'common/cmdlib.c',
257   'common/inout.c',
258   'common/l3dslib.c',
259   'common/lbmlib.c',
260   'common/mathlib.c',
261   'common/md4.c',
262   'common/path_init.c',
263   'common/scriplib.c',
264   'common/threads.c',
265   'common/trilib.c'
266 ]
267
268 q2_tools_qdata3_src = [
269   'qdata/images.c',
270   'qdata/models.c',
271   'qdata/qdata.c',
272   'qdata/sprites.c',
273   'qdata/tables.c',
274   'qdata/video.c'
275 ]
276
277 q2_tools_q2map_full_src = [ ]
278 for i in q2_tools_common_src + q2_tools_q2map_src:
279   q2_tools_q2map_full_src.append('tools/quake2/' + i)
280
281 q2_tools_qdata3_full_src = [ ]
282 for i in q2_tools_common_src + q2_tools_qdata3_src:
283   q2_tools_qdata3_full_src.append('tools/quake2/' + i)
284
285 if ( OS != 'Darwin' ):
286   q2_tools_q2map_prog = q2_tools_env.Program(target='quake2_tools/q2map', source=q2_tools_q2map_full_src, LIBS='l_net', LIBPATH='libs')
287   q2_tools_env.Depends(q2_tools_q2map_prog, l_net_lib)
288   q2_tools_env.Install(INSTALL, q2_tools_q2map_prog )
289
290   q2_tools_qdata3_prog = q2_tools_env.Program(target='quake2_tools/qdata3', source=q2_tools_qdata3_full_src, LIBS='l_net', LIBPATH='libs')
291   q2_tools_env.Depends(q2_tools_qdata3_prog, l_net_lib)
292   q2_tools_env.Install(INSTALL, q2_tools_qdata3_prog )
293
294
295 # end q2_tools ----------------------------------------------------------------------
296
297 # qdata3_heretic2 ---------------------------------------------------------------------------
298
299 heretic2_tools_env = g_env.Copy()
300 heretic2_tools_env['CPPPATH'].append('include')
301 heretic2_tools_env.useXML2()
302 heretic2_tools_env.usePThread()
303 heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2')
304 heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2/qcommon')
305 heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2/common')
306
307 heretic2_tools_qdata3_common_src = [
308   'qdata_heretic2/common/bspfile.c',
309   'qdata_heretic2/common/cmdlib.c',
310   'qdata_heretic2/common/inout.c',
311   'qdata_heretic2/common/l3dslib.c',
312   'qdata_heretic2/common/lbmlib.c',
313   'qdata_heretic2/common/mathlib.c',
314   'qdata_heretic2/common/md4.c',
315   'qdata_heretic2/common/path_init.c',
316   'qdata_heretic2/common/qfiles.c',
317   'qdata_heretic2/common/scriplib.c',
318   'qdata_heretic2/common/threads.c',
319   'qdata_heretic2/common/token.c',
320   'qdata_heretic2/common/trilib.c'
321 ]
322
323 heretic2_tools_qdata3_qcommon_src = [
324   'qdata_heretic2/qcommon/reference.c',
325   'qdata_heretic2/qcommon/resourcemanager.c',
326   'qdata_heretic2/qcommon/skeletons.c'
327 ]
328
329 heretic2_tools_qdata3_src = [
330   'qdata_heretic2/animcomp.c',
331   'qdata_heretic2/book.c',
332   'qdata_heretic2/fmodels.c',
333   'qdata_heretic2/images.c',
334   'qdata_heretic2/jointed.c',
335   'qdata_heretic2/models.c',
336   'qdata_heretic2/pics.c',
337   'qdata_heretic2/qdata.c',
338   'qdata_heretic2/qd_skeletons.c',
339   'qdata_heretic2/sprites.c',
340   'qdata_heretic2/svdcmp.c',
341   'qdata_heretic2/tables.c',
342   'qdata_heretic2/tmix.c',
343   'qdata_heretic2/video.c'
344 ]
345
346 heretic2_tools_qdata3_full_src = [ ]
347 for i in heretic2_tools_qdata3_common_src + heretic2_tools_qdata3_qcommon_src + heretic2_tools_qdata3_src:
348   heretic2_tools_qdata3_full_src.append('tools/quake2/' + i)
349
350
351 heretic2_tools_env['CCFLAGS'] += '-D_LINUX '
352
353 if ( OS != 'Darwin' ):
354   heretic2_tools_prog = heretic2_tools_env.Program(target='h2data', source=heretic2_tools_qdata3_full_src, LIBS='l_net', LIBPATH='libs')
355   heretic2_tools_env.Depends(heretic2_tools_prog, l_net_lib)
356   heretic2_tools_env.Install(INSTALL + '/heretic2', heretic2_tools_prog )
357
358 # end heretic2_tools ----------------------------------------------------------------------
359
360
361
362 # radiant, modules and plugins ----------------------------------------------------
363
364 module_env = g_env.Copy()
365 module_env['CPPPATH'].append('include')
366 if ( OS == 'Darwin' ):
367   module_env['LINKFLAGS'] += '-dynamiclib -ldl '
368 else:
369   module_env['LINKFLAGS'] += '-ldl '
370 module_env['LIBPREFIX'] = ''
371
372
373 vfspk3_env = module_env.Copy()
374 vfspk3_lst = build_list('plugins/vfspk3', 'vfspk3.cpp vfs.cpp archive.cpp')
375 vfspk3_env.useGlib2()
376 vfspk3_lib = vfspk3_env.SharedLibrarySafe(target='vfspk3', source=vfspk3_lst)
377 vfspk3_env.Install(INSTALL + '/modules', vfspk3_lib)
378
379 archivepak_env = module_env.Copy()
380 archivepak_lst = build_list('plugins/archivepak', 'plugin.cpp archive.cpp pak.cpp')
381 archivepak_lib = archivepak_env.SharedLibrarySafe(target='archivepak', source=archivepak_lst, LIBS='cmdlib', LIBPATH='libs')
382 archivepak_env.Depends(archivepak_lib, cmdlib_lib)
383 archivepak_env.Install(INSTALL + '/modules', archivepak_lib)
384
385 archivewad_env = module_env.Copy()
386 archivewad_lst = build_list('plugins/archivewad', 'plugin.cpp archive.cpp wad.cpp')
387 archivewad_lib = archivewad_env.SharedLibrarySafe(target='archivewad', source=archivewad_lst, LIBS='cmdlib', LIBPATH='libs')
388 archivewad_env.Depends(archivewad_lib, cmdlib_lib)
389 archivewad_env.Install(INSTALL + '/modules', archivewad_lib)
390
391 archivezip_env = module_env.Copy()
392 archivezip_lst = build_list('plugins/archivezip', 'plugin.cpp archive.cpp pkzip.cpp zlibstream.cpp')
393 archivezip_env.useZLib()
394 archivezip_lib = archivezip_env.SharedLibrarySafe(target='archivezip', source=archivezip_lst, LIBS='cmdlib', LIBPATH='libs')
395 archivezip_env.Depends(archivezip_lib, cmdlib_lib)
396 archivezip_env.Install(INSTALL + '/modules', archivezip_lib)
397
398 shaders_env = module_env.Copy()
399 shaders_lst = build_list('plugins/shaders', 'shaders.cpp plugin.cpp')
400 shaders_env.useGlib2()
401 shaders_lib = shaders_env.SharedLibrarySafe(target='shaders', source=shaders_lst, LIBS='cmdlib', LIBPATH='libs')
402 shaders_env.Depends(shaders_lib, cmdlib_lib)
403 shaders_env.Install(INSTALL + '/modules', shaders_lib)
404
405 image_env = module_env.Copy()
406 image_lst = build_list('plugins/image', 'bmp.cpp jpeg.cpp image.cpp pcx.cpp tga.cpp dds.cpp')
407 image_lib = image_env.SharedLibrarySafe(target='image', source=image_lst, LIBS=['jpeg6', 'ddslib'], LIBPATH='libs')
408 image_env.Depends(image_lib, jpeg_lib)
409 image_env.Depends(image_lib, ddslib_lib)
410 image_env.Install(INSTALL + '/modules', image_lib)
411
412 imagehl_lst=build_list('plugins/imagehl', 'imagehl.cpp hlw.cpp mip.cpp sprite.cpp')
413 imagehl_lib = module_env.SharedLibrarySafe(target='imagehl', source=imagehl_lst)
414 module_env.Install(INSTALL + '/modules', imagehl_lib)
415
416 imageq2_lst = build_list('plugins/imageq2', 'imageq2.cpp wal.cpp wal32.cpp')
417 imageq2_lib = module_env.SharedLibrarySafe(target='imageq2', source=imageq2_lst)
418 module_env.Install(INSTALL + '/modules', imageq2_lib)
419
420 mapq3_env = module_env.Copy()
421 mapq3_lst=build_list('plugins/mapq3', 'plugin.cpp parse.cpp write.cpp')
422 mapq3_lib = mapq3_env.SharedLibrarySafe(target='mapq3', source=mapq3_lst, LIBS='cmdlib', LIBPATH='libs')
423 mapq3_env.Depends(mapq3_lib, cmdlib_lib)
424 mapq3_env.Install(INSTALL + '/modules', mapq3_lib)
425
426 imagepng_env = module_env.Copy()
427 imagepng_lst = build_list('plugins/imagepng', 'plugin.cpp')
428 imagepng_env.usePNG()
429 imagepng_lib = imagepng_env.SharedLibrarySafe(target='imagepng', source=imagepng_lst)
430 imagepng_env.Install(INSTALL + '/modules', imagepng_lib)
431
432 mapxml_env = module_env.Copy()
433 mapxml_lst = build_list('plugins/mapxml', 'plugin.cpp xmlparse.cpp xmlwrite.cpp')
434 mapxml_lib = mapxml_env.SharedLibrarySafe(target='mapxml', source=mapxml_lst)
435 mapxml_env.useXML2()
436 mapxml_env.useGlib2()
437 mapxml_env.Install(INSTALL + '/modules', mapxml_lib)
438
439 model_env = module_env.Copy()
440 model_lst = build_list('plugins/model', 'plugin.cpp model.cpp')
441 model_lib = model_env.SharedLibrarySafe(target='model', source=model_lst, LIBS=['mathlib', 'picomodel'], LIBPATH='libs')
442 model_env.Depends(model_lib, mathlib_lib)
443 model_env.Depends(model_lib, picomodel_lib)
444 model_env.Install(INSTALL + '/modules', model_lib)
445
446 md3model_lst=build_list('plugins/md3model', 'plugin.cpp mdl.cpp md3.cpp md2.cpp mdc.cpp mdlimage.cpp md5.cpp')
447 md3model_lib = module_env.SharedLibrarySafe(target='md3model', source=md3model_lst)
448 module_env.Install(INSTALL + '/modules', md3model_lib)
449
450 entity_lst = build_list('plugins/entity', 'plugin.cpp entity.cpp eclassmodel.cpp generic.cpp group.cpp light.cpp miscmodel.cpp doom3group.cpp skincache.cpp angle.cpp angles.cpp colour.cpp filters.cpp model.cpp namedentity.cpp origin.cpp scale.cpp targetable.cpp rotation.cpp modelskinkey.cpp')
451 entity_lib = module_env.SharedLibrarySafe(target='entity', source=entity_lst)
452 module_env.Install(INSTALL + '/modules', entity_lib)
453
454 bob_env = module_env.Copy()
455 bob_lst = build_list('contrib/bobtoolz/',
456 'dialogs/dialogs-gtk.cpp bobToolz-GTK.cpp bsploader.cpp cportals.cpp DBobView.cpp \
457 DBrush.cpp DEntity.cpp DEPair.cpp DMap.cpp DPatch.cpp DPlane.cpp DPoint.cpp \
458 DShape.cpp DTrainDrawer.cpp DTreePlanter.cpp DVisDrawer.cpp DWinding.cpp funchandlers-GTK.cpp \
459 lists.cpp misc.cpp ScriptParser.cpp shapes.cpp visfind.cpp')
460 bob_lib = bob_env.SharedLibrarySafe(target='bobtoolz', source=bob_lst, LIBS=['mathlib', 'cmdlib', 'profile'], LIBPATH='libs')
461 bob_env.Depends(bob_lib, mathlib_lib)
462 bob_env.Depends(bob_lib, cmdlib_lib)
463 bob_env.Depends(bob_lib, profile_lib)
464 bob_env.useGlib2()
465 bob_env.useGtk2()
466 bob_env.Install(INSTALL + '/plugins', bob_lib)
467
468 #camera_lst = build_list('contrib/camera',
469 #'camera.cpp dialogs.cpp dialogs_common.cpp funchandlers.cpp listener.cpp misc.cpp renderer.cpp')
470 #camera_lst.append('libs/libsplines.a')
471 #bob_env.SharedLibrarySafe(target='camera', source=camera_lst)
472 #bob_env.Install(INSTALL + '/plugins', 'camera.so')
473
474 prtview_env = module_env.Copy()
475 prtview_lst = build_list('contrib/prtview', 'AboutDialog.cpp ConfigDialog.cpp LoadPortalFileDialog.cpp portals.cpp prtview.cpp')
476 prtview_env.useGlib2()
477 prtview_env.useGtk2()
478 prtview_lib = prtview_env.SharedLibrarySafe(target='prtview', source=prtview_lst, LIBS='profile', LIBPATH='libs')
479 prtview_env.Depends(prtview_lib, profile_lib)
480 prtview_env.Install(INSTALL + '/plugins', prtview_lib)
481
482 brushexport2_env = module_env.Copy()
483 brushexport2_lst = build_list('contrib/brushexport', ['plugin.cpp','interface.cpp','callbacks.cpp', 'support.cpp', 'export.cpp'])
484 brushexport2_env.useGlib2()
485 brushexport2_env.useGtk2()
486 brushexport2_lib = brushexport2_env.SharedLibrarySafe(target='brushexport', source=brushexport2_lst, LIBPATH='libs')
487 brushexport2_env.Install(INSTALL + '/plugins', brushexport2_lib)
488
489 sunplug_env = module_env.Copy()
490 sunplug_lst = build_list('contrib/sunplug', 'sunplug.cpp')
491 sunplug_env.useGlib2()
492 sunplug_env.useGtk2()
493 sunplug_lib = sunplug_env.SharedLibrarySafe(target='sunplug', source=sunplug_lst, LIBPATH='libs')
494 sunplug_env.Install(INSTALL + '/plugins', sunplug_lib)
495
496 ufoai_env = module_env.Copy()
497 ufoai_lst = build_list('contrib/ufoaiplug', 'ufoai.cpp ufoai_filters.cpp ufoai_gtk.cpp ufoai_level.cpp')
498 ufoai_env.useGlib2()
499 ufoai_env.useGtk2()
500 ufoai_lib = ufoai_env.SharedLibrarySafe(target='ufoaiplug', source=ufoai_lst, LIBPATH='libs')
501 ufoai_env.Install(INSTALL + '/plugins', ufoai_lib)
502
503 shaderplug_env = module_env.Copy()
504 shaderplug_lst = build_list('contrib/shaderplug', 'shaderplug.cpp')
505 shaderplug_env.useGlib2()
506 shaderplug_env.useGtk2()
507 shaderplug_env.useXML2()
508 shaderplug_lib = shaderplug_env.SharedLibrarySafe(target='shaderplug', source=shaderplug_lst,  LIBS='xmllib', LIBPATH='libs')
509 shaderplug_env.Install(INSTALL + '/plugins', shaderplug_lib)
510
511 #gensurf_lst = build_list('contrib/gtkgensurf',
512 #'bitmap.cpp dec.cpp face.cpp font.cpp gendlgs.cpp genmap.cpp gensurf.cpp heretic.cpp plugin.cpp view.cpp triangle.c')
513 #bob_env.SharedLibrarySafe(target='gensurf', source=gensurf_lst)
514 #bob_env.Install(INSTALL + '/plugins', 'gensurf.so')
515
516 #bkgrnd2d_list = build_list( 'contrib/bkgrnd2d', 'bkgrnd2d.cpp plugin.cpp dialog.cpp' )
517 #bkgrnd2d_list.append( 'libs/libsynapse.a' )
518 #bkgrnd2d_env = module_env.Copy()
519 #bkgrnd2d_env.useGtk2()
520 #bkgrnd2d_env.SharedLibrarySafe( target='bkgrnd2d', source=bkgrnd2d_list )
521 #bkgrnd2d_env.Install( INSTALL + '/plugins', 'bkgrnd2d.so' )
522
523 radiant_env = g_env.Copy()
524 radiant_env['CPPPATH'].append('include')
525 radiant_env['LINKFLAGS'] += '-ldl -lGL '
526 if ( OS == 'Darwin' ):
527   radiant_env['CXXFLAGS'] += '-fno-common '
528   radiant_env['CCFLAGS'] += '-fno-common '
529   radiant_env['LINKFLAGS'] += '-lX11 -lGL -lGLU '
530 radiant_env['LIBPREFIX'] = ''
531 radiant_env.useGlib2()
532 radiant_env.useXML2()
533 radiant_env.useGtk2()
534 radiant_env.useGtkGLExt()
535
536 radiant_src = [
537 'autosave.cpp',
538 'brush.cpp',
539 'brushmanip.cpp',
540 'brushmodule.cpp',
541 'brushnode.cpp',
542 'brushtokens.cpp',
543 'brushxml.cpp',
544 'brush_primit.cpp',
545 'build.cpp',
546 'camwindow.cpp',
547 'clippertool.cpp',
548 'commands.cpp',
549 'console.cpp',
550 'csg.cpp',
551 'dialog.cpp',
552 'eclass.cpp',
553 'eclass_def.cpp',
554 'eclass_doom3.cpp',
555 'eclass_fgd.cpp',
556 'eclass_xml.cpp',
557 'entity.cpp',
558 'entityinspector.cpp',
559 'entitylist.cpp',
560 'environment.cpp',
561 'error.cpp',
562 'feedback.cpp',
563 'filetypes.cpp',
564 'filters.cpp',
565 'findtexturedialog.cpp',
566 'glwidget.cpp',
567 'grid.cpp',
568 'groupdialog.cpp',
569 'gtkdlgs.cpp',
570 'gtkmisc.cpp',
571 'help.cpp',
572 'image.cpp',
573 'main.cpp',
574 'mainframe.cpp',
575 'map.cpp',
576 'mru.cpp',
577 'nullmodel.cpp',
578 'parse.cpp',
579 'patch.cpp',
580 'patchdialog.cpp',
581 'patchmanip.cpp',
582 'patchmodule.cpp',
583 'plugin.cpp',
584 'pluginapi.cpp',
585 'pluginmanager.cpp',
586 'pluginmenu.cpp',
587 'plugintoolbar.cpp',
588 'points.cpp',
589 'preferencedictionary.cpp',
590 'preferences.cpp',
591 'qe3.cpp',
592 'qgl.cpp',
593 'referencecache.cpp',
594 'renderer.cpp',
595 'renderstate.cpp',
596 'scenegraph.cpp',
597 'stacktrace.cpp',
598 'select.cpp',
599 'selection.cpp',
600 'server.cpp',
601 'shaders.cpp',
602 'sockets.cpp',
603 'surfacedialog.cpp',
604 'texmanip.cpp',
605 'textures.cpp',
606 'texwindow.cpp',
607 'timer.cpp',
608 'treemodel.cpp',
609 'undo.cpp',
610 'url.cpp',
611 'view.cpp',
612 'watchbsp.cpp',
613 'winding.cpp',
614 'windowobservers.cpp',
615 'xmlstuff.cpp',
616 'xywindow.cpp',
617 ]
618
619 for i in range(len(radiant_src)):
620   radiant_src[i] = 'radiant/' + radiant_src[i]
621
622 radiant_libs = ['mathlib', 'cmdlib', 'l_net', 'profile', 'gtkutil', 'xmllib']
623 radiant_prog = radiant_env.Program(target='radiant.' + g_cpu, source=radiant_src, LIBS=radiant_libs, LIBPATH='libs')
624 radiant_env.Depends(radiant_prog, mathlib_lib)
625 radiant_env.Depends(radiant_prog, cmdlib_lib)
626 radiant_env.Depends(radiant_prog, l_net_lib)
627 radiant_env.Depends(radiant_prog, profile_lib)
628 radiant_env.Depends(radiant_prog, gtkutil_lib)
629 radiant_env.Depends(radiant_prog, xml_lib)
630 radiant_env.Install(INSTALL, radiant_prog)
631
632
633 # end setup ---------------------------------------------------------------------------------------