1 |
# Scons configuration file for esysUtils |
# Scons configuration file for esysUtils |
2 |
|
esysroot=str(Dir('./..').abspath) |
3 |
import os |
execfile(str(File(esysroot+"/scons/esys_options.py"))) |
|
import sys |
|
|
|
|
|
# |
|
|
# ensure correct versions of python and scons |
|
|
|
|
|
EnsurePythonVersion(2,3) |
|
|
EnsureSConsVersion(0,96) |
|
|
|
|
|
# |
|
|
# set appropriate defaults for configuration variables |
|
|
|
|
|
esysroot = Dir('#..') |
|
|
dodebug = 0 |
|
|
usegcc = 0 |
|
|
options = None |
|
|
|
|
|
# |
|
|
# import configuration variables passed in from |
|
|
# calling SConscript (if any) |
|
|
|
|
|
Import('*') |
|
|
|
|
|
# |
|
|
# retreive command-line arguments if any |
|
|
|
|
|
if ARGUMENTS.get('debug',0): |
|
|
dodebug = 1 |
|
|
|
|
|
if ARGUMENTS.get('usegcc',0): |
|
|
usegcc = 1 |
|
|
|
|
|
if ARGUMENTS.get('options',0): |
|
|
options = ARGUMENTS.get('options',0) |
|
|
|
|
|
# |
|
|
# determine platform |
|
|
|
|
|
env = Environment(ENV = os.environ) |
|
|
platform = env['PLATFORM'] |
|
|
|
|
|
# |
|
|
# determine hostname |
|
|
|
|
|
import socket |
|
|
hostname = socket.gethostname() |
|
|
|
|
|
# |
|
|
# export esysroot |
|
|
|
|
|
Export(["esysroot"]) |
|
|
|
|
|
# |
|
|
# set and export library directory |
|
|
|
|
|
libdir = Dir(str(esysroot) + '/esysUtils/lib') |
|
|
Export(["libdir"]) |
|
|
|
|
|
# |
|
|
# load and export configuration settings |
|
|
|
|
|
options_dir = str(esysroot) + '/scons' |
|
|
sys.path.append(options_dir) |
|
|
|
|
|
from default_options import * |
|
|
|
|
|
if hostname=='ess': |
|
|
from ess_options import * |
|
|
|
|
|
if usegcc==1: |
|
|
from gcc_options import * |
|
|
|
|
|
if options!=None: |
|
|
exec "from " + options + " import *" |
|
|
|
|
|
if dodebug==1: |
|
|
cxx_flags=cxx_flags_debug |
|
4 |
|
|
5 |
Export(["python_path"]) |
Export(["python_path"]) |
6 |
Export(["boost_path"]) |
Export(["boost_path"]) |
12 |
# print out build configuration for this module |
# print out build configuration for this module |
13 |
|
|
14 |
print "Build configuration for module: esysUtils" |
print "Build configuration for module: esysUtils" |
|
print " dodebug: ", dodebug |
|
|
print " usegcc: ", usegcc |
|
15 |
print " cxx: ", cxx |
print " cxx: ", cxx |
16 |
print " platform: ", platform |
print " cxx_flags: ", cxx_flags |
17 |
print " hostname: ", hostname |
|
18 |
|
|
19 |
|
# set and export library directory |
20 |
|
libdir = Dir(str(esysroot) + '/esysUtils/lib') |
21 |
|
Export(["libdir"]) |
22 |
|
|
23 |
# |
# |
24 |
# call the SConscript to do the actual build |
# call the SConscript to do the actual build |