ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/SConstruct
Revision: 1.4
Committed: Thu Oct 21 15:47:11 2004 UTC (19 years, 11 months ago) by schorsch
Branch: MAIN
CVS Tags: rad3R6, rad3R6P1
Changes since 1.3: +12 -5 lines
Log Message:
SCons build simplifications.

File Contents

# Content
1
2 import os
3 import sys
4 import string
5
6 OPTFILE = 'rayopts.py'
7 SourceSignatures('timestamp')
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 opts.Add('RAD_DEBUG', 'Build a debug version', 0)
16 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 if os.name == 'posix':
49 from build_utils import install
50 csh_b = Builder(action = install.install_cshscript,
51 suffix = '', src_suffix = '.csh')
52 env.Append(BUILDERS={'InstallCsh': csh_b})
53
54 # configure platform-specific stuff
55 from build_utils import load_plat
56 load_plat.load_plat(env, ARGUMENTS, platform=None)
57
58 # override options
59 set_opts(env)
60
61 # accept license
62 if not env['SKIP'] and not '-c' in sys.argv:
63 from build_utils import copyright
64 copyright.show_license()
65
66 # fill in generic config
67 allplats_setup(env)
68
69
70
71 # Bring in all the actual things to build
72 Export('env')
73 SConscript(os.path.join('src', 'common', 'SConscript'))
74 post_common_setup(env)
75 for d in Split('meta cv gen ot rt px hd util cal'):
76 print d
77 SConscript(os.path.join('src', d, 'SConscript'))
78
79 if string.find(string.join(sys.argv[1:]), 'install') > -1:
80 shareinstall_setup(env)
81
82 # virtual targets
83 env.Alias('bininstall', '$RAD_BINDIR')
84 env.Alias('rlibinstall', '$RAD_RLIBDIR')
85 env.Alias('maninstall', '$RAD_MANDIR')
86
87 env.Alias('build', ['#bin'])
88 env.Alias('test', ['#src/test'])
89 env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall'])
90
91 # Further virtual targets are defined locally:
92 # meta_special: mt1601 okimate imagew mt160 mx80 impress aed5
93 # tcurve tscat tbar mtext libt4014.a plotout t4014
94 # px_special: ra_im, t4027, paintjet, mt160t, greyscale, colorscale, d48c
95 # util_special: scanner, makedist (not for Windows yet)
96 env.Alias('special', ['meta_special', 'px_special', 'util_special'])
97 env.Alias('special_install', ['meta_special_install',
98 'px_special_install', 'util_special_install'])
99