SAMBA_LIBRARY('libsmb/smbclient') can now be built, which
distinguishes it from the binary 'smbclient'
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
+ libname = os.path.basename(libname)
+ version = os.path.basename(version)
libname = libname.replace("-", "_").replace("+","_").upper()
version = version.replace("-", "_").replace("+","_").upper()
libname = libname.replace("-", "_").replace("+","_").upper()
version = version.replace("-", "_").replace("+","_").upper()
return root1+ext2
Build.BuildContext.map_shlib_extension = map_shlib_extension
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
def make_libname(ctx, name, nolibprefix=False, version=None, python=False):
"""make a library filename
python : if we should use python module name conventions"""
if python:
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)
- 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:
if nolibprefix and libname[0:3] == 'lib':
libname = libname[3:]
if version:
vscript = "%s.vscript" % libname
bld.ABI_VSCRIPT(libname, abi_directory, version, vscript,
abi_match)
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
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)
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)