merge with ns-3-dev

This commit is contained in:
Tom Henderson
2007-08-03 08:29:24 -07:00
141 changed files with 9133 additions and 1861 deletions

View File

@@ -9,37 +9,51 @@ import Object
import Params
all_modules = [
all_modules = (
'core',
'common',
'simulator',
'node',
'internet-node',
'devices/p2p',
'devices/point-to-point',
'devices/csma-cd',
'applications',
'routing/global',
]
'mobility',
)
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.sub_config(module)
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('ns3_headers', func=_ns3_headers_inst, color='BLUE')
Action.Action('ns3header', func=_ns3_headers_inst, color='BLUE')
bld.add_subdirs(all_modules)
bld.add_subdirs(list(all_modules))
class Ns3Header(Object.genobj):
"""A set of NS-3 header files"""
@@ -53,19 +67,15 @@ class Ns3Header(Object.genobj):
def apply(self):
ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3")
inputs = []
outputs = []
for filename in self.to_list(self.source):
src_node = self.path.find_source(filename)
if src_node is None:
Params.fatal("source ns3 header file %s not found" % (filename,))
dst_node = ns3_dir_node.find_build(os.path.basename(filename))
assert dst_node is not None
inputs.append(src_node)
outputs.append(dst_node)
task = self.create_task('ns3_headers', self.env, 1)
task.set_inputs(inputs)
task.set_outputs(outputs)
task = self.create_task('ns3header', self.env, 1)
task.set_inputs([src_node])
task.set_outputs([dst_node])
def install(self):
for i in self.m_tasks: