diff options
author | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-07-15 07:56:42 +0900 |
---|---|---|
committer | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-07-15 17:58:47 +0900 |
commit | 2c4349aa3ac9a6d5ee1f7b1aeb5eb0ee1cb54690 (patch) | |
tree | 14e5968a67a3f00cad1487bbce0829d952f2a351 /src/gallium/state_trackers/python/SConscript | |
parent | ead8fcd92a737c7184020768203496a08eb3b7dd (diff) |
python: Move the python scons code to a separate tool module.
Diffstat (limited to 'src/gallium/state_trackers/python/SConscript')
-rw-r--r-- | src/gallium/state_trackers/python/SConscript | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/src/gallium/state_trackers/python/SConscript b/src/gallium/state_trackers/python/SConscript index 854cd83b7c..687c46bfd7 100644 --- a/src/gallium/state_trackers/python/SConscript +++ b/src/gallium/state_trackers/python/SConscript @@ -7,50 +7,20 @@ if 'python' in env['statetrackers']: env = env.Clone() - env.Append(CPPPATH = '.') + env.Tool('python') env.Tool('swig') env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe']) env.Append(SWIGFLAGS = ['-python', '-keyword']) - # http://www.scons.org/wiki/PythonExtensions - #env.AppendUnique(CPPATH = [distutils.sysconfig.get_python_inc()]) - #distutils.sysconfig.get_config_vars('SO') - - env['SHLIBPREFIX'] = '' - - if platform in ['linux']: - env.ParseConfig('python-config --cflags --ldflags --libs') - - if platform in ['windows']: - python_root = sys.prefix - python_version = '%u%u' % sys.version_info[:2] - python_include = os.path.join(python_root, 'include') - python_libs = os.path.join(python_root, 'libs') - python_lib = os.path.join(python_libs, 'python' + python_version + '.lib') - - env.Append(CPPPATH = [python_include]) - env.Append(LIBPATH = [python_libs]) - env.Append(LIBS = ['python' + python_version + '.lib']) - env.Replace(SHLIBSUFFIX = '.pyd') - - if env['debug']: - # XXX; python25_d.lib is not included in Python for windows, and - # we'll get missing symbols unless we undefine _DEBUG - cppdefines = env['CPPDEFINES'] - cppdefines = [define for define in cppdefines if define != '_DEBUG'] - env.Replace(CPPDEFINES = cppdefines) - - # http://www.swig.org/Doc1.3/Windows.html - env['ENV']['PYTHON_INCLUDE'] = python_include - env['ENV']['PYTHON_LIB'] = python_lib - + env.Append(CPPPATH = '.') + env.SharedLibrary( - target = '_gallium', - source = [ - 'gallium.i', + target = '_gallium', + source = [ + 'gallium.i', 'st_device.c', 'st_softpipe_winsys.c', - ], + ], LIBS = softpipe + auxiliaries + env['LIBS'], ) |