1 |
jgs |
214 |
# Scons configuration file for bruce |
2 |
|
|
|
3 |
|
|
import os |
4 |
jgs |
216 |
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 |
jgs |
192 |
libinstall = None |
17 |
jgs |
268 |
pyinstall = None |
18 |
jgs |
214 |
dodebug = 0 |
19 |
|
|
usegcc = 0 |
20 |
jgs |
246 |
options = None |
21 |
jgs |
190 |
|
22 |
jgs |
214 |
# |
23 |
|
|
# import configuration variables passed in from |
24 |
|
|
# calling SConscript (if any) |
25 |
|
|
|
26 |
jgs |
190 |
Import('*') |
27 |
|
|
|
28 |
jgs |
214 |
# |
29 |
|
|
# retreive command-line arguments if any |
30 |
jgs |
190 |
|
31 |
jgs |
214 |
if ARGUMENTS.get('libinstall',0): |
32 |
|
|
libinstall = ARGUMENTS.get('libinstall',0) |
33 |
jgs |
192 |
Export(["libinstall"]) |
34 |
|
|
|
35 |
jgs |
268 |
if ARGUMENTS.get('pyinstall',0): |
36 |
|
|
pyinstall = ARGUMENTS.get('pyinstall',0) |
37 |
jgs |
340 |
pyinstall = Dir(str(pyinstall) + '/bruce') |
38 |
jgs |
268 |
Export(["pyinstall"]) |
39 |
|
|
|
40 |
jgs |
214 |
if ARGUMENTS.get('debug',0): |
41 |
|
|
dodebug = 1 |
42 |
|
|
|
43 |
|
|
if ARGUMENTS.get('usegcc',0): |
44 |
|
|
usegcc = 1 |
45 |
|
|
|
46 |
jgs |
246 |
if ARGUMENTS.get('options',0): |
47 |
|
|
options = ARGUMENTS.get('options',0) |
48 |
|
|
|
49 |
jgs |
214 |
# |
50 |
|
|
# determine platform |
51 |
|
|
|
52 |
|
|
env = Environment(ENV = os.environ) |
53 |
|
|
platform = env['PLATFORM'] |
54 |
|
|
|
55 |
|
|
# |
56 |
|
|
# determine hostname |
57 |
|
|
|
58 |
jgs |
325 |
import socket |
59 |
|
|
hostname = socket.gethostname() |
60 |
jgs |
214 |
|
61 |
|
|
# |
62 |
|
|
# export esysroot |
63 |
|
|
|
64 |
|
|
Export(["esysroot"]) |
65 |
|
|
|
66 |
|
|
# |
67 |
jgs |
288 |
# set and export library directories |
68 |
jgs |
214 |
|
69 |
jgs |
190 |
libdir = Dir(str(esysroot) + '/bruce/lib') |
70 |
jgs |
176 |
Export(["libdir"]) |
71 |
jgs |
288 |
libdir2 = Dir(str(esysroot) + '/lib') |
72 |
|
|
Export(["libdir2"]) |
73 |
jgs |
176 |
|
74 |
jgs |
214 |
# |
75 |
jgs |
288 |
# set and export python directories |
76 |
jgs |
268 |
|
77 |
|
|
pydir = Dir(str(esysroot) + '/bruce/lib/py_src') |
78 |
|
|
Export(["pydir"]) |
79 |
jgs |
288 |
pydir2 = Dir(str(esysroot) + '/esys/bruce') |
80 |
|
|
Export(["pydir2"]) |
81 |
jgs |
268 |
|
82 |
|
|
# |
83 |
jgs |
214 |
# load and export configuration settings |
84 |
|
|
|
85 |
jgs |
216 |
options_dir = str(esysroot) + '/scons' |
86 |
|
|
sys.path.append(options_dir) |
87 |
jgs |
191 |
|
88 |
jgs |
309 |
from default_options import * |
89 |
|
|
|
90 |
jgs |
224 |
if hostname=='ess': |
91 |
jgs |
309 |
from ess_options import * |
92 |
jgs |
214 |
|
93 |
jgs |
241 |
if usegcc==1: |
94 |
|
|
from gcc_options import * |
95 |
|
|
|
96 |
jgs |
246 |
if options!=None: |
97 |
|
|
exec "from " + options + " import *" |
98 |
|
|
|
99 |
jgs |
224 |
if dodebug==1: |
100 |
|
|
cxx_flags=cxx_flags_debug |
101 |
|
|
|
102 |
jgs |
191 |
Export(["python_path"]) |
103 |
|
|
Export(["boost_path"]) |
104 |
jgs |
223 |
Export(["cxx"]) |
105 |
jgs |
214 |
Export(["cxx_flags"]) |
106 |
jgs |
277 |
Export(["boost_lib_path"]) |
107 |
|
|
Export(["boost_lib"]) |
108 |
|
|
Export(["sys_libs"]) |
109 |
jgs |
191 |
|
110 |
jgs |
214 |
# |
111 |
|
|
# print out build configuration for this module |
112 |
jgs |
191 |
|
113 |
jgs |
214 |
print "Build configuration for module: bruce" |
114 |
|
|
print " dodebug: ", dodebug |
115 |
|
|
print " usegcc: ", usegcc |
116 |
jgs |
223 |
print " cxx: ", cxx |
117 |
jgs |
214 |
print " platform: ", platform |
118 |
|
|
print " hostname: ", hostname |
119 |
|
|
print " libinstall: ", libinstall |
120 |
jgs |
268 |
print " pyinstall: ", pyinstall |
121 |
jgs |
191 |
|
122 |
jgs |
214 |
# |
123 |
|
|
# call the SConscript to do the actual build |
124 |
|
|
|
125 |
jgs |
268 |
SConscript(dirs=['src/Bruce'], build_dir='obj/Bruce', duplicate=0) |
126 |
|
|
SConscript(dirs=['py_src'], build_dir='obj/py_src', duplicate=0) |
127 |
jgs |
288 |
SConscript(dirs=['test/Bruce'], build_dir='obj/test/Bruce', duplicate=0) |
128 |
|
|
SConscript(dirs=['test/BruceFactory'], build_dir='obj/test/BruceFactory', duplicate=0) |