summaryrefslogtreecommitdiffstats
path: root/source4/heimdal_build
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-12-08 14:57:31 +1100
committerAndrew Tridgell <tridge@samba.org>2010-12-08 05:26:06 +0100
commit4debe69b731b69aebd95386c2f1a36bb2a53d047 (patch)
tree967bb2a2c008eea939d5c3ce489993ec50bf7c02 /source4/heimdal_build
parent35134214ae819ad26ec388fa44dd37b24d72d3c4 (diff)
downloadsamba-4debe69b731b69aebd95386c2f1a36bb2a53d047.tar.gz
samba-4debe69b731b69aebd95386c2f1a36bb2a53d047.tar.xz
samba-4debe69b731b69aebd95386c2f1a36bb2a53d047.zip
s4-heimdal: enable symbol versioning in heimdal
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/heimdal_build')
-rw-r--r--source4/heimdal_build/wscript_build58
1 files changed, 38 insertions, 20 deletions
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='',