| 1 | schorsch | 1.1 | import os | 
| 2 |  |  |  | 
| 3 |  |  | Import('env') # inherit from parent | 
| 4 |  |  |  | 
| 5 | schorsch | 1.2 | mlib = env['RAD_MLIB'] | 
| 6 | schorsch | 1.1 |  | 
| 7 |  |  | # compose paths | 
| 8 | schorsch | 1.2 | def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name) | 
| 9 |  |  | def radlib(name): return os.path.join(env['RAD_BUILDLIB'], name) | 
| 10 |  |  |  | 
| 11 |  |  | warp3d = env.Object(source="warp3d.c") | 
| 12 |  |  | clrtab = env.Object(source="clrtab.c") | 
| 13 |  |  | neuclrtab = env.Object(source="neuclrtab.c") | 
| 14 |  |  | ciq = env.Object(source="ciq.c") | 
| 15 |  |  | cut = env.Object(source="cut.c") | 
| 16 |  |  | closest = env.Object(source="closest.c") | 
| 17 | schorsch | 1.1 |  | 
| 18 |  |  | # standard targets | 
| 19 |  |  | PROGS = ( | 
| 20 | schorsch | 1.2 | # name          files            libs | 
| 21 |  |  | ('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], | 
| 22 |  |  | ['rtpic','rtproc','rtpath','rtio','rtargs','rtcont','rtmem','rterror']), | 
| 23 |  |  | ('pcond',    Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], | 
| 24 |  |  | ['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtcont','rtmem','rterror']), | 
| 25 |  |  | ('pfilt',    Split('pfilt.c pf2.c pf3.c'), | 
| 26 |  |  | ['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'], | 
| 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',   ['oki20c.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), | 
| 42 |  |  | ('oki20',    ['oki20.c'], ['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), | 
| 43 |  |  |  | 
| 44 |  |  | ('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']), | 
| 49 |  |  | ('ra_ps',    ['ra_ps.c'],     ['rtpic','rtio','rtargs','rtmem']), | 
| 50 |  |  | ('ra_ppm',   ['ra_ppm.c'],    ['rtpic','rtio','rtmem']), | 
| 51 | schorsch | 1.4 | ('ra_bmp',   ['ra_bmp.c'],    ['rtpic','rtio','rtmem']), | 
| 52 | schorsch | 1.2 | ('ra_t8',    ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), | 
| 53 |  |  | ('ra_t16',   ['ra_t16.c'],    ['rtpic','rtio','rtmem']), | 
| 54 |  |  | ('ra_bn',    ['ra_bn.c'],     ['rtpic','rtio','rtmem']), | 
| 55 |  |  | ('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), | 
| 56 |  |  | ('ra_pict',  ['ra_pict.c'],   ['rtpic','rtio','rtmem']), | 
| 57 |  |  | ('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']), | 
| 58 |  |  | ('ra_xyze',  ['ra_xyze.c'],   ['rtpic','rtio','rtmem']), | 
| 59 | schorsch | 1.1 |  | 
| 60 | schorsch | 1.2 | ('ttyimage', ['ttyimage.c'],  ['rtpic','rtio','rtmem']), | 
| 61 | schorsch | 1.1 | ) | 
| 62 |  |  | for p in PROGS: | 
| 63 | schorsch | 1.2 | prog = env.Program(target=radbin(p[0]), source=p[1], | 
| 64 |  |  | LIBS=p[2]+mlib) | 
| 65 | schorsch | 1.1 | Default(prog) | 
| 66 | schorsch | 1.2 | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) | 
| 67 | schorsch | 1.1 |  | 
| 68 |  |  |  | 
| 69 |  |  | # special targets not normally built | 
| 70 |  |  | SPECIAL = ( | 
| 71 | schorsch | 1.2 | # 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 | schorsch | 1.1 | ) | 
| 85 |  |  | specprogs = [] | 
| 86 |  |  | specinst = [] | 
| 87 |  |  | for p in SPECIAL: | 
| 88 | schorsch | 1.2 | prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib) | 
| 89 | schorsch | 1.1 | specprogs.append(prog) | 
| 90 | schorsch | 1.2 | specinst.append(env.Install(env['RAD_BINDIR'], prog)) | 
| 91 |  |  | env.Alias('px_special', specprogs) | 
| 92 |  |  | env.Alias('px_special_install', specinst) | 
| 93 | schorsch | 1.1 |  | 
| 94 |  |  |  | 
| 95 |  |  | # tiff library (unix-specific for the moment) | 
| 96 |  |  | if os.name == 'posix': | 
| 97 |  |  | cwd = os.getcwd() | 
| 98 | schorsch | 1.2 | libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']), | 
| 99 | schorsch | 1.1 | 'tiff/config.local', | 
| 100 | schorsch | 1.3 | [('cd "%s"; ' | 
| 101 |  |  | 'sh ./configure -quiet -noninteractive ' | 
| 102 |  |  | '-with-CC="$CC" -with-ENVOPTS="$CCFLAGS"; ' | 
| 103 |  |  | 'cd libtiff; ' | 
| 104 |  |  | 'make install;') % os.path.join(cwd, 'tiff')]) | 
| 105 | schorsch | 1.1 |  | 
| 106 |  |  | # tiff programs | 
| 107 | schorsch | 1.2 | ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'), | 
| 108 |  |  | LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) | 
| 109 | schorsch | 1.1 | Default(ra_tiff) | 
| 110 | schorsch | 1.2 | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)]) | 
| 111 | schorsch | 1.1 |  | 
| 112 | schorsch | 1.2 | normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'), | 
| 113 |  |  | LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) | 
| 114 | schorsch | 1.1 | Default(normtiff) | 
| 115 | schorsch | 1.2 | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)]) | 
| 116 | schorsch | 1.1 |  | 
| 117 |  |  |  | 
| 118 |  |  | # pixar format requires extra lib | 
| 119 | schorsch | 1.2 | if env.has_key('PIXAR_LIB'): | 
| 120 |  |  | ra_pixar = env.Program(radbin('ra_pixar'), source=['ra_pixar.c'], | 
| 121 | schorsch | 1.5 | LIBS=['rtpic', env['PIXAR_LIB']]) | 
| 122 | schorsch | 1.1 | Default(ra_pixar) | 
| 123 | schorsch | 1.2 | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_pixar)]) | 
| 124 | schorsch | 1.1 |  | 
| 125 |  |  |  | 
| 126 |  |  | # X11 targets | 
| 127 | schorsch | 1.2 | if env.has_key('X11LIB'): | 
| 128 | schorsch | 1.6 | xincl = env.get('CPPPATH',[]) + [env['X11INCLUDE']] | 
| 129 | schorsch | 1.2 | xlibp = env.get('LIBPATH',[]) + [env['X11LIB']] | 
| 130 |  |  | xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem'] | 
| 131 | schorsch | 1.6 | x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice | 
| 132 |  |  | CPPPATH=xincl) | 
| 133 | schorsch | 1.2 |  | 
| 134 |  |  | ximage = env.Program(target=radbin('ximage'), | 
| 135 |  |  | source=Split('x11image.c x11raster.c')+[clrtab], | 
| 136 | schorsch | 1.6 | CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) | 
| 137 | schorsch | 1.1 | Default(ximage) | 
| 138 | schorsch | 1.2 | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)]) | 
| 139 | schorsch | 1.1 |  | 
| 140 | schorsch | 1.2 | xshowtrace = env.Program(target=radbin('xshowtrace'), | 
| 141 | schorsch | 1.5 | source=Split('xshowtrace.c') + [x11findwind], | 
| 142 | schorsch | 1.6 | CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) | 
| 143 | schorsch | 1.1 | Default(xshowtrace) | 
| 144 | schorsch | 1.2 | env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)]) | 
| 145 | schorsch | 1.1 |  | 
| 146 |  |  | # NeWS ?!? | 
| 147 | schorsch | 1.2 | #    if env.has_key('OGL'): | 
| 148 |  |  | #        glimage = env.Program(target=radbin('glimage'), | 
| 149 |  |  | #            CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']], | 
| 150 | schorsch | 1.1 | #            source=Split('glimage.c'), | 
| 151 | schorsch | 1.2 | #            LIBS=['gl_s']+env['LIBS'],) | 
| 152 | schorsch | 1.1 | #        Default(glimage) | 
| 153 | schorsch | 1.2 | #        env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glimage)]) | 
| 154 | schorsch | 1.1 |  | 
| 155 |  |  |  |