5 |
|
# math libs |
6 |
|
mlib = env['RAD_MLIB'] |
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 |
+ |
|
12 |
|
# common objects |
13 |
|
viewbeams = env.Object(source='viewbeams.c') |
14 |
|
holo = env.Object(source='holo.c') |
15 |
|
holofile = env.Object(source='holofile.c') |
16 |
< |
Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice |
16 |
> |
clumpbeams = env.Object(source='clumpbeams.c') |
17 |
|
|
14 |
– |
|
18 |
|
# standard targets |
19 |
|
PROGS = ( |
20 |
|
('rholo', Split('''rholo.c rholo2.c rholo2l.c rholo3.c rholo4.c''') |
21 |
< |
+ [Version, holofile, holo, viewbeams], |
22 |
< |
['rtpic','rtio','rtproc','rtpath','rtargs','rtmath','rtmem','rterror']), |
23 |
< |
('rhpict', Split('rhpict.c rhpict2.c')+[Version, holofile, holo, viewbeams], |
24 |
< |
['rtpic','rtio','rtproc','rtargs','rtmath','rtmem','rterror']), |
25 |
< |
('rhcopy', Split('rhcopy.c clumpbeams.c') + [holofile, holo], |
26 |
< |
['rtpic','rtio','rtproc','rtargs','rtmath','rtmem','rterror']), |
21 |
> |
+ [env.version, holofile, holo, viewbeams], |
22 |
> |
['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtmem','rterror']), |
23 |
> |
('rhpict', Split('rhpict.c rhpict2.c')+[env.version, holofile, holo, viewbeams], |
24 |
> |
['rtpic','rtproc','rtargs','rtio','rtmath','rtmem','rterror']), |
25 |
> |
('rhcopy', Split('rhcopy.c') + [clumpbeams, holofile, holo], |
26 |
> |
['rtpic','rtproc','rtargs','rtio','rtmath','rtmem','rterror']), |
27 |
|
('rhinfo', Split('rhinfo.c') + [holofile, holo], |
28 |
|
['rtio','rtproc', 'rtmath','rterror']), |
29 |
< |
#('genrhenv', Split('genrhenv.c') + [holofile, holo], |
30 |
< |
# []), # XXX broken |
29 |
> |
('rhoptimize', Split('rhoptimize.c') + [clumpbeams, holofile, holo], |
30 |
> |
['rtio','rtproc', 'rtmath','rterror']), |
31 |
|
('genrhgrid', Split('genrhgrid.c') + [holofile, holo], |
32 |
|
['rtio','rtmath','rtproc','rterror']), |
33 |
|
) |
34 |
|
if os.name != 'nt': # pending some major work... |
35 |
|
for p in PROGS: |
36 |
< |
prog = env.Program(target=os.path.join(env['RAD_BUILDBIN'], p[0]), |
36 |
> |
prog = env.Program(target=radbin(p[0]), |
37 |
|
source=p[1], LIBS=p[2] + mlib) |
38 |
|
Default(prog) |
39 |
|
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) |
40 |
|
|
41 |
|
# display drivers |
42 |
|
if env.has_key('X11INCLUDE'): |
43 |
< |
xenv = env.Copy(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'], |
43 |
> |
xenv = env.Clone(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'], |
44 |
|
LIBPATH=[env['X11LIB']] + env['LIBPATH'],) |
45 |
|
# common objects |
46 |
|
rhdisp = xenv.Object(source='rhdisp.c') |
55 |
|
# XXX the .hdi extension will cause problems on Windows |
56 |
|
xenv['PROGSUFFIX'] = '.hdi' |
57 |
|
|
58 |
< |
dlibs = ['rtpic','rtio','rtmath','rtcont','rtmem','rtargs','rterror'] |
58 |
> |
dlibs = ['rtpic','rtmath','rtcont','rtmem','rtargs','rtio','rterror','rtdummy'] |
59 |
|
def make_hdi(p): # build them |
60 |
|
obj = xenv.Object(target=p[3], source=p[4], CPPFLAGS=ocppflags + p[5]) |
61 |
< |
prog = xenv.Program(target=os.path.join(devdir, p[0]), |
61 |
> |
prog = xenv.Program(target=radbin(p[0]), |
62 |
|
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 |
< |
insth = xenv.InstallAs(target=os.path.join(idevdir, |
66 |
> |
insth = xenv.InstallAs(target=radbin( |
67 |
|
p[0] + 'h' + xenv['PROGSUFFIX']), source=prog) |
68 |
|
env.Append(RAD_BININSTALL=[inst, insth]) |
69 |
|
|
77 |
|
|
78 |
|
if env.has_key('OGL'): |
79 |
|
rgllibs = ['rgl','rtscene','rtpath'] |
77 |
– |
# XXX There's a BITS(x) macro missing in sm_geom.h |
78 |
– |
#sm_common_s = Split('''sm_samp.c sm_qtree.c sm_stree.c sm_geom.c |
79 |
– |
# sm_list.c sm_del.c sm_ogl.c sm_usets.c sm.c''') |
80 |
– |
#sm_common = map(lambda s:xenv.Object(source=s), sm_common_s) |
80 |
|
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 |
+ |
# glx1h |
86 |
|
('glx1', ['rhd_qtree2c.c', rhd_qtree], |
87 |
|
dlibs + ['GLU','GL','X11'] + mlib, |
88 |
|
'rhd_glx1', 'rhd_glx1.c', ['-DNOSTEREO']), |
89 |
|
|
90 |
< |
#('glx', sm_common, |
91 |
< |
# dlibs + ['GLU','GL','X11'] + mlib, |
92 |
< |
# 'rhd_glx0', 'rhd_glx.c', ['-DNOSTEREO']), |
93 |
< |
|
94 |
< |
#('glxo', [rhdobj] + sm_common, |
95 |
< |
# rgllibs+dlibs+['GLU','GL','X11'] + mlib, |
96 |
< |
# 'rhd_glxo', 'rhd_glx.c', ['-DDOBJ', '-DNOSTEREO']), |
97 |
< |
|
90 |
> |
# oglh |
91 |
|
('ogl', ogl_common, |
92 |
|
rgllibs+dlibs+['GLU','GL','X11'] + mlib, |
93 |
|
'rhd_ogl0', 'rhd_ogl.c', ['-DNOSTEREO']), |
94 |
|
|
95 |
+ |
# ogloh |
96 |
|
('oglo', [rhdobj] + ogl_common, |
97 |
|
rgllibs+['rtproc']+dlibs+['GLU','GL','X11'] + mlib, |
98 |
|
'rhd_oglo', 'rhd_ogl.c', ['-DDOBJ', '-DNOSTEREO']), |
102 |
|
if xenv['RAD_STEREO'] == '-DSTEREO': |
103 |
|
|
104 |
|
GLSHDI = ( |
105 |
< |
#('glxs', sm_common, |
112 |
< |
# dlibs + ['GLU','GL','X11','Xext'] + mlib, |
113 |
< |
# 'rhd_glxs', 'rhd_glx.c' ['-DSTEREO']), |
114 |
< |
|
115 |
< |
#('glxso', [rhdobj] + sm_common, |
116 |
< |
# rgllibs+dlibs+['GLU','GL','X11','Xext'] + mlib, |
117 |
< |
# 'rhd_glxo', 'rhd_glx.c' ['-DDOBJ', '-DSTEREO']), |
118 |
< |
|
105 |
> |
# oglsh |
106 |
|
('ogls', ogl_common, |
107 |
|
rgllibs+dlibs+['GLU','GL','X11','Xext'] + mlib, |
108 |
|
'rhd_ogls', 'rhd_ogl.c' ['-DSTEREO']), |
109 |
|
|
110 |
+ |
# oglsoh |
111 |
|
('oglso', [rhdobj] + ogl_common, |
112 |
|
rgllibs+dlibs+['GLU','GL','X11','Xext'] + mlib, |
113 |
|
'rhd_oglso', 'rhd_ogl.c' ['-DDOBJ', '-DSTEREO']), |
117 |
|
|
118 |
|
|
119 |
|
|
120 |
+ |
# vim: set syntax=python: |