2 |
|
|
3 |
|
Import('env') # inherit from parent |
4 |
|
|
5 |
< |
# make a modified local copy |
6 |
< |
px = env.Copy(LIBS=['rt'] + env['RAD_MLIB']) |
5 |
> |
mlib = ['$RAD_MLIB'] |
6 |
> |
progs = [] |
7 |
|
|
8 |
|
# compose paths |
9 |
< |
def radbin(name): return os.path.join(px['RAD_BUILDBIN'], name) |
10 |
< |
def radlib(name): return os.path.join(px['RAD_BUILDLIB'], name) |
9 |
> |
def radbin(name): return os.path.join('$RAD_BUILDBIN', name) |
10 |
> |
def radlib(name): return os.path.join('$RAD_BUILDLIB', name) |
11 |
|
|
12 |
+ |
warp3d = env.Object(source="warp3d.c") |
13 |
+ |
clrtab = env.Object(source="clrtab.c") |
14 |
+ |
neuclrtab = env.Object(source="neuclrtab.c") |
15 |
+ |
|
16 |
|
# standard targets |
17 |
|
PROGS = ( |
18 |
< |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c warp3d.c')), |
19 |
< |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c warp3d.c')), |
20 |
< |
('pfilt', Split('pfilt.c pf2.c pf3.c')), |
21 |
< |
('pcwarp', Split('pcwarp.c warp3d.c')), |
22 |
< |
('pvalue', Split('pvalue.c')), |
23 |
< |
('pcompos', Split('pcompos.c')), |
24 |
< |
('psign', Split('psign.c')), |
25 |
< |
('protate', Split('protate.c')), |
26 |
< |
('pextrem', Split('pextrem.c')), |
27 |
< |
('pflip', Split('pflip.c')), |
28 |
< |
('pcomb', Split('pcomb.c')), |
29 |
< |
('pinterp', Split('pinterp.c')), |
18 |
> |
# name files libs |
19 |
> |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], |
20 |
> |
['rtpic','rtproc','rtpath','rtargs','rtio','rtcont','rtmem','rterror']), |
21 |
> |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], |
22 |
> |
['rtpic','rtproc','rtpath','rtargs','rtio','rtmath','rtcont','rtmem','rterror']), |
23 |
> |
('pfilt', Split('pfilt.c pf2.c pf3.c'), |
24 |
> |
['rtlamps','rtpic','rtpath','rtargs','rtio','rtmath']), |
25 |
> |
('pcwarp', ['pcwarp.c', warp3d], |
26 |
> |
['rtpic','rtio','rtcont','rtmem','rterror']), |
27 |
> |
('pvalue', ['pvalue.c'], ['rtpic','rtargs','rtio','rtmath']), |
28 |
> |
('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']), |
29 |
> |
('psign', ['psign.c'], |
30 |
> |
['rtpic','rtscene','rtpath','rtargs','rtio','rtcont','rtmem','rterror']), |
31 |
> |
('protate', ['protate.c'], ['rtpic','rtio']), |
32 |
> |
('pextrem', ['pextrem.c'], ['rtpic','rtio']), |
33 |
> |
('pflip', ['pflip.c'], ['rtpic','rtio']), |
34 |
> |
('pcomb', ['pcomb.c'], |
35 |
> |
['rtpic','rtproc','rtpath','rtfunc','rtargs','rtio','rtmath','rtcont','rtmem']), |
36 |
> |
('pinterp', ['pinterp.c'], |
37 |
> |
['rtproc','rtpic','rtpath','rtargs','rtio','rtmath','rtmem','rterror']), |
38 |
|
|
39 |
< |
('oki20c', Split('oki20c.c')), |
40 |
< |
('oki20', Split('oki20.c')), |
39 |
> |
('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), |
40 |
> |
('ra_ps', ['ra_ps.c'], ['rtpic','rtargs','rtio','rtmem']), |
41 |
> |
('ra_ppm', ['ra_ppm.c'], ['rtpic','rtio','rtmem']), |
42 |
> |
('ra_bmp', ['ra_bmp.c'], |
43 |
> |
['rtpic','rtproc','rterror','rtpath','rtio','rtmem']), |
44 |
> |
('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), |
45 |
> |
('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']), |
46 |
> |
('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), |
47 |
> |
('ra_pict', ['ra_pict.c'], ['rtpic','rtio','rtmem']), |
48 |
> |
('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']), |
49 |
> |
('ra_xyze', ['ra_xyze.c'], ['rtpic','rtio','rtmem']), |
50 |
> |
('pmblur2', ['pmblur2.c'], ['rtpic','rtargs','rtio','rtargs','rtmath','rtmem','rtcont','rterror',mlib]), |
51 |
|
|
52 |
< |
('ra_gif', Split('ra_gif.c clrtab.c neuclrtab.c')), |
31 |
< |
('ra_pr', Split('ra_pr.c ciq.c cut.c closest.c biq.c')), |
32 |
< |
('ra_pr24', Split('ra_pr24.c')), |
33 |
< |
('ra_avs', Split('ra_avs.c')), |
34 |
< |
('ra_ps', Split('ra_ps.c')), |
35 |
< |
('ra_ppm', Split('ra_ppm.c')), |
36 |
< |
('ra_t8', Split('ra_t8.c clrtab.c neuclrtab.c')), |
37 |
< |
('ra_t16', Split('ra_t16.c')), |
38 |
< |
('ra_bn', Split('ra_bn.c')), |
39 |
< |
('ra_rgbe', Split('ra_rgbe.c')), |
40 |
< |
('ra_pict', Split('ra_pict.c')), |
41 |
< |
('ra_hexbit', Split('ra_hexbit.c')), |
42 |
< |
('ra_xyze', Split('ra_xyze.c')), |
43 |
< |
|
44 |
< |
('ttyimage', Split('ttyimage.c')), |
52 |
> |
('ttyimage', ['ttyimage.c'], ['rtpic','rtio','rtmem']), |
53 |
|
) |
54 |
|
for p in PROGS: |
55 |
< |
prog = px.Program(target=radbin(p[0]), source=p[1]) |
56 |
< |
Default(prog) |
57 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], prog)]) |
55 |
> |
prog = env.Program(target=radbin(p[0]), source=p[1], |
56 |
> |
LIBS=p[2]+mlib) |
57 |
> |
progs.append(prog) |
58 |
|
|
59 |
|
|
60 |
< |
# special targets not normally built |
61 |
< |
SPECIAL = ( |
62 |
< |
#('psum', Split('psum.c'), ['rt']), # (errors) |
63 |
< |
#('panim', Split('panim.c'), px['LIBS]+['client','rpcsvc']), |
60 |
> |
# tiff library (building it is unix-specific for the moment) |
61 |
> |
# If we haven't found one supporting LogLuv installed, build our own. |
62 |
> |
libtiff_fn = radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']) |
63 |
> |
if os.name == 'posix' and not env.get('TIFFLIB_INSTALLED'): |
64 |
> |
cwd = os.getcwd() |
65 |
> |
upperdir = os.path.split(cwd)[0] |
66 |
> |
libtiff = env.Command(libtiff_fn, None, |
67 |
> |
[('cd "%(tiffdir)s"; ' |
68 |
> |
'env CC="$CC" ' |
69 |
> |
'./configure -C ' |
70 |
> |
'"libdir=%(upperdir)s/lib" ' |
71 |
> |
'--enable-static --disable-shared --disable-cxx ' |
72 |
> |
'--enable-logluv --disable-jpeg --disable-zlib --disable-pixarlog; ' |
73 |
> |
'cd %(portdir)s; make all;' |
74 |
> |
'cd %(libtiffdir)s; make install-exec;' # don't install headers |
75 |
> |
) % { |
76 |
> |
'upperdir':upperdir, |
77 |
> |
'tiffdir':os.path.join(cwd, 'tiff'), |
78 |
> |
'portdir':os.path.join(cwd, 'tiff', 'port'), |
79 |
> |
'libtiffdir':os.path.join(cwd, 'tiff', 'libtiff') |
80 |
> |
} |
81 |
> |
]) |
82 |
|
|
83 |
< |
('ra_im', Split('ra_im.c')), |
83 |
> |
env['TIFFLIB_INSTALLED'] = 1 |
84 |
|
|
85 |
< |
#('aedimage', Split('aedimage.c ciq.c cut.c closest.c'), []), # (errors) |
86 |
< |
('t4027', Split('t4027.c'), ['rt']), |
61 |
< |
('paintjet', Split('paintjet.c')), |
62 |
< |
('mt160r', Split('mt160r.c')), |
63 |
< |
('greyscale', Split('greyscale.c')), |
64 |
< |
('colorscale', Split('colorscale.c')), |
65 |
< |
('d48c', Split('d48c.c'), ['rt']), # (warnings) |
66 |
< |
) |
67 |
< |
specprogs = [] |
68 |
< |
specinst = [] |
69 |
< |
for p in SPECIAL: |
70 |
< |
if len(p) > 2: |
71 |
< |
prog = px.Program(target=radbin(p[0]), source=p[1], |
72 |
< |
LIBS=p[2]) |
73 |
< |
else: |
74 |
< |
prog = px.Program(target=radbin(p[0]), source=p[1]) |
75 |
< |
specprogs.append(prog) |
76 |
< |
specinst.append(px.Install(px['RAD_BINDIR'], prog)) |
77 |
< |
px.Alias('px_special', specprogs) |
78 |
< |
px.Alias('px_special_install', specinst) |
85 |
> |
if os.name == 'posix': # cleanup action for a previously built tifflib |
86 |
> |
Clean(libtiff_fn, [libtiff_fn, radlib(env['LIBPREFIX'] + 'tiff.la')]) |
87 |
|
|
88 |
< |
|
89 |
< |
# tiff library (unix-specific for the moment) |
82 |
< |
if os.name == 'posix': |
83 |
< |
cwd = os.getcwd() |
84 |
< |
libtiff = px.Command(radlib(px['LIBPREFIX'] + 'tiff' + px['LIBSUFFIX']), |
85 |
< |
'tiff/config.local', |
86 |
< |
['cd "%s";' |
87 |
< |
'sh ./configure -quiet -noninteractive -with-CC=$CC -with-ENVOPTS=$CCFLAGS;' |
88 |
< |
'cd libtiff;' |
89 |
< |
'make install;' % os.path.join(cwd, 'tiff')]) |
90 |
< |
|
88 |
> |
if env.get('TIFFLIB_INSTALLED'): |
89 |
> |
libtiff = env.get('RAD_LIBTIFF') |
90 |
|
# tiff programs |
91 |
< |
ra_tiff = px.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), |
92 |
< |
LIBS=['tiff'] + px['LIBS']) |
93 |
< |
Default(ra_tiff) |
94 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_tiff)]) |
91 |
> |
tiffi = env.get('RAD_TIFFINCLUDE') |
92 |
> |
if tiffi: tiffincl = [tiffi] + env.get('CPPPATH', []) |
93 |
> |
else: tiffincl = env.get('CPPPATH', []) |
94 |
> |
tiffl = env.get('RAD_TIFFLIB') |
95 |
> |
if tiffl: tifflib = [tiffl] + env.get('LIBPATH', []) |
96 |
> |
else: tifflib = env.get('LIBPATH', []) |
97 |
|
|
98 |
< |
normtiff = px.Program(target=radbin('normtiff'), source=Split('normtiff.c'), |
99 |
< |
LIBS=['tiff'] + px['LIBS']) |
100 |
< |
Default(normtiff) |
101 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], normtiff)]) |
98 |
> |
ra_tiff = env.Program(target=radbin('ra_tiff'), source=['ra_tiff.c'], |
99 |
> |
CPPPATH = tiffincl, LIBPATH=tifflib, |
100 |
> |
LIBS=[libtiff,'rtpic','rtio','rtmem'] + mlib) |
101 |
> |
progs.append(ra_tiff) |
102 |
|
|
103 |
+ |
normtiff = env.Program(target=radbin('normtiff'),source=['normtiff.c'], |
104 |
+ |
CPPPATH = tiffincl, LIBPATH=tifflib, |
105 |
+ |
LIBS=[libtiff,'rtpic','rtio','rtmem', 'rtproc', 'rtpath', 'rterror'] + mlib) |
106 |
+ |
progs.append(normtiff) |
107 |
|
|
103 |
– |
# pixar format requires extra lib |
104 |
– |
if px.has_key('PIXAR_LIB'): |
105 |
– |
ra_pixar = px.Program(radbin('ra_pixar'), source=['ra_pixar.c'], |
106 |
– |
LIBS=['rt', px['PIXAR_LIB']]) |
107 |
– |
Default(ra_pixar) |
108 |
– |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_pixar)]) |
108 |
|
|
110 |
– |
|
109 |
|
# X11 targets |
110 |
< |
if px.has_key('X11LIB'): |
111 |
< |
px.Append(CPPPATH=px['X11INCLUDE']) |
112 |
< |
px.Append(LIBS=['X11']) |
113 |
< |
px.Append(LIBPATH=px['X11LIB']) |
110 |
> |
if env.has_key('X11LIB'): |
111 |
> |
xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] |
112 |
> |
xlibp = env.get('LIBPATH', []) + ['$X11LIB'] |
113 |
> |
xlibs = ['X11','rtpic','rtargs','rtio','rtmath','rtmem'] |
114 |
> |
env.x11findwind = env.Object(source='../common/x11findwind.c', # XXX remote magic |
115 |
> |
CPPPATH=xincl) |
116 |
|
|
117 |
< |
ximage = px.Program(target=radbin('ximage'), |
118 |
< |
source=Split('x11image.c x11raster.c clrtab.c'),) |
119 |
< |
Default(ximage) |
120 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ximage)]) |
117 |
> |
ximage = env.Program(target=radbin('ximage'), |
118 |
> |
source=Split('x11image.c x11raster.c')+[clrtab], |
119 |
> |
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) |
120 |
> |
progs.append(ximage) |
121 |
|
|
122 |
< |
xshowtrace = px.Program(target=radbin('xshowtrace'), |
123 |
< |
source=Split('xshowtrace.c x11findwind.c'),) |
124 |
< |
Default(xshowtrace) |
125 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], xshowtrace)]) |
122 |
> |
xshowtrace = env.Program(target=radbin('xshowtrace'), |
123 |
> |
source=Split('xshowtrace.c') + [env.x11findwind], # XXX remote magic |
124 |
> |
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) |
125 |
> |
progs.append(xshowtrace) |
126 |
|
|
127 |
< |
# NeWS ?!? |
128 |
< |
# if px.has_key('OGL'): |
129 |
< |
# glimage = px.Program(target=radbin('glimage'), |
130 |
< |
# CPPFLAGS=px.get('CPPFLAGS', []) + [px['RAD_STEREO']], |
131 |
< |
# source=Split('glimage.c'), |
132 |
< |
# LIBS=['gl_s']+px['LIBS'],) |
133 |
< |
# Default(glimage) |
134 |
< |
# env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], glimage)]) |
127 |
> |
if os.name == 'posix': # XXX ignoring trad.wsh |
128 |
> |
for s in Split('''normpat pdfblur pmblur pmdblur |
129 |
> |
xyzimage phisto pdelta pgblur ra_pfm ran2tiff pbilat'''): |
130 |
> |
Default(env.InstallScript(radbin(s), s + '.csh')) |
131 |
> |
for s in Split('''falsecolor'''): |
132 |
> |
Default(env.InstallScript(radbin(s), s + '.pl')) |
133 |
> |
# XXX probably needs fixing |
134 |
> |
#else: |
135 |
> |
# for s in Split('''falsecolor'''): |
136 |
> |
# Default(env.InstallScript(radbin(s), s + '.pl')) |
137 |
> |
# ignored by Rmakefile: pacuity phisteq psquish pveil vlpic |
138 |
|
|
139 |
+ |
Default('#src/px') |
140 |
+ |
env.Install('$RAD_BINDIR', progs) |
141 |
|
|
142 |
+ |
# vim: set syntax=python: |