3 Frontend-tool for Gallium3D architecture.
8 # Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
11 # Permission is hereby granted, free of charge, to any person obtaining a
12 # copy of this software and associated documentation files (the
13 # "Software"), to deal in the Software without restriction, including
14 # without limitation the rights to use, copy, modify, merge, publish,
15 # distribute, sub license, and/or sell copies of the Software, and to
16 # permit persons to whom the Software is furnished to do so, subject to
17 # the following conditions:
19 # The above copyright notice and this permission notice (including the
20 # next paragraph) shall be included in all copies or substantial portions
23 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
26 # IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
27 # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 import distutils
.sysconfig
39 # See http://www.scons.org/wiki/PythonExtensions
41 if sys
.platform
in ['win32']:
42 python_root
= sys
.prefix
43 python_version
= '%u%u' % sys
.version_info
[:2]
44 python_include
= os
.path
.join(python_root
, 'include')
45 python_libs
= os
.path
.join(python_root
, 'libs')
46 python_lib
= os
.path
.join(python_libs
, 'python' + python_version
+ '.lib')
48 env
.Append(CPPPATH
= [python_include
])
49 env
.Append(LIBPATH
= [python_libs
])
50 env
.Append(LIBS
= ['python' + python_version
+ '.lib'])
51 env
.Replace(SHLIBPREFIX
= '')
52 env
.Replace(SHLIBSUFFIX
= '.pyd')
54 # XXX; python25_d.lib is not included in Python for windows, and
55 # we'll get missing symbols unless we undefine _DEBUG
56 cppdefines
= env
['CPPDEFINES']
57 cppdefines
= [define
for define
in cppdefines
if define
!= '_DEBUG']
58 env
.Replace(CPPDEFINES
= cppdefines
)
59 env
.AppendUnique(CPPFLAGS
= ['/U_DEBUG'])
60 env
.AppendUnique(LINKFLAGS
= ['/nodefaultlib:python25_d.lib'])
62 #env.ParseConfig('python-config --cflags --ldflags --libs')
63 env
.AppendUnique(CPPPATH
= [distutils
.sysconfig
.get_python_inc()])
64 env
.Replace(SHLIBPREFIX
= '')
65 env
.Replace(SHLIBSUFFIX
= distutils
.sysconfig
.get_config_vars()['SO'])