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.11 by greg, Wed Jun 2 15:58:30 2010 UTC vs.
Revision 1.19 by schorsch, Tue Apr 19 21:21:23 2016 UTC

# Line 3 | Line 3 | import os
3   import sys
4   import string
5  
6 < OPTFILE = 'rayopts.py'
6 > PATHFILE = 'scbuild/raypaths.py'
7 > OPTFILE = 'scbuild/rayopts.py'
8 > def set_pre_opts():
9 >        vars = Variables(OPTFILE, ARGUMENTS)
10 >        vars.Add('SKIP', 'Skip Display of License terms', 0)
11 >        vars.Add('RAD_DEBUG',  'Build a debug version',  0)
12 >        vars.Add('MSVC_VERSION', 'Microsoft VC Version',  '12.0')
13 >        vars.Add('TARGET_ARCH',  'Windows only: "x68" or "amd64"',  '')
14 >        return vars
15 >
16   def set_opts(env):
17 <        # XXX add some caching
18 <        opts = Options(OPTFILE, ARGUMENTS)
19 <        opts.Add('SKIP', 'Skip Display of License terms', 0)
20 <        opts.Add('RAD_BINDIR',  'Install executables here',   env['RAD_BINDIR'])
21 <        opts.Add('RAD_RLIBDIR', 'Install support files here', env['RAD_RLIBDIR'])
22 <        opts.Add('RAD_MANDIR',  'Install man pages here',     env['RAD_MANDIR'])
23 <        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))
17 >        vars = Variables(PATHFILE, ARGUMENTS)
18 >        vars.Add('RAD_BINDIR',  'Install executables here',   env['RAD_BINDIR'])
19 >        vars.Add('RAD_RLIBDIR', 'Install support files here', env['RAD_RLIBDIR'])
20 >        vars.Add('RAD_MANDIR',  'Install man pages here',     env['RAD_MANDIR'])
21 >        vars.Update(env)
22 >        vars.Save(PATHFILE, env)
23 >        Help(vars.GenerateHelpText(env, sort=cmp))
24          # where stuff is located in the source tree
25 <        env['RAD_BUILDLIB']  = '#src/lib'
20 <        env['RAD_BUILDBIN']  = '#bin'
25 >        # the binary target libs are configured by platform
26          env['RAD_BUILDRLIB'] = '#lib'
27          env['RAD_BUILDMAN']  = '#doc/man'
28  
# Line 27 | Line 32 | def allplats_setup(env):
32          find_libs.find_x11(env)
33          find_libs.find_gl(env) # OpenGL
34          find_libs.find_libtiff(env)
35 +        find_libs.find_pyinstaller(env)
36  
37   def post_common_setup(env):
38          env.Append(CPPPATH = [os.path.join('#src', 'common')])
39 <        env.Append(LIBPATH=['../lib']) # our own libs
39 >        env.Append(LIBPATH=[env['RAD_BUILDLIB']]) # our own libs
40          if not env.has_key('RAD_MLIB'):
41                  env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
42  
# Line 42 | Line 48 | def shareinstall_setup(env):
48          if 'install' in sys.argv or 'maninstall' in sys.argv:
49                  install.install_manfiles(env)
50  
51 +
52 + # set stuff before loading platforms
53 + prevars = set_pre_opts()
54   # Set up build environment
55 < env = Environment(tools=['mingw'])
55 > env = Environment(variables=prevars)
56 > prevars.Save(OPTFILE, env)
57   env.Decider('timestamp-match')
58  
59 + from build_utils import install
60 + script_b = Builder(action = install.install_script, suffix = '')
61 + env.Append(BUILDERS={'InstallScript': script_b})
62   if os.name == 'posix':
63 <        from build_utils import install
64 <        csh_b = Builder(action = install.install_cshscript,
52 <                        suffix = '', src_suffix = '.csh')
53 <        env.Append(BUILDERS={'InstallCsh': csh_b})
63 >        tclscript_b = Builder(action = install.install_tclscript, suffix = '')
64 >        env.Append(BUILDERS={'InstallTCLScript': tclscript_b})
65  
66 +
67   # configure platform-specific stuff
68   from build_utils import load_plat
69 < load_plat.load_plat(env, ARGUMENTS, platform=None)
69 > load_plat.load_plat(env)
70  
71   # override options
72   set_opts(env)
73  
74   # accept license
75   if ((not env['SKIP']
76 <                        or env['SKIP'].strip().lower() in (0,'0','no','false'))
76 >                        or env['SKIP'].strip().lower() in (0,'0','n','no','false',None))
77                  and not '-c' in sys.argv and not 'test' in sys.argv):
78          from build_utils import copyright
79          copyright.show_license()
# Line 69 | Line 81 | if ((not env['SKIP']
81   # fill in generic config
82   allplats_setup(env)
83  
72
84   # Bring in all the actual things to build
85   Export('env')
86   if 'test' in sys.argv:
87          SConscript(os.path.join('test', 'SConscript'))
88          
89   else:
90 <        SConscript(os.path.join('src', 'common', 'SConscript'))
90 >        SConscript(os.path.join('src', 'common', 'SConscript'),
91 >                        variant_dir=os.path.join(env['RAD_BUILDOBJ'],'common'), duplicate=0)
92          post_common_setup(env)
93 <        for d in Split('meta cv gen ot rt px hd util cal'):
94 <                print d
95 <                SConscript(os.path.join('src', d, 'SConscript'))
93 >        dirs = Split('''meta cv gen ot rt px hd util cal''')
94 >        if os.path.isfile('src/winimage/SConscript'):
95 >                dirs.append('winimage')
96 >        if os.path.isfile('src/winrview/SConscript'):
97 >                dirs.append('winrview')
98 >        for d in dirs:
99 >                print(d)
100 >                SConscript(os.path.join('src', d, 'SConscript'),
101 >                                variant_dir=os.path.join(env['RAD_BUILDOBJ'], d), duplicate=0)
102  
103          if string.find(string.join(sys.argv[1:]), 'install') > -1:
104                  shareinstall_setup(env)
# Line 92 | Line 110 | env.Alias('bininstall',  '$RAD_BINDIR')
110   env.Alias('rlibinstall', '$RAD_RLIBDIR')
111   env.Alias('maninstall',  '$RAD_MANDIR')
112  
113 < env.Alias('build',   ['#bin'])
113 > env.Alias('build',   ['$RAD_BUILDBIN', '$RAD_BUILDRLIB'])
114   env.Alias('test',    ['#test'])
115   env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
116  
117 + # vim: set syntax=python:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines