summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_utils.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-02-17 14:42:19 +1100
committerAndrew Tridgell <tridge@samba.org>2011-02-18 15:09:47 +1100
commit1c5108c98b51c7c3edcd94d3a238d0476ece53dd (patch)
treee8b4ce706f78accc40392394dd9bbad595d80a0b /buildtools/wafsamba/samba_utils.py
parent88508291fe80829b559f8e6b91a7453e03479111 (diff)
downloadsamba-1c5108c98b51c7c3edcd94d3a238d0476ece53dd.tar.gz
samba-1c5108c98b51c7c3edcd94d3a238d0476ece53dd.tar.bz2
samba-1c5108c98b51c7c3edcd94d3a238d0476ece53dd.zip
waf: support building libraries with a directory prefix
SAMBA_LIBRARY('libsmb/smbclient') can now be built, which distinguishes it from the binary 'smbclient' Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools/wafsamba/samba_utils.py')
-rw-r--r--buildtools/wafsamba/samba_utils.py11
1 files changed, 9 insertions, 2 deletions
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: