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

Contents of /trunk/pygtk/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 734 - (show annotations) (download)
Wed Jul 5 01:18:43 2006 UTC (18 years ago) by johnpye
File size: 3401 byte(s)
Added missing dependence for ascpy.py
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 integrator.cpp
15 integratorreporter.cpp
16 """)
17
18 # Build a static library with all the sources
19
20 python_env = env.Copy()
21
22 import platform
23
24 if platform.system()=='Windows' and env.get('MSVS'):
25 python_env.Append(CCFLAGS=['/EHsc']) # for exceptions (as suggested by a MSVC error msg, dunno if it's right or not -- JP)
26
27 swig_has_gccvisibility = False
28 min,maj,pat = env['SWIGVERSION']
29 if min==1 and maj==3 and pat>=29:
30 swig_has_gccvisibility = True
31
32 if env.get('HAVE_GCC'):
33 python_env.Append(CPPFLAGS=['-O3'])
34 if swig_has_gccvisibility and env.has_key('HAVE_GCCVISIBILITY'):
35 python_env.Append(CCFLAGS=['-fvisibility=hidden']);
36
37 objs = []
38
39 python_env.Append(CPPPATH=['#base/generic']+env['PYTHON_CPPPATH'])
40
41 for s in srcs:
42 objs += python_env.SharedObject(s)
43
44 #----------------------------------------------
45 # SWIG wrapper
46
47 def get_new_swig_flags(env):
48 min,maj,pat = env['SWIGVERSION']
49 flags = []
50 if min==1 and maj==3 and pat>=28:
51 flags += ['-O']
52 return flags
53
54 swigobj = python_env.SharedObject('ascpy.i'
55 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
56 )
57 python_env.SideEffect(['ascpy.py','ascpy_wrap.h'],'ascpy$SWIGCXXFILESUFFIX')
58 python_env.Depends('ascpy.py',['ascpy.i'])
59 python_env.Clean('ascpy_wrap$SWIGCXXFILESUFFIX',swigobj)
60 python_env.Clean('ascpy.py','ascpy$SWIGCXXFILESUFFIX')
61 python_env.Clean('ascpy_wrap.h','ascpy$SWIGCXXFILESUFFIX')
62
63 swiglib = python_env.SharedLibrary("ascpy",objs + swigobj
64 , LIBS = ['ascend'] + env['PYTHON_LIB'] + ['stdc++']
65 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
66 , SHLIBPREFIX = '_'
67 )
68
69 #---------------------------------------------
70 # CONFIG & runtime shell script for posix
71
72 configpy = env.SubstInFile(source='config.py.in')
73 configh = env.SubstInFile(source='config.h.in')
74
75 if platform.system() != "Windows" or env.has_key('IS_MINGW'):
76 ascendcmd = env.SubstInFile(source='ascend.in')
77 env.AddPostAction(ascendcmd, 'chmod 755 $TARGET')
78
79 #---------------------------------------------
80 # LITTLE WEE TEST PROGRAM for debuggin the c++ wrapper
81 #
82 #libascxx = env.SharedLibrary('ascxx',objs
83 # , LIBS = ['ascend'] + env['PYTHON_LIB']
84 # , LIBPATH = ['.'] + ['#'] + env['PYTHON_LIBPATH']
85 #)
86 #
87 #ascxxtest = env.Program('ascxxtest',['ascxxtest.cpp']
88 # , LIBS = ['ascxx','ascend']
89 # , LIBPATH = ['.','#']
90 #)
91 #
92 #env.Alias('ascxx',ascxxtest)
93
94 #---------------------------------------------
95 # INSTALLATION
96
97 if env.get('CAN_INSTALL'):
98 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
99
100 import glob
101 pythonfiles = glob.glob("*.py")
102
103 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_ASCDATA']+"/",pythonfiles)
104
105 gladefiles = glob.glob("glade/*")
106 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_ASCDATA']+"/glade/",gladefiles)
107
108 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_ASCDATA']+"/",swiglib)
109
110 import platform
111 if platform.system()=="Windows":
112 env.Append(NSISDEFINES={'OUTFILE':env['WIN_INSTALLER_NAME']})
113 installer = env.Installer('create.nsi')
114 Depends(installer,[swiglib,configpy,configh])
115 env.Alias('installer',installer)

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