ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/SConscript
Revision: 1.3
Committed: Fri Jan 2 23:27:43 2004 UTC (20 years, 3 months ago) by schorsch
Branch: MAIN
Changes since 1.2: +5 -4 lines
Log Message:
Made tifflib compile a bit more robust.

File Contents

# User Rev Content
1 schorsch 1.1 import os
2    
3     Import('env') # inherit from parent
4    
5 schorsch 1.2 mlib = env['RAD_MLIB']
6 schorsch 1.1
7     # compose paths
8 schorsch 1.2 def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name)
9     def radlib(name): return os.path.join(env['RAD_BUILDLIB'], name)
10    
11     warp3d = env.Object(source="warp3d.c")
12     clrtab = env.Object(source="clrtab.c")
13     neuclrtab = env.Object(source="neuclrtab.c")
14     ciq = env.Object(source="ciq.c")
15     cut = env.Object(source="cut.c")
16     closest = env.Object(source="closest.c")
17 schorsch 1.1
18     # standard targets
19     PROGS = (
20 schorsch 1.2 # name files libs
21     ('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d],
22     ['rtpic','rtproc','rtpath','rtio','rtargs','rtcont','rtmem','rterror']),
23     ('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d],
24     ['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtcont','rtmem','rterror']),
25     ('pfilt', Split('pfilt.c pf2.c pf3.c'),
26     ['rtlamps','rtpic','rtio','rtpath','rtargs','rtmath']),
27     ('pcwarp', ['pcwarp.c', warp3d],
28     ['rtpic','rtio','rtcont','rtmem','rterror']),
29     ('pvalue', ['pvalue.c'], ['rtpic','rtio','rtargs','rtmath']),
30     ('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']),
31     ('psign', ['psign.c'],
32     ['rtpic','rtscene','rtio','rtpath','rtargs','rtcont','rtmem','rterror']),
33     ('protate', ['protate.c'], ['rtpic','rtio']),
34     ('pextrem', ['pextrem.c'], ['rtpic','rtio']),
35     ('pflip', ['pflip.c'], ['rtpic','rtio']),
36     ('pcomb', ['pcomb.c'],
37     ['rtpic','rtproc','rtpath','rtio','rtfunc','rtargs','rtmath','rtcont','rtmem']),
38     ('pinterp', ['pinterp.c'],
39     ['rtproc','rtpic','rtio','rtpath','rtargs','rtmath','rtmem','rterror']),
40    
41     ('oki20c', ['oki20c.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
42     ('oki20', ['oki20.c'], ['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
43    
44     ('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']),
45     ('ra_pr', Split('ra_pr.c biq.c')+ [ciq, cut, closest],
46     ['rtpic','rtio','rtmem']),
47     ('ra_pr24', ['ra_pr24.c'], ['rtpic','rtio','rtmem']),
48     ('ra_avs', ['ra_avs.c'], ['rtpic','rtio','rtmem']),
49     ('ra_ps', ['ra_ps.c'], ['rtpic','rtio','rtargs','rtmem']),
50     ('ra_ppm', ['ra_ppm.c'], ['rtpic','rtio','rtmem']),
51     ('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']),
52     ('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']),
53     ('ra_bn', ['ra_bn.c'], ['rtpic','rtio','rtmem']),
54     ('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
55     ('ra_pict', ['ra_pict.c'], ['rtpic','rtio','rtmem']),
56     ('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']),
57     ('ra_xyze', ['ra_xyze.c'], ['rtpic','rtio','rtmem']),
58 schorsch 1.1
59 schorsch 1.2 ('ttyimage', ['ttyimage.c'], ['rtpic','rtio','rtmem']),
60 schorsch 1.1 )
61     for p in PROGS:
62 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1],
63     LIBS=p[2]+mlib)
64 schorsch 1.1 Default(prog)
65 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])
66 schorsch 1.1
67    
68     # special targets not normally built
69     SPECIAL = (
70 schorsch 1.2 # name files libs
71     ('psum', ['psum.c'], ['rtpic','rtio']),
72     #('panim', ['panim.c'], ['client','rpcsvc']),# missing externals
73    
74     ('ra_im', ['ra_im.c'], ['rtproc','rtpath','rtio','rterror']),
75    
76     #('aedimage', Split('aedimage.c')+[ciq, cut, closest],[]),# missing externals
77     ('t4027', ['t4027.c'], ['rtpic']),
78     ('paintjet', ['paintjet.c'], ['rtpic','rtio','rtmem']),
79     ('mt160r', ['mt160r.c'], ['rtpic','rtio','rtmem']),
80     ('greyscale', ['greyscale.c'], ['rtpic']),
81     ('colorscale', ['colorscale.c'], ['rtpic']),
82     ('d48c', ['d48c.c'], ['rtpic']),
83 schorsch 1.1 )
84     specprogs = []
85     specinst = []
86     for p in SPECIAL:
87 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
88 schorsch 1.1 specprogs.append(prog)
89 schorsch 1.2 specinst.append(env.Install(env['RAD_BINDIR'], prog))
90     env.Alias('px_special', specprogs)
91     env.Alias('px_special_install', specinst)
92 schorsch 1.1
93    
94     # tiff library (unix-specific for the moment)
95     if os.name == 'posix':
96     cwd = os.getcwd()
97 schorsch 1.2 libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']),
98 schorsch 1.1 'tiff/config.local',
99 schorsch 1.3 [('cd "%s"; '
100     'sh ./configure -quiet -noninteractive '
101     '-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; '
102     'cd libtiff; '
103     'make install;') % os.path.join(cwd, 'tiff')])
104 schorsch 1.1
105     # tiff programs
106 schorsch 1.2 ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'),
107     LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
108 schorsch 1.1 Default(ra_tiff)
109 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)])
110 schorsch 1.1
111 schorsch 1.2 normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'),
112     LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
113 schorsch 1.1 Default(normtiff)
114 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)])
115 schorsch 1.1
116    
117     # pixar format requires extra lib
118 schorsch 1.2 if env.has_key('PIXAR_LIB'):
119     ra_pixar = env.Program(radbin('ra_pixar'), source=['ra_pixar.c'],
120     LIBS=['rtpic', env['PIXAR_LIB']])
121 schorsch 1.1 Default(ra_pixar)
122 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_pixar)])
123 schorsch 1.1
124    
125     # X11 targets
126 schorsch 1.2 if env.has_key('X11LIB'):
127     xcppp = env.get('CPPPATH',[]) + [env['X11INCLUDE']]
128     xlibp = env.get('LIBPATH',[]) + [env['X11LIB']]
129     xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem']
130    
131     ximage = env.Program(target=radbin('ximage'),
132     source=Split('x11image.c x11raster.c')+[clrtab],
133     CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib)
134 schorsch 1.1 Default(ximage)
135 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)])
136 schorsch 1.1
137 schorsch 1.2 xshowtrace = env.Program(target=radbin('xshowtrace'),
138     source=Split('xshowtrace.c x11findwind.c'),
139     CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib)
140 schorsch 1.1 Default(xshowtrace)
141 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)])
142 schorsch 1.1
143     # NeWS ?!?
144 schorsch 1.2 # if env.has_key('OGL'):
145     # glimage = env.Program(target=radbin('glimage'),
146     # CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']],
147 schorsch 1.1 # source=Split('glimage.c'),
148 schorsch 1.2 # LIBS=['gl_s']+env['LIBS'],)
149 schorsch 1.1 # Default(glimage)
150 schorsch 1.2 # env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glimage)])
151 schorsch 1.1
152