/[escript]/branches/RW_WIN32/SConstruct
ViewVC logotype

Annotation of /branches/RW_WIN32/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 221 - (hide annotations)
Thu Nov 24 11:23:33 2005 UTC (13 years, 5 months ago) by phornby
File size: 3617 byte(s)
Builds on Linux. Changes to path names in top level
SConstruct will break the windows build. I've done my best
to not change anything else that would break windows, but
something might have slipped past.

Please check the finley_UnitTests.cpp, bruce_UnitTests.cpp and
escript_UnitTest.cpp (look at the TODO).


1 robwdcock 186 opts = Options('custom.py')
2     opts.AddOptions(
3     BoolOption('RELEASE', 'Set to build for release', 0),
4 phornby 221 PathOption('PYTHON_HOME','Path to python home','/usr/lib/python2.3')
5 robwdcock 186 )
6 robwdcock 220
7    
8     # Extensions to Scons
9     def build_py(target, source, env):
10     # Code to build .pyc from .py
11     import py_compile, sys;
12     py_compile.compile(str(source[0]), str(target[0]))
13     return None
14     py_builder = Builder(action = build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
15    
16 robwdcock 186 env = Environment(tools = ['default'],options = opts)
17 robwdcock 220 env.Append(BUILDERS = {'PyCompile' : py_builder});
18 robwdcock 186
19     print "PLATFORM is:", env['PLATFORM']
20    
21     EnsurePythonVersion(2,3)
22    
23     #TODO: How do I convert these to options?
24     #TODO: Is there a more compact way of setting up the include paths?
25    
26     # Third-Party libraries
27 phornby 221 boost_home = '/usr/include/boost'
28 robwdcock 209 python_home = env['PYTHON_HOME']
29 robwdcock 186
30     # Where to install (and find) esys includes and libraries
31     # Note: #/ means relative to the top of source tree
32     esys_inc = '#/include'
33     esys_lib = '#/lib'
34    
35     # Derived paths
36 phornby 221 if env['PLATFORM'] == "win32":
37     python_inc = python_home + '/include'
38     python_lib = python_home + '/libs'
39     boost_inc = boost_home
40     boost_lib = boost_home + '/usr/lib'
41     elif env['PLATFORM'] == "posix":
42     python_inc = '/usr/include/python2.3'
43     python_lib = '/usr/lib'
44     boost_inc = '/usr/include'
45     boost_lib = '/usr/lib'
46 robwdcock 186
47     incdir = [ boost_inc, python_inc, esys_inc ]
48 robwdcock 209 libdir = [ boost_lib, python_lib, esys_lib ]
49 robwdcock 186
50     env.Append(CPPPATH=incdir)
51     env.Append(LIBPATH=libdir)
52    
53    
54     if env['PLATFORM'] == "win32":
55     env.Append(CCFLAGS = ' /GR /EHsc /TP /wd4068')
56     env.Append(CPPDEFINES = ['MSVC', 'WIN32'])
57     if False :
58     print "RELEASE build"
59     else:
60     print "DEBUG build"
61 phornby 221 env.Append(CPPDEFINES = ['DOASSERT'])
62 robwdcock 186 env.Append(CCFLAGS = ' /Od /MDd /RTC1')
63     env.Append(CPPDEFINES = ['_DEBUG'])
64 robwdcock 209 boost_lib_name = 'boost_python-vc71-mt-sgd'
65 phornby 221 elif env['PLATFORM'] == "posix":
66     env.Append(CC = ' -std=c99')
67     env.Append(CCFLAGS = ' -c -fpic -W -Wall -Wno-unknown-pragmas')
68     boost_lib_name = 'boost_python'
69     if False :
70     print "RELEASE build"
71     else:
72     print "DEBUG build"
73     env.Append(CPPDEFINES = ['DOASSERT', 'DOPROF'])
74     env.Prepend(CCFLAGS = ' -g -O0')
75 robwdcock 186
76 robwdcock 209 Export(["env", "incdir", "esys_inc", "esys_lib", "boost_lib_name" ])
77 robwdcock 186
78 robwdcock 220 # C/C++ Libraries
79 phornby 221 env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
80     env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
81     env.SConscript(dirs = ['escript/src/Data'], build_dir='build/$PLATFORM/escript/Data', duplicate=0)
82     env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
83     env.SConscript(dirs = ['tools/mmio/src'], build_dir='build/$PLATFORM/tools/mmio', duplicate=0)
84     env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
85     env.SConscript(dirs = ['finley/src/finleyC'], build_dir='build/$PLATFORM/finleyC', duplicate=0)
86     env.SConscript(dirs = ['finley/src/CPPAdapter'], build_dir='build/$PLATFORM/CPPAdapter', duplicate=0)
87 robwdcock 218
88     # Unit Tests
89 phornby 221 env.SConscript(dirs = ['esysUtils/test/EsysException'], build_dir='build/$PLATFORM/esysUtils/test/EsysException', duplicate=0)
90     env.SConscript(dirs = ['escript/test'], build_dir='build/$PLATFORM/escript/test', duplicate=0)
91     env.SConscript(dirs = ['bruce/test'], build_dir='build/$PLATFORM/bruce/test', duplicate=0)
92     env.SConscript(dirs = ['finley/test'], build_dir='build/$PLATFORM/finley/test', duplicate=0)
93    
94     if env['PLATFORM'] == "win32":
95     env.SConscript(dirs = ['win32/win32_utils'], build_dir='build/$PLATFORM/win32_utils', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26