Bug 1200 - ./waf install doesn't install Python bindings properly

This commit is contained in:
Gustavo J. A. M. Carneiro
2011-07-11 14:24:59 +01:00
parent 3ab8b373af
commit 51c97a2cd8

View File

@@ -22,6 +22,8 @@ REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
from TaskGen import feature, after
import Task, ccroot
from python import _get_python_variables # this comes from wafadmin/Tools/python.py
@feature('pch')
@after('apply_link')
@@ -113,6 +115,19 @@ def configure(conf):
conf.report_optional_feature("python", "Python Bindings", False, str(ex))
return
# alternative code to computing PYTHONDIR, that is more correct than the one in waf 1.5.16
if 'PYTHONDIR' in conf.environ:
pydir = conf.environ['PYTHONDIR']
else:
(pydir,) = _get_python_variables(conf.env['PYTHON'],
["get_python_lib(standard_lib=0, prefix=%r)" % conf.env['PREFIX']],
['from distutils.sysconfig import get_python_lib'])
if hasattr(conf, 'define'): # conf.define is added by the C tool, so may not exist
conf.define('PYTHONDIR', pydir)
conf.env['PYTHONDIR'] = pydir
# -fvisibility=hidden optimization
if (conf.env['CXX_NAME'] == 'gcc' and [int(x) for x in conf.env['CC_VERSION']] >= [4,0,0]
and conf.check_compilation_flag('-fvisibility=hidden')):