16 |
|
vars.Save(OPTFILE, env) |
17 |
|
Help(vars.GenerateHelpText(env, sort=cmp)) |
18 |
|
# where stuff is located in the source tree |
19 |
< |
env['RAD_BUILDLIB'] = '#src/lib' |
20 |
< |
env['RAD_BUILDBIN'] = '#bin' |
19 |
> |
# the binary target libs are configured by platform |
20 |
|
env['RAD_BUILDRLIB'] = '#lib' |
21 |
|
env['RAD_BUILDMAN'] = '#doc/man' |
22 |
|
|
29 |
|
|
30 |
|
def post_common_setup(env): |
31 |
|
env.Append(CPPPATH = [os.path.join('#src', 'common')]) |
32 |
< |
env.Append(LIBPATH=['../lib']) # our own libs |
32 |
> |
env.Append(LIBPATH=[env['RAD_BUILDLIB']]) # our own libs |
33 |
|
if not env.has_key('RAD_MLIB'): |
34 |
|
env['RAD_MLIB'] = [] #['m'] # no seperate mlib on Win |
35 |
|
|
41 |
|
if 'install' in sys.argv or 'maninstall' in sys.argv: |
42 |
|
install.install_manfiles(env) |
43 |
|
|
44 |
+ |
_arch = None |
45 |
+ |
for item in sys.argv[1:]: |
46 |
+ |
if item.startswith('TARGET_ARCH'): |
47 |
+ |
res = item.split('=') |
48 |
+ |
if len(res) == 2: |
49 |
+ |
_arch = res[1].strip() |
50 |
+ |
|
51 |
|
# Set up build environment |
52 |
< |
env = Environment() |
52 |
> |
env = Environment(TARGET_ARCH=_arch) |
53 |
|
env.Decider('timestamp-match') |
54 |
|
|
55 |
|
if os.name == 'posix': |
61 |
|
|
62 |
|
# configure platform-specific stuff |
63 |
|
from build_utils import load_plat |
64 |
< |
load_plat.load_plat(env, ARGUMENTS, ourplat=None) |
64 |
> |
load_plat.load_plat(env, ARGUMENTS, arch=_arch) |
65 |
|
|
66 |
|
# override options |
67 |
|
set_opts(env) |
82 |
|
SConscript(os.path.join('test', 'SConscript')) |
83 |
|
|
84 |
|
else: |
85 |
< |
SConscript(os.path.join('src', 'common', 'SConscript')) |
85 |
> |
SConscript(os.path.join('src', 'common', 'SConscript'), |
86 |
> |
variant_dir=os.path.join(env['RAD_BUILDOBJ'],'common'), duplicate=0) |
87 |
|
post_common_setup(env) |
88 |
|
for d in Split('meta cv gen ot rt px hd util cal'): |
89 |
|
print d |
90 |
< |
SConscript(os.path.join('src', d, 'SConscript')) |
90 |
> |
SConscript(os.path.join('src', d, 'SConscript'), |
91 |
> |
variant_dir=os.path.join(env['RAD_BUILDOBJ'], d), duplicate=0) |
92 |
|
|
93 |
|
if string.find(string.join(sys.argv[1:]), 'install') > -1: |
94 |
|
shareinstall_setup(env) |
100 |
|
env.Alias('rlibinstall', '$RAD_RLIBDIR') |
101 |
|
env.Alias('maninstall', '$RAD_MANDIR') |
102 |
|
|
103 |
< |
env.Alias('build', ['#bin']) |
103 |
> |
env.Alias('build', ['$RAD_BUILDBIN']) |
104 |
|
env.Alias('test', ['#test']) |
105 |
|
env.Alias('install', ['bininstall', 'rlibinstall', 'maninstall']) |
106 |
|
|