| 1 |
import os |
| 2 |
|
| 3 |
Import('env') # inherit from parent |
| 4 |
|
| 5 |
mlib = env['RAD_MLIB'] |
| 6 |
|
| 7 |
# compose paths |
| 8 |
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 |
|
| 18 |
# standard targets |
| 19 |
PROGS = ( |
| 20 |
# 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_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']), |
| 61 |
) |
| 62 |
for p in PROGS: |
| 63 |
prog = env.Program(target=radbin(p[0]), source=p[1], |
| 64 |
LIBS=p[2]+mlib) |
| 65 |
Default(prog) |
| 66 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) |
| 67 |
|
| 68 |
|
| 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 |
|
| 95 |
# 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 |
|
| 106 |
# tiff programs |
| 107 |
ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), |
| 108 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
| 109 |
Default(ra_tiff) |
| 110 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)]) |
| 111 |
|
| 112 |
normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), |
| 113 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
| 114 |
Default(normtiff) |
| 115 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)]) |
| 116 |
|
| 117 |
|
| 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 |
|
| 126 |
# X11 targets |
| 127 |
if env.has_key('X11LIB'): |
| 128 |
xcppp = env.get('CPPPATH',[]) + [env['X11INCLUDE']] |
| 129 |
xlibp = env.get('LIBPATH',[]) + [env['X11LIB']] |
| 130 |
xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem'] |
| 131 |
x11findwind = env.Object(source='../common/x11findwind.c') # XXX ../ |
| 132 |
|
| 133 |
ximage = env.Program(target=radbin('ximage'), |
| 134 |
source=Split('x11image.c x11raster.c')+[clrtab], |
| 135 |
CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib) |
| 136 |
Default(ximage) |
| 137 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)]) |
| 138 |
|
| 139 |
xshowtrace = env.Program(target=radbin('xshowtrace'), |
| 140 |
source=Split('xshowtrace.c') + [x11findwind], |
| 141 |
CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib) |
| 142 |
Default(xshowtrace) |
| 143 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)]) |
| 144 |
|
| 145 |
# NeWS ?!? |
| 146 |
# if env.has_key('OGL'): |
| 147 |
# glimage = env.Program(target=radbin('glimage'), |
| 148 |
# CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']], |
| 149 |
# source=Split('glimage.c'), |
| 150 |
# LIBS=['gl_s']+env['LIBS'],) |
| 151 |
# Default(glimage) |
| 152 |
# env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glimage)]) |
| 153 |
|
| 154 |
|