/[escript]/trunk/pasowrap/src/SConscript
ViewVC logotype

Contents of /trunk/pasowrap/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3737 - (show annotations)
Tue Dec 13 00:04:39 2011 UTC (7 years, 10 months ago) by caltinay
File size: 2461 byte(s)
Reordered and removed superfluous libraries from link lines. Hope W32 likes
that.

1 ########################################################
2 #
3 # Copyright (c) 2003-2010 by University of Queensland
4 # Earth Systems Science Computational Center (ESSCC)
5 # http://www.uq.edu.au/esscc
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 ########################################################
12
13 import os
14 Import('*')
15
16 local_env = env.Clone()
17 local_dodgy = dodgy_env.Clone()
18 py_wrapper_local_env = env.Clone()
19
20 # Remove the sharedlibrary prefix on all platform - we don't want 'lib'
21 # mucking with our python modules
22 del py_wrapper_local_env['SHLIBPREFIX']
23
24 sources = """
25 PasoException.cpp
26 SystemMatrixAdapter.cpp
27 TransportProblemAdapter.cpp
28 """.split()
29
30 headers = """
31 PasoException.h
32 SystemMatrixAdapter.h
33 TransportProblemAdapter.h
34 system_dep.h
35 """.split()
36
37 local_env.Prepend(LIBS = ['escript', 'paso', 'esysUtils'])
38 if IS_WINDOWS:
39 local_env.Append(CPPDEFINES = ['PASOWRAP_EXPORTS'])
40
41 module_name = 'pasowrap'
42
43 # specify to build shared object
44
45 lib = local_env.SharedLibrary(module_name, sources)
46 env.Alias('build_pasowrap_lib', lib)
47
48 include_path = Dir('pasowrap', local_env['incinstall'])
49 hdr_inst = local_env.Install(include_path, headers)
50 env.Alias('install_pasowrap_headers', hdr_inst)
51
52 lib_inst = local_env.Install(local_env['libinstall'], lib)
53 env.Alias('install_pasowrap_lib', lib_inst)
54
55 ### Python wrapper ###
56 if not env['build_shared']:
57 py_wrapper_local_env.Prepend(LIBS = ['pasowrap', 'escript'])
58 else:
59 py_wrapper_local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
60 py_wrapper_name = module_name + 'cpp'
61 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'pasowrapcpp.cpp')
62 env.Alias('build_pasowrapcpp_lib', py_wrapper_lib)
63
64 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
65 if IS_WINDOWS:
66 wrapper_ext = '.pyd'
67 else:
68 wrapper_ext = '.so'
69
70 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
71 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
72 source=py_wrapper_lib[0])
73 env.Alias('install_pasowrapcpp_lib', mod_inst)
74
75 # configure python module
76 local_env.SConscript(dirs = ['#/pasowrap/py_src'], variant_dir='py', duplicate=0)
77
78 # configure unit tests
79 local_env.SConscript(dirs = ['#/pasowrap/test'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap/test', duplicate=0, exports=['py_wrapper_lib'])
80

  ViewVC Help
Powered by ViewVC 1.1.26