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

Contents of /trunk/pygtk/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 482 - (show annotations) (download)
Mon Apr 17 12:22:31 2006 UTC (13 years, 10 months ago) by johnpye
Original Path: trunk/pygtk/interface/SConscript
File size: 2496 byte(s)
Set up memory of file->open path in PyGTK GUI.
Improved pass-through of ./ascend parameters in ASC_DEVELOPING mode.
Removed disused SWIG builder in SConscript (using SCOns' builtin stuff now)
Improved some console messages from Python.
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 def get_new_swig_flags(env):
47 min,maj,pat = env['SWIGVERSION']
48 flags = []
49 if min==1 and maj==3 and pat>=28:
50 flags += ['-O']
51 return flags
52
53
54 swiglib = env.SharedLibrary("ascpy",objs + ['ascpy.i']
55 , LIBS = ['ascend'] + env['PYTHON_LIB']
56 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
57 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
58 , CPPPATH = ['../../base/generic'] + env['PYTHON_CPPPATH']
59 , CPPDEFINES = {
60 'ASCXX_USE_PYTHON':None
61 ,'DEFAULT_ASCENDLIBRARY':'\\"'+env['DEFAULT_ASCENDLIBRARY']+'\\"'
62 }
63 , CPPFLAGS = ['-O3']
64 , SHLIBPREFIX = '_'
65 )
66
67 #env.Depends(swiglib,'ascpy.py')
68
69 #print env['SUBST_DICT']
70
71 env.SubstInFile(source='config.py.in')
72 env.SubstInFile(source='config.h.in')
73
74 ascendcmd = env.SubstInFile(source='ascend.in')
75
76 #---------------------------------------------
77 # INSTALLATION
78
79 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
80 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
81
82 import glob
83 pythonfiles = glob.glob("*.py")
84
85 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
86
87 gladefiles = glob.glob("glade/*")
88 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
89
90 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
91
92 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
93 import platform
94 if platform.system()=="Windows":
95 env.Nsis('create.nsi')

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