1 |
# Scons configuration file for mmio |
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 |
dodebug = 0 |
17 |
usegcc = 0 |
18 |
options = None |
19 |
|
20 |
# |
21 |
# import configuration variables passed in from |
22 |
# calling SConscript (if any) |
23 |
|
24 |
Import('*') |
25 |
|
26 |
# |
27 |
# retreive command-line arguments if any |
28 |
|
29 |
if ARGUMENTS.get('debug',0): |
30 |
dodebug = 1 |
31 |
|
32 |
if ARGUMENTS.get('usegcc',0): |
33 |
usegcc = 1 |
34 |
|
35 |
if ARGUMENTS.get('options',0): |
36 |
options = ARGUMENTS.get('options',0) |
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) + '/tools/mmio/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 hostname=='ess': |
67 |
from ess_options import * |
68 |
|
69 |
if usegcc==1: |
70 |
from gcc_options import * |
71 |
|
72 |
if options!=None: |
73 |
exec "from " + options + " import *" |
74 |
|
75 |
if dodebug==1: |
76 |
cc_flags=cc_flags_debug |
77 |
|
78 |
Export(["cc"]) |
79 |
Export(["cc_flags"]) |
80 |
Export(["ar_flags"]) |
81 |
|
82 |
# |
83 |
# print out build configuration for this module |
84 |
|
85 |
print "############################################" |
86 |
print "Build configuration for module: mmio" |
87 |
print " dodebug: ", dodebug |
88 |
print " usegcc: ", usegcc |
89 |
print " cc: ", cc |
90 |
print " platform: ", platform |
91 |
print " hostname: ", hostname |
92 |
print "############################################" |
93 |
|
94 |
# |
95 |
# call the SConscript to do the actual build |
96 |
|
97 |
SConscript('src/SConscript', src_dir='src', build_dir='obj', duplicate=0) |