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

Annotation of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 398 - (hide annotations) (download)
Fri Mar 31 07:55:11 2006 UTC (14 years, 7 months ago) by johnpye
File size: 1956 byte(s)
Added SWIG version detection.
Added some ignore patterns for files in the repository.
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 johnpye 398 #----------------------------------------------
44     # SWIG Builder
45    
46 johnpye 395 def swig_modify_targets(target, source, env):
47     target.append('ascend.py')
48     target.append('ascend_wrap.h')
49     return target, source
50    
51     swig_builder = Builder(
52     action='$SWIG $SWIGFLAGS -o $TARGET $SOURCE'
53     , emitter=swig_modify_targets
54     )
55     env.Append(BUILDERS={'Swig':swig_builder})
56 johnpye 398 #---------------------------------------------
57 johnpye 395
58 johnpye 398
59 johnpye 395 swig = env.Swig(target=['ascend_wrap.cc'],source=['ascend.i']
60     , SWIGFLAGS=['-python','-c++']
61     , CPPFLAGS = ['-O3']
62     )
63    
64    
65     swiglib = env.SharedLibrary("ascend",['ascend_wrap.cc']
66     , LIBS = ['ascxx']+libs+env['PYTHON_LIB']
67     , LIBPATH = ['.']+libpath+env['PYTHON_LIBPATH']
68     , CPPPATH = ['../../base/generic']+env['PYTHON_CPPPATH']
69     , CPPDEFINES = {
70     'ASCXX_USE_PYTHON':None
71     ,'DEFAULT_ASCENDLIBRARY':'\\"'+env['DEFAULT_ASCENDLIBRARY']+'\\"'
72     }
73     , CPPFLAGS = ['-O3']
74 johnpye 392 , SHLIBPREFIX = '_'
75 johnpye 387 )
76 johnpye 392
77 johnpye 395 env.Depends(swiglib,'ascend.py')
78 johnpye 393
79     print env['SUBST_DICT']
80    
81     env.SubstInFile(source='config.py.in')
82    

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