summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-05-06 12:45:42 +0200
committerAndrew Bartlett <abartlet@samba.org>2015-05-19 19:28:18 +0200
commit13a91e542737562e26368ca6a359cb20026bb724 (patch)
treea33a82b52aec39f28b6dead208462a1d8a3c9e22 /buildtools
parentcd6615ecbd43d53fa353a18bd6db2291b086de2d (diff)
downloadsamba-13a91e542737562e26368ca6a359cb20026bb724.tar.gz
buildtools: Expose the Python 3 ABI tag
Expose the tag in the env to allow using it in pkg-config files Add a "pyembed_libname" function to correctly form library names. (This can't be done automatically in SAMBA_LIBRARY because the name could be used as a dependency for another library) Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_python.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index a371b434a78..b90655d9a2c 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -23,6 +23,12 @@ def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
else:
conf.msg("python headers", "using cache")
+ if conf.env['PYTHON_VERSION'] > '3':
+ abi_pattern = os.path.splitext(conf.env['pyext_PATTERN'])[0]
+ conf.env['PYTHON_SO_ABI_FLAG'] = abi_pattern % ''
+ else:
+ conf.env['PYTHON_SO_ABI_FLAG'] = ''
+
def SAMBA_PYTHON(bld, name,
source='',
@@ -69,3 +75,9 @@ def SAMBA_PYTHON(bld, name,
enabled=enabled)
Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
+
+
+def pyembed_libname(bld, name, extrapython=False):
+ return name + bld.env['PYTHON_SO_ABI_FLAG']
+
+Build.BuildContext.pyembed_libname = pyembed_libname