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

Contents of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 507 - (show annotations) (download)
Wed Apr 19 02:44:25 2006 UTC (13 years, 11 months ago) by johnpye
File size: 2736 byte(s)
Fixing for ubuntu GCC 4
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 if env.has_key('HAVE_GCCVISIBILITY'):
30 cxxflags += ['-fvisibility=hidden'];
31
32 objs = []
33 for s in srcs:
34 objs += env.SharedObject(s
35 , CPPPATH = ['../../base/generic']+env['PYTHON_CPPPATH']
36
37 , CPPFLAGS = cppflags
38 , CCFLAGS = cxxflags
39 )
40
41 #----------------------------------------------
42 # SWIG Builder
43
44 def swig_modify_targets(target, source, env):
45 target.append('ascpy.py')
46 target.append('ascpy_wrap.h')
47 return target, source
48
49 swig_builder = Builder(
50 action='$SWIG $SWIGFLAGS -o $TARGET $SOURCE'
51 , emitter=swig_modify_targets
52 )
53 env.Append(BUILDERS={'Swig':swig_builder})
54
55 #---------------------------------------------
56
57 def get_new_swig_flags(env):
58 min,maj,pat = env['SWIGVERSION']
59 flags = []
60 if min==1 and maj==3 and pat>=28:
61 flags += ['-O']
62 return flags
63
64 swiglib = env.SharedLibrary("ascpy",objs + ['ascpy.i']
65 , LIBS = ['ascend'] + env['PYTHON_LIB']
66 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
67 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
68 , CPPPATH = ['../../base/generic'] + env['PYTHON_CPPPATH']
69 , CPPFLAGS = cppflags
70 , CCFLAGS = cxxflags
71 , SHLIBPREFIX = '_'
72 )
73
74 #env.Depends(swiglib,'ascpy.py')
75
76 #print env['SUBST_DICT']
77
78 configpy = env.SubstInFile(source='config.py.in')
79 configh = env.SubstInFile(source='config.h.in')
80
81 ascendcmd = env.SubstInFile(source='ascend.in')
82
83 #---------------------------------------------
84 # INSTALLATION
85
86 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
87 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
88
89 import glob
90 pythonfiles = glob.glob("*.py")
91
92 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
93
94 gladefiles = glob.glob("glade/*")
95 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
96
97 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
98
99 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
100 import platform
101 if platform.system()=="Windows":
102 installer = env.Nsis('create.nsi')
103 Depends(installer,[swiglib,configpy,configh,ascendcmd])

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