/[ascend]/trunk/models/johnpye/fprops/python/SConscript
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2663 - (show annotations) (download)
Fri Jan 18 01:06:06 2013 UTC (9 years, 5 months ago) by jpye
File size: 1250 byte(s)
Revert to not using a 'libfprops.so'.
1 Import('fprops_env')
2 import os
3
4 pyenv = fprops_env.Clone()
5
6 pyenv['LIBS'] = []
7 pyenv['SHLIBSUFFIX'] = '.so'
8 pyenv['SHLIBPREFIX'] = '_'
9
10 import distutils.sysconfig, sys, platform
11
12 if platform.system()=="Windows":
13 python_lib='python%d%d'
14 pyenv['SHLIBSUFFIX']='.pyd'
15 else:
16 python_lib='python%d.%d'
17
18 if not fprops_env.get('PYTHON_LIBPATH'):
19 cfig = distutils.sysconfig.get_config_vars()
20 python_libpath = []
21 python_linkflags = []
22 if platform.system()=="Windows":
23 python_libpath += [os.path.join(sys.prefix,"libs")]
24 elif platform.system()=="Darwin":
25 python_libpath += [cfig['LIBPL']]
26 python_linkflags += cfig['LIBS'].split(' ')
27 else:
28 # checked on Linux and SunOS
29 if cfig['LDLIBRARY']==cfig['LIBRARY']:
30 sys.stdout.write("(static)")
31 python_libpath += [cfig['LIBPL']]
32 python_linkflags += cfig['LIBS'].split(' ')
33 fprops_env['PYTHON_LIBPATH'] = python_libpath
34
35 lib = pyenv.SharedLibrary('fprops',['fprops.i'] + fprops_env['shobjs']
36 ,LIBPATH=['..'] + fprops_env['PYTHON_LIBPATH']
37 ,CPPPATH=['#',distutils.sysconfig.get_python_inc()]
38 ,LIBS=[python_lib % (sys.version_info[0],sys.version_info[1])]
39 ,SWIGFLAGS=['-python']
40 )
41
42 pyenv.Depends(lib,"fprops_wrap.c")
43 pyenv.Depends(lib,fprops_env['libfprops'])
44
45 fprops_env['pyfprops'] = lib
46

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