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

Contents of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 476 - (show annotations) (download)
Mon Apr 17 07:06:45 2006 UTC (18 years, 2 months ago) by johnpye
File size: 2427 byte(s)
Added some INSTALL notes relating to building windows installer.
Added some optimisations to the SWIG build to reduce target file size.
Fixed bug with WITH_INSTALLER=1 flag.
1 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 # Build a static library with all the sources
18
19 objs = []
20 for s in srcs:
21 objs += env.SharedObject(s
22 , CPPPATH = ['../../base/generic']+env['PYTHON_CPPPATH']
23 , CPPDEFINES = {
24 'ASCXX_USE_PYTHON':None
25 ,'DEFAULT_ASCENDLIBRARY':'\\"'+env['DEFAULT_ASCENDLIBRARY']+'\\"'
26 }
27 , CPPFLAGS = ['-O3']
28 )
29
30 #----------------------------------------------
31 # SWIG Builder
32
33 def swig_modify_targets(target, source, env):
34 target.append('ascpy.py')
35 target.append('ascpy_wrap.h')
36 return target, source
37
38 swig_builder = Builder(
39 action='$SWIG $SWIGFLAGS -o $TARGET $SOURCE'
40 , emitter=swig_modify_targets
41 )
42 env.Append(BUILDERS={'Swig':swig_builder})
43
44 #---------------------------------------------
45
46
47 #swig = env.Swig(target=['ascpy_wrap.cc'],source=['ascpy.i']
48 # , SWIGFLAGS=['-python','-c++']
49 # , CPPFLAGS = ['-O3']
50 #)
51
52
53 swiglib = env.SharedLibrary("ascpy",objs + ['ascpy.i']
54 , LIBS = ['ascend'] + env['PYTHON_LIB']
55 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
56 , SWIGFLAGS=['-python','-c++','-O','-fvirtual']
57 , CPPPATH = ['../../base/generic'] + env['PYTHON_CPPPATH']
58 , CPPDEFINES = {
59 'ASCXX_USE_PYTHON':None
60 ,'DEFAULT_ASCENDLIBRARY':'\\"'+env['DEFAULT_ASCENDLIBRARY']+'\\"'
61 }
62 , CPPFLAGS = ['-O3']
63 , SHLIBPREFIX = '_'
64 )
65
66 #env.Depends(swiglib,'ascpy.py')
67
68 #print env['SUBST_DICT']
69
70 env.SubstInFile(source='config.py.in')
71
72 ascendcmd = env.SubstInFile(source='ascend.in')
73
74 #---------------------------------------------
75 # INSTALLATION
76
77 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
78 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
79
80 import glob
81 pythonfiles = glob.glob("*.py")
82
83 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
84
85 gladefiles = glob.glob("glade/*")
86 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
87
88 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
89
90 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
91 import platform
92 if platform.system()=="Windows":
93 env.Nsis('create.nsi')

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