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 radbin(name): return name |
11 |
> |
def radlib(name): return os.path.join('$RAD_BUILDLIB', name) |
12 |
|
|
13 |
|
warp3d = env.Object(source="warp3d.c") |
14 |
|
clrtab = env.Object(source="clrtab.c") |
15 |
|
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") |
16 |
|
|
17 |
|
# standard targets |
18 |
|
PROGS = ( |
23 |
|
['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtcont','rtmem','rterror']), |
24 |
|
('pfilt', Split('pfilt.c pf2.c pf3.c'), |
25 |
|
['rtlamps','rtpic','rtio','rtpath','rtargs','rtmath']), |
26 |
< |
('pcwarp', ['pcwarp.c', warp3d], |
26 |
> |
('pcwarp', ['pcwarp.c', warp3d], |
27 |
|
['rtpic','rtio','rtcont','rtmem','rterror']), |
28 |
|
('pvalue', ['pvalue.c'], ['rtpic','rtio','rtargs','rtmath']), |
29 |
|
('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']), |
37 |
|
('pinterp', ['pinterp.c'], |
38 |
|
['rtproc','rtpic','rtio','rtpath','rtargs','rtmath','rtmem','rterror']), |
39 |
|
|
41 |
– |
('oki20c', ['oki20c.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), |
42 |
– |
('oki20', ['oki20.c'], ['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), |
43 |
– |
|
40 |
|
('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']), |
41 |
|
('ra_ps', ['ra_ps.c'], ['rtpic','rtio','rtargs','rtmem']), |
42 |
|
('ra_ppm', ['ra_ppm.c'], ['rtpic','rtio','rtmem']), |
43 |
< |
('ra_bmp', ['ra_bmp.c'], ['rtpic','rtio','rtmem']), |
43 |
> |
('ra_bmp', ['ra_bmp.c'], ['rtpic','rtproc','rtio','rtmem']), |
44 |
|
('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), |
45 |
|
('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']), |
54 |
– |
('ra_bn', ['ra_bn.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']), |
52 |
|
) |
53 |
|
for p in PROGS: |
54 |
|
prog = env.Program(target=radbin(p[0]), source=p[1], |
55 |
< |
LIBS=p[2]+mlib) |
56 |
< |
Default(prog) |
66 |
< |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) |
55 |
> |
LIBS=p[2]+mlib) |
56 |
> |
progs.append(prog) |
57 |
|
|
58 |
|
|
69 |
– |
# special targets not normally built |
70 |
– |
SPECIAL = ( |
71 |
– |
# name files libs |
72 |
– |
('psum', ['psum.c'], ['rtpic','rtio']), |
73 |
– |
#('panim', ['panim.c'], ['client','rpcsvc']),# missing externals |
74 |
– |
|
75 |
– |
('ra_im', ['ra_im.c'], ['rtproc','rtpath','rtio','rterror']), |
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) |
93 |
– |
|
94 |
– |
|
59 |
|
# tiff library (unix-specific for the moment) |
60 |
|
if os.name == 'posix': |
61 |
|
cwd = os.getcwd() |
62 |
+ |
upperdir = os.path.split(cwd)[0] |
63 |
+ |
|
64 |
|
libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']), |
65 |
< |
'tiff/config.local', |
66 |
< |
[('cd "%s"; ' |
67 |
< |
'sh ./configure -quiet -noninteractive ' |
68 |
< |
'-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; ' |
69 |
< |
'cd libtiff; ' |
70 |
< |
'make install;') % os.path.join(cwd, 'tiff')]) |
65 |
> |
None, |
66 |
> |
[('cd "%(tiffdir)s"; ' |
67 |
> |
'env CC="$CC" ' |
68 |
> |
'./configure -C '#-with-CC="$CC" ' |
69 |
> |
'"libdir=%(upperdir)s/lib" "includedir=%(upperdir)s/common" ' |
70 |
> |
'--enable-static --disable-shared --disable-cxx ' |
71 |
> |
'--enable-logluv --disable-jpeg ' |
72 |
> |
'--disable-zlib --disable-pixarlog; ' |
73 |
> |
#'"-with-ENVOPTS=$CCFLAGS"; ' |
74 |
> |
'cd %(portdir)s; make all;' |
75 |
> |
'cd %(libtiffdir)s; make install;') % { |
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 |
+ |
# libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']), |
84 |
+ |
# 'tiff/config.local', |
85 |
+ |
# [('cd "%s"; ' |
86 |
+ |
# 'sh ./configure -quiet -noninteractive ' |
87 |
+ |
# '-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; ' |
88 |
+ |
# 'cd libtiff; ' |
89 |
+ |
# 'make install;') % os.path.join(cwd, 'tiff')]) |
90 |
+ |
|
91 |
|
# tiff programs |
92 |
|
ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), |
93 |
|
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
94 |
< |
Default(ra_tiff) |
110 |
< |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)]) |
94 |
> |
progs.append(ra_tiff) |
95 |
|
|
96 |
|
normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), |
97 |
|
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
98 |
< |
Default(normtiff) |
115 |
< |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)]) |
98 |
> |
progs.append(normtiff) |
99 |
|
|
100 |
|
|
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)]) |
124 |
– |
|
125 |
– |
|
101 |
|
# X11 targets |
102 |
|
if env.has_key('X11LIB'): |
103 |
< |
xincl = env.get('CPPPATH',[]) + [env['X11INCLUDE']] |
104 |
< |
xlibp = env.get('LIBPATH',[]) + [env['X11LIB']] |
103 |
> |
xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] |
104 |
> |
xlibp = env.get('LIBPATH', []) + ['$X11LIB'] |
105 |
|
xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem'] |
106 |
|
x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice |
107 |
< |
CPPPATH=xincl) |
107 |
> |
CPPPATH=xincl) |
108 |
|
|
109 |
|
ximage = env.Program(target=radbin('ximage'), |
110 |
|
source=Split('x11image.c x11raster.c')+[clrtab], |
111 |
|
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) |
112 |
< |
Default(ximage) |
138 |
< |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)]) |
112 |
> |
progs.append(ximage) |
113 |
|
|
114 |
|
xshowtrace = env.Program(target=radbin('xshowtrace'), |
115 |
|
source=Split('xshowtrace.c') + [x11findwind], |
116 |
|
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) |
117 |
< |
Default(xshowtrace) |
144 |
< |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)]) |
117 |
> |
progs.append(xshowtrace) |
118 |
|
|
146 |
– |
# NeWS ?!? |
147 |
– |
# if env.has_key('OGL'): |
148 |
– |
# glimage = env.Program(target=radbin('glimage'), |
149 |
– |
# CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']], |
150 |
– |
# source=Split('glimage.c'), |
151 |
– |
# LIBS=['gl_s']+env['LIBS'],) |
152 |
– |
# Default(glimage) |
153 |
– |
# env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glimage)]) |
119 |
|
|
120 |
+ |
if os.name == 'posix': # XXX ignoring trad.wsh |
121 |
+ |
for s in Split('''normpat falsecolor pdfblur |
122 |
+ |
pmblur xyzimage phisto pdelta pgblur ra_pfm'''): |
123 |
+ |
Default(env.InstallCsh(radbin(s), s + '.csh')) |
124 |
+ |
# XXX probably needs fixing |
125 |
+ |
#else: |
126 |
+ |
# for s in Split('''falsecolor'''): |
127 |
+ |
# Default(env.InstallCsh(radbin(s), s + '.csh')) |
128 |
+ |
|
129 |
+ |
Default('#src/px') |
130 |
+ |
env.Install('$RAD_BINDIR', progs) |
131 |
|
|