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

Annotation of /trunk/pygtk/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 508 - (hide annotations) (download)
Wed Apr 19 04:48:32 2006 UTC (13 years, 10 months ago) by johnpye
Original Path: trunk/pygtk/interface/SConscript
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 johnpye 387 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 johnpye 395 # Build a static library with all the sources
18    
19 johnpye 508 python_env = env.Copy()
20 johnpye 502
21     import platform
22    
23     if platform.system()=='Windows' and env.has_key('MSVS'):
24 johnpye 508 python_env.Append(CCFLAGS=['/EHsc']) # for exceptions (as suggested by a MSVC error msg, dunno if it's right or not -- JP)
25 johnpye 502
26     if env.has_key('HAVE_GCC'):
27 johnpye 508 python_env.Append(CPPFLAGS=['-O3'])
28 johnpye 507 if env.has_key('HAVE_GCCVISIBILITY'):
29 johnpye 508 python_env.Append(CCFLAGS=['-fvisibility=hidden']);
30 johnpye 502
31 johnpye 463 objs = []
32 johnpye 508
33     python_env.Append(CPPPATH=['#base/generic']+env['PYTHON_CPPPATH'])
34    
35 johnpye 463 for s in srcs:
36 johnpye 508 objs += python_env.SharedObject(s)
37 johnpye 500
38 johnpye 398 #----------------------------------------------
39     # SWIG Builder
40    
41 johnpye 508 #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 johnpye 395
52 johnpye 398 #---------------------------------------------
53 johnpye 395
54 johnpye 478 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 johnpye 482 flags += ['-O']
59 johnpye 478 return flags
60 johnpye 395
61 johnpye 508 swiglib = python_env.SharedLibrary("ascpy",objs + ['ascpy.i']
62 johnpye 463 , LIBS = ['ascend'] + env['PYTHON_LIB']
63     , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
64 johnpye 478 , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
65 johnpye 392 , SHLIBPREFIX = '_'
66 johnpye 387 )
67 johnpye 392
68 johnpye 505 configpy = env.SubstInFile(source='config.py.in')
69     configh = env.SubstInFile(source='config.h.in')
70 johnpye 393
71 johnpye 436 ascendcmd = env.SubstInFile(source='ascend.in')
72    
73 johnpye 508 env.Execute(Chmod(ascendcmd, 0755))
74    
75 johnpye 435 #---------------------------------------------
76     # INSTALLATION
77    
78 johnpye 463 if env.has_key('CAN_INSTALL') and env['CAN_INSTALL']:
79     env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
80 johnpye 435
81 johnpye 463 import glob
82     pythonfiles = glob.glob("*.py")
83 johnpye 435
84 johnpye 463 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",pythonfiles)
85 johnpye 435
86 johnpye 463 gladefiles = glob.glob("glade/*")
87     env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/glade/",gladefiles)
88 johnpye 435
89 johnpye 463 env.Install(env['INSTALL_ROOT']+env['INSTALL_DATA']+"/ascend/",swiglib)
90 johnpye 466
91 johnpye 476 if env.has_key('WITH_INSTALLER') and env['WITH_INSTALLER']:
92 johnpye 466 import platform
93     if platform.system()=="Windows":
94 johnpye 502 installer = env.Nsis('create.nsi')
95 johnpye 505 Depends(installer,[swiglib,configpy,configh,ascendcmd])

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