| 1 |
schorsch |
1.1 |
import os
|
| 2 |
|
|
|
| 3 |
|
|
Import('env') # inherit from parent
|
| 4 |
|
|
|
| 5 |
schorsch |
1.7 |
mlib = ['$RAD_MLIB']
|
| 6 |
|
|
progs = []
|
| 7 |
schorsch |
1.1 |
|
| 8 |
|
|
# compose paths
|
| 9 |
schorsch |
1.7 |
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 |
schorsch |
1.2 |
|
| 13 |
|
|
warp3d = env.Object(source="warp3d.c")
|
| 14 |
|
|
clrtab = env.Object(source="clrtab.c")
|
| 15 |
|
|
neuclrtab = env.Object(source="neuclrtab.c")
|
| 16 |
schorsch |
1.1 |
|
| 17 |
|
|
# standard targets
|
| 18 |
|
|
PROGS = (
|
| 19 |
schorsch |
1.18 |
# name files libs
|
| 20 |
schorsch |
1.2 |
('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d],
|
| 21 |
schorsch |
1.16 |
['rtpic','rtproc','rtpath','rtargs','rtio','rtcont','rtmem','rterror']),
|
| 22 |
schorsch |
1.2 |
('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d],
|
| 23 |
schorsch |
1.16 |
['rtpic','rtproc','rtpath','rtargs','rtio','rtmath','rtcont','rtmem','rterror']),
|
| 24 |
schorsch |
1.2 |
('pfilt', Split('pfilt.c pf2.c pf3.c'),
|
| 25 |
schorsch |
1.16 |
['rtlamps','rtpic','rtpath','rtargs','rtio','rtmath']),
|
| 26 |
schorsch |
1.10 |
('pcwarp', ['pcwarp.c', warp3d],
|
| 27 |
|
|
['rtpic','rtio','rtcont','rtmem','rterror']),
|
| 28 |
schorsch |
1.16 |
('pvalue', ['pvalue.c'], ['rtpic','rtargs','rtio','rtmath']),
|
| 29 |
schorsch |
1.2 |
('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']),
|
| 30 |
|
|
('psign', ['psign.c'],
|
| 31 |
schorsch |
1.16 |
['rtpic','rtscene','rtpath','rtargs','rtio','rtcont','rtmem','rterror']),
|
| 32 |
schorsch |
1.2 |
('protate', ['protate.c'], ['rtpic','rtio']),
|
| 33 |
|
|
('pextrem', ['pextrem.c'], ['rtpic','rtio']),
|
| 34 |
|
|
('pflip', ['pflip.c'], ['rtpic','rtio']),
|
| 35 |
|
|
('pcomb', ['pcomb.c'],
|
| 36 |
schorsch |
1.16 |
['rtpic','rtproc','rtpath','rtfunc','rtargs','rtio','rtmath','rtcont','rtmem']),
|
| 37 |
schorsch |
1.2 |
('pinterp', ['pinterp.c'],
|
| 38 |
schorsch |
1.16 |
['rtproc','rtpic','rtpath','rtargs','rtio','rtmath','rtmem','rterror']),
|
| 39 |
schorsch |
1.2 |
|
| 40 |
|
|
('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']),
|
| 41 |
schorsch |
1.16 |
('ra_ps', ['ra_ps.c'], ['rtpic','rtargs','rtio','rtmem']),
|
| 42 |
schorsch |
1.2 |
('ra_ppm', ['ra_ppm.c'], ['rtpic','rtio','rtmem']),
|
| 43 |
schorsch |
1.18 |
('ra_bmp', ['ra_bmp.c'],
|
| 44 |
|
|
['rtpic','rtproc','rterror','rtpath','rtio','rtmem']),
|
| 45 |
schorsch |
1.2 |
('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']),
|
| 46 |
|
|
('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']),
|
| 47 |
|
|
('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
|
| 48 |
|
|
('ra_pict', ['ra_pict.c'], ['rtpic','rtio','rtmem']),
|
| 49 |
|
|
('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']),
|
| 50 |
|
|
('ra_xyze', ['ra_xyze.c'], ['rtpic','rtio','rtmem']),
|
| 51 |
schorsch |
1.1 |
|
| 52 |
schorsch |
1.2 |
('ttyimage', ['ttyimage.c'], ['rtpic','rtio','rtmem']),
|
| 53 |
schorsch |
1.1 |
)
|
| 54 |
|
|
for p in PROGS:
|
| 55 |
schorsch |
1.2 |
prog = env.Program(target=radbin(p[0]), source=p[1],
|
| 56 |
schorsch |
1.7 |
LIBS=p[2]+mlib)
|
| 57 |
|
|
progs.append(prog)
|
| 58 |
schorsch |
1.1 |
|
| 59 |
|
|
|
| 60 |
|
|
# tiff library (unix-specific for the moment)
|
| 61 |
|
|
if os.name == 'posix':
|
| 62 |
|
|
cwd = os.getcwd()
|
| 63 |
schorsch |
1.12 |
upperdir = os.path.split(cwd)[0]
|
| 64 |
|
|
|
| 65 |
schorsch |
1.2 |
libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']),
|
| 66 |
schorsch |
1.12 |
None,
|
| 67 |
|
|
[('cd "%(tiffdir)s"; '
|
| 68 |
|
|
'env CC="$CC" '
|
| 69 |
schorsch |
1.15 |
'./configure -C '
|
| 70 |
schorsch |
1.13 |
'"libdir=%(upperdir)s/lib" '
|
| 71 |
schorsch |
1.12 |
'--enable-static --disable-shared --disable-cxx '
|
| 72 |
schorsch |
1.15 |
'--enable-logluv --disable-jpeg --disable-zlib --disable-pixarlog; '
|
| 73 |
schorsch |
1.12 |
'cd %(portdir)s; make all;'
|
| 74 |
schorsch |
1.13 |
'cd %(libtiffdir)s; make install-exec;' # don't install headers
|
| 75 |
|
|
) % {
|
| 76 |
schorsch |
1.12 |
'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 |
schorsch |
1.1 |
# tiff programs
|
| 84 |
schorsch |
1.15 |
ra_tiff = env.Program(target=radbin('ra_tiff'), source=['ra_tiff.c'],
|
| 85 |
schorsch |
1.2 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
|
| 86 |
schorsch |
1.7 |
progs.append(ra_tiff)
|
| 87 |
schorsch |
1.1 |
|
| 88 |
schorsch |
1.15 |
normtiff = env.Program(target=radbin('normtiff'),source=['normtiff.c'],
|
| 89 |
schorsch |
1.2 |
LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
|
| 90 |
schorsch |
1.7 |
progs.append(normtiff)
|
| 91 |
schorsch |
1.1 |
|
| 92 |
|
|
|
| 93 |
|
|
# X11 targets
|
| 94 |
schorsch |
1.2 |
if env.has_key('X11LIB'):
|
| 95 |
schorsch |
1.7 |
xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
|
| 96 |
|
|
xlibp = env.get('LIBPATH', []) + ['$X11LIB']
|
| 97 |
schorsch |
1.16 |
xlibs = ['X11','rtpic','rtargs','rtio','rtmath','rtmem']
|
| 98 |
schorsch |
1.6 |
x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice
|
| 99 |
schorsch |
1.7 |
CPPPATH=xincl)
|
| 100 |
schorsch |
1.2 |
|
| 101 |
|
|
ximage = env.Program(target=radbin('ximage'),
|
| 102 |
|
|
source=Split('x11image.c x11raster.c')+[clrtab],
|
| 103 |
schorsch |
1.6 |
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib)
|
| 104 |
schorsch |
1.7 |
progs.append(ximage)
|
| 105 |
schorsch |
1.1 |
|
| 106 |
schorsch |
1.2 |
xshowtrace = env.Program(target=radbin('xshowtrace'),
|
| 107 |
schorsch |
1.5 |
source=Split('xshowtrace.c') + [x11findwind],
|
| 108 |
schorsch |
1.6 |
CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib)
|
| 109 |
schorsch |
1.7 |
progs.append(xshowtrace)
|
| 110 |
schorsch |
1.1 |
|
| 111 |
schorsch |
1.7 |
if os.name == 'posix': # XXX ignoring trad.wsh
|
| 112 |
schorsch |
1.17 |
for s in Split('''normpat falsecolor pdfblur pmblur pmdblur pbilat
|
| 113 |
schorsch |
1.14 |
xyzimage phisto pdelta pgblur ra_pfm ran2tiff'''):
|
| 114 |
schorsch |
1.7 |
Default(env.InstallCsh(radbin(s), s + '.csh'))
|
| 115 |
schorsch |
1.8 |
# XXX probably needs fixing
|
| 116 |
|
|
#else:
|
| 117 |
|
|
# for s in Split('''falsecolor'''):
|
| 118 |
|
|
# Default(env.InstallCsh(radbin(s), s + '.csh'))
|
| 119 |
schorsch |
1.14 |
# ignored by Rmakefile: pacuity phisteq psquish pveil vlpic
|
| 120 |
schorsch |
1.7 |
|
| 121 |
|
|
Default('#src/px')
|
| 122 |
|
|
env.Install('$RAD_BINDIR', progs)
|
| 123 |
|
|
|