2007-05-07 12:01:51 +01:00
|
|
|
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
|
|
|
|
|
|
2007-05-17 17:34:19 +01:00
|
|
|
import os
|
|
|
|
|
import sys
|
2007-05-13 12:46:18 +01:00
|
|
|
import Params
|
|
|
|
|
|
|
|
|
|
all_modules = [
|
|
|
|
|
'core',
|
|
|
|
|
'common',
|
|
|
|
|
'simulator',
|
|
|
|
|
'node',
|
|
|
|
|
'internet-node',
|
|
|
|
|
'devices/p2p',
|
|
|
|
|
'applications',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 12:01:51 +01:00
|
|
|
def set_options(opt):
|
|
|
|
|
opt.sub_options('simulator')
|
2007-05-13 12:46:18 +01:00
|
|
|
opt.add_option('--disable-rpath',
|
|
|
|
|
help=("Don't link programs with rpath"),
|
|
|
|
|
action="store_true", default=False,
|
|
|
|
|
dest='disable_rpath')
|
|
|
|
|
|
2007-05-07 12:01:51 +01:00
|
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
|
conf.sub_config('core')
|
|
|
|
|
conf.sub_config('simulator')
|
|
|
|
|
|
2007-05-13 12:46:18 +01:00
|
|
|
conf.env['DISABLE_RPATH'] = Params.g_options.disable_rpath
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 12:01:51 +01:00
|
|
|
def build(bld):
|
2007-05-13 12:46:18 +01:00
|
|
|
|
|
|
|
|
## Add a global RPATH pointing to each module, so that programs can find the libs
|
|
|
|
|
## Note: this is slightly evil; we get away because our programs
|
|
|
|
|
## and libs are not supposed to be installed system wide.
|
|
|
|
|
env = bld.env_of_name('default')
|
|
|
|
|
if not env['DISABLE_RPATH']:
|
|
|
|
|
for module in all_modules:
|
2007-05-13 17:37:30 +01:00
|
|
|
node = bld.m_curdirnode.find_dir(module)
|
2007-05-17 17:34:19 +01:00
|
|
|
if sys.platform == 'win32':
|
|
|
|
|
os.environ["PATH"] = ';'.join([os.environ["PATH"], node.abspath(env)])
|
|
|
|
|
else:
|
|
|
|
|
env.append_value('RPATH', '-Wl,--rpath=%s' % (node.abspath(env),))
|
2007-05-13 12:46:18 +01:00
|
|
|
|
|
|
|
|
bld.add_subdirs(all_modules)
|
2007-05-07 12:01:51 +01:00
|
|
|
|