| 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 |
|
clumpbeams = env.Object(source='clumpbeams.c') |
| 13 |
– |
Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice |
| 17 |
|
|
| 15 |
– |
|
| 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, holofile, holo], |
| 26 |
< |
['rtpic','rtio','rtproc','rtargs','rtmath','rtmem','rterror']), |
| 27 |
< |
('rhinfo', Split('rhinfo.c') + [holofile, holo], |
| 26 |
< |
['rtio','rtproc', 'rtmath','rterror']), |
| 27 |
< |
('rhoptimize', Split('rhoptimize.c') + [clumpbeams, holofile, holo], |
| 28 |
< |
['rtio','rtproc', 'rtmath','rterror']), |
| 29 |
< |
('genrhgrid', Split('genrhgrid.c') + [holofile, holo], |
| 30 |
< |
['rtio','rtmath','rtproc','rterror']), |
| 21 |
> |
+ [env.version, holofile, holo, viewbeams], ['rtrad'],0), |
| 22 |
> |
('rhpict', Split('rhpict.c rhpict2.c')+[env.version, holofile, holo, viewbeams], |
| 23 |
> |
['rtrad'],1), |
| 24 |
> |
('rhcopy', Split('rhcopy.c') + [clumpbeams, holofile, holo], ['rtrad'],1), |
| 25 |
> |
('rhinfo', Split('rhinfo.c') + [holofile, holo], ['rtrad'],1), |
| 26 |
> |
('rhoptimize', Split('rhoptimize.c') + [clumpbeams,holofile,holo], ['rtrad'],1), |
| 27 |
> |
('genrhgrid', Split('genrhgrid.c') + [holofile, holo], ['rtrad'],1), |
| 28 |
|
) |
| 29 |
< |
if os.name != 'nt': # pending some major work... |
| 29 |
> |
if 1: |
| 30 |
|
for p in PROGS: |
| 31 |
< |
prog = env.Program(target=os.path.join(env['RAD_BUILDBIN'], p[0]), |
| 31 |
> |
print(p[0]) |
| 32 |
> |
if not p[3] and os.name == 'nt': continue |
| 33 |
> |
prog = env.Program(target=radbin(p[0]), |
| 34 |
|
source=p[1], LIBS=p[2] + mlib) |
| 35 |
|
Default(prog) |
| 36 |
|
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) |
| 37 |
|
|
| 38 |
|
# display drivers |
| 39 |
|
if env.has_key('X11INCLUDE'): |
| 40 |
< |
xenv = env.Copy(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'], |
| 40 |
> |
xenv = env.Clone(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'], |
| 41 |
|
LIBPATH=[env['X11LIB']] + env['LIBPATH'],) |
| 42 |
|
# common objects |
| 43 |
|
rhdisp = xenv.Object(source='rhdisp.c') |
| 52 |
|
# XXX the .hdi extension will cause problems on Windows |
| 53 |
|
xenv['PROGSUFFIX'] = '.hdi' |
| 54 |
|
|
| 55 |
< |
dlibs = ['rtpic','rtio','rtmath','rtcont','rtmem','rtargs','rterror'] |
| 55 |
> |
dlibs = ['rtrad', 'rtdummy'] |
| 56 |
|
def make_hdi(p): # build them |
| 57 |
|
obj = xenv.Object(target=p[3], source=p[4], CPPFLAGS=ocppflags + p[5]) |
| 58 |
< |
prog = xenv.Program(target=os.path.join(devdir, p[0]), |
| 58 |
> |
prog = xenv.Program(target=radbin(p[0]), |
| 59 |
|
source=[obj] + p[1] + xcommon, LIBS=p[2]) |
| 60 |
|
Default(prog) |
| 61 |
|
inst = xenv.Install(idevdir, prog) |
| 62 |
|
# XXX what are the alternative "<driver>h" names good for? |
| 63 |
< |
insth = xenv.InstallAs(target=os.path.join(idevdir, |
| 63 |
> |
insth = xenv.InstallAs(target=radbin( |
| 64 |
|
p[0] + 'h' + xenv['PROGSUFFIX']), source=prog) |
| 65 |
|
env.Append(RAD_BININSTALL=[inst, insth]) |
| 66 |
|
|
| 73 |
|
make_hdi(p) |
| 74 |
|
|
| 75 |
|
if env.has_key('OGL'): |
| 76 |
< |
rgllibs = ['rgl','rtscene','rtpath'] |
| 76 |
> |
rgllibs = ['rgl','rtrad'] |
| 77 |
|
ogl_common_s = Split('rhd_odraw.c rhd_geom.c') |
| 78 |
|
ogl_common = map(lambda s:xenv.Object(source=s), ogl_common_s) |
| 79 |
|
rhdobj = xenv.Object(source='rhdobj.c') |
| 91 |
|
|
| 92 |
|
# ogloh |
| 93 |
|
('oglo', [rhdobj] + ogl_common, |
| 94 |
< |
rgllibs+['rtproc']+dlibs+['GLU','GL','X11'] + mlib, |
| 94 |
> |
rgllibs+['rtrad']+dlibs+['GLU','GL','X11'] + mlib, |
| 95 |
|
'rhd_oglo', 'rhd_ogl.c', ['-DDOBJ', '-DNOSTEREO']), |
| 96 |
|
) |
| 97 |
|
for p in GLHDI: |
| 114 |
|
|
| 115 |
|
|
| 116 |
|
|
| 117 |
+ |
# vim: set syntax=python: |