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