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:
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
'''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" %
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']:
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']):
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
- if not conf.env.standalone_talloc:
- if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
- implied_deps='replace'):
- conf.define('USING_SYSTEM_TALLOC', 1)
- if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
- implied_deps='talloc replace'):
- conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
-
conf.env.TALLOC_COMPAT1 = False
if conf.env.standalone_talloc:
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
+ conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+ conf.env.TALLOC_VERSION = VERSION
conf.CHECK_XSLTPROC_MANPAGES()
+ conf.CHECK_HEADERS('sys/auxv.h')
+ conf.CHECK_FUNCS('getauxval')
+
+ conf.SAMBA_CONFIG_H()
+
+ conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+
+ # We need to set everything non-python up before here, because
+ # SAMBA_CHECK_PYTHON makes a copy of conf and we need it set up correctly
+
if not conf.env.disable_python:
# also disable if we don't have the python libs installed
conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,4,2))
Logs.warn('Disabling pytalloc-util as python devel libs not found')
conf.env.disable_python = True
- conf.CHECK_HEADERS('sys/auxv.h')
- conf.CHECK_FUNCS('getauxval')
+ if not conf.env.standalone_talloc:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
- conf.SAMBA_CONFIG_H()
+ using_system_pytalloc_util = True
+ if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ using_system_pytalloc_util = False
- conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+ # We need to get a pytalloc-util for all the python versions
+ # we are building for
+ if conf.env['EXTRA_PYTHON']:
+ name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
+ if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
+ implied_deps='talloc replace'):
+ using_system_pytalloc_util = False
+
+ if using_system_pytalloc_util:
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
def build(bld):
bld.RECURSE('lib/replace')
if bld.env.standalone_talloc:
- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
- bld.env.TALLOC_VERSION = VERSION
private_library = False
# should we also install the symlink to libtalloc1.so here?