SConscript 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. import os, sys, commands, string
  2. from makeversion import get_version
  3. # OS Detection:
  4. OS = commands.getoutput('uname')
  5. Import('GLOBALS')
  6. Import(GLOBALS)
  7. def build_list(s_prefix, s_string):
  8. s_list = Split(s_string)
  9. for i in range(len(s_list)):
  10. s_list[i] = s_prefix + '/' + s_list[i]
  11. return s_list
  12. # common code ------------------------------------------------------
  13. cmdlib_lib = g_env.StaticLibrary(target='libs/cmdlib', source='libs/cmdlib/cmdlib.cpp')
  14. mathlib_src = 'mathlib.c bbox.c line.c m4x4.c ray.c'
  15. mathlib_lib = g_env.StaticLibrary(target='libs/mathlib', source=build_list('libs/mathlib', mathlib_src))
  16. md5lib_lib = g_env.StaticLibrary(target='libs/md5lib', source='libs/md5lib/md5lib.c')
  17. ddslib_lib = g_env.StaticLibrary(target='libs/ddslib', source='libs/ddslib/ddslib.c')
  18. jpeg_env = g_env.Copy()
  19. jpeg_env.Prepend(CPPPATH = 'libs/jpeg6')
  20. 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'
  21. jpeg_lib = jpeg_env.StaticLibrary(target='libs/jpeg6', source=build_list('libs/jpeg6', jpeg_src))
  22. l_net_lib = g_env.StaticLibrary(target='libs/l_net', source=['libs/l_net/l_net.c', 'libs/l_net/l_net_berkley.c'])
  23. picomodel_src = 'picointernal.c picomodel.c picomodules.c pm_3ds.c pm_ase.c pm_md3.c pm_obj.c\
  24. 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\
  25. lwo/lwo2.c lwo/lwob.c lwo/pntspols.c lwo/surface.c lwo/vecmath.c lwo/vmap.c'
  26. picomodel_lib = g_env.StaticLibrary(target='libs/picomodel', source=build_list('libs/picomodel', picomodel_src))
  27. #splines_env = g_env.Copy()
  28. #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')
  29. #splines_env['CPPPATH'].append('include')
  30. #splines_lib = splines_env.StaticLibrary(target='libs/splines', source=splines_src)
  31. profile_env = g_env.Copy();
  32. profile_env['CPPPATH'].append('include')
  33. profile_src = 'profile.cpp file.cpp'
  34. profile_lib = profile_env.StaticLibrary(target='libs/profile', source=build_list('libs/profile', profile_src))
  35. gtkutil_env = g_env.Copy();
  36. gtkutil_env['CPPPATH'].append('include')
  37. gtkutil_env.useGlib2()
  38. gtkutil_env.useGtk2()
  39. gtkutil_env.useGtkGLExt()
  40. gtkutil_src = '\
  41. accelerator.cpp\
  42. button.cpp\
  43. clipboard.cpp\
  44. closure.cpp\
  45. container.cpp\
  46. cursor.cpp\
  47. dialog.cpp\
  48. entry.cpp\
  49. frame.cpp\
  50. filechooser.cpp\
  51. glfont.cpp\
  52. glwidget.cpp\
  53. image.cpp\
  54. idledraw.cpp\
  55. menu.cpp\
  56. messagebox.cpp\
  57. nonmodal.cpp\
  58. paned.cpp\
  59. pointer.cpp\
  60. toolbar.cpp\
  61. widget.cpp\
  62. window.cpp\
  63. xorrectangle.cpp\
  64. '
  65. gtkutil_lib = gtkutil_env.StaticLibrary(target='libs/gtkutil', source=build_list('libs/gtkutil', gtkutil_src))
  66. # end static / common libraries ---------------------------------------------------
  67. # q3map ---------------------------------------------------------------------------
  68. q3map_env = g_env.Copy()
  69. q3map_env['CPPPATH'].append('include')
  70. q3map_env.useXML2()
  71. q3map_env.useGlib2()
  72. q3map_env.usePNG()
  73. q3map_env.useMHash()
  74. q3map_env.usePThread()
  75. q3map_env.Prepend(CPPPATH='tools/quake3/common')
  76. q3map_common_src = [
  77. 'common/cmdlib.c',
  78. 'common/imagelib.c',
  79. 'common/inout.c',
  80. 'common/mutex.c',
  81. 'common/polylib.c',
  82. 'common/scriplib.c',
  83. 'common/threads.c',
  84. 'common/unzip.c',
  85. 'common/vfs.c' ]
  86. q3map_src = [
  87. 'q3map2/brush.c',
  88. 'q3map2/brush_primit.c',
  89. 'q3map2/bsp.c',
  90. 'q3map2/facebsp.c',
  91. 'q3map2/fog.c',
  92. 'q3map2/leakfile.c',
  93. 'q3map2/map.c',
  94. 'q3map2/model.c',
  95. 'q3map2/patch.c',
  96. 'q3map2/portals.c',
  97. 'q3map2/prtfile.c',
  98. 'q3map2/surface.c',
  99. 'q3map2/surface_fur.c',
  100. 'q3map2/surface_meta.c',
  101. 'q3map2/tjunction.c',
  102. 'q3map2/tree.c',
  103. 'q3map2/writebsp.c',
  104. 'q3map2/image.c',
  105. 'q3map2/light.c',
  106. 'q3map2/light_bounce.c',
  107. 'q3map2/light_trace.c',
  108. 'q3map2/light_ydnar.c',
  109. 'q3map2/lightmaps_ydnar.c',
  110. 'q3map2/vis.c',
  111. 'q3map2/visflow.c',
  112. 'q3map2/bspfile_abstract.c',
  113. 'q3map2/bspfile_ibsp.c',
  114. 'q3map2/bspfile_rbsp.c',
  115. 'q3map2/decals.c',
  116. 'q3map2/main.c',
  117. 'q3map2/mesh.c',
  118. 'q3map2/path_init.c',
  119. 'q3map2/shaders.c',
  120. 'q3map2/surface_extra.c',
  121. 'q3map2/surface_foliage.c',
  122. 'q3map2/convert_ase.c',
  123. 'q3map2/convert_map.c' ]
  124. q3map_full_src = [ ]
  125. for i in q3map_common_src + q3map_src:
  126. q3map_full_src.append('tools/quake3/' + i)
  127. q3map_libs = ['mathlib', 'l_net', 'jpeg6', 'picomodel', 'ddslib']
  128. q3map_prog = q3map_env.Program(target='q3map2.' + g_cpu, source=q3map_full_src, LIBS=q3map_libs, LIBPATH='libs')
  129. q3map_env.Depends(q3map_prog, mathlib_lib)
  130. q3map_env.Depends(q3map_prog, l_net_lib)
  131. q3map_env.Depends(q3map_prog, jpeg_lib)
  132. q3map_env.Depends(q3map_prog, picomodel_lib)
  133. q3map_env.Depends(q3map_prog, ddslib_lib)
  134. q3map_env.Install(INSTALL, q3map_prog)
  135. # end q3map2 ----------------------------------------------------------------------
  136. # q3data ---------------------------------------------------------------------------
  137. q3data_env = q3map_env.Copy()
  138. q3data_common_src = [
  139. 'common/aselib.c',
  140. 'common/bspfile.c',
  141. 'common/cmdlib.c',
  142. 'common/imagelib.c',
  143. 'common/inout.c',
  144. 'common/md4.c',
  145. 'common/scriplib.c',
  146. 'common/trilib.c',
  147. 'common/unzip.c',
  148. 'common/vfs.c'
  149. ]
  150. q3data_src = [
  151. 'q3data/3dslib.c',
  152. 'q3data/compress.c',
  153. 'q3data/images.c',
  154. 'q3data/md3lib.c',
  155. 'q3data/models.c',
  156. 'q3data/p3dlib.c',
  157. 'q3data/polyset.c',
  158. 'q3data/q3data.c',
  159. 'q3data/stripper.c',
  160. 'q3data/video.c' ]
  161. q3data_full_src = [ ]
  162. for i in q3data_common_src + q3data_src:
  163. q3data_full_src.append('tools/quake3/' + i)
  164. q3data_prog = q3data_env.Program( target = 'q3data.' + g_cpu, source = q3data_full_src, LIBS=['mathlib', 'l_net'], LIBPATH='libs' )
  165. q3data_env.Depends(q3data_prog, mathlib_lib)
  166. q3data_env.Depends(q3data_prog, l_net_lib)
  167. q3data_env.Install( INSTALL, q3data_prog )
  168. # end q3data ----------------------------------------------------------------------
  169. # q2_tools ---------------------------------------------------------------------------
  170. q2_tools_env = g_env.Copy()
  171. q2_tools_env['CPPPATH'].append('include')
  172. q2_tools_env.useXML2()
  173. q2_tools_env.usePThread()
  174. q2_tools_env.Prepend(CPPPATH='tools/quake2/common')
  175. q2_tools_common_src = [
  176. 'common/bspfile.c',
  177. 'common/cmdlib.c',
  178. 'common/inout.c',
  179. 'common/l3dslib.c',
  180. 'common/lbmlib.c',
  181. 'common/mathlib.c',
  182. 'common/md4.c',
  183. 'common/path_init.c',
  184. 'common/polylib.c',
  185. 'common/scriplib.c',
  186. 'common/threads.c',
  187. 'common/trilib.c'
  188. ]
  189. q2_tools_q2map_src = [
  190. 'q2map/brushbsp.c',
  191. 'q2map/csg.c',
  192. 'q2map/faces.c',
  193. 'q2map/flow.c',
  194. 'q2map/glfile.c',
  195. 'q2map/leakfile.c',
  196. 'q2map/lightmap.c',
  197. 'q2map/main.c',
  198. 'q2map/map.c',
  199. 'q2map/nodraw.c',
  200. 'q2map/patches.c',
  201. 'q2map/portals.c',
  202. 'q2map/prtfile.c',
  203. 'q2map/qbsp.c',
  204. 'q2map/qrad.c',
  205. 'q2map/qvis.c',
  206. 'q2map/textures.c',
  207. 'q2map/trace.c',
  208. 'q2map/tree.c',
  209. 'q2map/writebsp.c'
  210. ]
  211. q2_tools_qdata3_common_src = [
  212. 'common/bspfile.c',
  213. 'common/cmdlib.c',
  214. 'common/inout.c',
  215. 'common/l3dslib.c',
  216. 'common/lbmlib.c',
  217. 'common/mathlib.c',
  218. 'common/md4.c',
  219. 'common/path_init.c',
  220. 'common/scriplib.c',
  221. 'common/threads.c',
  222. 'common/trilib.c'
  223. ]
  224. q2_tools_qdata3_src = [
  225. 'qdata/images.c',
  226. 'qdata/models.c',
  227. 'qdata/qdata.c',
  228. 'qdata/sprites.c',
  229. 'qdata/tables.c',
  230. 'qdata/video.c'
  231. ]
  232. q2_tools_q2map_full_src = [ ]
  233. for i in q2_tools_common_src + q2_tools_q2map_src:
  234. q2_tools_q2map_full_src.append('tools/quake2/' + i)
  235. q2_tools_qdata3_full_src = [ ]
  236. for i in q2_tools_common_src + q2_tools_qdata3_src:
  237. q2_tools_qdata3_full_src.append('tools/quake2/' + i)
  238. if ( OS != 'Darwin' ):
  239. q2_tools_q2map_prog = q2_tools_env.Program(target='quake2_tools/q2map', source=q2_tools_q2map_full_src, LIBS='l_net', LIBPATH='libs')
  240. q2_tools_env.Depends(q2_tools_q2map_prog, l_net_lib)
  241. q2_tools_env.Install(INSTALL, q2_tools_q2map_prog )
  242. q2_tools_qdata3_prog = q2_tools_env.Program(target='quake2_tools/qdata3', source=q2_tools_qdata3_full_src, LIBS='l_net', LIBPATH='libs')
  243. q2_tools_env.Depends(q2_tools_qdata3_prog, l_net_lib)
  244. q2_tools_env.Install(INSTALL, q2_tools_qdata3_prog )
  245. # end q2_tools ----------------------------------------------------------------------
  246. # qdata3_heretic2 ---------------------------------------------------------------------------
  247. heretic2_tools_env = g_env.Copy()
  248. heretic2_tools_env['CPPPATH'].append('include')
  249. heretic2_tools_env.useXML2()
  250. heretic2_tools_env.usePThread()
  251. heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2')
  252. heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2/qcommon')
  253. heretic2_tools_env.Prepend(CPPPATH='tools/quake2/qdata_heretic2/common')
  254. heretic2_tools_qdata3_common_src = [
  255. 'qdata_heretic2/common/bspfile.c',
  256. 'qdata_heretic2/common/cmdlib.c',
  257. 'qdata_heretic2/common/inout.c',
  258. 'qdata_heretic2/common/l3dslib.c',
  259. 'qdata_heretic2/common/lbmlib.c',
  260. 'qdata_heretic2/common/mathlib.c',
  261. 'qdata_heretic2/common/md4.c',
  262. 'qdata_heretic2/common/path_init.c',
  263. 'qdata_heretic2/common/qfiles.c',
  264. 'qdata_heretic2/common/scriplib.c',
  265. 'qdata_heretic2/common/threads.c',
  266. 'qdata_heretic2/common/token.c',
  267. 'qdata_heretic2/common/trilib.c'
  268. ]
  269. heretic2_tools_qdata3_qcommon_src = [
  270. 'qdata_heretic2/qcommon/reference.c',
  271. 'qdata_heretic2/qcommon/resourcemanager.c',
  272. 'qdata_heretic2/qcommon/skeletons.c'
  273. ]
  274. heretic2_tools_qdata3_src = [
  275. 'qdata_heretic2/animcomp.c',
  276. 'qdata_heretic2/book.c',
  277. 'qdata_heretic2/fmodels.c',
  278. 'qdata_heretic2/images.c',
  279. 'qdata_heretic2/jointed.c',
  280. 'qdata_heretic2/models.c',
  281. 'qdata_heretic2/pics.c',
  282. 'qdata_heretic2/qdata.c',
  283. 'qdata_heretic2/qd_skeletons.c',
  284. 'qdata_heretic2/sprites.c',
  285. 'qdata_heretic2/svdcmp.c',
  286. 'qdata_heretic2/tables.c',
  287. 'qdata_heretic2/tmix.c',
  288. 'qdata_heretic2/video.c'
  289. ]
  290. heretic2_tools_qdata3_full_src = [ ]
  291. for i in heretic2_tools_qdata3_common_src + heretic2_tools_qdata3_qcommon_src + heretic2_tools_qdata3_src:
  292. heretic2_tools_qdata3_full_src.append('tools/quake2/' + i)
  293. heretic2_tools_env['CCFLAGS'] += '-D_LINUX '
  294. if ( OS != 'Darwin' ):
  295. heretic2_tools_prog = heretic2_tools_env.Program(target='h2data', source=heretic2_tools_qdata3_full_src, LIBS='l_net', LIBPATH='libs')
  296. heretic2_tools_env.Depends(heretic2_tools_prog, l_net_lib)
  297. heretic2_tools_env.Install(INSTALL + '/heretic2', heretic2_tools_prog )
  298. # end heretic2_tools ----------------------------------------------------------------------
  299. # radiant, modules and plugins ----------------------------------------------------
  300. module_env = g_env.Copy()
  301. module_env['CPPPATH'].append('include')
  302. if ( OS == 'Darwin' ):
  303. module_env['LINKFLAGS'] += '-dynamiclib -ldl '
  304. else:
  305. module_env['LINKFLAGS'] += '-ldl '
  306. module_env['LIBPREFIX'] = ''
  307. vfspk3_env = module_env.Copy()
  308. vfspk3_lst = build_list('plugins/vfspk3', 'vfspk3.cpp vfs.cpp archive.cpp')
  309. vfspk3_env.useGlib2()
  310. vfspk3_lib = vfspk3_env.SharedLibrarySafe(target='vfspk3', source=vfspk3_lst)
  311. vfspk3_env.Install(INSTALL + '/modules', vfspk3_lib)
  312. archivepak_env = module_env.Copy()
  313. archivepak_lst = build_list('plugins/archivepak', 'plugin.cpp archive.cpp pak.cpp')
  314. archivepak_lib = archivepak_env.SharedLibrarySafe(target='archivepak', source=archivepak_lst, LIBS='cmdlib', LIBPATH='libs')
  315. archivepak_env.Depends(archivepak_lib, cmdlib_lib)
  316. archivepak_env.Install(INSTALL + '/modules', archivepak_lib)
  317. archivewad_env = module_env.Copy()
  318. archivewad_lst = build_list('plugins/archivewad', 'plugin.cpp archive.cpp wad.cpp')
  319. archivewad_lib = archivewad_env.SharedLibrarySafe(target='archivewad', source=archivewad_lst, LIBS='cmdlib', LIBPATH='libs')
  320. archivewad_env.Depends(archivewad_lib, cmdlib_lib)
  321. archivewad_env.Install(INSTALL + '/modules', archivewad_lib)
  322. archivezip_env = module_env.Copy()
  323. archivezip_lst = build_list('plugins/archivezip', 'plugin.cpp archive.cpp pkzip.cpp zlibstream.cpp')
  324. archivezip_env.useZLib()
  325. archivezip_lib = archivezip_env.SharedLibrarySafe(target='archivezip', source=archivezip_lst, LIBS='cmdlib', LIBPATH='libs')
  326. archivezip_env.Depends(archivezip_lib, cmdlib_lib)
  327. archivezip_env.Install(INSTALL + '/modules', archivezip_lib)
  328. shaders_env = module_env.Copy()
  329. shaders_lst = build_list('plugins/shaders', 'shaders.cpp plugin.cpp')
  330. shaders_env.useGlib2()
  331. shaders_lib = shaders_env.SharedLibrarySafe(target='shaders', source=shaders_lst, LIBS='cmdlib', LIBPATH='libs')
  332. shaders_env.Depends(shaders_lib, cmdlib_lib)
  333. shaders_env.Install(INSTALL + '/modules', shaders_lib)
  334. image_env = module_env.Copy()
  335. image_lst = build_list('plugins/image', 'bmp.cpp jpeg.cpp image.cpp pcx.cpp tga.cpp dds.cpp')
  336. image_lib = image_env.SharedLibrarySafe(target='image', source=image_lst, LIBS=['jpeg6', 'ddslib'], LIBPATH='libs')
  337. image_env.Depends(image_lib, jpeg_lib)
  338. image_env.Depends(image_lib, ddslib_lib)
  339. image_env.Install(INSTALL + '/modules', image_lib)
  340. imagehl_lst=build_list('plugins/imagehl', 'imagehl.cpp hlw.cpp mip.cpp sprite.cpp')
  341. imagehl_lib = module_env.SharedLibrarySafe(target='imagehl', source=imagehl_lst)
  342. module_env.Install(INSTALL + '/modules', imagehl_lib)
  343. imageq2_lst = build_list('plugins/imageq2', 'imageq2.cpp wal.cpp wal32.cpp')
  344. imageq2_lib = module_env.SharedLibrarySafe(target='imageq2', source=imageq2_lst)
  345. module_env.Install(INSTALL + '/modules', imageq2_lib)
  346. mapq3_env = module_env.Copy()
  347. mapq3_lst=build_list('plugins/mapq3', 'plugin.cpp parse.cpp write.cpp')
  348. mapq3_lib = mapq3_env.SharedLibrarySafe(target='mapq3', source=mapq3_lst, LIBS='cmdlib', LIBPATH='libs')
  349. mapq3_env.Depends(mapq3_lib, cmdlib_lib)
  350. mapq3_env.Install(INSTALL + '/modules', mapq3_lib)
  351. imagepng_env = module_env.Copy()
  352. imagepng_lst = build_list('plugins/imagepng', 'plugin.cpp')
  353. imagepng_env.usePNG()
  354. imagepng_lib = imagepng_env.SharedLibrarySafe(target='imagepng', source=imagepng_lst)
  355. imagepng_env.Install(INSTALL + '/modules', imagepng_lib)
  356. mapxml_env = module_env.Copy()
  357. mapxml_lst = build_list('plugins/mapxml', 'plugin.cpp xmlparse.cpp xmlwrite.cpp')
  358. mapxml_lib = mapxml_env.SharedLibrarySafe(target='mapxml', source=mapxml_lst)
  359. mapxml_env.useXML2()
  360. mapxml_env.useGlib2()
  361. mapxml_env.Install(INSTALL + '/modules', mapxml_lib)
  362. model_env = module_env.Copy()
  363. model_lst = build_list('plugins/model', 'plugin.cpp model.cpp')
  364. model_lib = model_env.SharedLibrarySafe(target='model', source=model_lst, LIBS=['mathlib', 'picomodel'], LIBPATH='libs')
  365. model_env.Depends(model_lib, mathlib_lib)
  366. model_env.Depends(model_lib, picomodel_lib)
  367. model_env.Install(INSTALL + '/modules', model_lib)
  368. md3model_lst=build_list('plugins/md3model', 'plugin.cpp mdl.cpp md3.cpp md2.cpp mdc.cpp mdlimage.cpp md5.cpp')
  369. md3model_lib = module_env.SharedLibrarySafe(target='md3model', source=md3model_lst)
  370. module_env.Install(INSTALL + '/modules', md3model_lib)
  371. 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')
  372. entity_lib = module_env.SharedLibrarySafe(target='entity', source=entity_lst)
  373. module_env.Install(INSTALL + '/modules', entity_lib)
  374. #bob_env = module_env.Copy()
  375. #bob_env.useGtk2()
  376. #bob_lst = build_list('contrib/bobtoolz/',
  377. #'dialogs/dialogs-gtk.cpp bobToolz-GTK.cpp bsploader.cpp cportals.cpp DBobView.cpp \
  378. #DBrush.cpp DEntity.cpp DEPair.cpp DListener.cpp DMap.cpp DPatch.cpp DPlane.cpp DPoint.cpp \
  379. #DShape.cpp DTrainDrawer.cpp DTreePlanter.cpp DVisDrawer.cpp DWinding.cpp funchandlers-GTK.cpp \
  380. #lists.cpp misc.cpp ScriptParser.cpp shapes.cpp visfind.cpp')
  381. #bob_lst.append('libs/libmathlib.a')
  382. #bob_lst.append('libs/libcmdlib.a')
  383. #bob_env['CPPPATH'].append('contrib/bobtoolz/dialogs')
  384. #bob_env.SharedLibrarySafe(target='bobtoolz', source=bob_lst)
  385. #bob_env.Install(INSTALL + '/plugins', 'bobtoolz.so')
  386. #camera_lst = build_list('contrib/camera',
  387. #'camera.cpp dialogs.cpp dialogs_common.cpp funchandlers.cpp listener.cpp misc.cpp renderer.cpp')
  388. #camera_lst.append('libs/libsplines.a')
  389. #bob_env.SharedLibrarySafe(target='camera', source=camera_lst)
  390. #bob_env.Install(INSTALL + '/plugins', 'camera.so')
  391. #prtview_lst = build_list('contrib/prtview',
  392. #'AboutDialog.cpp ConfigDialog.cpp LoadPortalFileDialog.cpp portals.cpp prtview.cpp')
  393. #prtview_env = bob_env.Copy()
  394. #prtview_env['CXXFLAGS'] += '-DGTK_PLUGIN '
  395. #prtview_env.SharedLibrarySafe(target='prtview', source=prtview_lst)
  396. #prtview_env.Install(INSTALL + '/plugins', 'prtview.so')
  397. #gensurf_lst = build_list('contrib/gtkgensurf',
  398. #'bitmap.cpp dec.cpp face.cpp font.cpp gendlgs.cpp genmap.cpp gensurf.cpp heretic.cpp plugin.cpp view.cpp triangle.c')
  399. #bob_env.SharedLibrarySafe(target='gensurf', source=gensurf_lst)
  400. #bob_env.Install(INSTALL + '/plugins', 'gensurf.so')
  401. #bkgrnd2d_list = build_list( 'contrib/bkgrnd2d', 'bkgrnd2d.cpp plugin.cpp dialog.cpp' )
  402. #bkgrnd2d_list.append( 'libs/libsynapse.a' )
  403. #bkgrnd2d_env = module_env.Copy()
  404. #bkgrnd2d_env.useGtk2()
  405. #bkgrnd2d_env.SharedLibrarySafe( target='bkgrnd2d', source=bkgrnd2d_list )
  406. #bkgrnd2d_env.Install( INSTALL + '/plugins', 'bkgrnd2d.so' )
  407. radiant_env = g_env.Copy()
  408. radiant_env['CPPPATH'].append('include')
  409. radiant_env['LINKFLAGS'] += '-ldl -lGL '
  410. if ( OS == 'Darwin' ):
  411. radiant_env['CXXFLAGS'] += '-fno-common '
  412. radiant_env['CCFLAGS'] += '-fno-common '
  413. radiant_env['LINKFLAGS'] += '-lX11 -lGL -lGLU '
  414. radiant_env['LIBPREFIX'] = ''
  415. radiant_env.useGlib2()
  416. radiant_env.useXML2()
  417. radiant_env.useGtk2()
  418. radiant_env.useGtkGLExt()
  419. radiant_src = [
  420. 'autosave.cpp',
  421. 'brush.cpp',
  422. 'brushmanip.cpp',
  423. 'brushmodule.cpp',
  424. 'brushnode.cpp',
  425. 'brushtokens.cpp',
  426. 'brushxml.cpp',
  427. 'brush_primit.cpp',
  428. 'build.cpp',
  429. 'camwindow.cpp',
  430. 'clippertool.cpp',
  431. 'commands.cpp',
  432. 'console.cpp',
  433. 'csg.cpp',
  434. 'dialog.cpp',
  435. 'eclass.cpp',
  436. 'eclass_def.cpp',
  437. 'eclass_doom3.cpp',
  438. 'eclass_fgd.cpp',
  439. 'eclass_xml.cpp',
  440. 'entity.cpp',
  441. 'entityinspector.cpp',
  442. 'entitylist.cpp',
  443. 'environment.cpp',
  444. 'error.cpp',
  445. 'feedback.cpp',
  446. 'filetypes.cpp',
  447. 'filters.cpp',
  448. 'findtexturedialog.cpp',
  449. 'glwidget.cpp',
  450. 'grid.cpp',
  451. 'groupdialog.cpp',
  452. 'gtkdlgs.cpp',
  453. 'gtkmisc.cpp',
  454. 'help.cpp',
  455. 'image.cpp',
  456. 'main.cpp',
  457. 'mainframe.cpp',
  458. 'map.cpp',
  459. 'mru.cpp',
  460. 'nullmodel.cpp',
  461. 'parse.cpp',
  462. 'patch.cpp',
  463. 'patchdialog.cpp',
  464. 'patchmanip.cpp',
  465. 'patchmodule.cpp',
  466. 'plugin.cpp',
  467. 'pluginapi.cpp',
  468. 'pluginmanager.cpp',
  469. 'pluginmenu.cpp',
  470. 'plugintoolbar.cpp',
  471. 'points.cpp',
  472. 'preferencedictionary.cpp',
  473. 'preferences.cpp',
  474. 'qe3.cpp',
  475. 'qgl.cpp',
  476. 'referencecache.cpp',
  477. 'renderer.cpp',
  478. 'renderstate.cpp',
  479. 'scenegraph.cpp',
  480. 'select.cpp',
  481. 'selection.cpp',
  482. 'server.cpp',
  483. 'shaders.cpp',
  484. 'surfacedialog.cpp',
  485. 'texmanip.cpp',
  486. 'textures.cpp',
  487. 'texwindow.cpp',
  488. 'timer.cpp',
  489. 'treemodel.cpp',
  490. 'undo.cpp',
  491. 'url.cpp',
  492. 'view.cpp',
  493. 'watchbsp.cpp',
  494. 'winding.cpp',
  495. 'windowobservers.cpp',
  496. 'xmlstuff.cpp',
  497. 'xywindow.cpp',
  498. ]
  499. for i in range(len(radiant_src)):
  500. radiant_src[i] = 'radiant/' + radiant_src[i]
  501. radiant_libs = ['mathlib', 'cmdlib', 'l_net', 'profile', 'gtkutil']
  502. radiant_prog = radiant_env.Program(target='radiant.' + g_cpu, source=radiant_src, LIBS=radiant_libs, LIBPATH='libs')
  503. radiant_env.Depends(radiant_prog, mathlib_lib)
  504. radiant_env.Depends(radiant_prog, cmdlib_lib)
  505. radiant_env.Depends(radiant_prog, l_net_lib)
  506. radiant_env.Depends(radiant_prog, profile_lib)
  507. radiant_env.Depends(radiant_prog, gtkutil_lib)
  508. radiant_env.Install(INSTALL, radiant_prog)
  509. # setup -------------------------------------------------------------------------------------------
  510. class setup_builder:
  511. g_dryrun = 0
  512. def system(self, cmd):
  513. if (self.g_dryrun):
  514. print cmd
  515. else:
  516. sys.stdout.write(cmd)
  517. ret = commands.getstatusoutput(cmd)
  518. print ret[1]
  519. if (ret[0] != 0):
  520. raise 'command failed'
  521. def copy_core(self):
  522. # binaries and misc
  523. self.system('mkdir -p %s/modules' % self.SETUP_BIN_DIR)
  524. self.system('mkdir -p %s/plugins' % self.SETUP_BIN_DIR)
  525. self.system('cp install/%s %s' % (self.EDITOR_BIN, self.SETUP_BIN_DIR))
  526. self.system('cp install/modules/*.so %s/modules' % self.SETUP_BIN_DIR )
  527. # self.system('cp install/plugins/*.so %s/plugins' % self.SETUP_BIN_DIR )
  528. self.system('cp install/q3map2.%s %s' % ( g_cpu, self.SETUP_BIN_DIR ) )
  529. self.M4_STDC = ''
  530. if (not self.g_darwin):
  531. # fugly
  532. # copy libgcc_s and stdc++ over to distribute it and reduce potential ABI fuckups
  533. ret = commands.getstatusoutput('ldd -r install/' + self.EDITOR_BIN + ' 2>/dev/null | grep libgcc_s | sed -e \'s/.* => \\([^ ]*\\) .*/\\1/\'')
  534. if (ret[0] != 0):
  535. raise 'ldd command failed'
  536. self.system('cp ' + ret[1] + ' ' + self.SETUP_BIN_DIR)
  537. ret = commands.getstatusoutput('ldd -r install/' + self.EDITOR_BIN + ' 2>/dev/null | grep libstdc++ | sed -e \'s/.* => \\([^ ]*\\) .*/\\1/\'')
  538. if (ret[0] != 0):
  539. raise 'ldd command failed'
  540. lines = string.split(ret[1], '\n')
  541. self.M4_STDC = '"'
  542. for i in lines:
  543. self.system('cp ' + i + ' ' + self.SETUP_BIN_DIR)
  544. self.M4_STDC += os.path.basename(i) + ' \n'
  545. self.M4_STDC += '"'
  546. # hack for symlink
  547. # setup process generates the wrapper at install time
  548. # but we need a dummy executable for symlink in loki_setup
  549. self.system('echo -n "#!/bin/sh\necho If you read this then there was a bug during setup. Report the bug and try running %s directly from it\'s installation directory.\n" > %s/radiant' % (self.EDITOR_BIN, self.SETUP_BIN_DIR));
  550. self.system('echo -n "#!/bin/sh\necho If you read this then there was a bug during setup. Report the bug and try running %s directly from it\'s installation directory.\n" > %s/q3map2' % (self.EDITOR_BIN, self.SETUP_BIN_DIR));
  551. ## this goes to the core install directory
  552. DEST = self.SETUP_DIR + '/core'
  553. self.system('mkdir -p ' + DEST + '/modules/bitmaps')
  554. # general content stuff
  555. self.system('cp -R plugins/model/bitmaps/* ' + DEST + '/modules/bitmaps')
  556. self.system('cp setup/data/tools/credits.html ' + DEST)
  557. self.system('cp setup/data/tools/links.htm ' + DEST)
  558. self.system('cp setup/data/tools/q3data.qdt ' + DEST)
  559. self.system('cp setup/data/tools/global.xlink ' + DEST)
  560. self.system('cp -R radiant/bitmaps ' + DEST)
  561. self.system('cp setup/changelog.txt ' + DEST)
  562. self.system('cp setup/openurl.sh ' + DEST)
  563. self.system('cp tools/quake3/q3map2/changelog.q3map2.txt ' + DEST)
  564. # documentation
  565. self.system('cp -R docs/manual/Q3Rad_Manual ' + DEST)
  566. self.system('cp -R docs/manual/quake3/Compile_Manual ' + DEST)
  567. self.system('cp -R docs/manual/quake3/Model_Manual ' + DEST)
  568. self.system('cp -R docs/manual/quake3/Terrain_Manual ' + DEST)
  569. # copy plugins media
  570. #self.system('mkdir -p ' + DEST + '/plugins/bitmaps')
  571. #self.system('cp -R contrib/bobtoolz/bitmaps/* ' + DEST + '/plugins/bitmaps')
  572. #self.system('cp -R contrib/bobtoolz/bt ' + DEST + '/plugins')
  573. #self.system('cp -R contrib/camera/bitmaps/* ' + DEST + '/plugins/bitmaps' )
  574. #self.system('cp -R contrib/bkgrnd2d/bitmaps/* ' + DEST + '/plugins/bitmaps' )
  575. # games files
  576. self.system('mkdir -p ' + self.SETUP_DIR + '/games')
  577. def copy_q3(self):
  578. # binaries
  579. self.system('mkdir -p ' + self.SETUP_BIN_DIR + '/q3')
  580. if ( self.g_darwin == 0 ):
  581. self.system('cp setup/linux/bspc ' + self.SETUP_BIN_DIR + '/q3')
  582. # goes in core
  583. DEST = self.SETUP_DIR + '/core/q3.game'
  584. self.system('mkdir -p ' + DEST)
  585. self.system('cp -R games/Q3Pack/tools/q3.game/* ' + DEST)
  586. self.system('cp -R docs/manual/quake3/Team_Arena_Mapping_Help ' + DEST)
  587. self.system('cp -R docs/manual/quake3/New_Teams_For_Q3TA ' + DEST)
  588. self.system('cp -R docs/manual/quake3/Q3AShader_Manual ' + DEST)
  589. # goes in the game install path
  590. DEST = self.SETUP_DIR + '/q3'
  591. self.system('mkdir -p ' + DEST)
  592. self.system('cp -R games/Q3Pack/baseq3 ' + DEST)
  593. self.system('cp -R games/Q3Pack/missionpack ' + DEST)
  594. # game file
  595. self.system('cp -R games/Q3Pack/tools/games/q3.game ' + self.SETUP_DIR + '/games')
  596. def copy_wolf(self):
  597. # binaries
  598. self.system('mkdir -p ' + self.SETUP_BIN_DIR + '/wolf')
  599. if ( self.g_darwin == 0 ):
  600. self.system('cp games/WolfPack/bin/wolf.game/bspc ' + self.SETUP_BIN_DIR + '/wolf')
  601. # goes in core
  602. DEST = self.SETUP_DIR + '/core/wolf.game'
  603. self.system('mkdir -p ' + DEST)
  604. self.system('cp -R games/WolfPack/docs ' + DEST)
  605. self.system('cp -R games/WolfPack/bin/wolf.game/* ' + DEST)
  606. # goes in the game install path
  607. DEST = self.SETUP_DIR + '/wolf/main'
  608. self.system('mkdir -p ' + DEST)
  609. self.system('cp games/WolfPack/astro-skies.pk3 ' + DEST)
  610. self.system('cp games/WolfPack/common-astro-spog.pk3 ' + DEST)
  611. self.system('cp games/WolfPack/lights.pk3 ' + DEST)
  612. self.system('cp -R games/WolfPack/scripts ' + DEST)
  613. self.system('cp -R games/WolfPack/maps ' + DEST)
  614. self.system('cp -R games/WolfPack/models ' + DEST)
  615. # game file
  616. self.system('cp -R games/WolfPack/bin/games/wolf.game ' + self.SETUP_DIR + '/games')
  617. def copy_et(self):
  618. # goes in core
  619. DEST = self.SETUP_DIR + '/core/et.game'
  620. self.system('mkdir -p ' + DEST)
  621. self.system('cp -R games/ETPack/docs ' + DEST)
  622. self.system('cp -R games/ETPack/et.game/* ' + DEST)
  623. # goes in game install path
  624. DEST = self.SETUP_DIR + '/et/etmain'
  625. self.system('mkdir -p ' + DEST)
  626. self.system('cp games/ETPack/astro-skies.pk3 ' + DEST)
  627. self.system('cp games/ETPack/common.pk3 ' + DEST)
  628. self.system('cp games/ETPack/goldrush.pcx ' + DEST)
  629. self.system('cp games/ETPack/lights.pk3 ' + DEST)
  630. self.system('cp games/ETPack/mapmedia.pk3 ' + DEST)
  631. self.system('cp -R games/ETPack/scripts ' + DEST)
  632. self.system('cp -R games/ETPack/maps ' + DEST)
  633. self.system('cp -R games/ETPack/models ' + DEST)
  634. # game file
  635. self.system('cp -R games/ETPack/games/et.game ' + self.SETUP_DIR + '/games')
  636. def copy_doom3(self):
  637. # goes in core
  638. DEST = self.SETUP_DIR + '/core/doom3.game'
  639. self.system('mkdir -p ' + DEST)
  640. self.system('cp -R games/Doom3Pack/tools/doom3.game/* ' + DEST)
  641. # game file
  642. self.system('cp -R games/Doom3Pack/tools/games/doom3.game ' + self.SETUP_DIR + '/games')
  643. def copy_q2(self):
  644. # binaries
  645. self.system('cp -R install/q2 %s' % (self.SETUP_BIN_DIR))
  646. # goes in core
  647. DEST = self.SETUP_DIR + '/core/q2.game'
  648. self.system('mkdir -p ' + DEST + '/modules')
  649. self.system('cp -R games/Q2Pack/q2.game/* ' + DEST)
  650. self.system('cp install/q2/q2map install/q2/qdata3 ' + DEST)
  651. # self.system('cp -R install/q2/modules ' + DEST )
  652. # goes in game install path
  653. DEST = self.SETUP_DIR + '/q2'
  654. self.system('mkdir -p ' + DEST + '/baseq2')
  655. self.system('cp -R games/Q2Pack/baseq2/* ' + DEST + '/baseq2')
  656. # game file
  657. self.system('cp -R games/Q2Pack/games/q2.game ' + self.SETUP_DIR + '/games')
  658. def copy_her2(self):
  659. # binaries
  660. self.system('cp -R install/heretic2 %s' % (self.SETUP_BIN_DIR))
  661. # goes in core
  662. DEST = self.SETUP_DIR + '/core/heretic2.game'
  663. self.system('mkdir -p ' + DEST + '/modules')
  664. self.system('cp -R games/Her2Pack/heretic2.game/* ' + DEST)
  665. self.system('cp install/q2/q2map install/heretic2/qdata3 ' + DEST)
  666. # self.system('cp -R install/heretic2/modules ' + DEST )
  667. # goes in game install path
  668. DEST = self.SETUP_DIR + '/heretic2'
  669. self.system('mkdir -p ' + DEST + '/base')
  670. self.system('cp -R games/Her2Pack/base/* ' + DEST + '/base')
  671. # game file
  672. self.system('cp -R games/Her2Pack/games/heretic2.game ' + self.SETUP_DIR + '/games')
  673. def build_setup(self):
  674. self.system( 'cp -R ' + self.SETUP_IMAGE_OS + '/* ' + self.SETUP_DIR )
  675. self.system( 'cp -fR ' + self.SETUP_IMAGE + '/* ' + self.SETUP_DIR )
  676. self.system('cp setup/license.txt ' + self.SETUP_DIR)
  677. self.system('cp setup/linux/README ' + self.SETUP_DIR)
  678. OS_DEFS=''
  679. if (self.g_darwin):
  680. OS_DEFS='--define=M4_OSX'
  681. M4_LINE = OS_DEFS + ' --define=M4_VER_MAJOR=' + self.major + ' --define=M4_VER_MINOR=' + self.minor + ' --define=M4_VER=' + self.line
  682. M4_LINE += ' --define=M4_GAME_ET=%d' % self.DO_GAME_ET
  683. M4_LINE += ' --define=M4_GAME_DOOM3=%d' % self.DO_GAME_DOOM3
  684. M4_LINE += ' --define=M4_GAME_Q2=%d' % self.DO_GAME_Q2
  685. if ( self.M4_STDC != '' ):
  686. M4_LINE += ' --define=M4_STDC=' + self.M4_STDC
  687. # setup.xml
  688. self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.data/setup.xml.in > ' + self.SETUP_DIR + '/setup.data/setup.xml')
  689. # postinstall.sh
  690. self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.data/postinstall.sh.in > ' + self.SETUP_DIR + '/setup.data/postinstall.sh')
  691. # config.sh
  692. self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.data/config.sh.in > ' + self.SETUP_DIR + '/setup.data/config.sh')
  693. # setup.sh
  694. self.system('m4 ' + M4_LINE + ' ' + self.SETUP_DIR + '/setup.sh.in > ' + self.SETUP_DIR + '/setup.sh')
  695. self.system('chmod +x ' +self.SETUP_DIR + '/setup.sh')
  696. self.system('find ' + self.SETUP_DIR + ' -name .svn | while read i ; do rm -r "$i" ; done')
  697. # pack it up
  698. self.system('setup/linux/makeself/makeself.sh ' + self.SETUP_DIR + ' ' + self.SETUP_TARGET + ' "GtkRadiant ' + self.line + ' setup" ./setup.sh')
  699. if (self.g_darwin):
  700. def build_fink_deb(self):
  701. print "Building installer .deb\n"
  702. self.F_REV = '1'
  703. self.FINKINFO_DIR = '/sw/fink/10.2/unstable/main/finkinfo/games'
  704. self.TARBALL_DIR='radiant-' + self.F_REV + '.' + self.major
  705. self.TARBALL_NAME='radiant-' + self.F_REV + '.' + self.major + '.tar.gz'
  706. self.TARBALL_DEST='/sw/src'
  707. # prepare package description
  708. self.system('mkdir -p ' + self.FINKINFO_DIR)
  709. self.system('m4 ' + M4_LINE + ' --define=M4_SETUP_TARGET=' + self.SETUP_TARGET + ' --define=M4_F_REV=' + self.F_REV + ' ' + 'setup/osx/radiant.info.m4 > ' + self.FINKINFO_DIR + '/radiant-' + self.TARBALL_DIR + '.info')
  710. # build the tarball
  711. self.system('if [ -r /tmp/' + self.TARBALL_DIR + ' ] ; then rm -r ' '/tmp/' + self.TARBALL_DIR + ' ; fi')
  712. self.system('mkdir -p ' '/tmp/' + self.TARBALL_DIR)
  713. self.system('cp ' + self.SETUP_TARGET + ' ' + '/tmp/' + self.TARBALL_DIR)
  714. self.system('cd /tmp ; tar -cvzf ' + self.TARBALL_NAME + ' ' + self.TARBALL_DIR + ' ; cp ' + self.TARBALL_NAME + ' ' + self.TARBALL_DEST + '/')
  715. self.system('/sw/bin/fink rebuild radiant')
  716. build_fink_deb(self)
  717. def spawn_setup(self, env, target, source):
  718. if ( OS == 'Darwin' ):
  719. self.g_darwin = 1
  720. else:
  721. self.g_darwin = 0
  722. (self.line, self.major, self.minor) = get_version()
  723. print 'Setup: GtkRadiant %s' % self.line
  724. if ( self.g_darwin ):
  725. self.SETUP_IMAGE_OS = '../loki_setup/image'
  726. else:
  727. self.SETUP_IMAGE_OS = 'setup/linux/setup_image.Linux'
  728. self.SETUP_IMAGE = 'setup/linux/setup_image'
  729. self.SETUP_DIR = '/tmp/radiant-setup.%d' % os.getpid()
  730. self.EDITOR_BIN='radiant.' + g_cpu
  731. if ( self.g_darwin ):
  732. self.SETUP_BIN_DIR = self.SETUP_DIR + '/bin/Darwin/ppc'
  733. self.SETUP_TARGET = 'osx-radiant-%s.run' % self.line
  734. else:
  735. self.SETUP_BIN_DIR = self.SETUP_DIR + '/bin/Linux/x86'
  736. self.SETUP_TARGET = 'linux-radiant-%s.run' % self.line
  737. # TODO: eval a conf file instead
  738. self.DO_CORE=1
  739. self.DO_GAME_Q3=1
  740. self.DO_GAME_WOLF=1
  741. self.DO_GAME_ET=1
  742. self.DO_GAME_DOOM3=1
  743. self.DO_GAME_Q2=1
  744. self.DO_GAME_HER2=1
  745. if ( self.g_darwin ):
  746. self.DO_GAME_Q2=0
  747. self.DO_GAME_ET=0
  748. self.DO_GAME_HER2=0
  749. # verbose a bit
  750. print 'version: %s major: %s minor: %s\neditor core: %d\nq3: %d\nwolf: %d\net: %d\ndoom3: %d\nq2: %d\nher2: %d' % (self.line, self.major, self.minor, self.DO_CORE, self.DO_GAME_Q3, self.DO_GAME_WOLF, self.DO_GAME_ET, self.DO_GAME_DOOM3, self.DO_GAME_Q2, self.DO_GAME_HER2)
  751. if (self.DO_CORE):
  752. self.copy_core()
  753. if (self.DO_GAME_Q3):
  754. self.copy_q3()
  755. if (self.DO_GAME_WOLF):
  756. self.copy_wolf()
  757. if (self.DO_GAME_ET):
  758. self.copy_et()
  759. if (self.DO_GAME_DOOM3):
  760. self.copy_doom3()
  761. if ( OS != 'Darwin' ):
  762. if (self.DO_GAME_Q2):
  763. self.copy_q2()
  764. if (self.DO_GAME_HER2):
  765. self.copy_her2()
  766. self.build_setup()
  767. return 0
  768. def spawn_setup(env, target, source):
  769. setup = setup_builder()
  770. setup.spawn_setup(env, target, source)
  771. # NOTE: could modify g_env to add the deps auto when calling SharedLibrarySafe ..
  772. if (SETUP == '1'):
  773. g_env.Command('foo', INSTALL + '/radiant.' + g_cpu, [ spawn_setup ] )
  774. depends_list = [
  775. INSTALL + '/modules/archivepak.so',
  776. INSTALL + '/modules/archivewad.so',
  777. INSTALL + '/modules/archivezip.so',
  778. INSTALL + '/modules/entity.so',
  779. # INSTALL + '/modules/fgd.so',
  780. INSTALL + '/modules/imagehl.so',
  781. INSTALL + '/modules/imageq2.so',
  782. INSTALL + '/modules/image.so',
  783. INSTALL + '/modules/imagepng.so',
  784. INSTALL + '/modules/mapq3.so',
  785. INSTALL + '/modules/mapxml.so',
  786. INSTALL + '/modules/model.so',
  787. INSTALL + '/modules/md3model.so',
  788. INSTALL + '/modules/shaders.so',
  789. INSTALL + '/modules/vfspk3.so',
  790. # INSTALL + '/modules/vfswad.so',
  791. # INSTALL + '/plugins/bobtoolz.so',
  792. # INSTALL + '/plugins/camera.so',
  793. # INSTALL + '/plugins/prtview.so',
  794. # INSTALL + '/plugins/gensurf.so',
  795. # INSTALL + '/plugins/bkgrnd2d.so',
  796. INSTALL + '/q3map2.' + g_cpu,
  797. INSTALL + '/radiant.' + g_cpu,
  798. INSTALL + '/q3data.' + g_cpu ]
  799. if ( OS != 'Darwin' ):
  800. depends_list += [
  801. INSTALL + '/q2/q2map',
  802. INSTALL + '/q2/qdata3',
  803. INSTALL + '/heretic2/qdata3',
  804. INSTALL + '/heretic2/q2map' ]
  805. g_env.Depends( 'foo', depends_list )
  806. # end setup ---------------------------------------------------------------------------------------