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

Contents of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 502 - (show annotations) (download)
Tue Apr 18 12:57:30 2006 UTC (13 years, 10 months ago) by johnpye
File size: 2609 byte(s)
Added check to see that YACC runs OK.
Fixing build with MSVC++ 2005.
All builds now except for some problems in the SWIG-generated code.
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 cxxflags = []
20 cppflags = []
21
22 import platform
23
24 if platform.system()=='Windows' and env.has_key('MSVS'):
25 cxxflags += ['/EHsc'] # for exceptions (as suggested by a MSVC error msg, dunno if it's right or not -- JP)
26
27 if env.has_key('HAVE_GCC'):
28 cppflags += ['-O3']
29
30
31 objs = []
32 for s in srcs:
33 objs += env.SharedObject(s
34 , CPPPATH = ['../../base/generic']+env['PYTHON_CPPPATH']
35
36 , CPPFLAGS = cppflags
37 , CCFLAGS = cxxflags
38 )
39
40 #----------------------------------------------
41 # SWIG Builder
42
43 def swig_modify_targets(target, source, env):
44 target.append('ascpy.py')
45 target.append('ascpy_wrap.h')
46 return target, source
47
48 swig_builder = Builder(
49 action='$SWIG $SWIGFLAGS -o $TARGET $SOURCE'
50 , emitter=swig_modify_targets
51 )
52 env.Append(BUILDERS={'Swig':swig_builder})
53
54 #---------------------------------------------
55
56 def get_new_swig_flags(env):
57 min,maj,pat = env['SWIGVERSION']
58 flags = []
59 if min==1 and maj==3 and pat>=28:
60 flags += ['-O']
61 return flags
62
63 swiglib = env.SharedLibrary("ascpy",objs + ['ascpy.i']
64 , LIBS = ['ascend'] + env['PYTHON_LIB']
65 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
66 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
67 , CPPPATH = ['../../base/generic'] + env['PYTHON_CPPPATH']
68 , CPPFLAGS = cppflags
69 , CCFLAGS = cxxflags
70 , SHLIBPREFIX = '_'
71 )
72
73 #env.Depends(swiglib,'ascpy.py')
74
75 #print env['SUBST_DICT']
76
77 env.SubstInFile(source='config.py.in')
78 env.SubstInFile(source='config.h.in')
79
80 ascendcmd = env.SubstInFile(source='ascend.in')
81
82 #---------------------------------------------
83 # INSTALLATION
84
85 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
86 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
87
88 import glob
89 pythonfiles = glob.glob("*.py")
90
91 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
92
93 gladefiles = glob.glob("glade/*")
94 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
95
96 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
97
98 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
99 import platform
100 if platform.system()=="Windows":
101 installer = env.Nsis('create.nsi')
102 Depends(installer,swiglib)

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