1 |
# Scons configuration file for modellib |
2 |
|
3 |
import os |
4 |
import sys |
5 |
|
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 |
pyinstall = None |
17 |
|
18 |
# |
19 |
# import configuration variables passed in from |
20 |
# calling SConscript (if any) |
21 |
|
22 |
Import('*') |
23 |
|
24 |
# |
25 |
# retreive command-line arguments if any |
26 |
|
27 |
if ARGUMENTS.get('pyinstall',0): |
28 |
pyinstall = ARGUMENTS.get('pyinstall',0) |
29 |
pyinstall = Dir(str(pyinstall) + '/modellib') |
30 |
Export(["pyinstall"]) |
31 |
|
32 |
# |
33 |
# determine platform |
34 |
|
35 |
env = Environment(ENV = os.environ) |
36 |
platform = env['PLATFORM'] |
37 |
|
38 |
# |
39 |
# determine hostname |
40 |
|
41 |
import socket |
42 |
hostname = socket.gethostname() |
43 |
|
44 |
# |
45 |
# export esysroot |
46 |
|
47 |
Export(["esysroot"]) |
48 |
|
49 |
# |
50 |
# set and export python directory |
51 |
|
52 |
pydir = Dir(str(esysroot) + '/modellib/lib/py_src') |
53 |
Export(["pydir"]) |
54 |
pydir2 = Dir(str(esysroot) + '/esys/modellib') |
55 |
Export(["pydir2"]) |
56 |
|
57 |
# |
58 |
# print out build configuration for this module |
59 |
|
60 |
print "Build configuration for module: modellib" |
61 |
print " platform: ", platform |
62 |
print " hostname: ", hostname |
63 |
print " pyinstall: ", pyinstall |
64 |
|
65 |
# |
66 |
# call the SConscript to do the actual build |
67 |
|
68 |
SConscript(dirs=['py_src'], build_dir='obj/py_src', duplicate=0) |