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 --- lib/replace/wscript | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/replace') diff --git a/lib/replace/wscript b/lib/replace/wscript index fa0e40d21a..d54e18b26b 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -20,9 +20,12 @@ def set_options(opt): opt.add_option('--sbindir', help=("system admin executables [PREFIX/sbin]"), action="store", dest='SBINDIR', default='${PREFIX}/sbin') - opt.add_option('--enable-rpath', - help=("Enable use of rpath for installed binaries"), - action="store_true", dest='enable_rpath', default=False) + opt.add_option('--disable-rpath', + help=("Disable use of rpath for build binaries"), + action="store_true", dest='disable_rpath_build', default=False) + opt.add_option('--disable-rpath-install', + help=("Disable use of rpath for installed binaries"), + action="store_true", dest='disable_rpath_install', default=False) opt.add_option('--enable-developer', help=("Turn on developer warnings and debugging"), action="store_true", dest='developer', default=False) @@ -71,7 +74,14 @@ def configure(conf): conf.env.BINDIR = Options.options.BINDIR conf.env.SBINDIR = Options.options.SBINDIR - conf.env.RPATH_ON_INSTALL = Options.options.enable_rpath + # check for rpath + if conf.CHECK_RPATH_SUPPORT(): + conf.env.RPATH_ON_BUILD = not Options.options.disable_rpath_build + conf.env.RPATH_ON_INSTALL = (conf.env.RPATH_ON_BUILD and + not Options.options.disable_rpath_install) + else: + conf.env.RPATH_ON_INSTALL = False + conf.env.RPATH_ON_BUILD = False # we should use the PIC options in waf instead conf.ADD_CFLAGS('-fPIC') -- cgit