wafsamba: use private extentions also for bundled public libraries
authorStefan Metzmacher <metze@samba.org>
Fri, 13 Aug 2021 13:16:59 +0000 (15:16 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 30 Nov 2021 15:53:34 +0000 (15:53 +0000)
Playing tricks with redefining libraries, which may also be installed in
the system with the same version, isn't really a good thing.
It may work in some cases, but there are so many things which may go
wrong. So if we build a library as private/bundled library we should
change the soname of the library.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780

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

index 72eca18cb28dc31173efecef949c837da0448476..7d2d855cd9c77e3c1d9b27bd3880395a249d2a8b 100644 (file)
@@ -5,16 +5,9 @@ from waflib import Build, Options, Logs
 from waflib.Configure import conf
 from wafsamba import samba_utils
 
-def PRIVATE_NAME(bld, name, private_extension):
+def PRIVATE_NAME(bld, name):
     '''possibly rename a library to include a bundled extension'''
 
-    # 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
-    if private_extension:
-        return name
-
     extension = bld.env.PRIVATE_EXTENSION
 
     if extension and name.startswith('%s' % extension):
index 3a5d84603365f5f9bef94c3ec611c829d3bcd5cc..f6ed3a7394717753cace5d30316f69f4aac872a7 100644 (file)
@@ -122,7 +122,6 @@ def SAMBA_LIBRARY(bld, libname, source,
                   pyembed=False,
                   pyext=False,
                   target_type='LIBRARY',
-                  bundled_extension=False,
                   bundled_name=None,
                   link_name=None,
                   abi_directory=None,
@@ -232,10 +231,7 @@ def SAMBA_LIBRARY(bld, libname, source,
             bundled_name = libname.replace('_', '-')
     else:
         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)
+        bundled_name = PRIVATE_NAME(bld, libname.replace('_', '-'))
 
     ldflags = TO_LIST(ldflags)
     if bld.env['ENABLE_RELRO'] is True: