wafsamba: fill PRIVATE_NAME() logic again
authorStefan Metzmacher <metze@samba.org>
Thu, 18 Dec 2014 14:05:12 +0000 (15:05 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 19 Dec 2014 12:15:12 +0000 (13:15 +0100)
We append bld.env.PRIVATE_EXTENSION to the name of private libraries
again, but only unless they have a abi_directory, vnum or soname defined.

This avoids naming conflicts with system libraries, e.g. libidmap.so
on Solaris

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_bundled.py
buildtools/wafsamba/wafsamba.py

index 45946d524bf12b959ea0500f816d4b834ef3e1de..515590fb01468a1d9218705d8644e661487f205d 100644 (file)
@@ -7,11 +7,25 @@ from samba_utils import *
 def PRIVATE_NAME(bld, name, private_extension, private_library):
     '''possibly rename a library to include a bundled extension'''
 
+    if not private_library:
+        return name
+
     # we now use the same private name for libraries as the public name.
     # see http://git.samba.org/?p=tridge/junkcode.git;a=tree;f=shlib for a
     # demonstration that this is the right thing to do
     # also see http://lists.samba.org/archive/samba-technical/2011-January/075816.html
-    return name
+    if private_extension:
+        return name
+
+    extension = bld.env.PRIVATE_EXTENSION
+
+    if extension and name.startswith('%s' % extension):
+        return name
+
+    if extension and name.endswith('%s' % extension):
+        return name
+
+    return "%s-%s" % (name, extension)
 
 
 def target_in_list(target, lst, default):
index bd2ca89f62ab858ed5b754cdcd0b8e3793871ba0..5fef9be3325c6186d1471aeb8c15a79b843d727d 100644 (file)
@@ -124,7 +124,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   pyembed=False,
                   pyext=False,
                   target_type='LIBRARY',
-                  bundled_extension=True,
+                  bundled_extension=False,
                   link_name=None,
                   abi_directory=None,
                   abi_match=None,
@@ -218,8 +218,11 @@ def SAMBA_LIBRARY(bld, libname, source,
         else:
             bundled_name = libname.replace('_', '-')
     else:
-        bundled_name = PRIVATE_NAME(bld, libname, bundled_extension,
-            private_library)
+        assert (private_library == True and realname is None)
+        if abi_directory or vnum or soname:
+            bundled_extension=True
+        bundled_name = PRIVATE_NAME(bld, libname.replace('_', '-'),
+                                    bundled_extension, private_library)
 
     ldflags = TO_LIST(ldflags)