From f0a90a46ede26b7fb4b6bd161b963def0c7419f7 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Fri, 20 Jul 2007 11:38:16 +0100 Subject: [PATCH] WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default. --- src/wscript | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/wscript b/src/wscript index 1945234c1..72344847e 100644 --- a/src/wscript +++ b/src/wscript @@ -22,26 +22,37 @@ all_modules = [ def set_options(opt): opt.sub_options('simulator') - + + opt.add_option('--enable-rpath', + help=("Link programs with rpath" + " (normally not needed, see " + " --run and --shell; moreover, only works in some" + " specific platforms, such as Linux and Solaris)"), + action="store_true", dest='enable_rpath', default=False) + + def configure(conf): conf.sub_config('core') conf.sub_config('simulator') blddir = os.path.abspath(os.path.join(conf.m_blddir, conf.env.variant())) for module in all_modules: - conf.env.append_value('NS3_MODULE_PATH', os.path.join(blddir, 'src', module)) + module_path = os.path.join(blddir, 'src', module) + conf.env.append_value('NS3_MODULE_PATH', module_path) + if Params.g_options.enable_rpath: + conf.env.append_value('RPATH', '-Wl,-rpath=%s' % (module_path,)) ## Used to link the 'run-tests' program with all of ns-3 code conf.env['NS3_MODULES'] = ['ns3-' + module.split('/')[-1] for module in all_modules] + def build(bld): Object.register('ns3header', Ns3Header) Action.Action('ns3header', func=_ns3_headers_inst, color='BLUE') bld.add_subdirs(all_modules) - class Ns3Header(Object.genobj): """A set of NS-3 header files""" def __init__(self, env=None):