ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/SConscript
Revision: 1.7
Committed: Tue Dec 23 15:04:00 2008 UTC (15 years, 3 months ago) by schorsch
Branch: MAIN
CVS Tags: rad4R2P2, rad5R0, rad4R2, rad4R1, rad4R0, rad4R2P1
Changes since 1.6: +2 -2 lines
Log Message:
SCons now uses installed libtiff, if a compatible one is available. Added platform/README to explain config files.

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