summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildtools/wafsamba/samba_abi.py2
-rw-r--r--buildtools/wafsamba/samba_utils.py11
-rw-r--r--buildtools/wafsamba/wafsamba.py4
3 files changed, 13 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index bd074f8f27..ebd5210317 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -197,6 +197,8 @@ def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None):
else:
source = ''
+ libname = os.path.basename(libname)
+ version = os.path.basename(version)
libname = libname.replace("-", "_").replace("+","_").upper()
version = version.replace("-", "_").replace("+","_").upper()
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index b1ddc5a99e..54ceba9103 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -560,6 +560,13 @@ def map_shlib_extension(ctx, name, python=False):
return root1+ext2
Build.BuildContext.map_shlib_extension = map_shlib_extension
+def apply_pattern(filename, pattern):
+ '''apply a filename pattern to a filename that may have a directory component'''
+ dirname = os.path.dirname(filename)
+ if not dirname:
+ return pattern % filename
+ basename = os.path.basename(filename)
+ return os.path.join(dirname, pattern % basename)
def make_libname(ctx, name, nolibprefix=False, version=None, python=False):
"""make a library filename
@@ -569,9 +576,9 @@ def make_libname(ctx, name, nolibprefix=False, version=None, python=False):
python : if we should use python module name conventions"""
if python:
- libname = ctx.env.pyext_PATTERN % name
+ libname = apply_pattern(name, ctx.env.pyext_PATTERN)
else:
- libname = ctx.env.shlib_PATTERN % name
+ libname = apply_pattern(name, ctx.env.shlib_PATTERN)
if nolibprefix and libname[0:3] == 'lib':
libname = libname[3:]
if version:
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 83972def10..4c9bf053a1 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -217,11 +217,11 @@ def SAMBA_LIBRARY(bld, libname, source,
vscript = "%s.vscript" % libname
bld.ABI_VSCRIPT(libname, abi_directory, version, vscript,
abi_match)
- fullname = bld.env.shlib_PATTERN % bundled_name
+ fullname = apply_pattern(bundled_name, bld.env.shlib_PATTERN)
bld.add_manual_dependency(bld.path.find_or_declare(fullname), bld.path.find_or_declare(vscript))
if Options.is_install:
# also make the .inst file depend on the vscript
- instname = bld.env.shlib_PATTERN % (bundled_name + '.inst')
+ instname = apply_pattern(bundled_name + '.inst', bld.env.shlib_PATTERN)
bld.add_manual_dependency(bld.path.find_or_declare(instname), bld.path.find_or_declare(vscript))
vscript = os.path.join(bld.path.abspath(bld.env), vscript)