summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/samba_deps.py3
-rw-r--r--buildtools/wafsamba/wafsamba.py18
2 files changed, 19 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 91737d5873..0ea966033c 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -952,7 +952,8 @@ def show_object_duplicates(bld, tgt_list):
######################################################################
# this provides a way to save our dependency calculations between runs
savedeps_version = 3
-savedeps_inputs = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags', 'source', 'grouping_library']
+savedeps_inputs = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags',
+ 'source', 'grouping_library', 'ldflags']
savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags', 'samba_deps_extended']
savedeps_outenv = ['INC_PATHS']
savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES', 'EXTRA_CFLAGS', 'EXTRA_LDFLAGS' ]
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 10b7dfe0f4..fc75def98d 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -103,6 +103,7 @@ def SAMBA_LIBRARY(bld, libname, source,
vnum=None,
soname=None,
cflags='',
+ ldflags='',
external_library=False,
realname=None,
autoproto=None,
@@ -188,11 +189,24 @@ def SAMBA_LIBRARY(bld, libname, source,
else:
bundled_name = PRIVATE_NAME(bld, libname, bundled_extension, private_library)
+ ldflags = TO_LIST(ldflags)
+
if private_library:
if vnum:
Logs.error("vnum is invalid for private libraries")
sys.exit(1)
- vnum = Utils.g_module.VERSION[0]
+ vnum = Utils.g_module.VERSION.split(".")[0]
+ version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION)
+ else:
+ version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION.split(".")[0])
+
+ if bld.env.HAVE_LD_VERSION_SCRIPT:
+ vscript = "%s.vscript" % libname
+ bld.SAMBA_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))
features = 'cc cshlib symlink_lib install_lib'
if target_type == 'PYTHON':
@@ -213,6 +227,7 @@ def SAMBA_LIBRARY(bld, libname, source,
source = [],
target = bundled_name,
depends_on = depends_on,
+ ldflags = ldflags,
samba_deps = deps,
samba_includes = includes,
local_include = local_include,
@@ -525,6 +540,7 @@ def SETUP_BUILD_GROUPS(bld):
bld.env['USING_BUILD_GROUPS'] = True
bld.add_group('setup')
bld.add_group('build_compiler_source')
+ bld.add_group('vscripts')
bld.add_group('base_libraries')
bld.add_group('generators')
bld.add_group('compiler_prototypes')