| 1 |
import os
|
| 2 |
|
| 3 |
Import('env') # inherit from parent
|
| 4 |
|
| 5 |
# make a modified local copy
|
| 6 |
px = env.Copy(LIBS=['rt'] + env['RAD_MLIB'])
|
| 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)
|
| 11 |
|
| 12 |
# standard targets
|
| 13 |
PROGS = (
|
| 14 |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c warp3d.c')),
|
| 15 |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c warp3d.c')),
|
| 16 |
('pfilt', Split('pfilt.c pf2.c pf3.c')),
|
| 17 |
('pcwarp', Split('pcwarp.c warp3d.c')),
|
| 18 |
('pvalue', Split('pvalue.c')),
|
| 19 |
('pcompos', Split('pcompos.c')),
|
| 20 |
('psign', Split('psign.c')),
|
| 21 |
('protate', Split('protate.c')),
|
| 22 |
('pextrem', Split('pextrem.c')),
|
| 23 |
('pflip', Split('pflip.c')),
|
| 24 |
('pcomb', Split('pcomb.c')),
|
| 25 |
('pinterp', Split('pinterp.c')),
|
| 26 |
|
| 27 |
('oki20c', Split('oki20c.c')),
|
| 28 |
('oki20', Split('oki20.c')),
|
| 29 |
|
| 30 |
('ra_gif', Split('ra_gif.c clrtab.c neuclrtab.c')),
|
| 31 |
('ra_pr', Split('ra_pr.c ciq.c cut.c closest.c biq.c')),
|
| 32 |
('ra_pr24', Split('ra_pr24.c')),
|
| 33 |
('ra_avs', Split('ra_avs.c')),
|
| 34 |
('ra_ps', Split('ra_ps.c')),
|
| 35 |
('ra_ppm', Split('ra_ppm.c')),
|
| 36 |
('ra_t8', Split('ra_t8.c clrtab.c neuclrtab.c')),
|
| 37 |
('ra_t16', Split('ra_t16.c')),
|
| 38 |
('ra_bn', Split('ra_bn.c')),
|
| 39 |
('ra_rgbe', Split('ra_rgbe.c')),
|
| 40 |
('ra_pict', Split('ra_pict.c')),
|
| 41 |
('ra_hexbit', Split('ra_hexbit.c')),
|
| 42 |
('ra_xyze', Split('ra_xyze.c')),
|
| 43 |
|
| 44 |
('ttyimage', Split('ttyimage.c')),
|
| 45 |
)
|
| 46 |
for p in PROGS:
|
| 47 |
prog = px.Program(target=radbin(p[0]), source=p[1])
|
| 48 |
Default(prog)
|
| 49 |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], prog)])
|
| 50 |
|
| 51 |
|
| 52 |
# special targets not normally built
|
| 53 |
SPECIAL = (
|
| 54 |
#('psum', Split('psum.c'), ['rt']), # (errors)
|
| 55 |
#('panim', Split('panim.c'), px['LIBS]+['client','rpcsvc']),
|
| 56 |
|
| 57 |
('ra_im', Split('ra_im.c')),
|
| 58 |
|
| 59 |
#('aedimage', Split('aedimage.c ciq.c cut.c closest.c'), []), # (errors)
|
| 60 |
('t4027', Split('t4027.c'), ['rt']),
|
| 61 |
('paintjet', Split('paintjet.c')),
|
| 62 |
('mt160r', Split('mt160r.c')),
|
| 63 |
('greyscale', Split('greyscale.c')),
|
| 64 |
('colorscale', Split('colorscale.c')),
|
| 65 |
('d48c', Split('d48c.c'), ['rt']), # (warnings)
|
| 66 |
)
|
| 67 |
specprogs = []
|
| 68 |
specinst = []
|
| 69 |
for p in SPECIAL:
|
| 70 |
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])
|
| 75 |
specprogs.append(prog)
|
| 76 |
specinst.append(px.Install(px['RAD_BINDIR'], prog))
|
| 77 |
px.Alias('px_special', specprogs)
|
| 78 |
px.Alias('px_special_install', specinst)
|
| 79 |
|
| 80 |
|
| 81 |
# tiff library (unix-specific for the moment)
|
| 82 |
if os.name == 'posix':
|
| 83 |
cwd = os.getcwd()
|
| 84 |
libtiff = px.Command(radlib(px['LIBPREFIX'] + 'tiff' + px['LIBSUFFIX']),
|
| 85 |
'tiff/config.local',
|
| 86 |
['cd "%s";'
|
| 87 |
'sh ./configure -quiet -noninteractive -with-CC=$CC -with-ENVOPTS=$CCFLAGS;'
|
| 88 |
'cd libtiff;'
|
| 89 |
'make install;' % os.path.join(cwd, 'tiff')])
|
| 90 |
|
| 91 |
# tiff programs
|
| 92 |
ra_tiff = px.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'),
|
| 93 |
LIBS=['tiff'] + px['LIBS'])
|
| 94 |
Default(ra_tiff)
|
| 95 |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_tiff)])
|
| 96 |
|
| 97 |
normtiff = px.Program(target=radbin('normtiff'), source=Split('normtiff.c'),
|
| 98 |
LIBS=['tiff'] + px['LIBS'])
|
| 99 |
Default(normtiff)
|
| 100 |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], normtiff)])
|
| 101 |
|
| 102 |
|
| 103 |
# pixar format requires extra lib
|
| 104 |
if px.has_key('PIXAR_LIB'):
|
| 105 |
ra_pixar = px.Program(radbin('ra_pixar'), source=['ra_pixar.c'],
|
| 106 |
LIBS=['rt', px['PIXAR_LIB']])
|
| 107 |
Default(ra_pixar)
|
| 108 |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_pixar)])
|
| 109 |
|
| 110 |
|
| 111 |
# X11 targets
|
| 112 |
if px.has_key('X11LIB'):
|
| 113 |
px.Append(CPPPATH=px['X11INCLUDE'])
|
| 114 |
px.Append(LIBS=['X11'])
|
| 115 |
px.Append(LIBPATH=px['X11LIB'])
|
| 116 |
|
| 117 |
ximage = px.Program(target=radbin('ximage'),
|
| 118 |
source=Split('x11image.c x11raster.c clrtab.c'),)
|
| 119 |
Default(ximage)
|
| 120 |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ximage)])
|
| 121 |
|
| 122 |
xshowtrace = px.Program(target=radbin('xshowtrace'),
|
| 123 |
source=Split('xshowtrace.c x11findwind.c'),)
|
| 124 |
Default(xshowtrace)
|
| 125 |
env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], xshowtrace)])
|
| 126 |
|
| 127 |
# NeWS ?!?
|
| 128 |
# if px.has_key('OGL'):
|
| 129 |
# glimage = px.Program(target=radbin('glimage'),
|
| 130 |
# CPPFLAGS=px.get('CPPFLAGS', []) + [px['RAD_STEREO']],
|
| 131 |
# source=Split('glimage.c'),
|
| 132 |
# LIBS=['gl_s']+px['LIBS'],)
|
| 133 |
# Default(glimage)
|
| 134 |
# env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], glimage)])
|
| 135 |
|
| 136 |
|