summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-11-12 16:53:33 +0100
committerJelmer Vernooij <jelmer@samba.org>2015-04-24 01:50:11 +0200
commitcc491fb080882e36f549fd0a348800431ccb3074 (patch)
tree953eb948e6a67719f01d8f7eddeafee7a554a03c /third_party
parent8ac21ec4aa76beb48c9c26cf1fd45495324d74cc (diff)
downloadsamba-cc491fb080882e36f549fd0a348800431ccb3074.tar.gz
buildtools: Honor LDVERSION when looking for Python library
Since Python 3.2, Python .so files are tagged for ABI compatibility, so the library name is something like libpython3.4m.so (note the 'm'). This information is found in distutils.sysconfig.get_config_var('LDVERSION') This fixes waf issue 1405 (https://code.google.com/p/waf/issues/detail?id=1405) Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'third_party')
-rw-r--r--third_party/waf/wafadmin/Tools/python.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/third_party/waf/wafadmin/Tools/python.py b/third_party/waf/wafadmin/Tools/python.py
index cfc8495e919..cd96b658185 100644
--- a/third_party/waf/wafadmin/Tools/python.py
+++ b/third_party/waf/wafadmin/Tools/python.py
@@ -170,10 +170,10 @@ def check_python_headers(conf, mandatory=True):
try:
# Get some python configuration variables using distutils
- v = 'prefix SO SYSLIBS LDFLAGS SHLIBS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET'.split()
+ v = 'prefix SO SYSLIBS LDFLAGS SHLIBS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDVERSION'.split()
(python_prefix, python_SO, python_SYSLIBS, python_LDFLAGS, python_SHLIBS,
python_LIBDIR, python_LIBPL, INCLUDEPY, Py_ENABLE_SHARED,
- python_MACOSX_DEPLOYMENT_TARGET) = \
+ python_MACOSX_DEPLOYMENT_TARGET, python_LDVERSION) = \
_get_python_variables(python, ["get_config_var('%s') or ''" % x for x in v],
['from distutils.sysconfig import get_config_var'])
except RuntimeError:
@@ -190,8 +190,10 @@ python_LIBPL = %r
INCLUDEPY = %r
Py_ENABLE_SHARED = %r
MACOSX_DEPLOYMENT_TARGET = %r
+LDVERSION = %r
""" % (python, python_prefix, python_SO, python_SYSLIBS, python_LDFLAGS, python_SHLIBS,
- python_LIBDIR, python_LIBPL, INCLUDEPY, Py_ENABLE_SHARED, python_MACOSX_DEPLOYMENT_TARGET))
+ python_LIBDIR, python_LIBPL, INCLUDEPY, Py_ENABLE_SHARED, python_MACOSX_DEPLOYMENT_TARGET,
+ python_LDVERSION))
# Allow some python overrides from env vars for cross-compiling
os_env = dict(os.environ)
@@ -230,7 +232,9 @@ MACOSX_DEPLOYMENT_TARGET = %r
parse_flags(python_LDFLAGS, 'PYEMBED', env)
result = False
- name = 'python' + env['PYTHON_VERSION']
+ if not python_LDVERSION:
+ python_LDVERSION = env['PYTHON_VERSION']
+ name = 'python' + python_LDVERSION
if python_LIBDIR is not None:
path = [python_LIBDIR]
@@ -245,7 +249,7 @@ MACOSX_DEPLOYMENT_TARGET = %r
if not result:
conf.log.write("\n\n# try again with -L$prefix/libs, and pythonXY name rather than pythonX.Y (win32)\n")
path = [os.path.join(python_prefix, "libs")]
- name = 'python' + env['PYTHON_VERSION'].replace('.', '')
+ name = 'python' + python_LDVERSION.replace('.', '')
result = conf.check(lib=name, uselib='PYEMBED', libpath=path)
if result: