ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/SConscript
Revision: 1.20
Committed: Sat Mar 5 13:24:58 2016 UTC (8 years ago) by schorsch
Branch: MAIN
Changes since 1.19: +38 -22 lines
Log Message:
SCons build now fully functional again on linux (SCons 2.3.0, Python 2.7)

File Contents

# Content
1 import os
2
3 Import('env') # inherit from parent
4
5 mlib = ['$RAD_MLIB']
6 progs = []
7
8 # compose paths
9 def radbin(name): return os.path.join('$RAD_BUILDBIN', name)
10 def radlib(name): return os.path.join('$RAD_BUILDLIB', name)
11 def tclscr(name): return os.path.join('$RAD_BUILDRLIB', 'tcl', name)
12
13 cmatrix = env.Object(source='cmatrix.c')
14 cmbsdf = env.Object(source='cmbsdf.c')
15
16 # standard targets
17 PROGS = [
18 ('findglare', Split('findglare.c glareval.c glaresrc.c setscan.c'),
19 ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']),
20 ('glarendx', Split('glarendx.c'), ['rtpic','rtargs','rtio','rtmath']),
21 ('vwright', Split('vwright.c'), ['rtpic','rtargs','rtio','rtmath']),
22 ('vwrays', Split('vwrays.c'), ['rtpic','rtargs','rtio','rtmath']),
23 ('rad', Split('rad.c'),
24 ['rtpic','rtproc','rtpath','rtmath','rtargs','rtio','rtcont','rtmem','rterror']),
25 ('rpiece', Split('rpiece.c') + [env.version], # remote magic
26 ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']),
27 ('ranimate', ['ranimate.c', '$RAD_NETCOMPAT'],
28 ['rtpic','rtargs','rtio','rtproc','rtcont','rtmem','rtpath','rtmath',
29 'rtnet','rterror','$RAD_SOCKETLIB']),
30 ('dctimestep', Split('dctimestep.c')+[cmatrix, cmbsdf], ['rtall']),
31 ('rttree_reduce', Split('rttree_reduce.c'), ['rtall']),
32 ('rcollate', Split('rcollate.c'), ['rtall']),
33 ('eplus_adduvf', Split('eplus_adduvf.c eplus_idf.c'), ['rtall']),
34 ('rfluxmtx', Split('rfluxmtx.c'), ['rtall']),
35 ('rmtxop', Split('rmtxop.c rmatrix.c')+[cmatrix, cmbsdf], ['rtall']),
36 ('wrapBSDF', Split('wrapBSDF.c'), ['rtall']),
37 ('evalglare', Split('evalglare.c pictool.c'), ['rtall', 'reetz']),
38 ]
39
40 for p in PROGS:
41 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
42 progs.append(prog)
43
44 # targets with different includes/libs
45 rs = Split('ranimove.c ranimove1.c ranimove2.c')
46 ranimove = env.Program(target=radbin('ranimove'), source=rs,
47 CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
48 LIBS=['raycalls','rttrace','rtscene','rtpic','rtfunc','rtmath',
49 'rtnet','rtcont','rtmem','rtargs','rtio','rtproc','rtpath','rterror']
50 + mlib)
51 progs.append(ranimove)
52 rsensor = env.Program(target=radbin('rsensor'), source='rsensor.c',
53 CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
54 LIBS=['raycalls','rttrace','rtscene','rtpic','rtfunc','rtmath',
55 'rtcont','rtmem','rtargs','rtio','rtpath','rterror','rtproc',
56 'rtnet','rtlamps'] + mlib)
57 progs.append(rsensor)
58
59 getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
60 LIBS=['rtio'])
61 progs.append(getinfo)
62
63
64 # X11 targets
65 if env.has_key('X11LIB'):
66 xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
67 xlibp = env.get('LIBPATH', []) + ['$X11LIB']
68 xglaresrc = env.Program(target=radbin('xglaresrc'),
69 source=Split('xglaresrc.c') + [env.x11findwind], # XXX remote magic
70 LIBPATH=xlibp, CPPPATH=xincl,
71 LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib)
72 progs.append(xglaresrc)
73
74 # OpenGL targets that also depend on X11
75 if env.has_key('OGL'):
76 glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
77 CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'],
78 LIBPATH=xlibp, CPPPATH=xincl,
79 LIBS=['rgl','rtpic','rtscene','rtproc','rtpath','rtargs','rtio',
80 'rtmath','rtcont','rtmem','rterror','rtdummy',
81 'GL', 'GLU','X11'] + mlib,)
82 progs.append(glrad)
83
84 if os.name == 'posix': # XXX ignoring trad.wsh
85 for s in Split('''objline glare dayfact
86 debugcal rlux raddepend compamb vinfo fieldcomb'''):
87 Default(env.InstallScript(radbin(s), s + '.csh'))
88 for s in Split('''objview objpict
89 genambpos genklemsamp genskyvec genBSDF ltview ltpict'''):
90 Default(env.InstallScript(radbin(s), s + '.pl'))
91 for s in Split('''do_action.tcl do_file.tcl do_options.tcl do_results.tcl
92 do_scene.tcl do_views.tcl do_zone.tcl file.hlp getfile.tcl gethelp.tcl
93 help.hlp tclIndex trad.hlp trad.icon util.tcl'''):
94 Default(env.InstallScript(tclscr(s), s))
95 Default(env.InstallTCLScript(radbin('trad'), 'trad.wsh'))
96
97 # Those don't really work yet
98 #else:
99 # for s in Split('''objview glare rlux '''):
100 # prog = env.Program(target=radbin(s), source=s+'.c')
101 # progs.append(prog)
102
103 Default('#src/util')
104 env.Install('$RAD_BINDIR', progs)
105
106 # vim: set syntax=python: