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

File Contents

# User Rev Content
1 schorsch 1.1 import os
2    
3     Import('env')
4    
5     # math libs
6     mlib = env['RAD_MLIB']
7    
8 schorsch 1.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    
12 schorsch 1.1 # common objects
13     viewbeams = env.Object(source='viewbeams.c')
14     holo = env.Object(source='holo.c')
15 schorsch 1.2 holofile = env.Object(source='holofile.c')
16 schorsch 1.5 clumpbeams = env.Object(source='clumpbeams.c')
17 schorsch 1.1
18     # standard targets
19     PROGS = (
20 schorsch 1.2 ('rholo', Split('''rholo.c rholo2.c rholo2l.c rholo3.c rholo4.c''')
21 schorsch 1.8 + [env.version, holofile, holo, viewbeams],
22 schorsch 1.6 ['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtmem','rterror']),
23 schorsch 1.8 ('rhpict', Split('rhpict.c rhpict2.c')+[env.version, holofile, holo, viewbeams],
24 schorsch 1.6 ['rtpic','rtproc','rtargs','rtio','rtmath','rtmem','rterror']),
25 schorsch 1.5 ('rhcopy', Split('rhcopy.c') + [clumpbeams, holofile, holo],
26 schorsch 1.6 ['rtpic','rtproc','rtargs','rtio','rtmath','rtmem','rterror']),
27 schorsch 1.2 ('rhinfo', Split('rhinfo.c') + [holofile, holo],
28     ['rtio','rtproc', 'rtmath','rterror']),
29 schorsch 1.5 ('rhoptimize', Split('rhoptimize.c') + [clumpbeams, holofile, holo],
30     ['rtio','rtproc', 'rtmath','rterror']),
31 schorsch 1.2 ('genrhgrid', Split('genrhgrid.c') + [holofile, holo],
32     ['rtio','rtmath','rtproc','rterror']),
33 schorsch 1.1 )
34     if os.name != 'nt': # pending some major work...
35     for p in PROGS:
36 schorsch 1.8 prog = env.Program(target=radbin(p[0]),
37 schorsch 1.2 source=p[1], LIBS=p[2] + mlib)
38 schorsch 1.1 Default(prog)
39     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])
40    
41     # display drivers
42     if env.has_key('X11INCLUDE'):
43 schorsch 1.7 xenv = env.Clone(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'],
44 schorsch 1.1 LIBPATH=[env['X11LIB']] + env['LIBPATH'],)
45     # common objects
46     rhdisp = xenv.Object(source='rhdisp.c')
47     rhdisp2 = xenv.Object(source='rhdisp2.c')
48     rhd_qtree = env.Object(source='rhd_qtree.c')
49     xcommon = [rhdisp, rhdisp2, holo, viewbeams]
50     # other stuff
51     devdir = os.path.join(xenv['RAD_BUILDBIN'],'dev')
52     idevdir = os.path.join(xenv['RAD_BINDIR'],'dev')
53     ocppflags = xenv.get('CPPFLAGS', [])
54    
55     # XXX the .hdi extension will cause problems on Windows
56     xenv['PROGSUFFIX'] = '.hdi'
57    
58 schorsch 1.7 dlibs = ['rtpic','rtmath','rtcont','rtmem','rtargs','rtio','rterror','rtdummy']
59 schorsch 1.1 def make_hdi(p): # build them
60     obj = xenv.Object(target=p[3], source=p[4], CPPFLAGS=ocppflags + p[5])
61 schorsch 1.8 prog = xenv.Program(target=radbin(p[0]),
62 schorsch 1.1 source=[obj] + p[1] + xcommon, LIBS=p[2])
63     Default(prog)
64     inst = xenv.Install(idevdir, prog)
65     # XXX what are the alternative "<driver>h" names good for?
66 schorsch 1.8 insth = xenv.InstallAs(target=radbin(
67 schorsch 1.1 p[0] + 'h' + xenv['PROGSUFFIX']), source=prog)
68     env.Append(RAD_BININSTALL=[inst, insth])
69    
70     # (name, sources, libs, obj, objsrc, objflags)
71     XHDI = (('x11', Split('rhd_ctab.c rhd_qtree2r.c') + [rhd_qtree],
72 schorsch 1.2 dlibs + ['X11'] + mlib,
73 schorsch 1.1 'rhd_x11', 'rhd_x11.c', []),
74     )
75     for p in XHDI:
76     make_hdi(p)
77    
78     if env.has_key('OGL'):
79 schorsch 1.2 rgllibs = ['rgl','rtscene','rtpath']
80 schorsch 1.1 ogl_common_s = Split('rhd_odraw.c rhd_geom.c')
81     ogl_common = map(lambda s:xenv.Object(source=s), ogl_common_s)
82     rhdobj = xenv.Object(source='rhdobj.c')
83    
84     GLHDI = (
85 schorsch 1.4 # glx1h
86 schorsch 1.1 ('glx1', ['rhd_qtree2c.c', rhd_qtree],
87 schorsch 1.2 dlibs + ['GLU','GL','X11'] + mlib,
88 schorsch 1.1 'rhd_glx1', 'rhd_glx1.c', ['-DNOSTEREO']),
89    
90 schorsch 1.4 # oglh
91 schorsch 1.1 ('ogl', ogl_common,
92 schorsch 1.2 rgllibs+dlibs+['GLU','GL','X11'] + mlib,
93 schorsch 1.1 'rhd_ogl0', 'rhd_ogl.c', ['-DNOSTEREO']),
94    
95 schorsch 1.4 # ogloh
96 schorsch 1.1 ('oglo', [rhdobj] + ogl_common,
97 schorsch 1.2 rgllibs+['rtproc']+dlibs+['GLU','GL','X11'] + mlib,
98 schorsch 1.1 'rhd_oglo', 'rhd_ogl.c', ['-DDOBJ', '-DNOSTEREO']),
99     )
100     for p in GLHDI:
101     make_hdi(p)
102     if xenv['RAD_STEREO'] == '-DSTEREO':
103    
104     GLSHDI = (
105 schorsch 1.4 # oglsh
106 schorsch 1.1 ('ogls', ogl_common,
107 schorsch 1.2 rgllibs+dlibs+['GLU','GL','X11','Xext'] + mlib,
108 schorsch 1.1 'rhd_ogls', 'rhd_ogl.c' ['-DSTEREO']),
109    
110 schorsch 1.4 # oglsoh
111 schorsch 1.1 ('oglso', [rhdobj] + ogl_common,
112 schorsch 1.2 rgllibs+dlibs+['GLU','GL','X11','Xext'] + mlib,
113 schorsch 1.1 'rhd_oglso', 'rhd_ogl.c' ['-DDOBJ', '-DSTEREO']),
114     )
115     for p in GLHDI:
116     make_hdi(p)
117    
118    
119    
120 schorsch 1.8 # vim: set syntax=python: