1 |
# Scons configuration file for paso |
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 |
libinstall = None |
17 |
dodebug = 0 |
18 |
usegcc = 0 |
19 |
options = None |
20 |
|
21 |
# |
22 |
# import configuration variables passed in from |
23 |
# calling SConscript (if any) |
24 |
|
25 |
Import('*') |
26 |
|
27 |
# |
28 |
# retreive command-line arguments if any |
29 |
|
30 |
if ARGUMENTS.get('libinstall',0): |
31 |
libinstall = ARGUMENTS.get('libinstall',0) |
32 |
Export(["libinstall"]) |
33 |
|
34 |
if ARGUMENTS.get('debug',0): |
35 |
dodebug = 1 |
36 |
|
37 |
if ARGUMENTS.get('usegcc',0): |
38 |
usegcc = 1 |
39 |
|
40 |
if ARGUMENTS.get('options',0): |
41 |
options = ARGUMENTS.get('options',0) |
42 |
|
43 |
# |
44 |
# determine platform |
45 |
|
46 |
env = Environment(ENV = os.environ) |
47 |
platform = env['PLATFORM'] |
48 |
|
49 |
# |
50 |
# determine hostname |
51 |
|
52 |
import socket |
53 |
hostname = socket.gethostname() |
54 |
|
55 |
# |
56 |
# export esysroot |
57 |
|
58 |
Export(["esysroot"]) |
59 |
|
60 |
# |
61 |
# set and export library directories |
62 |
|
63 |
libdir = Dir(str(esysroot) + '/paso/lib') |
64 |
Export(["libdir"]) |
65 |
libdir2 = Dir(str(esysroot) + '/lib') |
66 |
Export(["libdir2"]) |
67 |
|
68 |
# |
69 |
# load and export configuration settings |
70 |
|
71 |
options_dir = str(esysroot) + '/scons' |
72 |
sys.path.append(options_dir) |
73 |
|
74 |
from default_options import * |
75 |
|
76 |
if hostname=='ess': |
77 |
from ess_options import * |
78 |
|
79 |
if usegcc==1: |
80 |
from gcc_options import * |
81 |
|
82 |
if options!=None: |
83 |
exec "from " + options + " import *" |
84 |
|
85 |
if dodebug==1: |
86 |
cc_flags=cc_flags_debug |
87 |
|
88 |
Export(["python_path"]) |
89 |
Export(["boost_path"]) |
90 |
Export(["cc"]) |
91 |
Export(["cc_flags"]) |
92 |
Export(["ar_flags"]) |
93 |
|
94 |
# |
95 |
# print out build configuration for this module |
96 |
|
97 |
print "Build configuration for module: paso" |
98 |
print " dodebug: ", dodebug |
99 |
print " usegcc: ", usegcc |
100 |
print " cc: ", cc |
101 |
print " platform: ", platform |
102 |
print " hostname: ", hostname |
103 |
print " libinstall: ", libinstall |
104 |
|
105 |
# |
106 |
# call the SConscript to do the actual build |
107 |
|
108 |
SConscript('src/SConscript', src_dir='src', build_dir='obj', duplicate=0) |