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