abi_gen = os.path.join(topsrc, 'buildtools/scripts/abi_gen.sh')
abi_file = "%s/%s-%s.sigs" % (self.abi_directory, self.version_libname,
- self.vnum)
+ self.abi_vnum)
tsk = self.create_task('abi_check', self.link_task.outputs[0])
tsk.ABI_FILE = abi_file
symmap = {}
versions = []
+ abi_match = list(task.env.ABI_MATCH)
for f in task.inputs:
fname = f.abspath(task.env)
basename = os.path.basename(fname)
version = basename[len(task.env.LIBNAME)+1:-len(".sigs")]
versions.append(version)
abi_process_file(fname, version, symmap)
+ if task.env.PRIVATE_LIBRARY:
+ # For private libraries we need to inject
+ # each public symbol explicitly into the
+ # abi match array and remove all explicit
+ # versioning so that each exported symbol
+ # is tagged with the private library tag.
+ for s in symmap:
+ abi_match.append(s)
+ symmap = {}
+ versions = []
f = open(tgt, mode='w')
try:
abi_write_vscript(f, task.env.LIBNAME, task.env.VERSION, versions,
- symmap, task.env.ABI_MATCH)
+ symmap, abi_match)
finally:
f.close()
-def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None):
+def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None, private_library=False):
'''generate a vscript file for our public libraries'''
if abi_directory:
source = bld.path.ant_glob('%s/%s-[0-9]*.sigs' % (abi_directory, libname), flat=True)
else:
source = ''
+ if private_library is None:
+ private_library = False
+
libname = os.path.basename(libname)
version = os.path.basename(version)
libname = libname.replace("-", "_").replace("+","_").upper()
t.env.ABI_MATCH = abi_match
t.env.VERSION = version
t.env.LIBNAME = libname
- t.vars = ['LIBNAME', 'VERSION', 'ABI_MATCH']
+ t.env.PRIVATE_LIBRARY = private_library
+ t.vars = ['LIBNAME', 'VERSION', 'ABI_MATCH', 'PRIVATE_LIBRARY']
Build.BuildContext.ABI_VSCRIPT = ABI_VSCRIPT
raise Errors.WafError("public library '%s' must have header files" %
libname)
+ abi_vnum = vnum
+
if bundled_name is not None:
pass
elif target_type == 'PYTHON' or realname or not private_library:
else:
assert (private_library == True and realname is None)
bundled_name = PRIVATE_NAME(bld, libname.replace('_', '-'))
+ vnum = None
ldflags = TO_LIST(ldflags)
if bld.env['ENABLE_RELRO'] is True:
vscript = None
if bld.env.HAVE_LD_VERSION_SCRIPT:
if private_library:
- version = "%s_%s" % (Context.g_module.APPNAME, Context.g_module.VERSION)
+ version = bld.env.PRIVATE_VERSION
elif vnum:
version = "%s_%s" % (libname, vnum)
else:
if version:
vscript = "%s.vscript" % libname
bld.ABI_VSCRIPT(version_libname, abi_directory, version, vscript,
- abi_match)
+ abi_match, private_library)
fullname = apply_pattern(bundled_name, bld.env.cshlib_PATTERN)
fullpath = bld.path.find_or_declare(fullname)
vscriptpath = bld.path.find_or_declare(vscript)
samba_install = install,
abi_directory = "%s/%s" % (bld.path.abspath(), abi_directory),
abi_match = abi_match,
+ abi_vnum = abi_vnum,
private_library = private_library,
grouping_library=grouping_library,
allow_undefined_symbols=allow_undefined_symbols