| 2 |  |  | 
| 3 |  | Import('env') # inherit from parent | 
| 4 |  |  | 
| 5 | < | mlib = env['RAD_MLIB'] | 
| 5 | > | mlib = ['$RAD_MLIB'] | 
| 6 | > | progs = [] | 
| 7 |  |  | 
| 8 |  | # compose paths | 
| 9 | < | def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name) | 
| 10 | < | def radlib(name): return os.path.join(env['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") | 
| 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']), | 
| 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'], | 
| 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 | – |  | 
| 41 |  | ('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']), | 
| 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','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']), | 
| 54 | – | ('ra_bn',    ['ra_bn.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']), | 
| 53 |  | ) | 
| 54 |  | for p in PROGS: | 
| 55 |  | prog = env.Program(target=radbin(p[0]), source=p[1], | 
| 56 | < | LIBS=p[2]+mlib) | 
| 57 | < | Default(prog) | 
| 66 | < | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) | 
| 56 | > | LIBS=p[2]+mlib) | 
| 57 | > | progs.append(prog) | 
| 58 |  |  | 
| 59 |  |  | 
| 69 | – | # special targets not normally built | 
| 70 | – | SPECIAL = ( | 
| 71 | – | # name          files             libs | 
| 72 | – | ('psum',       ['psum.c'],       ['rtpic','rtio']), | 
| 73 | – | #('panim',      ['panim.c'],      ['client','rpcsvc']),# missing externals | 
| 74 | – |  | 
| 75 | – | ('ra_im',      ['ra_im.c'],      ['rtproc','rtpath','rtio','rterror']), | 
| 76 | – |  | 
| 77 | – | #('aedimage',   Split('aedimage.c')+[ciq, cut, closest],[]),# missing externals | 
| 78 | – | ('t4027',      ['t4027.c'],      ['rtpic']), | 
| 79 | – | ('paintjet',   ['paintjet.c'],   ['rtpic','rtio','rtmem']), | 
| 80 | – | ('mt160r',     ['mt160r.c'],     ['rtpic','rtio','rtmem']), | 
| 81 | – | ('greyscale',  ['greyscale.c'],  ['rtpic']), | 
| 82 | – | ('colorscale', ['colorscale.c'], ['rtpic']), | 
| 83 | – | ('d48c',       ['d48c.c'],       ['rtpic']), | 
| 84 | – | ) | 
| 85 | – | specprogs = [] | 
| 86 | – | specinst = [] | 
| 87 | – | for p in SPECIAL: | 
| 88 | – | prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib) | 
| 89 | – | specprogs.append(prog) | 
| 90 | – | specinst.append(env.Install(env['RAD_BINDIR'], prog)) | 
| 91 | – | env.Alias('px_special', specprogs) | 
| 92 | – | env.Alias('px_special_install', specinst) | 
| 93 | – |  | 
| 94 | – |  | 
| 60 |  | # tiff library (unix-specific for the moment) | 
| 61 |  | if os.name == 'posix': | 
| 62 |  | cwd = os.getcwd() | 
| 71 |  | # tiff programs | 
| 72 |  | ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), | 
| 73 |  | LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) | 
| 74 | < | Default(ra_tiff) | 
| 110 | < | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)]) | 
| 74 | > | progs.append(ra_tiff) | 
| 75 |  |  | 
| 76 |  | normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), | 
| 77 |  | LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) | 
| 78 | < | Default(normtiff) | 
| 115 | < | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)]) | 
| 78 | > | progs.append(normtiff) | 
| 79 |  |  | 
| 80 |  |  | 
| 118 | – | # pixar format requires extra lib | 
| 119 | – | if env.has_key('PIXAR_LIB'): | 
| 120 | – | ra_pixar = env.Program(radbin('ra_pixar'), source=['ra_pixar.c'], | 
| 121 | – | LIBS=['rtpic', env['PIXAR_LIB']]) | 
| 122 | – | Default(ra_pixar) | 
| 123 | – | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_pixar)]) | 
| 124 | – |  | 
| 125 | – |  | 
| 81 |  | # X11 targets | 
| 82 |  | if env.has_key('X11LIB'): | 
| 83 | < | xincl = env.get('CPPPATH',[]) + [env['X11INCLUDE']] | 
| 84 | < | xlibp = env.get('LIBPATH',[]) + [env['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) | 
| 87 | > | CPPPATH=xincl) | 
| 88 |  |  | 
| 89 |  | ximage = env.Program(target=radbin('ximage'), | 
| 90 |  | source=Split('x11image.c x11raster.c')+[clrtab], | 
| 91 |  | CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) | 
| 92 | < | Default(ximage) | 
| 138 | < | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)]) | 
| 92 | > | progs.append(ximage) | 
| 93 |  |  | 
| 94 |  | xshowtrace = env.Program(target=radbin('xshowtrace'), | 
| 95 |  | source=Split('xshowtrace.c') + [x11findwind], | 
| 96 |  | CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) | 
| 97 | < | Default(xshowtrace) | 
| 144 | < | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)]) | 
| 97 | > | progs.append(xshowtrace) | 
| 98 |  |  | 
| 146 | – | # NeWS ?!? | 
| 147 | – | #    if env.has_key('OGL'): | 
| 148 | – | #        glimage = env.Program(target=radbin('glimage'), | 
| 149 | – | #            CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']], | 
| 150 | – | #            source=Split('glimage.c'), | 
| 151 | – | #            LIBS=['gl_s']+env['LIBS'],) | 
| 152 | – | #        Default(glimage) | 
| 153 | – | #        env.Append(RAD_BININSTALL=[env.Install(env['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 |  |  |