summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-08-14 12:17:48 +0200
committerStefan Metzmacher <metze@samba.org>2015-11-01 01:09:06 +0100
commit9ef47d25317947248b0796059e6f0a851ba3cb07 (patch)
treec87766fbef78061a63c4ae95c02770c63885833d /buildtools
parent2f619066fbf2e8310e0a21b6680212c3e676b6ea (diff)
downloadsamba-9ef47d25317947248b0796059e6f0a851ba3cb07.tar.gz
buildtools: Ignore exact Python version for ABI checking
Utilities for Python libraries are built for a specific Python version. Starting with Python 3, the Python version is recorded in the shared library filename as an ABI tag, e.g. "pytalloc.cpython-34m.so. The exact version doesn't matter for Samba's ABI check. Replace the ABI tag with a simpler one that just records the major version of Python. Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Nov 1 01:09:06 CET 2015 on sn-devel-104
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_abi.py3
-rw-r--r--buildtools/wafsamba/wafsamba.py12
2 files changed, 13 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 3ff6d77811c..82205945ce0 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -137,7 +137,8 @@ def abi_check(self):
topsrc = self.bld.srcnode.abspath()
abi_gen = os.path.join(topsrc, 'buildtools/scripts/abi_gen.sh')
- abi_file = "%s/%s-%s.sigs" % (self.abi_directory, self.name, self.vnum)
+ abi_file = "%s/%s-%s.sigs" % (self.abi_directory, self.version_libname,
+ self.vnum)
tsk = self.create_task('abi_check', self.link_task.outputs[0])
tsk.ABI_FILE = abi_file
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index fdd0371b63c..318dabf44e1 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -253,6 +253,15 @@ def SAMBA_LIBRARY(bld, libname, source,
if abi_directory:
features += ' abi_check'
+ if pyembed and bld.env['PYTHON_SO_ABI_FLAG']:
+ # For ABI checking, we don't care about the exact Python version.
+ # Replace the Python ABI tag (e.g. ".cpython-35m") by a generic ".py3"
+ abi_flag = bld.env['PYTHON_SO_ABI_FLAG']
+ replacement = '.py%s' % bld.env['PYTHON_VERSION'].split('.')[0]
+ version_libname = libname.replace(abi_flag, replacement)
+ else:
+ version_libname = libname
+
vscript = None
if bld.env.HAVE_LD_VERSION_SCRIPT:
if private_library:
@@ -263,7 +272,7 @@ def SAMBA_LIBRARY(bld, libname, source,
version = None
if version:
vscript = "%s.vscript" % libname
- bld.ABI_VSCRIPT(libname, abi_directory, version, vscript,
+ bld.ABI_VSCRIPT(version_libname, abi_directory, version, vscript,
abi_match)
fullname = apply_pattern(bundled_name, bld.env.shlib_PATTERN)
fullpath = bld.path.find_or_declare(fullname)
@@ -289,6 +298,7 @@ def SAMBA_LIBRARY(bld, libname, source,
samba_deps = deps,
samba_includes = includes,
version_script = vscript,
+ version_libname = version_libname,
local_include = local_include,
global_include = global_include,
vnum = vnum,