From 7a54416bbb67348602aeecebeede9e4f99cd26cf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 18 Dec 2014 15:05:12 +0100 Subject: [PATCH 1/2] wafsamba: fill PRIVATE_NAME() logic again 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 Reviewed-by: Andrew Bartlett (cherry picked from commit 76fdcf5c15bd904c3686f0c2dd93d27486c61ca4) --- buildtools/wafsamba/samba_bundled.py | 16 +++++++++++++++- buildtools/wafsamba/wafsamba.py | 9 ++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index 45946d5..515590f 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -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): diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index e564877..07c76d3 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -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) -- 1.9.1 From 820da76eb19926654df9b064f16dd63631574ec0 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 18 Dec 2014 06:37:28 +0100 Subject: [PATCH 2/2] wafsamba: check for rpath compiler/linker flags Older SunOS linker only support -Wl,-R,/path instead of -Wl,-rpath,/path. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112 Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Ralph Boehme Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit 89cc31f5cf9181f04f3ca1a5f7000ee15a74e86e) --- buildtools/wafsamba/wscript | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 1a2cfe6..1a30d2f 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -295,6 +295,10 @@ def configure(conf): headers='stdio.h', msg='Checking simple C program') + # check which compiler/linker flags are needed for rpath support + if not conf.CHECK_LDFLAGS(['-Wl,-rpath,.']) and conf.CHECK_LDFLAGS(['-Wl,-R,.']): + conf.env['RPATH_ST'] = '-Wl,-R,%s' + # check for rpath if conf.CHECK_LIBRARY_SUPPORT(rpath=True): support_rpath = True -- 1.9.1