/[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 209 by robwdcock, Wed Nov 23 06:32:25 2005 UTC revision 305 by robwdcock, Sat Dec 3 05:05:25 2005 UTC
# Line 1  Line 1 
1    import scons_ext
2    
3  opts = Options('custom.py')  opts = Options('custom.py')
4  opts.AddOptions(  opts.AddOptions(
5     BoolOption('RELEASE', 'Set to build for release', 0),     BoolOption('RELEASE', 'Set to build for release', 0),
6     PathOption('PYTHON_HOME','Path to python home','C:/python23')     PathOption('PYTHON_HOME','Path to python home','/usr/lib/python2.3'),
7       PathOption('BOOST_HOME','Path to boost home','/usr/include/boost')
8  )  )
9    
10  env = Environment(tools = ['default'],options = opts)  env = Environment(tools = ['default'],options = opts)
11    
12    Help(opts.GenerateHelpText(env))
13    
14    py_builder = Builder(action = scons_ext.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
15    env.Append(BUILDERS = {'PyCompile' : py_builder});
16    
17    if env['PLATFORM'] == "win32":
18       runUnitTest_builder = Builder(action = scons_ext.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)
19    else:
20       runUnitTest_builder = Builder(action = scons_ext.runUnitTest, suffix = '.passed', single_source=True)
21    env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
22    
23    runPyUnitTest_builder = Builder(action = scons_ext.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
24    env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
25    
26    
27  print "PLATFORM is:", env['PLATFORM']  print "PLATFORM is:", env['PLATFORM']
28    
29  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
# Line 13  EnsurePythonVersion(2,3) Line 32  EnsurePythonVersion(2,3)
32  #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?
33    
34  # Third-Party libraries  # Third-Party libraries
35  boost_home = 'E:/woo409/development/boost'  boost_home = env['BOOST_HOME']
36  python_home = env['PYTHON_HOME']  python_home = env['PYTHON_HOME']
37    
38  # Where to install (and find) esys includes and libraries  # Where to install (and find) esys includes and libraries
# Line 21  python_home = env['PYTHON_HOME'] Line 40  python_home = env['PYTHON_HOME']
40  esys_inc = '#/include'  esys_inc = '#/include'
41  esys_lib = '#/lib'  esys_lib = '#/lib'
42    
43    env.Default(esys_lib)
44    env.Alias('py_test')
45    
46  # Derived paths  # Derived paths
47  python_inc = python_home + '/include'  if env['PLATFORM'] == "win32":
48  python_lib = python_home + '/libs'     python_inc = python_home + '/include'
49  boost_inc = boost_home     python_lib = python_home + '/libs'
50  boost_lib = boost_home + '/windows_binary/lib'     boost_inc = boost_home
51       boost_lib = boost_home + '/windows_binary/lib'
52    elif  env['PLATFORM'] == "posix":
53       python_inc = '/usr/include/python2.3'
54       python_lib = '/usr/lib'
55       boost_inc = '/usr/include'
56       boost_lib = '/usr/lib'
57    
58  incdir = [ boost_inc, python_inc, esys_inc ]  incdir = [ boost_inc, python_inc, esys_inc ]
59  libdir = [ boost_lib, python_lib, esys_lib ]  libdir = [ boost_lib, python_lib, esys_lib ]
# Line 33  libdir = [ boost_lib, python_lib, esys_l Line 61  libdir = [ boost_lib, python_lib, esys_l
61  env.Append(CPPPATH=incdir)  env.Append(CPPPATH=incdir)
62  env.Append(LIBPATH=libdir)  env.Append(LIBPATH=libdir)
63    
 env.Append(CPPDEFINES = ['DOASSERT'])  
64    
65  if env['PLATFORM'] == "win32":  if env['PLATFORM'] == "win32":
66     env.Append(CCFLAGS = ' /GR /EHsc /TP /wd4068')     env.Append(CCFLAGS = ' /GR /EHsc /TP /wd4068')
# Line 42  if env['PLATFORM'] == "win32": Line 69  if env['PLATFORM'] == "win32":
69        print "RELEASE build"        print "RELEASE build"
70     else:     else:
71        print "DEBUG build"        print "DEBUG build"
72          env.Append(CPPDEFINES = ['DOASSERT'])
73        env.Append(CCFLAGS = ' /Od /MDd /RTC1')        env.Append(CCFLAGS = ' /Od /MDd /RTC1')
74        env.Append(CPPDEFINES = ['_DEBUG'])        env.Append(CPPDEFINES = ['_DEBUG'])
75        boost_lib_name = 'boost_python-vc71-mt-sgd'        boost_lib_name = 'boost_python-vc71-mt-sgd'
76    elif env['PLATFORM'] == "posix":
77       env.Append(CC = ' -std=c99')
78       env.Append(CCFLAGS = ' -c -fpic -W -Wall -Wno-unknown-pragmas')
79       boost_lib_name = 'boost_python'
80       if False :
81          print "RELEASE build"
82       else:
83          print "DEBUG build"
84          env.Append(CPPDEFINES = ['DOASSERT', 'DOPROF'])
85          env.Prepend(CCFLAGS = ' -g -O0')
86    
87  Export(["env", "incdir", "esys_inc", "esys_lib", "boost_lib_name" ])  Export(["env", "incdir", "esys_inc", "esys_lib", "boost_lib_name" ])
88    
89  env.SConscript(dirs = ['paso/src'], build_dir='win32/build/paso', duplicate=0)  # C/C++ Libraries
90  env.SConscript(dirs = ['bruce/src'], build_dir='win32/build/bruce', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
91  env.SConscript(dirs = ['escript/src/Data'], build_dir='win32/build/escript/Data', duplicate=0)  env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
92  env.SConscript(dirs = ['esysUtils/src'], build_dir='win32/build/esysUtils', duplicate=0)  env.SConscript(dirs = ['escript/src/Data'], build_dir='build/$PLATFORM/escript/Data', duplicate=0)
93  env.SConscript(dirs = ['win32/win32_utils'], build_dir='win32/build/win32_utils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
94  env.SConscript(dirs = ['tools/mmio/src'], build_dir='win32/build/tools/mmio', duplicate=0)  env.SConscript(dirs = ['tools/mmio/src'], build_dir='build/$PLATFORM/tools/mmio', duplicate=0)
95  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='win32/build/tools/CppUnitTest', duplicate=0)  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
96    env.SConscript(dirs = ['finley/src/finleyC'], build_dir='build/$PLATFORM/finley/finleyC', duplicate=0)
97    env.SConscript(dirs = ['finley/src/CPPAdapter'], build_dir='build/$PLATFORM/finley/CPPAdapter', duplicate=0)
98    
99    if env['PLATFORM'] == "win32":
100       env.SConscript(dirs = ['win32/win32_utils'], build_dir='build/$PLATFORM/win32_utils', duplicate=0)
101    
102    # Unit Tests
103    env.SConscript(dirs = ['esysUtils/test/EsysException'], build_dir='build/$PLATFORM/esysUtils/test/EsysException', duplicate=0)
104    env.SConscript(dirs = ['escript/test'], build_dir='build/$PLATFORM/escript/test', duplicate=0)
105    env.SConscript(dirs = ['bruce/test'], build_dir='build/$PLATFORM/bruce/test', duplicate=0)
106    env.SConscript(dirs = ['finley/test'], build_dir='build/$PLATFORM/finley/test', duplicate=0)
107    
108    # Python
109    env.SConscript(dirs = ['esys/py_src'], build_dir='build/$PLATFORM/esys/py', duplicate=0)

Legend:
Removed from v.209  
changed lines
  Added in v.305

  ViewVC Help
Powered by ViewVC 1.1.26