4 |
|
import string |
5 |
|
|
6 |
|
OPTFILE = 'rayopts.py' |
7 |
– |
|
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.Add('RAD_DEBUG', 'Build a debug version', 0) |
15 |
< |
opts.Update(env) |
16 |
< |
opts.Save(OPTFILE, env) |
17 |
< |
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 |
|
|
24 |
|
def allplats_setup(env): |
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 |
25 |
> |
from build_utils import find_libs |
26 |
> |
find_libs.find_radlib(env) |
27 |
> |
find_libs.find_x11(env) |
28 |
> |
find_libs.find_gl(env) # OpenGL |
29 |
> |
find_libs.find_libtiff(env) |
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 |
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 |
43 |
|
install.install_manfiles(env) |
44 |
|
|
45 |
|
# Set up build environment |
46 |
< |
env = Environment() |
46 |
> |
env = Environment(tools=['mingw']) |
47 |
> |
env.Decider('timestamp-match') |
48 |
|
|
49 |
+ |
if os.name == 'posix': |
50 |
+ |
from build_utils import install |
51 |
+ |
csh_b = Builder(action = install.install_cshscript, |
52 |
+ |
suffix = '', src_suffix = '.csh') |
53 |
+ |
env.Append(BUILDERS={'InstallCsh': csh_b}) |
54 |
+ |
|
55 |
|
# configure platform-specific stuff |
56 |
|
from build_utils import load_plat |
57 |
|
load_plat.load_plat(env, ARGUMENTS, platform=None) |
60 |
|
set_opts(env) |
61 |
|
|
62 |
|
# accept license |
63 |
< |
if not env['SKIP'] and not '-c' in sys.argv: |
64 |
< |
from build_utils import copyright |
65 |
< |
copyright.show_license() |
63 |
> |
if ((not env['SKIP'] |
64 |
> |
or env['SKIP'].strip().lower() in (0,'0','no','false')) |
65 |
> |
and not '-c' in sys.argv and not 'test' in sys.argv): |
66 |
> |
from build_utils import copyright |
67 |
> |
copyright.show_license() |
68 |
|
|
69 |
|
# fill in generic config |
70 |
|
allplats_setup(env) |
71 |
|
|
72 |
+ |
|
73 |
|
# Bring in all the actual things to build |
74 |
|
Export('env') |
75 |
< |
SConscript(os.path.join('src', 'common', 'SConscript')) |
76 |
< |
post_common_setup(env) |
77 |
< |
for d in Split('meta cv gen ot rt px hd util cal'): |
78 |
< |
SConscript(os.path.join('src', d, 'SConscript')) |
75 |
> |
if 'test' in sys.argv: |
76 |
> |
SConscript(os.path.join('test', 'SConscript')) |
77 |
> |
|
78 |
> |
else: |
79 |
> |
SConscript(os.path.join('src', 'common', 'SConscript')) |
80 |
> |
post_common_setup(env) |
81 |
> |
for d in Split('meta cv gen ot rt px hd util cal'): |
82 |
> |
print d |
83 |
> |
SConscript(os.path.join('src', d, 'SConscript')) |
84 |
|
|
85 |
< |
if string.find(string.join(sys.argv[1:]), 'install') > -1: |
86 |
< |
shareinstall_setup(env) |
85 |
> |
if string.find(string.join(sys.argv[1:]), 'install') > -1: |
86 |
> |
shareinstall_setup(env) |
87 |
|
|
88 |
+ |
Default('.') |
89 |
+ |
|
90 |
|
# virtual targets |
91 |
< |
# RAD_XXXINSTALL are filled in by the local scripts |
92 |
< |
env.Alias('bininstall', env.get('RAD_BININSTALL', [])) |
93 |
< |
env.Alias('rlibinstall', env.get('RAD_RLIBINSTALL',[])) |
77 |
< |
env.Alias('maninstall', env.get('RAD_MANINSTALL', [])) |
91 |
> |
env.Alias('bininstall', '$RAD_BINDIR') |
92 |
> |
env.Alias('rlibinstall', '$RAD_RLIBDIR') |
93 |
> |
env.Alias('maninstall', '$RAD_MANDIR') |
94 |
|
|
95 |
|
env.Alias('build', ['#bin']) |
96 |
< |
env.Alias('test', ['#src/test']) |
96 |
> |
env.Alias('test', ['#test']) |
97 |
|
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 |
– |
# util_special -> scanner, makedist (not for Windows yet) |
93 |
– |
# util_special_install |
94 |
– |
|
98 |
|
|