diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-11-30 01:10:31 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-11-30 02:23:37 +0100 |
commit | 2a5daa7ddb67e103ed173559bd2ec60dbe06d816 (patch) | |
tree | 27222990779d5d17bbf1baebdb1178126c1af2be | |
parent | 7ab6aa157534921aabb8af2bf2c672d85f217b8e (diff) | |
download | samba-2a5daa7ddb67e103ed173559bd2ec60dbe06d816.tar.gz samba-2a5daa7ddb67e103ed173559bd2ec60dbe06d816.tar.bz2 samba-2a5daa7ddb67e103ed173559bd2ec60dbe06d816.zip |
wafsamba: Only use private library rpath when linking against private
libraries.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Nov 30 02:23:37 CET 2010 on sn-devel-104
-rw-r--r-- | buildtools/wafsamba/samba_install.py | 4 | ||||
-rw-r--r-- | buildtools/wafsamba/samba_utils.py | 14 |
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) |