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

Contents of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 508 - (show annotations) (download)
Wed Apr 19 04:48:32 2006 UTC (17 years, 7 months ago) by johnpye
File size: 2641 byte(s)
More fixes for compiling and running on ubuntu 5.10 with GCC:
gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)

Added ASC_SHLIBSUFFIX and ASC_SHLIBPREFIX which are used in packages.c in preference to platform-specific #ifdefs.

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 python_env = env.Copy()
20
21 import platform
22
23 if platform.system()=='Windows' and env.has_key('MSVS'):
24 python_env.Append(CCFLAGS=['/EHsc']) # for exceptions (as suggested by a MSVC error msg, dunno if it's right or not -- JP)
25
26 if env.has_key('HAVE_GCC'):
27 python_env.Append(CPPFLAGS=['-O3'])
28 if env.has_key('HAVE_GCCVISIBILITY'):
29 python_env.Append(CCFLAGS=['-fvisibility=hidden']);
30
31 objs = []
32
33 python_env.Append(CPPPATH=['#base/generic']+env['PYTHON_CPPPATH'])
34
35 for s in srcs:
36 objs += python_env.SharedObject(s)
37
38 #----------------------------------------------
39 # SWIG Builder
40
41 #def swig_modify_targets(target, source, env):
42 # target.append('ascpy.py')
43 # target.append('ascpy_wrap.h')
44 # return target, source
45 #
46 #swig_builder = Builder(
47 # action='$SWIG $SWIGFLAGS -o $TARGET $SOURCE'
48 # , emitter=swig_modify_targets
49 #)
50 #python_env.Append(BUILDERS={'Swig':swig_builder})
51
52 #---------------------------------------------
53
54 def get_new_swig_flags(env):
55 min,maj,pat = env['SWIGVERSION']
56 flags = []
57 if min==1 and maj==3 and pat>=28:
58 flags += ['-O']
59 return flags
60
61 swiglib = python_env.SharedLibrary("ascpy",objs + ['ascpy.i']
62 , LIBS = ['ascend'] + env['PYTHON_LIB']
63 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
64 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
65 , SHLIBPREFIX = '_'
66 )
67
68 configpy = env.SubstInFile(source='config.py.in')
69 configh = env.SubstInFile(source='config.h.in')
70
71 ascendcmd = env.SubstInFile(source='ascend.in')
72
73 env.Execute(Chmod(ascendcmd, 0755))
74
75 #---------------------------------------------
76 # INSTALLATION
77
78 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
79 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
80
81 import glob
82 pythonfiles = glob.glob("*.py")
83
84 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
85
86 gladefiles = glob.glob("glade/*")
87 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
88
89 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
90
91 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
92 import platform
93 if platform.system()=="Windows":
94 installer = env.Nsis('create.nsi')
95 Depends(installer,[swiglib,configpy,configh,ascendcmd])

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