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

Comparing ray/SConstruct (file contents):
Revision 1.3 by schorsch, Sun Jul 4 12:08:47 2004 UTC vs.
Revision 1.16 by schorsch, Thu Mar 10 01:49:56 2016 UTC

# Line 4 | Line 4 | import sys
4   import string
5  
6   OPTFILE = 'rayopts.py'
7
7   def set_opts(env):
8 <    # XXX add some caching
9 <    opts = Options(OPTFILE, ARGUMENTS)
10 <    opts.Add('SKIP', 'Skip Display of License terms', 0)
11 <    opts.Add('RAD_BINDIR',  'Install executables here',   env['RAD_BINDIR'])
12 <    opts.Add('RAD_RLIBDIR', 'Install support files here', env['RAD_RLIBDIR'])
13 <    opts.Add('RAD_MANDIR',  'Install man pages here',     env['RAD_MANDIR'])
14 <    opts.Add('RAD_DEBUG',   'Build a debug version',  0)
15 <    opts.Update(env)
16 <    opts.Save(OPTFILE, env)
17 <    Help(opts.GenerateHelpText(env, sort=cmp))
8 >        # XXX add some caching
9 >        vars = Variables(OPTFILE, ARGUMENTS)
10 >        vars.Add('SKIP', 'Skip Display of License terms', 0)
11 >        vars.Add('RAD_BINDIR',  'Install executables here',   env['RAD_BINDIR'])
12 >        vars.Add('RAD_RLIBDIR', 'Install support files here', env['RAD_RLIBDIR'])
13 >        vars.Add('RAD_MANDIR',  'Install man pages here',     env['RAD_MANDIR'])
14 >        vars.Add('RAD_DEBUG',   'Build a debug version',  0)
15 >        vars.Update(env)
16 >        vars.Save(OPTFILE, env)
17 >        Help(vars.GenerateHelpText(env, sort=cmp))
18          # where stuff is located in the source tree
19 <    env['RAD_BUILDLIB']  = '#src/lib'
20 <    env['RAD_BUILDBIN']  = '#bin'
21 <    env['RAD_BUILDRLIB'] = '#lib'
23 <    env['RAD_BUILDMAN']  = '#doc/man'
19 >        # the binary target libs are configured by platform
20 >        env['RAD_BUILDRLIB'] = '#lib'
21 >        env['RAD_BUILDMAN']  = '#doc/man'
22  
23   def allplats_setup(env):
24 <    from build_utils import find_libs
25 <    find_libs.find_x11(env)
26 <    find_libs.find_gl(env) # OpenGL
27 <    #find_libs.find_pixar(env) # PIXAR_LIB for src/px/ra_pixar.c
24 >        from build_utils import find_libs
25 >        find_libs.find_radlib(env)
26 >        find_libs.find_x11(env)
27 >        find_libs.find_gl(env) # OpenGL
28 >        find_libs.find_libtiff(env)
29  
30   def post_common_setup(env):
31 <    env.Append(CPPPATH = [os.path.join('#src', 'common')])
32 <    env.Append(LIBPATH=['../lib']) # our own libs
33 <    if not env.has_key('RAD_MLIB'):
34 <        env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
31 >        env.Append(CPPPATH = [os.path.join('#src', 'common')])
32 >        env.Append(LIBPATH=[env['RAD_BUILDLIB']]) # our own libs
33 >        if not env.has_key('RAD_MLIB'):
34 >                env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
35  
36   def shareinstall_setup(env):
37          from build_utils import install
# Line 42 | Line 41 | def shareinstall_setup(env):
41          if 'install' in sys.argv or 'maninstall' in sys.argv:
42                  install.install_manfiles(env)
43  
44 + _arch = None
45 + for item in sys.argv[1:]:
46 +        if item.startswith('TARGET_ARCH'):
47 +                res = item.split('=')
48 +                if len(res) == 2:
49 +                        _arch = res[1].strip()
50 +
51   # Set up build environment
52 < env = Environment()
52 > env = Environment(TARGET_ARCH=_arch)
53 > env.Decider('timestamp-match')
54  
55 + if os.name == 'posix':
56 +        from build_utils import install
57 +        script_b = Builder(action = install.install_script, suffix = '')
58 +        env.Append(BUILDERS={'InstallScript': script_b})
59 +        tclscript_b = Builder(action = install.install_tclscript, suffix = '')
60 +        env.Append(BUILDERS={'InstallTCLScript': tclscript_b})
61 +
62   # configure platform-specific stuff
63   from build_utils import load_plat
64 < load_plat.load_plat(env, ARGUMENTS, platform=None)
64 > load_plat.load_plat(env, ARGUMENTS, arch=_arch)
65  
66   # override options
67   set_opts(env)
68  
69   # accept license
70 < if not env['SKIP'] and not '-c' in sys.argv:
71 <    from build_utils import copyright
72 <    copyright.show_license()
70 > if ((not env['SKIP']
71 >                        or env['SKIP'].strip().lower() in (0,'0','no','false'))
72 >                and not '-c' in sys.argv and not 'test' in sys.argv):
73 >        from build_utils import copyright
74 >        copyright.show_license()
75  
76   # fill in generic config
77   allplats_setup(env)
78  
79   # Bring in all the actual things to build
80   Export('env')
81 < SConscript(os.path.join('src', 'common', 'SConscript'))
82 < post_common_setup(env)
83 < for d in Split('meta cv gen ot rt px hd util cal'):
84 <    print d
85 <    SConscript(os.path.join('src', d, 'SConscript'))
81 > if 'test' in sys.argv:
82 >        SConscript(os.path.join('test', 'SConscript'))
83 >        
84 > else:
85 >        SConscript(os.path.join('src', 'common', 'SConscript'),
86 >                        variant_dir=os.path.join(env['RAD_BUILDOBJ'],'common'), duplicate=0)
87 >        post_common_setup(env)
88 >        for d in Split('meta cv gen ot rt px hd util cal'):
89 >                print d
90 >                SConscript(os.path.join('src', d, 'SConscript'),
91 >                                variant_dir=os.path.join(env['RAD_BUILDOBJ'], d), duplicate=0)
92  
93 < if string.find(string.join(sys.argv[1:]), 'install') > -1:
94 <        shareinstall_setup(env)
93 >        if string.find(string.join(sys.argv[1:]), 'install') > -1:
94 >                shareinstall_setup(env)
95  
96 + Default('.')
97 +
98   # virtual targets
99 < # RAD_XXXINSTALL are filled in by the local scripts
100 < env.Alias('bininstall',  env.get('RAD_BININSTALL', []))
101 < env.Alias('rlibinstall', env.get('RAD_RLIBINSTALL',[]))
78 < env.Alias('maninstall',  env.get('RAD_MANINSTALL', []))
99 > env.Alias('bininstall',  '$RAD_BINDIR')
100 > env.Alias('rlibinstall', '$RAD_RLIBDIR')
101 > env.Alias('maninstall',  '$RAD_MANDIR')
102  
103 < env.Alias('build',   ['#bin'])
104 < env.Alias('test',    ['#src/test'])
103 > env.Alias('build',   ['$RAD_BUILDBIN'])
104 > env.Alias('test',    ['#test'])
105   env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
106  
107 < # Further virtual targets are defined locally:
85 < # meta_special: mt1601 okimate imagew mt160 mx80 impress aed5
86 < #               tcurve tscat tbar mtext libt4014.a plotout t4014
87 < # px_special:   ra_im, t4027, paintjet, mt160t, greyscale, colorscale, d48c
88 < # util_special: scanner, makedist (not for Windows yet)
89 < env.Alias('special', ['meta_special', 'px_special', 'util_special'])
90 < env.Alias('special_install', ['meta_special_install',
91 <                'px_special_install', 'util_special_install'])
92 <
107 > # vim: set syntax=python:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines