From 4debe69b731b69aebd95386c2f1a36bb2a53d047 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Dec 2010 14:57:31 +1100 Subject: s4-heimdal: enable symbol versioning in heimdal Pair-Programmed-With: Andrew Bartlett Pair-Programmed-With: Jelmer Vernooij --- source4/heimdal_build/wscript_build | 58 ++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 20 deletions(-) (limited to 'source4/heimdal_build') diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build index 3e792d3c7e..5607701d29 100644 --- a/source4/heimdal_build/wscript_build +++ b/source4/heimdal_build/wscript_build @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os +import os, Utils, Build from samba_utils import SET_TARGET_TYPE from samba_autoconf import CURRENT_CFLAGS @@ -181,6 +181,27 @@ def HEIMDAL_AUTOPROTO_PRIVATE(header, source): HEIMDAL_AUTOPROTO(header, source, options='-q -P comment -p') +def HEIMDAL_GENERATOR(name, rule, source='', target='', + group='generators'): + '''A generic source generator target''' + + if not SET_TARGET_TYPE(bld, name, 'GENERATOR'): + return + + bld.set_group(group) + return bld( + rule=rule, + source=source, + target=target, + shell=isinstance(rule, str), + on_results=True, + before='cc', + ext_out='.c', + vars=[rule], + samba_type='GENERATOR', + name=name) + + def HEIMDAL_LIBRARY(libname, source, deps, vnum, includes='', cflags='', @@ -206,13 +227,27 @@ def HEIMDAL_LIBRARY(libname, source, deps, vnum, deps = to_list(deps) deps.append(obj_target) + ldflags = [] + if not private_library: # Sanitize the library name bundled_name = libname.lower().replace('_', '-') while bundled_name.startswith("lib"): bundled_name = bundled_name[3:] + version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION.split(".")[0]) else: bundled_name = libname + '-samba4' + vnum = Utils.g_module.VERSION[0] + version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION) + + if bld.env.HAVE_LD_VERSION_SCRIPT: + vscript = "%s.vscript" % libname + HEIMDAL_GENERATOR(vscript, + rule="echo %s \{ global: \*\; \}\; > ${TGT}" % version.replace("-","_").upper(), + group='vscripts', + target=vscript) + ldflags.append("-Wl,--version-script=%s/%s" % (bld.path.abspath(bld.env), vscript)) + deps.append(vscript) features = 'cc cshlib symlink_lib install_lib' @@ -226,29 +261,12 @@ def HEIMDAL_LIBRARY(libname, source, deps, vnum, vnum = vnum, install_path = None, name = libname, + ldflags = ldflags, + vars = [version], private_library = private_library ) -def HEIMDAL_GENERATOR(name, rule, source='', target='', - group='generators'): - '''A generic source generator target''' - - if not SET_TARGET_TYPE(bld, name, 'GENERATOR'): - return - - bld.set_group(group) - return bld( - rule=rule, - source=source, - target=target, - shell=isinstance(rule, str), - on_results=True, - before='cc', - ext_out='.c', - name=name) - - def HEIMDAL_SUBSYSTEM(modname, source, deps='', includes='', -- cgit