| 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 | > | ('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',     Split('oki20c.c')), | 
| 42 | < | ('oki20',      Split('oki20.c')), | 
| 41 | > | ('ra_gif',   ['ra_gif.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), | 
| 42 | > | ('ra_ps',    ['ra_ps.c'],     ['rtpic','rtio','rtargs','rtmem']), | 
| 43 | > | ('ra_ppm',   ['ra_ppm.c'],    ['rtpic','rtio','rtmem']), | 
| 44 | > | ('ra_bmp',   ['ra_bmp.c'],    ['rtpic','rtproc','rtio','rtmem']), | 
| 45 | > | ('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 |  |  | 
| 52 | < | ('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')), | 
| 52 | > | ('ttyimage', ['ttyimage.c'],  ['rtpic','rtio','rtmem']), | 
| 53 |  | ) | 
| 54 |  | for p in PROGS: | 
| 55 | < | prog = px.Program(target=radbin(p[0]), source=p[1]) | 
| 56 | < | Default(prog) | 
| 57 | < | env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], prog)]) | 
| 55 | > | prog = env.Program(target=radbin(p[0]), source=p[1], | 
| 56 | > | LIBS=p[2]+mlib) | 
| 57 | > | progs.append(prog) | 
| 58 |  |  | 
| 59 |  |  | 
| 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 | – |  | 
| 60 |  | # tiff library (unix-specific for the moment) | 
| 61 |  | if os.name == 'posix': | 
| 62 |  | cwd = os.getcwd() | 
| 63 | < | libtiff = px.Command(radlib(px['LIBPREFIX'] + 'tiff' + px['LIBSUFFIX']), | 
| 63 | > | libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']), | 
| 64 |  | 'tiff/config.local', | 
| 65 | < | ['cd "%s";' | 
| 66 | < | 'sh ./configure -quiet -noninteractive -with-CC=$CC -with-ENVOPTS=$CCFLAGS;' | 
| 67 | < | 'cd libtiff;' | 
| 68 | < | 'make install;' % os.path.join(cwd, 'tiff')]) | 
| 65 | > | [('cd "%s"; ' | 
| 66 | > | 'sh ./configure -quiet -noninteractive ' | 
| 67 | > | '-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; ' | 
| 68 | > | 'cd libtiff; ' | 
| 69 | > | 'make install;') % os.path.join(cwd, 'tiff')]) | 
| 70 |  |  | 
| 71 |  | # tiff programs | 
| 72 | < | ra_tiff = px.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), | 
| 73 | < | LIBS=['tiff'] + px['LIBS']) | 
| 74 | < | Default(ra_tiff) | 
| 95 | < | env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ra_tiff)]) | 
| 72 | > | ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), | 
| 73 | > | LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) | 
| 74 | > | progs.append(ra_tiff) | 
| 75 |  |  | 
| 76 | < | normtiff = px.Program(target=radbin('normtiff'), source=Split('normtiff.c'), | 
| 77 | < | LIBS=['tiff'] + px['LIBS']) | 
| 78 | < | Default(normtiff) | 
| 100 | < | env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], normtiff)]) | 
| 76 | > | normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), | 
| 77 | > | LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) | 
| 78 | > | progs.append(normtiff) | 
| 79 |  |  | 
| 80 |  |  | 
| 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 | – |  | 
| 81 |  | # X11 targets | 
| 82 | < | if px.has_key('X11LIB'): | 
| 83 | < | px.Append(CPPPATH=px['X11INCLUDE']) | 
| 84 | < | px.Append(LIBS=['X11']) | 
| 85 | < | px.Append(LIBPATH=px['X11LIB']) | 
| 82 | > | if env.has_key('X11LIB'): | 
| 83 | > | xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] | 
| 84 | > | xlibp = env.get('LIBPATH', []) + ['$X11LIB'] | 
| 85 | > | xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem'] | 
| 86 | > | x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice | 
| 87 | > | CPPPATH=xincl) | 
| 88 |  |  | 
| 89 | < | ximage = px.Program(target=radbin('ximage'), | 
| 90 | < | source=Split('x11image.c x11raster.c clrtab.c'),) | 
| 91 | < | Default(ximage) | 
| 92 | < | env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], ximage)]) | 
| 89 | > | ximage = env.Program(target=radbin('ximage'), | 
| 90 | > | source=Split('x11image.c x11raster.c')+[clrtab], | 
| 91 | > | CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) | 
| 92 | > | progs.append(ximage) | 
| 93 |  |  | 
| 94 | < | xshowtrace = px.Program(target=radbin('xshowtrace'), | 
| 95 | < | source=Split('xshowtrace.c x11findwind.c'),) | 
| 96 | < | Default(xshowtrace) | 
| 97 | < | env.Append(RAD_BININSTALL=[px.Install(px['RAD_BINDIR'], xshowtrace)]) | 
| 94 | > | xshowtrace = env.Program(target=radbin('xshowtrace'), | 
| 95 | > | source=Split('xshowtrace.c') + [x11findwind], | 
| 96 | > | CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) | 
| 97 | > | progs.append(xshowtrace) | 
| 98 |  |  | 
| 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)]) | 
| 99 |  |  | 
| 100 | + | if os.name == 'posix': # XXX ignoring trad.wsh | 
| 101 | + | for s in Split('''normpat falsecolor pdfblur | 
| 102 | + | pmblur xyzimage phisto pdelta pgblur'''): | 
| 103 | + | Default(env.InstallCsh(radbin(s), s + '.csh')) | 
| 104 | + | # XXX probably needs fixing | 
| 105 | + | #else: | 
| 106 | + | #       for s in Split('''falsecolor'''): | 
| 107 | + | #               Default(env.InstallCsh(radbin(s), s + '.csh')) | 
| 108 | + |  | 
| 109 | + | Default('#src/px') | 
| 110 | + | env.Install('$RAD_BINDIR', progs) | 
| 111 |  |  |