summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-12-09 12:24:48 +1100
committerAndrew Tridgell <tridge@samba.org>2010-12-09 13:18:03 +1100
commitc90b7824a618f878486d8d79a9b06887f05d6873 (patch)
tree18dc50deec368e2870f0e1df6367774bc13fd990 /buildtools/wafsamba
parentffb2b3d1c6b099bc80ca2c33ec50c9ff03a0a4e4 (diff)
downloadsamba-c90b7824a618f878486d8d79a9b06887f05d6873.tar.gz
samba-c90b7824a618f878486d8d79a9b06887f05d6873.tar.bz2
samba-c90b7824a618f878486d8d79a9b06887f05d6873.zip
waf: use vscripts for our private libraries too
if the library has a vnum, then use it. If it doesn't have a vnum then use the application version for symbol versions
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/samba_abi.py12
-rw-r--r--buildtools/wafsamba/wafsamba.py17
2 files changed, 14 insertions, 15 deletions
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 4059fe3378..d5376ca1e7 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -146,11 +146,9 @@ def abi_process_file(fname, version, symmap):
symmap[symname] = version
f.close()
-def abi_write_vscript(vscript, libname, vnum, symmap):
+def abi_write_vscript(vscript, libname, version, symmap):
'''write a vscript file for a library in --version-script format'''
- libname = libname.replace("-", "_").replace("+","_").upper()
-
invmap = {}
for s in symmap:
invmap.setdefault(symmap[s], []).append(s)
@@ -182,10 +180,10 @@ def abi_build_vscript(task):
basename = os.path.basename(fname)
version = basename[len(task.env.LIBNAME)+1:-len(".sigs")]
abi_process_file(fname, version, symmap)
- abi_write_vscript(tgt, task.env.LIBNAME, task.env.VNUM, symmap)
+ abi_write_vscript(tgt, task.env.LIBNAME, task.env.VERSION, symmap)
-def ABI_VSCRIPT(bld, libname, abi_directory, vnum, vscript):
+def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript):
'''generate a vscript file for our public libraries'''
if abi_directory:
source = bld.path.ant_glob('%s/%s-[0-9]*.sigs' % (abi_directory, libname))
@@ -201,7 +199,7 @@ def ABI_VSCRIPT(bld, libname, abi_directory, vnum, vscript):
source=source,
group='vscripts',
target=vscript)
- t.env.VNUM = vnum
+ t.env.VERSION = version
t.env.LIBNAME = libname
- t.vars = [vnum, vscript]
+ t.vars = [libname, version, vscript]
Build.BuildContext.ABI_VSCRIPT = ABI_VSCRIPT
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index aea9d2bf30..f37f10da16 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -195,10 +195,6 @@ def SAMBA_LIBRARY(bld, libname, source,
if vnum:
Logs.error("vnum is invalid for private libraries")
sys.exit(1)
- vnum = None
- 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])
features = 'cc cshlib symlink_lib install_lib'
if target_type == 'PYTHON':
@@ -210,10 +206,15 @@ def SAMBA_LIBRARY(bld, libname, source,
if abi_directory:
features += ' abi_check'
- if bld.env.HAVE_LD_VERSION_SCRIPT:
- vscript = "%s.vscript" % libname
- bld.ABI_VSCRIPT(libname, abi_directory, vnum, vscript)
- ldflags.append("-Wl,--version-script=%s/%s" % (bld.path.abspath(bld.env), vscript))
+
+ if bld.env.HAVE_LD_VERSION_SCRIPT:
+ vscript = "%s.vscript" % libname
+ if private_library:
+ version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION)
+ else:
+ version = "%s_%s" % (libname, vnum)
+ bld.ABI_VSCRIPT(libname, abi_directory, version, vscript)
+ ldflags.append("-Wl,--version-script=%s/%s" % (bld.path.abspath(bld.env), vscript))
bld.SET_BUILD_GROUP(group)
t = bld(