1 |
# Scons configuration file for paso |
2 |
|
3 |
import os |
4 |
|
5 |
# |
6 |
# ensure correct versions of python and scons |
7 |
|
8 |
EnsurePythonVersion(2,3) |
9 |
EnsureSConsVersion(0,96) |
10 |
|
11 |
# |
12 |
# set appropriate defaults for configuration variables |
13 |
|
14 |
esysroot = Dir('#..') |
15 |
libinstall = None |
16 |
dodebug = 0 |
17 |
usegcc = 0 |
18 |
|
19 |
# |
20 |
# import configuration variables passed in from |
21 |
# calling SConscript (if any) |
22 |
|
23 |
Import('*') |
24 |
|
25 |
# |
26 |
# retreive command-line arguments if any |
27 |
|
28 |
if ARGUMENTS.get('libinstall',0): |
29 |
libinstall = ARGUMENTS.get('libinstall',0) |
30 |
Export(["libinstall"]) |
31 |
|
32 |
if ARGUMENTS.get('debug',0): |
33 |
dodebug = 1 |
34 |
|
35 |
if ARGUMENTS.get('usegcc',0): |
36 |
usegcc = 1 |
37 |
|
38 |
# |
39 |
# determine platform |
40 |
|
41 |
env = Environment(ENV = os.environ) |
42 |
platform = env['PLATFORM'] |
43 |
|
44 |
# |
45 |
# determine hostname |
46 |
|
47 |
hostname = os.environ['HOSTNAME'] |
48 |
|
49 |
# |
50 |
# export esysroot |
51 |
|
52 |
Export(["esysroot"]) |
53 |
|
54 |
# |
55 |
# set and export library directory |
56 |
|
57 |
libdir = Dir(str(esysroot) + '/paso/lib') |
58 |
Export(["libdir"]) |
59 |
|
60 |
# |
61 |
# load and export configuration settings |
62 |
|
63 |
options_dir = str(esysroot) + '/scons' |
64 |
sys.path.append(options_dir) |
65 |
|
66 |
if dodebug==0 and hostname=='ess': |
67 |
from ess_options import * |
68 |
|
69 |
cc_flags = cc_flags + ' -DSCSL' |
70 |
|
71 |
Export(["python_path"]) |
72 |
Export(["boost_path"]) |
73 |
Export(["cc_flags"]) |
74 |
Export(["ar_flags"]) |
75 |
|
76 |
# |
77 |
# print out build configuration for this module |
78 |
|
79 |
print "############################################" |
80 |
print "Build configuration for module: paso" |
81 |
print " dodebug: ", dodebug |
82 |
print " usegcc: ", usegcc |
83 |
print " platform: ", platform |
84 |
print " hostname: ", hostname |
85 |
print " libinstall: ", libinstall |
86 |
print "############################################" |
87 |
|
88 |
# |
89 |
# call the SConscript to do the actual build |
90 |
|
91 |
SConscript('src/SConscript', src_dir='src', build_dir='obj', duplicate=0) |