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) |
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)) |
25 |
|
from build_utils import find_libs |
26 |
|
find_libs.find_x11(env) |
27 |
|
find_libs.find_gl(env) # OpenGL |
28 |
< |
#find_libs.find_pixar(env) # PIXAR_LIB for src/px/ra_pixar.c |
28 |
> |
find_libs.find_libtiff(env) |
29 |
|
|
30 |
|
def post_common_setup(env): |
31 |
|
env.Append(CPPPATH = [os.path.join('#src', 'common')]) |
43 |
|
|
44 |
|
# Set up build environment |
45 |
|
env = Environment() |
46 |
+ |
env.Decider('timestamp-match') |
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, platform=None) |
56 |
> |
load_plat.load_plat(env, ARGUMENTS, platform=None) |
57 |
|
|
58 |
|
# override options |
59 |
|
set_opts(env) |
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 |
+ |
Default('.') |
83 |
+ |
|
84 |
|
# virtual targets |
85 |
< |
# RAD_XXXINSTALL are filled in by the local scripts |
86 |
< |
env.Alias('bininstall', env.get('RAD_BININSTALL', [])) |
87 |
< |
env.Alias('rlibinstall', env.get('RAD_RLIBINSTALL',[])) |
81 |
< |
env.Alias('maninstall', env.get('RAD_MANINSTALL', [])) |
85 |
> |
env.Alias('bininstall', '$RAD_BINDIR') |
86 |
> |
env.Alias('rlibinstall', '$RAD_RLIBDIR') |
87 |
> |
env.Alias('maninstall', '$RAD_MANDIR') |
88 |
|
|
89 |
|
env.Alias('build', ['#bin']) |
90 |
|
env.Alias('test', ['#src/test']) |
91 |
|
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 |
92 |
|
|