summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-23 10:00:48 -0400
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:01 +1000
commit3e84e10daf7282c61b6a557a8e97af84d8ab3e15 (patch)
treeb56a41be1d50c736c9464339a6c9bc336b400e4b
parent9730166fd6111160dc7925785317208f94fc677c (diff)
downloadsamba-3e84e10daf7282c61b6a557a8e97af84d8ab3e15.tar.gz
samba-3e84e10daf7282c61b6a557a8e97af84d8ab3e15.tar.bz2
samba-3e84e10daf7282c61b6a557a8e97af84d8ab3e15.zip
build: finer grained rpath checking for binary/install
-rw-r--r--buildtools/wafsamba/samba_utils.py23
-rw-r--r--buildtools/wafsamba/wafsamba.py12
-rw-r--r--lib/replace/wscript2
3 files changed, 20 insertions, 17 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 564b5b82e3..8bd913f720 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -59,23 +59,26 @@ def runonce(function):
return wrapper
-
-def set_rpath(bld):
- '''setup the default rpath'''
- if bld.env.RPATH_ON_BUILD:
- rpath = os.path.normpath('%s/%s' % (bld.env['BUILD_DIRECTORY'], LIB_PATH))
- bld.env.append_value('RPATH', '-Wl,-rpath=%s' % rpath)
- else:
- os.environ['LD_LIBRARY_PATH'] = os.path.normpath('%s/../shared' % bld.srcnode.abspath(bld.env))
-Build.BuildContext.set_rpath = set_rpath
-
def install_rpath(bld):
'''the rpath value for installation'''
+ bld.env['RPATH'] = []
+ bld.env['RPATH_ST'] = []
if bld.env.RPATH_ON_INSTALL:
return ['-Wl,-rpath=%s/lib' % bld.env.PREFIX]
return []
+def build_rpath(bld):
+ '''the rpath value for build'''
+ rpath = os.path.normpath('%s/%s' % (bld.env['BUILD_DIRECTORY'], LIB_PATH))
+ bld.env['RPATH'] = []
+ bld.env['RPATH_ST'] = []
+ if bld.env.RPATH_ON_BUILD:
+ return ['-Wl,-rpath=%s' % rpath]
+ os.environ['LD_LIBRARY_PATH'] = rpath
+ return []
+
+
#############################################################
# return a named build cache dictionary, used to store
# state inside the following functions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 8a37edfb88..90006e46cf 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -121,7 +121,8 @@ def SAMBA_LIBRARY(bld, libname, source,
samba_includes = includes,
local_include = local_include,
vnum = vnum,
- install_path = None
+ install_path = None,
+ ldflags = build_rpath(bld)
)
if install_path is None:
@@ -151,8 +152,8 @@ def SAMBA_LIBRARY(bld, libname, source,
vnum = vnum,
install_as = libname,
install_path = None,
+ ldflags = install_rpath(bld)
)
- t.env['RPATH'] = install_rpath(bld)
if install:
if vnum:
@@ -235,7 +236,8 @@ def SAMBA_BINARY(bld, binname, source,
samba_modules = modules,
top = True,
samba_subsystem= subsystem_name,
- install_path = None
+ install_path = None,
+ ldflags = build_rpath(bld)
)
if install_path is None:
@@ -264,9 +266,9 @@ def SAMBA_BINARY(bld, binname, source,
samba_modules = modules,
top = True,
samba_subsystem= subsystem_name,
- install_path = None
+ install_path = None,
+ ldflags = install_rpath(bld)
)
- t.env['RPATH'] = install_rpath(bld)
if install:
bld.install_as(os.path.join(install_path, binname),
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 39e75c06c7..d8d690f5e1 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -374,8 +374,6 @@ def configure(conf):
def build(bld):
- bld.set_rpath()
-
# libreplace needs to put the library in the right build groups
# as libreplace is a base library for everything, even for our
# compilers, we need libreplace to build very early