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

Contents of /trunk/pygtk/interface/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 529 - (show annotations) (download)
Sat Apr 22 06:26:23 2006 UTC (14 years, 3 months ago) by johnpye
File size: 3173 byte(s)
Working of debugging the mysterious PyGTK bug. Seems to be coming from a wrong
char *filename in an error_reporter call from the DEBUG_RELS sections of the
compiler code.
Also renamed the WSEM and WSNM macros for clarity, removed unused file pointer.
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 python_env.Replace(
21 CPPFLAGS=[]
22 , CCFLAGS=[]
23 , CPPDEFINES=[]
24 , LIBS=[]
25 )
26
27 import platform
28
29 if platform.system()=='Windows' and env.has_key('MSVS'):
30 python_env.Append(CCFLAGS=['/EHsc']) # for exceptions (as suggested by a MSVC error msg, dunno if it's right or not -- JP)
31
32 swig_has_gccvisibility = False
33 min,maj,pat = env['SWIGVERSION']
34 if min==1 and maj==3 and pat>=29:
35 swig_has_gccvisibility = True
36
37 if env.has_key('HAVE_GCC'):
38 python_env.Append(CPPFLAGS=['-O3'])
39 if swig_has_gccvisibility and env.has_key('HAVE_GCCVISIBILITY'):
40 python_env.Append(CCFLAGS=['-fvisibility=hidden']);
41
42 objs = []
43
44 python_env.Append(CPPPATH=['#base/generic']+env['PYTHON_CPPPATH'])
45
46 for s in srcs:
47 objs += python_env.SharedObject(s)
48
49 #----------------------------------------------
50 # SWIG wrapper
51
52 def get_new_swig_flags(env):
53 min,maj,pat = env['SWIGVERSION']
54 flags = []
55 if min==1 and maj==3 and pat>=28:
56 flags += ['-O']
57 return flags
58
59 swigobj = python_env.SharedObject('ascpy.i'
60 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
61 )
62 python_env.SideEffect(['ascpy.py','ascpy_wrap.h'],'ascpy_wrap.cc')
63
64 swiglib = python_env.SharedLibrary("ascpy",objs + swigobj
65 , LIBS = ['ascend'] + env['PYTHON_LIB']
66 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
67 , SHLIBPREFIX = '_'
68 )
69
70 #---------------------------------------------
71 # CONFIG & runtime shell script for posix
72
73 configpy = env.SubstInFile(source='config.py.in')
74 configh = env.SubstInFile(source='config.h.in')
75
76 if platform.system() != "Windows" or env.has_key('IS_MINGW'):
77 ascendcmd = env.SubstInFile(source='ascend.in')
78 env.AddPostAction(ascendcmd, 'chmod 755 $TARGET')
79
80 #---------------------------------------------
81 # LITTLE WEE TEST PROGRAM for debuggin the c++ wrapper
82
83 libascxx = env.SharedLibrary('ascxx',objs
84 , LIBS = ['ascend'] + env['PYTHON_LIB']
85 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
86 )
87
88 ascxxtest = env.Program('ascxxtest',['ascxxtest.cpp']
89 , LIBS = ['ascxx','ascend']
90 , LIBPATH = ['.','#']
91 )
92
93 env.Alias('ascxx',ascxxtest)
94
95 #---------------------------------------------
96 # INSTALLATION
97
98 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
99 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
100
101 import glob
102 pythonfiles = glob.glob("*.py")
103
104 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
105
106 gladefiles = glob.glob("glade/*")
107 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
108
109 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
110
111 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
112 import platform
113 if platform.system()=="Windows":
114 installer = env.Nsis('create.nsi')
115 Depends(installer,[swiglib,configpy,configh])

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