From dc9010572c1d32a4e1c82afbee2a359c429cc9aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 20 Mar 2010 23:41:15 +1100 Subject: build: support systems without rpath --- buildtools/wafsamba/samba_autoconf.py | 9 +++++++++ buildtools/wafsamba/samba_utils.py | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'buildtools') diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 4ea29d4058..e91409e0a4 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -409,3 +409,12 @@ def CURRENT_CFLAGS(bld, target, cflags): ret = TO_LIST(cflags) ret.extend(list) return ret + +@conf +def CHECK_RPATH_SUPPORT(conf): + '''see if the system supports rpath''' + return conf.CHECK_CODE('int x', + define='HAVE_RPATH_SUPPORT', + execute=True, + msg='Checking for rpath support', + cflags='-Wl,-rpath=.') diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 9893a86c30..564b5b82e3 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -62,13 +62,16 @@ def runonce(function): def set_rpath(bld): '''setup the default rpath''' - rpath = os.path.normpath('%s/%s' % (bld.env['BUILD_DIRECTORY'], LIB_PATH)) - bld.env.append_value('RPATH', '-Wl,-rpath=%s' % 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''' - if bld.env['RPATH_ON_INSTALL']: + if bld.env.RPATH_ON_INSTALL: return ['-Wl,-rpath=%s/lib' % bld.env.PREFIX] return [] -- cgit