/[ascend]/trunk/pygtk/interface/SConscript
ViewVC logotype

Annotation of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 395 - (hide annotations) (download)
Fri Mar 31 06:09:03 2006 UTC (14 years, 7 months ago) by johnpye
File size: 2102 byte(s)
Successful build of Python interface on Windows with MinGW/MSYS.
1 johnpye 387 Import('env')
2    
3     srcs = Split("""
4    
5     library.cpp type.cpp module.cpp symchar.cpp
6     instance.cpp instanceinterfacedata.cpp
7     method.cpp name.cpp
8     reporter.cpp simulation.cpp set.cpp units.cpp dimensions.cpp extmethod.cpp
9     variable.cpp relation.cpp
10     solver.cpp curve.cpp plot.cpp
11     solverparameters.cpp solverparameter.cpp solverparameteriterator.cpp
12     solverstatus.cpp solverreporter.cpp
13     incidencematrix.cpp
14    
15     """)
16    
17     libs = Split("""
18     asccompiler ascpackages ascsolver ascutilities ascgeneral
19     """)
20    
21 johnpye 392
22 johnpye 388 libpath = [
23     '../../base/generic/compiler'
24     ,'../../base/generic/packages'
25     ,'../../base/generic/solver'
26     ,'../../base/generic/utilities'
27     ,'../../base/generic/general'
28     ]
29 johnpye 387
30 johnpye 395 # Build a static library with all the sources
31    
32     lib = env.Library("ascxx",srcs
33     , LIBS = libs
34     , LIBPATH = libpath
35 johnpye 392 , CPPPATH = ['../../base/generic']+env['PYTHON_CPPPATH']
36 johnpye 393 , CPPDEFINES = {
37     'ASCXX_USE_PYTHON':None
38     ,'DEFAULT_ASCENDLIBRARY':'\\"'+env['DEFAULT_ASCENDLIBRARY']+'\\"'
39     }
40 johnpye 395 , CPPFLAGS = ['-O3']
41     )
42    
43     #import platform
44     #if platform.system()=="Windows":
45     # #
46     # #
47     def swig_modify_targets(target, source, env):
48     target.append('ascend.py')
49     target.append('ascend_wrap.h')
50     return target, source
51    
52     swig_builder = Builder(
53     action='$SWIG $SWIGFLAGS -o $TARGET $SOURCE'
54     , emitter=swig_modify_targets
55     )
56     env.Append(BUILDERS={'Swig':swig_builder})
57    
58     swig = env.Swig(target=['ascend_wrap.cc'],source=['ascend.i']
59     , SWIGFLAGS=['-python','-c++']
60     , CPPFLAGS = ['-O3']
61     )
62     #else:
63     #swig = env.CFile(target=['ascend_wrap.cc'],source=['ascend.i']
64     # , SWIGFLAGS=['-python','-c++']
65     # , ENV={'SWIGFEATURES':'-O'}
66     # , CPPFLAGS = ['-O3']
67     # )
68    
69     #env.Depends('ascend.py',swig);
70    
71    
72     swiglib = env.SharedLibrary("ascend",['ascend_wrap.cc']
73     , LIBS = ['ascxx']+libs+env['PYTHON_LIB']
74     , LIBPATH = ['.']+libpath+env['PYTHON_LIBPATH']
75     , CPPPATH = ['../../base/generic']+env['PYTHON_CPPPATH']
76     , CPPDEFINES = {
77     'ASCXX_USE_PYTHON':None
78     ,'DEFAULT_ASCENDLIBRARY':'\\"'+env['DEFAULT_ASCENDLIBRARY']+'\\"'
79     }
80     , CPPFLAGS = ['-O3']
81 johnpye 392 , SHLIBPREFIX = '_'
82 johnpye 387 )
83 johnpye 392
84 johnpye 395 env.Depends(swiglib,'ascend.py')
85 johnpye 393
86     print env['SUBST_DICT']
87    
88     env.SubstInFile(source='config.py.in')
89    

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22