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.1 by schorsch, Tue Oct 21 19:27:28 2003 UTC vs.
Revision 1.10 by greg, Thu May 27 19:32:11 2010 UTC

# Line 1 | Line 1
1  
2 # Notes to people who come after:
3 #
4 # In general, only use '/' as a path separator in *nix-specific code, use
5 # os.path.join() for everythign else
6
2   import os
3   import sys
4   import string
5  
6   OPTFILE = 'rayopts.py'
12
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.Update(env)
15 <    opts.Save(OPTFILE, env)
16 <    Help(opts.GenerateHelpText(env, sort=cmp))
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))
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'
22 <    env['RAD_BUILDMAN']  = '#doc/man'
19 >        env['RAD_BUILDLIB']  = '#src/lib'
20 >        env['RAD_BUILDBIN']  = '#bin'
21 >        env['RAD_BUILDRLIB'] = '#lib'
22 >        env['RAD_BUILDMAN']  = '#doc/man'
23 >        # compatibility modules
24 >        env['RAD_COMPAT'] = 'timegm.o'
25  
26   def allplats_setup(env):
27 <    from build_utils import find_libs
28 <    find_libs.find_x11(env)
29 <    find_libs.find_gl(env) # OpenGL
30 <    #find_libs.find_pixar(env) # PIXAR_LIB for src/px/ra_pixar.c
27 >        from build_utils import find_libs
28 >        find_libs.find_radlib(env)
29 >        find_libs.find_x11(env)
30 >        find_libs.find_gl(env) # OpenGL
31 >        find_libs.find_libtiff(env)
32  
33   def post_common_setup(env):
34 <    env.Append(CPPPATH = [os.path.join('#src', 'common')])
35 <    env.Append(LIBPATH=['../lib']) # our own libs
36 <    if not env.has_key('RAD_MLIB'):
37 <        env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
34 >        env.Append(CPPPATH = [os.path.join('#src', 'common')])
35 >        env.Append(LIBPATH=['../lib']) # our own libs
36 >        if not env.has_key('RAD_MLIB'):
37 >                env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
38  
39   def shareinstall_setup(env):
40          from build_utils import install
# Line 47 | Line 45 | def shareinstall_setup(env):
45                  install.install_manfiles(env)
46  
47   # Set up build environment
48 < env = Environment()
48 > env = Environment(tools=['mingw'])
49 > env.Decider('timestamp-match')
50  
51 + if os.name == 'posix':
52 +        from build_utils import install
53 +        csh_b = Builder(action = install.install_cshscript,
54 +                        suffix = '', src_suffix = '.csh')
55 +        env.Append(BUILDERS={'InstallCsh': csh_b})
56 +
57   # configure platform-specific stuff
58   from build_utils import load_plat
59 < load_plat.load_plat(env, platform=None)
59 > load_plat.load_plat(env, ARGUMENTS, platform=None)
60  
61   # override options
62   set_opts(env)
63  
64   # accept license
65 < if not env['SKIP'] and not '-c' in sys.argv:
66 <    from build_utils import copyright
67 <    copyright.show_license()
65 > if ((not env['SKIP']
66 >                        or env['SKIP'].strip().lower() in (0,'0','no','false'))
67 >                and not '-c' in sys.argv and not 'test' in sys.argv):
68 >        from build_utils import copyright
69 >        copyright.show_license()
70  
71   # fill in generic config
72   allplats_setup(env)
73  
74 +
75   # Bring in all the actual things to build
76   Export('env')
77 < SConscript(os.path.join('src', 'common', 'SConscript'))
78 < post_common_setup(env)
79 < for d in Split('meta cv gen ot rt px hd util cal'):
80 <    SConscript(os.path.join('src', d, 'SConscript'))
77 > if 'test' in sys.argv:
78 >        SConscript(os.path.join('test', 'SConscript'))
79 >        
80 > else:
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'))
86  
87 < if string.find(string.join(sys.argv[1:]), 'install') > -1:
88 <        shareinstall_setup(env)
87 >        if string.find(string.join(sys.argv[1:]), 'install') > -1:
88 >                shareinstall_setup(env)
89  
90 + Default('.')
91 +
92   # virtual targets
93 < # RAD_XXXINSTALL are filled in by the local scripts
94 < env.Alias('bininstall',  env.get('RAD_BININSTALL', []))
95 < env.Alias('rlibinstall', env.get('RAD_RLIBINSTALL',[]))
81 < env.Alias('maninstall',  env.get('RAD_MANINSTALL', []))
93 > env.Alias('bininstall',  '$RAD_BINDIR')
94 > env.Alias('rlibinstall', '$RAD_RLIBDIR')
95 > env.Alias('maninstall',  '$RAD_MANDIR')
96  
97   env.Alias('build',   ['#bin'])
98 < env.Alias('test',    ['#src/test'])
98 > env.Alias('test',    ['#test'])
99   env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
86
87 # Further virtual targets are defined locally:
88
89 # meta_special -> mt1601 okimate imagew mt160 mx80 impress aed5
90 #                 tcurve tscat tbar mtext libt4014.a plotout t4014
91 # meta_special_install
92
93 # px_special   -> ra_im, t4027, paintjet, mt160t, greyscale, colorscale, d48c
94 # px_special_install
95
96 # util_special -> scanner, makedist
97 # util_special_install
100  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines