ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/SConstruct
Revision: 1.3
Committed: Sun Jul 4 12:08:47 2004 UTC (19 years, 8 months ago) by schorsch
Branch: MAIN
Changes since 1.2: +8 -11 lines
Log Message:
Updated SCons build environment to work with a fresh download and on OS X, as suggested by Randolph Fritz.

File Contents

# User Rev Content
1 schorsch 1.1
2     import os
3     import sys
4     import string
5    
6     OPTFILE = 'rayopts.py'
7    
8     def set_opts(env):
9     # XXX add some caching
10     opts = Options(OPTFILE, ARGUMENTS)
11     opts.Add('SKIP', 'Skip Display of License terms', 0)
12     opts.Add('RAD_BINDIR', 'Install executables here', env['RAD_BINDIR'])
13     opts.Add('RAD_RLIBDIR', 'Install support files here', env['RAD_RLIBDIR'])
14     opts.Add('RAD_MANDIR', 'Install man pages here', env['RAD_MANDIR'])
15 schorsch 1.2 opts.Add('RAD_DEBUG', 'Build a debug version', 0)
16 schorsch 1.1 opts.Update(env)
17     opts.Save(OPTFILE, env)
18     Help(opts.GenerateHelpText(env, sort=cmp))
19     # where stuff is located in the source tree
20     env['RAD_BUILDLIB'] = '#src/lib'
21     env['RAD_BUILDBIN'] = '#bin'
22     env['RAD_BUILDRLIB'] = '#lib'
23     env['RAD_BUILDMAN'] = '#doc/man'
24    
25     def allplats_setup(env):
26     from build_utils import find_libs
27     find_libs.find_x11(env)
28     find_libs.find_gl(env) # OpenGL
29     #find_libs.find_pixar(env) # PIXAR_LIB for src/px/ra_pixar.c
30    
31     def post_common_setup(env):
32     env.Append(CPPPATH = [os.path.join('#src', 'common')])
33     env.Append(LIBPATH=['../lib']) # our own libs
34     if not env.has_key('RAD_MLIB'):
35     env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win
36    
37     def shareinstall_setup(env):
38     from build_utils import install
39     # only scan for those files when we actually need them
40     if 'install' in sys.argv or 'rlibinstall' in sys.argv:
41     install.install_rlibfiles(env)
42     if 'install' in sys.argv or 'maninstall' in sys.argv:
43     install.install_manfiles(env)
44    
45     # Set up build environment
46     env = Environment()
47    
48     # configure platform-specific stuff
49     from build_utils import load_plat
50 schorsch 1.2 load_plat.load_plat(env, ARGUMENTS, platform=None)
51 schorsch 1.1
52     # override options
53     set_opts(env)
54    
55     # accept license
56     if not env['SKIP'] and not '-c' in sys.argv:
57     from build_utils import copyright
58     copyright.show_license()
59    
60     # fill in generic config
61     allplats_setup(env)
62    
63     # Bring in all the actual things to build
64     Export('env')
65     SConscript(os.path.join('src', 'common', 'SConscript'))
66     post_common_setup(env)
67     for d in Split('meta cv gen ot rt px hd util cal'):
68 schorsch 1.3 print d
69 schorsch 1.1 SConscript(os.path.join('src', d, 'SConscript'))
70    
71     if string.find(string.join(sys.argv[1:]), 'install') > -1:
72     shareinstall_setup(env)
73    
74     # virtual targets
75     # RAD_XXXINSTALL are filled in by the local scripts
76     env.Alias('bininstall', env.get('RAD_BININSTALL', []))
77     env.Alias('rlibinstall', env.get('RAD_RLIBINSTALL',[]))
78     env.Alias('maninstall', env.get('RAD_MANINSTALL', []))
79    
80     env.Alias('build', ['#bin'])
81     env.Alias('test', ['#src/test'])
82     env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
83    
84     # Further virtual targets are defined locally:
85 schorsch 1.3 # 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 schorsch 1.1