1 |
import os |
2 |
|
3 |
Import('env') # inherit from parent |
4 |
|
5 |
mlib = ['$RAD_MLIB'] |
6 |
progs = [] |
7 |
|
8 |
# compose paths |
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") |
16 |
|
17 |
# standard targets |
18 |
PROGS = ( |
19 |
# name files libs |
20 |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], |
21 |
['rtpic','rtproc','rtpath','rtio','rtargs','rtcont','rtmem','rterror']), |
22 |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], |
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], |
27 |
['rtpic','rtio','rtcont','rtmem','rterror']), |
28 |
('pvalue', ['pvalue.c'], ['rtpic','rtio','rtargs','rtmath']), |
29 |
('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']), |
30 |
('psign', ['psign.c'], |
31 |
['rtpic','rtscene','rtio','rtpath','rtargs','rtcont','rtmem','rterror']), |
32 |
('protate', ['protate.c'], ['rtpic','rtio']), |
33 |
('pextrem', ['pextrem.c'], ['rtpic','rtio']), |
34 |
('pflip', ['pflip.c'], ['rtpic','rtio']), |
35 |
('pcomb', ['pcomb.c'], |
36 |
['rtpic','rtproc','rtpath','rtio','rtfunc','rtargs','rtmath','rtcont','rtmem']), |
37 |
('pinterp', ['pinterp.c'], |
38 |
['rtproc','rtpic','rtio','rtpath','rtargs','rtmath','rtmem','rterror']), |
39 |
|
40 |
('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['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','rtproc','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 |
|
51 |
('ttyimage', ['ttyimage.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 |
progs.append(prog) |
57 |
|
58 |
|
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 |
None, |
66 |
[('cd "%(tiffdir)s"; ' |
67 |
'env CC="$CC" ' |
68 |
'./configure -C '#-with-CC="$CC" ' |
69 |
'"libdir=%(upperdir)s/lib" ' |
70 |
'--enable-static --disable-shared --disable-cxx ' |
71 |
'--enable-logluv --disable-jpeg ' |
72 |
'--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 |
# 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 |
progs.append(ra_tiff) |
95 |
|
96 |
normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), |
97 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
98 |
progs.append(normtiff) |
99 |
|
100 |
|
101 |
# X11 targets |
102 |
if env.has_key('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) |
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 |
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 |
progs.append(xshowtrace) |
118 |
|
119 |
if os.name == 'posix': # XXX ignoring trad.wsh |
120 |
for s in Split('''normpat falsecolor pdfblur pmblur pmdblur |
121 |
xyzimage phisto pdelta pgblur ra_pfm ran2tiff'''): |
122 |
Default(env.InstallCsh(radbin(s), s + '.csh')) |
123 |
# XXX probably needs fixing |
124 |
#else: |
125 |
# for s in Split('''falsecolor'''): |
126 |
# Default(env.InstallCsh(radbin(s), s + '.csh')) |
127 |
# ignored by Rmakefile: pacuity phisteq psquish pveil vlpic |
128 |
|
129 |
Default('#src/px') |
130 |
env.Install('$RAD_BINDIR', progs) |
131 |
|