From 44b71a7d54e5fe568beb45011c5e0500d4df2600 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 25 Oct 2010 18:17:12 +0100 Subject: [PATCH] Revive the option --enable-modules from bit-rot; however it won't yet work in practice due to dependencies not declared and non-modular python bindings --- wscript | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index 959cebadf..c7c225b35 100644 --- a/wscript +++ b/wscript @@ -529,11 +529,14 @@ def build(bld): if env['NS3_ENABLED_MODULES']: modules = env['NS3_ENABLED_MODULES'] + + # Find out about additional modules that need to be enabled + # due to dependency constraints. changed = True while changed: changed = False for module in modules: - module_obj = Object.name_to_obj(module) + module_obj = bld.name_to_obj(module, env) if module_obj is None: raise ValueError("module %s not found" % module) for dep in module_obj.add_objects: @@ -543,14 +546,26 @@ def build(bld): modules.append(dep) changed = True - ## remove objects that depend on modules not listed + env['NS3_ENABLED_MODULES'] = modules + print "Modules to build:", modules + + # Exclude the programs other misc task gens that depend on disabled modules for obj in list(bld.all_task_gen): + + # check for ns3moduleheader_taskgen + if type(obj).__name__ == 'ns3moduleheader_taskgen': + if ("ns3-%s" % obj.module) not in modules: + bld.all_task_gen.remove(obj) + + # check for programs if hasattr(obj, 'ns3_module_dependencies'): + # this is an NS-3 program (bld.create_ns3_program) for dep in obj.ns3_module_dependencies: - if dep not in modules: + if dep not in modules: # prog. depends on a module that isn't enabled? bld.all_task_gen.remove(obj) break - if obj.name in env['NS3_MODULES'] and obj.name not in modules: + + if hasattr(obj, "is_ns3_module") and obj.name not in modules: bld.all_task_gen.remove(obj) ## Create a single ns3 library containing all enabled modules