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

Annotation of /trunk/pygtk/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 858 - (hide annotations) (download)
Mon Sep 25 15:04:48 2006 UTC (14 years ago) by johnpye
File size: 3596 byte(s)
Added new script 'ascdev' to launch ASCEND in 'developer mode'
which means that files in the source hierarchy will be used instead
of the installed files.
1 johnpye 387 Import('env')
2    
3     srcs = Split("""
4    
5 johnpye 770 library.cpp compiler.cpp type.cpp module.cpp symchar.cpp
6 johnpye 387 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 johnpye 669 integrator.cpp
15     integratorreporter.cpp
16 johnpye 387 """)
17    
18 johnpye 395 # Build a static library with all the sources
19    
20 johnpye 508 python_env = env.Copy()
21 johnpye 502
22     import platform
23    
24 johnpye 552 if platform.system()=='Windows' and env.get('MSVS'):
25 johnpye 508 python_env.Append(CCFLAGS=['/EHsc']) # for exceptions (as suggested by a MSVC error msg, dunno if it's right or not -- JP)
26 johnpye 502
27 johnpye 509 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 johnpye 552 if env.get('HAVE_GCC'):
33 johnpye 508 python_env.Append(CPPFLAGS=['-O3'])
34 johnpye 509 if swig_has_gccvisibility and env.has_key('HAVE_GCCVISIBILITY'):
35 johnpye 508 python_env.Append(CCFLAGS=['-fvisibility=hidden']);
36 johnpye 502
37 johnpye 463 objs = []
38 johnpye 508
39 johnpye 743 python_env.AppendUnique(CPPPATH=['#base/generic']+env['PYTHON_CPPPATH'])
40 johnpye 508
41 johnpye 463 for s in srcs:
42 johnpye 508 objs += python_env.SharedObject(s)
43 johnpye 500
44 johnpye 398 #----------------------------------------------
45 johnpye 529 # SWIG wrapper
46 johnpye 398
47 johnpye 478 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 johnpye 482 flags += ['-O']
52 johnpye 478 return flags
53 johnpye 395
54 johnpye 519 swigobj = python_env.SharedObject('ascpy.i'
55     , SWIGFLAGS=['-python','-c++'] + get_new_swig_flags(env)
56     )
57 johnpye 558 python_env.SideEffect(['ascpy.py','ascpy_wrap.h'],'ascpy$SWIGCXXFILESUFFIX')
58 johnpye 734 python_env.Depends('ascpy.py',['ascpy.i'])
59 johnpye 558 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 johnpye 519
63 johnpye 742 _libs = ['ascend']+env['PYTHON_LIB']
64     if not env.get('MSVS'):
65     _libs.append('stdc++')
66    
67 johnpye 519 swiglib = python_env.SharedLibrary("ascpy",objs + swigobj
68 johnpye 742 , LIBS = _libs
69 johnpye 463 , LIBPATH = ['#'] + env['PYTHON_LIBPATH']
70 johnpye 392 , SHLIBPREFIX = '_'
71 johnpye 387 )
72 johnpye 529
73     #---------------------------------------------
74     # CONFIG & runtime shell script for posix
75    
76 johnpye 505 configpy = env.SubstInFile(source='config.py.in')
77     configh = env.SubstInFile(source='config.h.in')
78 johnpye 393
79 johnpye 529 if platform.system() != "Windows" or env.has_key('IS_MINGW'):
80     ascendcmd = env.SubstInFile(source='ascend.in')
81     env.AddPostAction(ascendcmd, 'chmod 755 $TARGET')
82 johnpye 858 ascdevcmd = env.SubstInFile(source='ascdev.in')
83     env.AddPostAction(ascdevcmd, 'chmod 755 $TARGET')
84 johnpye 436
85 johnpye 435 #---------------------------------------------
86 johnpye 529 # LITTLE WEE TEST PROGRAM for debuggin the c++ wrapper
87 johnpye 542 #
88     #libascxx = env.SharedLibrary('ascxx',objs
89     # , LIBS = ['ascend'] + env['PYTHON_LIB']
90     # , LIBPATH = ['.'] + ['#'] + env['PYTHON_LIBPATH']
91     #)
92     #
93     #ascxxtest = env.Program('ascxxtest',['ascxxtest.cpp']
94     # , LIBS = ['ascxx','ascend']
95     # , LIBPATH = ['.','#']
96     #)
97     #
98     #env.Alias('ascxx',ascxxtest)
99 johnpye 529
100     #---------------------------------------------
101 johnpye 435 # INSTALLATION
102    
103 johnpye 552 if env.get('CAN_INSTALL'):
104 johnpye 463 env.InstallProgram(env['INSTALL_ROOT']+env['INSTALL_BIN'],ascendcmd)
105 johnpye 435
106 johnpye 463 import glob
107     pythonfiles = glob.glob("*.py")
108 johnpye 435
109 johnpye 629 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_ASCDATA']+"/",pythonfiles)
110 johnpye 435
111 johnpye 463 gladefiles = glob.glob("glade/*")
112 johnpye 629 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_ASCDATA']+"/glade/",gladefiles)
113 johnpye 435
114 johnpye 629 env.InstallShared(env['INSTALL_ROOT']+env['INSTALL_ASCDATA']+"/",swiglib)
115 johnpye 466
116 johnpye 631 import platform
117     if platform.system()=="Windows":
118     env.Append(NSISDEFINES={'OUTFILE':env['WIN_INSTALLER_NAME']})
119     installer = env.Installer('create.nsi')
120     Depends(installer,[swiglib,configpy,configh])
121     env.Alias('installer',installer)
122 johnpye 811
123     # vim: set syntax=python:
124    

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