| 2 |
|
|
| 3 |
|
Import('env') # inherit from parent |
| 4 |
|
|
| 5 |
< |
# make a modified local copy |
| 6 |
< |
px = env.Copy(LIBS=['rt'] + env['RAD_MLIB']) |
| 5 |
> |
mlib = ['$RAD_MLIB'] |
| 6 |
> |
progs = [] |
| 7 |
|
|
| 8 |
|
# compose paths |
| 9 |
< |
def radbin(name): return os.path.join(px['RAD_BUILDBIN'], name) |
| 10 |
< |
def radlib(name): return os.path.join(px['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") |
| 16 |
+ |
ciq = env.Object(source="ciq.c") |
| 17 |
+ |
cut = env.Object(source="cut.c") |
| 18 |
+ |
closest = env.Object(source="closest.c") |
| 19 |
+ |
|
| 20 |
|
# standard targets |
| 21 |
|
PROGS = ( |
| 22 |
< |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c warp3d.c')), |
| 23 |
< |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c warp3d.c')), |
| 24 |
< |
('pfilt', Split('pfilt.c pf2.c pf3.c')), |
| 25 |
< |
('pcwarp', Split('pcwarp.c warp3d.c')), |
| 26 |
< |
('pvalue', Split('pvalue.c')), |
| 27 |
< |
('pcompos', Split('pcompos.c')), |
| 28 |
< |
('psign', Split('psign.c')), |
| 29 |
< |
('protate', Split('protate.c')), |
| 30 |
< |
('pextrem', Split('pextrem.c')), |
| 31 |
< |
('pflip', Split('pflip.c')), |
| 32 |
< |
('pcomb', Split('pcomb.c')), |
| 33 |
< |
('pinterp', Split('pinterp.c')), |
| 22 |
> |
# name files libs |
| 23 |
> |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], |
| 24 |
> |
['rtpic','rtproc','rtpath','rtio','rtargs','rtcont','rtmem','rterror']), |
| 25 |
> |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], |
| 26 |
> |
['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtcont','rtmem','rterror']), |
| 27 |
> |
('pfilt', Split('pfilt.c pf2.c pf3.c'), |
| 28 |
> |
['rtlamps','rtpic','rtio','rtpath','rtargs','rtmath']), |
| 29 |
> |
('pcwarp', ['pcwarp.c', warp3d], |
| 30 |
> |
['rtpic','rtio','rtcont','rtmem','rterror']), |
| 31 |
> |
('pvalue', ['pvalue.c'], ['rtpic','rtio','rtargs','rtmath']), |
| 32 |
> |
('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']), |
| 33 |
> |
('psign', ['psign.c'], |
| 34 |
> |
['rtpic','rtscene','rtio','rtpath','rtargs','rtcont','rtmem','rterror']), |
| 35 |
> |
('protate', ['protate.c'], ['rtpic','rtio']), |
| 36 |
> |
('pextrem', ['pextrem.c'], ['rtpic','rtio']), |
| 37 |
> |
('pflip', ['pflip.c'], ['rtpic','rtio']), |
| 38 |
> |
('pcomb', ['pcomb.c'], |
| 39 |
> |
['rtpic','rtproc','rtpath','rtio','rtfunc','rtargs','rtmath','rtcont','rtmem']), |
| 40 |
> |
('pinterp', ['pinterp.c'], |
| 41 |
> |
['rtproc','rtpic','rtio','rtpath','rtargs','rtmath','rtmem','rterror']), |
| 42 |
|
|
| 43 |
< |
('oki20c', Split('oki20c.c')), |
| 44 |
< |
('oki20', Split('oki20.c')), |
| 43 |
> |
('oki20c', ['oki20c.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), |
| 44 |
> |
('oki20', ['oki20.c'], ['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), |
| 45 |
|
|
| 46 |
< |
('ra_gif', Split('ra_gif.c clrtab.c neuclrtab.c')), |
| 47 |
< |
('ra_pr', Split('ra_pr.c ciq.c cut.c closest.c biq.c')), |
| 48 |
< |
('ra_pr24', Split('ra_pr24.c')), |
| 49 |
< |
('ra_avs', Split('ra_avs.c')), |
| 50 |
< |
('ra_ps', Split('ra_ps.c')), |
| 51 |
< |
('ra_ppm', Split('ra_ppm.c')), |
| 52 |
< |
('ra_t8', Split('ra_t8.c clrtab.c neuclrtab.c')), |
| 53 |
< |
('ra_t16', Split('ra_t16.c')), |
| 54 |
< |
('ra_bn', Split('ra_bn.c')), |
| 55 |
< |
('ra_rgbe', Split('ra_rgbe.c')), |
| 56 |
< |
('ra_pict', Split('ra_pict.c')), |
| 57 |
< |
('ra_hexbit', Split('ra_hexbit.c')), |
| 58 |
< |
('ra_xyze', Split('ra_xyze.c')), |
| 46 |
> |
('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), |
| 47 |
> |
('ra_pr', Split('ra_pr.c biq.c')+ [ciq, cut, closest], |
| 48 |
> |
['rtpic','rtio','rtmem']), |
| 49 |
> |
('ra_pr24', ['ra_pr24.c'], ['rtpic','rtio','rtmem']), |
| 50 |
> |
('ra_avs', ['ra_avs.c'], ['rtpic','rtio','rtmem']), |
| 51 |
> |
('ra_ps', ['ra_ps.c'], ['rtpic','rtio','rtargs','rtmem']), |
| 52 |
> |
('ra_ppm', ['ra_ppm.c'], ['rtpic','rtio','rtmem']), |
| 53 |
> |
('ra_bmp', ['ra_bmp.c'], ['rtpic','rtio','rtmem']), |
| 54 |
> |
('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), |
| 55 |
> |
('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']), |
| 56 |
> |
('ra_bn', ['ra_bn.c'], ['rtpic','rtio','rtmem']), |
| 57 |
> |
('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), |
| 58 |
> |
('ra_pict', ['ra_pict.c'], ['rtpic','rtio','rtmem']), |
| 59 |
> |
('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']), |
| 60 |
> |
('ra_xyze', ['ra_xyze.c'], ['rtpic','rtio','rtmem']), |
| 61 |
|
|
| 62 |
< |
('ttyimage', Split('ttyimage.c')), |
| 62 |
> |
('ttyimage', ['ttyimage.c'], ['rtpic','rtio','rtmem']), |
| 63 |
|
) |
| 64 |
|
for p in PROGS: |
| 65 |
< |
prog = px.Program(target=radbin(p[0]), source=p[1]) |
| 66 |
< |
Default(prog) |
| 67 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], prog)]) |
| 65 |
> |
prog = env.Program(target=radbin(p[0]), source=p[1], |
| 66 |
> |
LIBS=p[2]+mlib) |
| 67 |
> |
progs.append(prog) |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
# special targets not normally built |
| 71 |
|
SPECIAL = ( |
| 72 |
< |
#('psum', Split('psum.c'), ['rt']), # (errors) |
| 73 |
< |
#('panim', Split('panim.c'), px['LIBS]+['client','rpcsvc']), |
| 72 |
> |
# name files libs |
| 73 |
> |
('psum', ['psum.c'], ['rtpic','rtio']), |
| 74 |
> |
#('panim', ['panim.c'], ['client','rpcsvc']),# missing externals |
| 75 |
|
|
| 76 |
< |
('ra_im', Split('ra_im.c')), |
| 76 |
> |
('ra_im', ['ra_im.c'], ['rtproc','rtpath','rtio','rterror']), |
| 77 |
|
|
| 78 |
< |
#('aedimage', Split('aedimage.c ciq.c cut.c closest.c'), []), # (errors) |
| 79 |
< |
('t4027', Split('t4027.c'), ['rt']), |
| 80 |
< |
('paintjet', Split('paintjet.c')), |
| 81 |
< |
('mt160r', Split('mt160r.c')), |
| 82 |
< |
('greyscale', Split('greyscale.c')), |
| 83 |
< |
('colorscale', Split('colorscale.c')), |
| 84 |
< |
('d48c', Split('d48c.c'), ['rt']), # (warnings) |
| 78 |
> |
#('aedimage', Split('aedimage.c')+[ciq, cut, closest],[]),# missing externals |
| 79 |
> |
('t4027', ['t4027.c'], ['rtpic']), |
| 80 |
> |
('paintjet', ['paintjet.c'], ['rtpic','rtio','rtmem']), |
| 81 |
> |
('mt160r', ['mt160r.c'], ['rtpic','rtio','rtmem']), |
| 82 |
> |
('greyscale', ['greyscale.c'], ['rtpic']), |
| 83 |
> |
('colorscale', ['colorscale.c'], ['rtpic']), |
| 84 |
> |
('d48c', ['d48c.c'], ['rtpic']), |
| 85 |
|
) |
| 86 |
|
specprogs = [] |
| 87 |
|
specinst = [] |
| 88 |
|
for p in SPECIAL: |
| 89 |
< |
if len(p) > 2: |
| 71 |
< |
prog = px.Program(target=radbin(p[0]), source=p[1], |
| 72 |
< |
LIBS=p[2]) |
| 73 |
< |
else: |
| 74 |
< |
prog = px.Program(target=radbin(p[0]), source=p[1]) |
| 89 |
> |
prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib) |
| 90 |
|
specprogs.append(prog) |
| 91 |
< |
specinst.append(px.Install(px['RAD_BINDIR'], prog)) |
| 92 |
< |
px.Alias('px_special', specprogs) |
| 93 |
< |
px.Alias('px_special_install', specinst) |
| 91 |
> |
specinst.append(env.Install('$RAD_BINDIR', prog)) |
| 92 |
> |
env.Alias('px_special', specprogs) |
| 93 |
> |
env.Alias('px_special_install', specinst) |
| 94 |
|
|
| 95 |
|
|
| 96 |
|
# tiff library (unix-specific for the moment) |
| 97 |
|
if os.name == 'posix': |
| 98 |
|
cwd = os.getcwd() |
| 99 |
< |
libtiff = px.Command(radlib(px['LIBPREFIX'] + 'tiff' + px['LIBSUFFIX']), |
| 99 |
> |
libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']), |
| 100 |
|
'tiff/config.local', |
| 101 |
< |
['cd "%s";' |
| 102 |
< |
'sh ./configure -quiet -noninteractive -with-CC=$CC -with-ENVOPTS=$CCFLAGS;' |
| 103 |
< |
'cd libtiff;' |
| 104 |
< |
'make install;' % os.path.join(cwd, 'tiff')]) |
| 101 |
> |
[('cd "%s"; ' |
| 102 |
> |
'sh ./configure -quiet -noninteractive ' |
| 103 |
> |
'-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; ' |
| 104 |
> |
'cd libtiff; ' |
| 105 |
> |
'make install;') % os.path.join(cwd, 'tiff')]) |
| 106 |
|
|
| 107 |
|
# tiff programs |
| 108 |
< |
ra_tiff = px.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), |
| 109 |
< |
LIBS=['tiff'] + px['LIBS']) |
| 110 |
< |
Default(ra_tiff) |
| 95 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_tiff)]) |
| 108 |
> |
ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), |
| 109 |
> |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
| 110 |
> |
progs.append(ra_tiff) |
| 111 |
|
|
| 112 |
< |
normtiff = px.Program(target=radbin('normtiff'), source=Split('normtiff.c'), |
| 113 |
< |
LIBS=['tiff'] + px['LIBS']) |
| 114 |
< |
Default(normtiff) |
| 100 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], normtiff)]) |
| 112 |
> |
normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), |
| 113 |
> |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) |
| 114 |
> |
progs.append(normtiff) |
| 115 |
|
|
| 116 |
|
|
| 117 |
|
# pixar format requires extra lib |
| 118 |
< |
if px.has_key('PIXAR_LIB'): |
| 119 |
< |
ra_pixar = px.Program(radbin('ra_pixar'), source=['ra_pixar.c'], |
| 120 |
< |
LIBS=['rt', px['PIXAR_LIB']]) |
| 121 |
< |
Default(ra_pixar) |
| 108 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_pixar)]) |
| 118 |
> |
if env.has_key('PIXAR_LIB'): |
| 119 |
> |
ra_pixar = env.Program(radbin('ra_pixar'), source='ra_pixar.c', |
| 120 |
> |
LIBS=['rtpic', '$PIXAR_LIB']) |
| 121 |
> |
progs.append(ra_pixar) |
| 122 |
|
|
| 123 |
|
|
| 124 |
|
# X11 targets |
| 125 |
< |
if px.has_key('X11LIB'): |
| 126 |
< |
px.Append(CPPPATH=px['X11INCLUDE']) |
| 127 |
< |
px.Append(LIBS=['X11']) |
| 128 |
< |
px.Append(LIBPATH=px['X11LIB']) |
| 125 |
> |
if env.has_key('X11LIB'): |
| 126 |
> |
xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] |
| 127 |
> |
xlibp = env.get('LIBPATH', []) + ['$X11LIB'] |
| 128 |
> |
xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem'] |
| 129 |
> |
x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice |
| 130 |
> |
CPPPATH=xincl) |
| 131 |
|
|
| 132 |
< |
ximage = px.Program(target=radbin('ximage'), |
| 133 |
< |
source=Split('x11image.c x11raster.c clrtab.c'),) |
| 134 |
< |
Default(ximage) |
| 135 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ximage)]) |
| 132 |
> |
ximage = env.Program(target=radbin('ximage'), |
| 133 |
> |
source=Split('x11image.c x11raster.c')+[clrtab], |
| 134 |
> |
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) |
| 135 |
> |
progs.append(ximage) |
| 136 |
|
|
| 137 |
< |
xshowtrace = px.Program(target=radbin('xshowtrace'), |
| 138 |
< |
source=Split('xshowtrace.c x11findwind.c'),) |
| 139 |
< |
Default(xshowtrace) |
| 140 |
< |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], xshowtrace)]) |
| 137 |
> |
xshowtrace = env.Program(target=radbin('xshowtrace'), |
| 138 |
> |
source=Split('xshowtrace.c') + [x11findwind], |
| 139 |
> |
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) |
| 140 |
> |
progs.append(xshowtrace) |
| 141 |
|
|
| 142 |
|
# NeWS ?!? |
| 143 |
< |
# if px.has_key('OGL'): |
| 144 |
< |
# glimage = px.Program(target=radbin('glimage'), |
| 145 |
< |
# CPPFLAGS=px.get('CPPFLAGS', []) + [px['RAD_STEREO']], |
| 143 |
> |
# if env.has_key('OGL'): |
| 144 |
> |
# glimage = env.Program(target=radbin('glimage'), |
| 145 |
> |
# CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']], |
| 146 |
|
# source=Split('glimage.c'), |
| 147 |
< |
# LIBS=['gl_s']+px['LIBS'],) |
| 148 |
< |
# Default(glimage) |
| 134 |
< |
# env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], glimage)]) |
| 147 |
> |
# LIBS=['gl_s']+env['LIBS'],) |
| 148 |
> |
# progs.append(glimage) |
| 149 |
|
|
| 150 |
+ |
|
| 151 |
+ |
if os.name == 'posix': # XXX ignoring trad.wsh |
| 152 |
+ |
for s in Split('''normpat falsecolor pdfblur |
| 153 |
+ |
pmblur xyzimage phisto pdelta pgblur'''): |
| 154 |
+ |
Default(env.InstallCsh(radbin(s), s + '.csh')) |
| 155 |
+ |
|
| 156 |
+ |
Default('#src/px') |
| 157 |
+ |
env.Install('$RAD_BINDIR', progs) |
| 158 |
|
|