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

Diff of /branches/RW_WIN32/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.200  
changed lines
  Added in v.222

  ViewVC Help
Powered by ViewVC 1.1.26