summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildtools/wafsamba/samba_install.py4
-rw-r--r--buildtools/wafsamba/samba_utils.py14
2 files changed, 14 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index 0196bd9535..fcbf4ea40f 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -15,7 +15,7 @@ def install_binary(self):
bld = self.bld
# get the ldflags we will use for install and build
- install_ldflags = install_rpath(bld)
+ install_ldflags = install_rpath(self)
build_ldflags = build_rpath(bld)
if not Options.is_install:
@@ -59,7 +59,7 @@ def install_library(self):
bld = self.bld
- install_ldflags = install_rpath(bld)
+ install_ldflags = install_rpath(self)
build_ldflags = build_rpath(bld)
if not Options.is_install or not getattr(self, 'samba_install', True):
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 7006381ae6..1e360f0856 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -63,13 +63,23 @@ def ADD_LD_LIBRARY_PATH(path):
os.environ['LD_LIBRARY_PATH'] = ':'.join(newpath)
-def install_rpath(bld):
+def needs_private_lib(bld, target):
+ '''return True if a target links to a private library'''
+ for lib in getattr(target, "uselib_local", []):
+ t = bld.name_to_obj(lib, bld.env)
+ if t and getattr(t, 'private_library', False):
+ return True
+ return False
+
+
+def install_rpath(target):
'''the rpath value for installation'''
+ bld = target.bld
bld.env['RPATH'] = []
ret = set()
if bld.env.RPATH_ON_INSTALL:
ret.add(bld.EXPAND_VARIABLES(bld.env.LIBDIR))
- if bld.env.RPATH_ON_INSTALL_PRIVATE:
+ if bld.env.RPATH_ON_INSTALL_PRIVATE and needs_private_lib(bld, target):
ret.add(bld.EXPAND_VARIABLES(bld.env.PRIVATELIBDIR))
return list(ret)