ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/SConstruct
Revision: 1.2
Committed: Mon Oct 27 10:35:41 2003 UTC (20 years, 5 months ago) by schorsch
Branch: MAIN
Changes since 1.1: +4 -7 lines
Log Message:
Experimental SCons update: Debug builds, split libraries, more Windows targets.

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     SConscript(os.path.join('src', d, 'SConscript'))
69    
70     if string.find(string.join(sys.argv[1:]), 'install') > -1:
71     shareinstall_setup(env)
72    
73     # virtual targets
74     # RAD_XXXINSTALL are filled in by the local scripts
75     env.Alias('bininstall', env.get('RAD_BININSTALL', []))
76     env.Alias('rlibinstall', env.get('RAD_RLIBINSTALL',[]))
77     env.Alias('maninstall', env.get('RAD_MANINSTALL', []))
78    
79     env.Alias('build', ['#bin'])
80     env.Alias('test', ['#src/test'])
81     env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
82    
83     # Further virtual targets are defined locally:
84    
85     # meta_special -> mt1601 okimate imagew mt160 mx80 impress aed5
86     # tcurve tscat tbar mtext libt4014.a plotout t4014
87     # meta_special_install
88    
89     # px_special -> ra_im, t4027, paintjet, mt160t, greyscale, colorscale, d48c
90     # px_special_install
91    
92 schorsch 1.2 # util_special -> scanner, makedist (not for Windows yet)
93 schorsch 1.1 # util_special_install
94 schorsch 1.2
95 schorsch 1.1