ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/SConscript
(Generate patch)

Comparing ray/src/px/SConscript (file contents):
Revision 1.5 by schorsch, Sun Jul 4 12:08:48 2004 UTC vs.
Revision 1.24 by schorsch, Mon Jan 8 13:38:37 2018 UTC

# Line 1 | Line 1
1 + from __future__ import division, print_function, unicode_literals
2 +
3   import os
4  
5   Import('env') # inherit from parent
6  
7 < mlib = env['RAD_MLIB']
7 > mlib = ['$RAD_MLIB']
8 > progs = []
9  
10   # compose paths
11 < def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name)
12 < def radlib(name): return os.path.join(env['RAD_BUILDLIB'], name)
11 > def radbin(name): return os.path.join('$RAD_BUILDBIN', name)
12 > def radlib(name): return os.path.join('$RAD_BUILDLIB', name)
13  
14   warp3d = env.Object(source="warp3d.c")
15   clrtab = env.Object(source="clrtab.c")
16   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  
18   # standard targets
19   PROGS = (
20 < # 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']),
20 > # name       files            libs
21 > ('macbethcal', Split('macbethcal.c pmapgen.c mx3.c')+[warp3d], ['rtrad']),
22 > ('pcond',    Split('pcond.c pcond2.c pcond3.c pcond4.c')+[warp3d], ['rtrad']),
23 > ('pfilt',    Split('pfilt.c pf2.c pf3.c'), ['rtrad']),
24 > ('pcwarp',   ['pcwarp.c', warp3d],       ['rtrad']),
25 > ('pvalue',   ['pvalue.c'],    ['rtrad']),
26 > ('pcompos',  ['pcompos.c'],   ['rtrad']),
27 > ('psign',    ['psign.c'],     ['rtrad']),
28 > ('protate',  ['protate.c'],   ['rtrad']),
29 > ('pextrem',  ['pextrem.c'],   ['rtrad']),
30 > ('pflip',    ['pflip.c'],     ['rtrad']),
31 > ('pcomb',    ['pcomb.c'],     ['rtrad']),
32 > ('pinterp',  ['pinterp.c'],   ['rtrad']),
33 > ('psketch',  ['psketch.c'],   ['rtrad']),
34  
35 < ('oki20c',   ['oki20c.c'],['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
36 < ('oki20',    ['oki20.c'], ['rtpic','rtproc','rtpath','rtio','rtmem','rterror']),
35 > ('ra_gif',   ['ra_gif.c', clrtab, neuclrtab], ['rtrad']),
36 > ('ra_ps',    ['ra_ps.c'],     ['rtrad']),
37 > ('ra_ppm',   ['ra_ppm.c'],    ['rtrad']),
38 > ('ra_bmp',   ['ra_bmp.c'],    ['rtrad']),
39 > ('ra_t8',    ['ra_t8.c', clrtab, neuclrtab], ['rtrad']),
40 > ('ra_t16',   ['ra_t16.c'],    ['rtrad']),
41 > ('ra_rgbe',  ['ra_rgbe.c'],   ['rtrad']),
42 > ('ra_pict',  ['ra_pict.c'],   ['rtrad']),
43 > ('ra_hexbit',['ra_hexbit.c'], ['rtrad']),
44 > ('ra_xyze',  ['ra_xyze.c'],   ['rtrad']),
45 > ('pmblur2',  ['pmblur2.c'],   ['rtrad']),
46  
47 < ('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 < ('ra_bmp',   ['ra_bmp.c'],    ['rtpic','rtio','rtmem']),
52 < ('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 <
60 < ('ttyimage', ['ttyimage.c'],  ['rtpic','rtio','rtmem']),
47 > ('ttyimage', ['ttyimage.c'],  ['rtrad']),
48   )
49   for p in PROGS:
50      prog = env.Program(target=radbin(p[0]), source=p[1],
51 <                LIBS=p[2]+mlib)
52 <    Default(prog)
66 <    env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])
51 >        LIBS=p[2]+mlib)
52 >    progs.append(prog)
53  
54  
55 < # special targets not normally built
56 < SPECIAL = (
57 < # name          files             libs
58 < ('psum',       ['psum.c'],       ['rtpic','rtio']),
59 < #('panim',      ['panim.c'],      ['client','rpcsvc']),# missing externals
55 > # tiff library (building it is unix-specific for the moment)
56 > #  If we haven't found one supporting LogLuv installed, build our own.
57 > libtiff_fn = radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX'])
58 > if os.name == 'posix' and not env.get('TIFFLIB_INSTALLED'):
59 >        cwd = os.getcwd()
60 >        upperdir = os.path.split(cwd)[0]
61 >        libtiff = env.Command(libtiff_fn, None,
62 >        [('cd "%(tiffdir)s"; '
63 >                'env CC="$CC" '
64 >                './configure -C '
65 >                '"libdir=%(upperdir)s/lib" '
66 >                '--enable-static --disable-shared --disable-cxx '
67 >                '--enable-logluv --disable-jpeg --disable-zlib --disable-pixarlog; '
68 >                'cd %(portdir)s; make all;'
69 >                'cd %(libtiffdir)s; make install-exec;' # don't install headers
70 >         ) % {
71 >        'upperdir':upperdir,
72 >        'tiffdir':os.path.join(cwd, 'tiff'),
73 >        'portdir':os.path.join(cwd, 'tiff', 'port'),
74 >        'libtiffdir':os.path.join(cwd, 'tiff', 'libtiff')
75 >        }
76 >        ])
77  
78 < ('ra_im',      ['ra_im.c'],      ['rtproc','rtpath','rtio','rterror']),
78 >        env['TIFFLIB_INSTALLED'] = 1
79  
80 < #('aedimage',   Split('aedimage.c')+[ciq, cut, closest],[]),# missing externals
81 < ('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)
80 > if os.name == 'posix': # cleanup action for a previously built tifflib
81 >        Clean(libtiff_fn, [libtiff_fn, radlib(env['LIBPREFIX'] + 'tiff.la')])
82  
83 <
84 < # tiff library (unix-specific for the moment)
96 < if os.name == 'posix':
97 <        cwd = os.getcwd()
98 <        libtiff = env.Command(radlib(env['LIBPREFIX'] + 'tiff' + env['LIBSUFFIX']),
99 <                'tiff/config.local',
100 <        [('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 <
83 > if env.get('TIFFLIB_INSTALLED'):
84 >        libtiff = env.get('RAD_LIBTIFF')
85          # tiff programs
86 <        ra_tiff = env.Program(target=radbin('ra_tiff'), source=Split('ra_tiff.c'),
87 <                LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
88 <        Default(ra_tiff)
89 <        env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ra_tiff)])
86 >        tiffi = env.get('RAD_TIFFINCLUDE')
87 >        if tiffi: tiffincl = [tiffi] + env.get('CPPPATH', [])
88 >        else: tiffincl = env.get('CPPPATH', [])
89 >        tiffl = env.get('RAD_TIFFLIB')
90 >        if tiffl: tifflib = [tiffl] + env.get('LIBPATH', [])
91 >        else: tifflib = env.get('LIBPATH', [])
92  
93 <        normtiff = env.Program(target=radbin('normtiff'), source=Split('normtiff.c'),
94 <                LIBS=['tiff','rtpic','rtio','rtmem'] + mlib)
95 <        Default(normtiff)
96 <        env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], normtiff)])
93 >        ra_tiff = env.Program(target=radbin('ra_tiff'), source=['ra_tiff.c'],
94 >                CPPPATH = tiffincl, LIBPATH=tifflib,
95 >                LIBS=[libtiff,'rtrad'] + mlib)
96 >        progs.append(ra_tiff)
97  
98 +        normtiff = env.Program(target=radbin('normtiff'),source=['normtiff.c'],
99 +                CPPPATH = tiffincl, LIBPATH=tifflib,
100 +                LIBS=[libtiff,'rtrad'] + mlib)
101 +        progs.append(normtiff)
102  
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)])
103  
125
104   # X11 targets
105   if env.has_key('X11LIB'):
106 <    xcppp = env.get('CPPPATH',[]) + [env['X11INCLUDE']]
107 <    xlibp = env.get('LIBPATH',[]) + [env['X11LIB']]
108 <    xlibs = ['X11','rtpic','rtio','rtmath','rtargs','rtmem']
109 <    x11findwind = env.Object(source='../common/x11findwind.c') # XXX ../
106 >        xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
107 >        xlibp = env.get('LIBPATH', []) + ['$X11LIB']
108 >        xlibs = ['X11','rtrad']
109 >        env.x11findwind = env.Object(source='../common/x11findwind.c',
110 >                CPPPATH=xincl)
111  
112 <    ximage = env.Program(target=radbin('ximage'),
113 <        source=Split('x11image.c x11raster.c')+[clrtab],
114 <        CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib)
115 <    Default(ximage)
137 <    env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ximage)])
112 >        ximage = env.Program(target=radbin('ximage'),
113 >                source=Split('x11image.c x11raster.c')+[clrtab],
114 >                CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib)
115 >        progs.append(ximage)
116  
117 <    xshowtrace = env.Program(target=radbin('xshowtrace'),
118 <        source=Split('xshowtrace.c') + [x11findwind],
119 <        CPPPATH=xcppp, LIBPATH=xlibp, LIBS=xlibs + mlib)
120 <    Default(xshowtrace)
143 <    env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xshowtrace)])
117 >        xshowtrace = env.Program(target=radbin('xshowtrace'),
118 >                source=Split('xshowtrace.c') + [env.x11findwind],
119 >                CPPPATH=xincl, LIBPATH=xlibp, LIBS=xlibs + mlib)
120 >        progs.append(xshowtrace)
121  
122 < # NeWS ?!?
123 < #    if env.has_key('OGL'):
124 < #        glimage = env.Program(target=radbin('glimage'),
125 < #            CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']],
126 < #            source=Split('glimage.c'),
127 < #            LIBS=['gl_s']+env['LIBS'],)
128 < #        Default(glimage)
129 < #        env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glimage)])
122 > pyscripts = Split('''falsecolor phisto''')
123 > if os.name == 'posix': # XXX ignoring trad.wsh
124 >        for s in Split('''normpat pdfblur pmblur pmdblur
125 >                        xyzimage pgblur ra_pfm ran2tiff pbilat'''):
126 >                Default(env.InstallScript(radbin(s), s + '.csh'))
127 >        for s in pyscripts:
128 >                Default(env.InstallScript(radbin(s), s + '.py'))
129 > else:
130 >        for s in pyscripts:
131 >                Default(env.InstallScript(radbin(s + '.py'), s + '.py'))
132 >        
133  
134 + # ignored by Rmakefile: pacuity phisteq psquish pveil vlpic
135  
136 + Default('#src/px')
137 + env.Install('$RAD_BINDIR', progs)
138 +
139 + # vim: set syntax=python:
140 + # vi: set ts=4 sw=4 :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines