buildtools: only use the ABI based version script for non private libraries
authorStefan Metzmacher <metze@samba.org>
Thu, 9 Dec 2010 15:34:28 +0000 (16:34 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 9 Dec 2010 15:45:51 +0000 (16:45 +0100)
Private libraries should not expose the symbols from the public namespace,
as then we may conflict with external libraries.

E.g. if we build tdb as private library, we want to be sure we're using the
private library and symbols, even if we also have the system libtdb.so loaded
via some external modules.

metze

buildtools/wafsamba/wafsamba.py

index fb685313538138ad1191a23964a7deb40b8c1ba5..3b1e4bb99b63bc246b0c40625abab98a87f17958 100644 (file)
@@ -206,12 +206,15 @@ def SAMBA_LIBRARY(bld, libname, source,
         vscript = "%s.vscript" % libname
         if private_library:
             version = "%s_%s" % (Utils.g_module.APPNAME, Utils.g_module.VERSION)
+            vscript_abi_directory = None
         elif vnum:
             version = "%s_%s" % (libname, vnum)
+            vscript_abi_directory = abi_directory
         else:
             version = None
+            vscript_abi_directory = None
         if version:
-            bld.ABI_VSCRIPT(libname, abi_directory, version, vscript)
+            bld.ABI_VSCRIPT(libname, vscript_abi_directory, version, vscript)
             ldflags.append("-Wl,--version-script=%s/%s" % (bld.path.abspath(bld.env), vscript))
             fullname = bld.env.shlib_PATTERN % bundled_name
             bld.add_manual_dependency(bld.path.find_or_declare(fullname), bld.path.find_or_declare(vscript))