--- ray/src/px/SConscript 2006/03/10 19:40:13 1.15 +++ ray/src/px/SConscript 2018/01/08 13:38:37 1.24 @@ -1,3 +1,5 @@ +from __future__ import division, print_function, unicode_literals + import os Import('env') # inherit from parent @@ -7,7 +9,6 @@ progs = [] # compose paths def radbin(name): return os.path.join('$RAD_BUILDBIN', name) -#def radbin(name): return name def radlib(name): return os.path.join('$RAD_BUILDLIB', name) warp3d = env.Object(source="warp3d.c") @@ -16,39 +17,34 @@ neuclrtab = env.Object(source="neuclrtab.c") # standard targets PROGS = ( -# name files libs -('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], - ['rtpic','rtproc','rtpath','rtio','rtargs','rtcont','rtmem','rterror']), -('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], - ['rtpic','rtproc','rtpath','rtio','rtargs','rtmath','rtcont','rtmem','rterror']), -('pfilt', Split('pfilt.c pf2.c pf3.c'), - ['rtlamps','rtpic','rtio','rtpath','rtargs','rtmath']), -('pcwarp', ['pcwarp.c', warp3d], - ['rtpic','rtio','rtcont','rtmem','rterror']), -('pvalue', ['pvalue.c'], ['rtpic','rtio','rtargs','rtmath']), -('pcompos', ['pcompos.c'], ['rtpic','rtproc','rtpath','rtio','rterror']), -('psign', ['psign.c'], - ['rtpic','rtscene','rtio','rtpath','rtargs','rtcont','rtmem','rterror']), -('protate', ['protate.c'], ['rtpic','rtio']), -('pextrem', ['pextrem.c'], ['rtpic','rtio']), -('pflip', ['pflip.c'], ['rtpic','rtio']), -('pcomb', ['pcomb.c'], - ['rtpic','rtproc','rtpath','rtio','rtfunc','rtargs','rtmath','rtcont','rtmem']), -('pinterp', ['pinterp.c'], - ['rtproc','rtpic','rtio','rtpath','rtargs','rtmath','rtmem','rterror']), +# name files libs +('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], ['rtrad']), +('pcond', Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], ['rtrad']), +('pfilt', Split('pfilt.c pf2.c pf3.c'), ['rtrad']), +('pcwarp', ['pcwarp.c', warp3d], ['rtrad']), +('pvalue', ['pvalue.c'], ['rtrad']), +('pcompos', ['pcompos.c'], ['rtrad']), +('psign', ['psign.c'], ['rtrad']), +('protate', ['protate.c'], ['rtrad']), +('pextrem', ['pextrem.c'], ['rtrad']), +('pflip', ['pflip.c'], ['rtrad']), +('pcomb', ['pcomb.c'], ['rtrad']), +('pinterp', ['pinterp.c'], ['rtrad']), +('psketch', ['psketch.c'], ['rtrad']), -('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), -('ra_ps', ['ra_ps.c'], ['rtpic','rtio','rtargs','rtmem']), -('ra_ppm', ['ra_ppm.c'], ['rtpic','rtio','rtmem']), -('ra_bmp', ['ra_bmp.c'], ['rtpic','rtproc','rtio','rtmem']), -('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtpic','rtio','rtmem']), -('ra_t16', ['ra_t16.c'], ['rtpic','rtio','rtmem']), -('ra_rgbe', ['ra_rgbe.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']), -('ra_pict', ['ra_pict.c'], ['rtpic','rtio','rtmem']), -('ra_hexbit',['ra_hexbit.c'], ['rtpic','rtio','rtmem']), -('ra_xyze', ['ra_xyze.c'], ['rtpic','rtio','rtmem']), +('ra_gif', ['ra_gif.c', clrtab, neuclrtab], ['rtrad']), +('ra_ps', ['ra_ps.c'], ['rtrad']), +('ra_ppm', ['ra_ppm.c'], ['rtrad']), +('ra_bmp', ['ra_bmp.c'], ['rtrad']), +('ra_t8', ['ra_t8.c', clrtab, neuclrtab], ['rtrad']), +('ra_t16', ['ra_t16.c'], ['rtrad']), +('ra_rgbe', ['ra_rgbe.c'], ['rtrad']), +('ra_pict', ['ra_pict.c'], ['rtrad']), +('ra_hexbit',['ra_hexbit.c'], ['rtrad']), +('ra_xyze', ['ra_xyze.c'], ['rtrad']), +('pmblur2', ['pmblur2.c'], ['rtrad']), -('ttyimage', ['ttyimage.c'], ['rtpic','rtio','rtmem']), +('ttyimage', ['ttyimage.c'], ['rtrad']), ) for p in PROGS: prog = env.Program(target=radbin(p[0]), source=p[1], @@ -56,13 +52,13 @@ for p in PROGS: progs.append(prog) -# tiff library (unix-specific for the moment) -if os.name == 'posix': +# tiff library (building it is unix-specific for the moment) +# If we haven't found one supporting LogLuv installed, build our own. +libtiff_fn = radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']) +if os.name == 'posix' and not env.get('TIFFLIB_INSTALLED'): cwd = os.getcwd() upperdir = os.path.split(cwd)[0] - - libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']), - None, + libtiff = env.Command(libtiff_fn, None, [('cd "%(tiffdir)s"; ' 'env CC="$CC" ' './configure -C ' @@ -79,44 +75,66 @@ if os.name == 'posix': } ]) + env['TIFFLIB_INSTALLED'] = 1 + +if os.name == 'posix': # cleanup action for a previously built tifflib + Clean(libtiff_fn, [libtiff_fn, radlib(env['LIBPREFIX'] + 'tiff.la')]) + +if env.get('TIFFLIB_INSTALLED'): + libtiff = env.get('RAD_LIBTIFF') # tiff programs + tiffi = env.get('RAD_TIFFINCLUDE') + if tiffi: tiffincl = [tiffi] + env.get('CPPPATH', []) + else: tiffincl = env.get('CPPPATH', []) + tiffl = env.get('RAD_TIFFLIB') + if tiffl: tifflib = [tiffl] + env.get('LIBPATH', []) + else: tifflib = env.get('LIBPATH', []) + ra_tiff = env.Program(target=radbin('ra_tiff'), source=['ra_tiff.c'], - LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) + CPPPATH = tiffincl, LIBPATH=tifflib, + LIBS=[libtiff,'rtrad'] + mlib) progs.append(ra_tiff) normtiff = env.Program(target=radbin('normtiff'),source=['normtiff.c'], - LIBS=['tiff','rtpic','rtio','rtmem'] + mlib) + CPPPATH = tiffincl, LIBPATH=tifflib, + LIBS=[libtiff,'rtrad'] + mlib) progs.append(normtiff) # X11 targets if env.has_key('X11LIB'): - xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] - xlibp = env.get('LIBPATH', []) + ['$X11LIB'] - xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem'] - x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice - CPPPATH=xincl) + xincl = env.get('CPPPATH', []) + ['$X11INCLUDE'] + xlibp = env.get('LIBPATH', []) + ['$X11LIB'] + xlibs = ['X11','rtrad'] + env.x11findwind = env.Object(source='../common/x11findwind.c', + CPPPATH=xincl) - ximage = env.Program(target=radbin('ximage'), - source=Split('x11image.c x11raster.c')+[clrtab], - CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) - progs.append(ximage) + ximage = env.Program(target=radbin('ximage'), + source=Split('x11image.c x11raster.c')+[clrtab], + CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) + progs.append(ximage) - xshowtrace = env.Program(target=radbin('xshowtrace'), - source=Split('xshowtrace.c') + [x11findwind], - CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) - progs.append(xshowtrace) + xshowtrace = env.Program(target=radbin('xshowtrace'), + source=Split('xshowtrace.c') + [env.x11findwind], + CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib) + progs.append(xshowtrace) +pyscripts = Split('''falsecolor phisto''') if os.name == 'posix': # XXX ignoring trad.wsh - for s in Split('''normpat falsecolor pdfblur pmblur pmdblur - xyzimage phisto pdelta pgblur ra_pfm ran2tiff'''): - Default(env.InstallCsh(radbin(s), s + '.csh')) -# XXX probably needs fixing -#else: -# for s in Split('''falsecolor'''): -# Default(env.InstallCsh(radbin(s), s + '.csh')) + for s in Split('''normpat pdfblur pmblur pmdblur + xyzimage pgblur ra_pfm ran2tiff pbilat'''): + Default(env.InstallScript(radbin(s), s + '.csh')) + for s in pyscripts: + Default(env.InstallScript(radbin(s), s + '.py')) +else: + for s in pyscripts: + Default(env.InstallScript(radbin(s + '.py'), s + '.py')) + + # ignored by Rmakefile: pacuity phisteq psquish pveil vlpic Default('#src/px') env.Install('$RAD_BINDIR', progs) +# vim: set syntax=python: +# vi: set ts=4 sw=4 :