ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/SConscript
Revision: 1.4
Committed: Mon Nov 8 19:24:46 2004 UTC (19 years, 5 months ago) by schorsch
Branch: MAIN
CVS Tags: rad3R7P2, rad3R7P1
Changes since 1.3: +5 -22 lines
Log Message:
Removed more obsolete stuff, added pcwarp again.

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