| 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_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']),
|
| 52 |
('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']),
|
| 53 |
('ra_bn', ['ra_bn.c'], ['rtpic','rtio','rtmem']),
|
| 54 |
('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
|
| 55 |
('ra_pict', ['ra_pict.c'], ['rtpic','rtio','rtmem']),
|
| 56 |
('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']),
|
| 57 |
('ra_xyze', ['ra_xyze.c'], ['rtpic','rtio','rtmem']),
|
| 58 |
|
| 59 |
('ttyimage', ['ttyimage.c'], ['rtpic','rtio','rtmem']),
|
| 60 |
)
|
| 61 |
for p in PROGS:
|
| 62 |
prog = env.Program(target=radbin(p[0]), source=p[1],
|
| 63 |
LIBS=p[2]+mlib)
|
| 64 |
Default(prog)
|
| 65 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])
|
| 66 |
|
| 67 |
|
| 68 |
# special targets not normally built
|
| 69 |
SPECIAL = (
|
| 70 |
# name files libs
|
| 71 |
('psum', ['psum.c'], ['rtpic','rtio']),
|
| 72 |
#('panim', ['panim.c'], ['client','rpcsvc']),# missing externals
|
| 73 |
|
| 74 |
('ra_im', ['ra_im.c'], ['rtproc','rtpath','rtio','rterror']),
|
| 75 |
|
| 76 |
#('aedimage', Split('aedimage.c')+[ciq, cut, closest],[]),# missing externals
|
| 77 |
('t4027', ['t4027.c'], ['rtpic']),
|
| 78 |
('paintjet', ['paintjet.c'], ['rtpic','rtio','rtmem']),
|
| 79 |
('mt160r', ['mt160r.c'], ['rtpic','rtio','rtmem']),
|
| 80 |
('greyscale', ['greyscale.c'], ['rtpic']),
|
| 81 |
('colorscale', ['colorscale.c'], ['rtpic']),
|
| 82 |
('d48c', ['d48c.c'], ['rtpic']),
|
| 83 |
)
|
| 84 |
specprogs = []
|
| 85 |
specinst = []
|
| 86 |
for p in SPECIAL:
|
| 87 |
prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
|
| 88 |
specprogs.append(prog)
|
| 89 |
specinst.append(env.Install(env['RAD_BINDIR'], prog))
|
| 90 |
env.Alias('px_special', specprogs)
|
| 91 |
env.Alias('px_special_install', specinst)
|
| 92 |
|
| 93 |
|
| 94 |
# tiff library (unix-specific for the moment)
|
| 95 |
if os.name == 'posix':
|
| 96 |
cwd = os.getcwd()
|
| 97 |
libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']),
|
| 98 |
'tiff/config.local',
|
| 99 |
[('cd "%s"; '
|
| 100 |
'sh ./configure -quiet -noninteractive '
|
| 101 |
'-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; '
|
| 102 |
'cd libtiff; '
|
| 103 |
'make install;') % os.path.join(cwd, 'tiff')])
|
| 104 |
|
| 105 |
# tiff programs
|
| 106 |
ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'),
|
| 107 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
|
| 108 |
Default(ra_tiff)
|
| 109 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)])
|
| 110 |
|
| 111 |
normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'),
|
| 112 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
|
| 113 |
Default(normtiff)
|
| 114 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)])
|
| 115 |
|
| 116 |
|
| 117 |
# pixar format requires extra lib
|
| 118 |
if env.has_key('PIXAR_LIB'):
|
| 119 |
ra_pixar = env.Program(radbin('ra_pixar'), source=['ra_pixar.c'],
|
| 120 |
LIBS=['rtpic', env['PIXAR_LIB']])
|
| 121 |
Default(ra_pixar)
|
| 122 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_pixar)])
|
| 123 |
|
| 124 |
|
| 125 |
# X11 targets
|
| 126 |
if env.has_key('X11LIB'):
|
| 127 |
xcppp = env.get('CPPPATH',[]) + [env['X11INCLUDE']]
|
| 128 |
xlibp = env.get('LIBPATH',[]) + [env['X11LIB']]
|
| 129 |
xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem']
|
| 130 |
|
| 131 |
ximage = env.Program(target=radbin('ximage'),
|
| 132 |
source=Split('x11image.c x11raster.c')+[clrtab],
|
| 133 |
CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib)
|
| 134 |
Default(ximage)
|
| 135 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)])
|
| 136 |
|
| 137 |
xshowtrace = env.Program(target=radbin('xshowtrace'),
|
| 138 |
source=Split('xshowtrace.c x11findwind.c'),
|
| 139 |
CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib)
|
| 140 |
Default(xshowtrace)
|
| 141 |
env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)])
|
| 142 |
|
| 143 |
# NeWS ?!?
|
| 144 |
# if env.has_key('OGL'):
|
| 145 |
# glimage = env.Program(target=radbin('glimage'),
|
| 146 |
# CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']],
|
| 147 |
# source=Split('glimage.c'),
|
| 148 |
# LIBS=['gl_s']+env['LIBS'],)
|
| 149 |
# Default(glimage)
|
| 150 |
# env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glimage)])
|
| 151 |
|
| 152 |
|