From f5cafee0c7a96396798d2b229ff3f9dced1d74f3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Mar 2017 19:25:13 +1300 Subject: talloc: use the system pytalloc-util for python3 as well This involves installing a .pc file for the python3 library as well To get the .pc file generated and installed is quite a mission, we have to rework the talloc build system to ensure that the second 'env' created for EXTRA_PYTHON has everything set up on it, the TALLOC_VERSION in particular. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall Incorportaing fixes by Petr Viktorin Signed-off-by: Petr Viktorin --- buildtools/wafsamba/pkgconfig.py | 12 ++++++++---- buildtools/wafsamba/samba_python.py | 2 ++ buildtools/wafsamba/wafsamba.py | 9 ++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'buildtools/wafsamba') diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py index 25cec781bc0..999bad474a3 100644 --- a/buildtools/wafsamba/pkgconfig.py +++ b/buildtools/wafsamba/pkgconfig.py @@ -38,16 +38,20 @@ def subst_at_vars(task): return 0 -def PKG_CONFIG_FILES(bld, pc_files, vnum=None): +def PKG_CONFIG_FILES(bld, pc_files, vnum=None, extra_name=None): '''install some pkg_config pc files''' dest = '${PKGCONFIGDIR}' dest = bld.EXPAND_VARIABLES(dest) for f in TO_LIST(pc_files): - base=os.path.basename(f) + if extra_name: + target = f.split('.pc')[0] + extra_name + ".pc" + else: + target = f + base=os.path.basename(target) t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base, rule=subst_at_vars, source=f+'.in', - target=f) + target=target) bld.add_manual_dependency(bld.path.find_or_declare(f), bld.env['PREFIX']) t.vars = [] if t.env.RPATH_ON_INSTALL: @@ -58,7 +62,7 @@ def PKG_CONFIG_FILES(bld, pc_files, vnum=None): t.env.PACKAGE_VERSION = vnum for v in [ 'PREFIX', 'EXEC_PREFIX', 'LIB_RPATH' ]: t.vars.append(t.env[v]) - bld.INSTALL_FILES(dest, f, flat=True, destname=base) + bld.INSTALL_FILES(dest, target, flat=True, destname=base) Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py index 057a0176e15..bba059edf98 100644 --- a/buildtools/wafsamba/samba_python.py +++ b/buildtools/wafsamba/samba_python.py @@ -75,6 +75,8 @@ def _check_python_headers(conf, mandatory): conf.env['PYTHON_SO_ABI_FLAG'] = abi_pattern % '' else: conf.env['PYTHON_SO_ABI_FLAG'] = '' + conf.env['PYTHON_LIBNAME_SO_ABI_FLAG'] = ( + conf.env['PYTHON_SO_ABI_FLAG'].replace('_', '-')) def SAMBA_PYTHON(bld, name, diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 4a47dbffe02..137cb0e4330 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -144,7 +144,7 @@ def SAMBA_LIBRARY(bld, libname, source, '''define a Samba library''' if pyembed and bld.env['IS_EXTRA_PYTHON']: - public_headers = pc_files = None + public_headers = None if private_library and public_headers: raise Utils.WafError("private library '%s' must not have public header files" % @@ -225,7 +225,7 @@ def SAMBA_LIBRARY(bld, libname, source, if vnum is None and soname is None: raise Utils.WafError("public library '%s' must have a vnum" % libname) - if pc_files is None and not bld.env['IS_EXTRA_PYTHON']: + if pc_files is None: raise Utils.WafError("public library '%s' must have pkg-config file" % libname) if public_headers is None and not bld.env['IS_EXTRA_PYTHON']: @@ -328,7 +328,10 @@ def SAMBA_LIBRARY(bld, libname, source, t.link_name = link_name if pc_files is not None and not private_library: - bld.PKG_CONFIG_FILES(pc_files, vnum=vnum) + if pyembed and bld.env['IS_EXTRA_PYTHON']: + bld.PKG_CONFIG_FILES(pc_files, vnum=vnum, extra_name=bld.env['PYTHON_SO_ABI_FLAG']) + else: + bld.PKG_CONFIG_FILES(pc_files, vnum=vnum) if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']): -- cgit v1.2.1