diff --git a/src/emu/wscript b/src/emu/wscript index 1dda64bac..97fa4cb9f 100644 --- a/src/emu/wscript +++ b/src/emu/wscript @@ -19,6 +19,8 @@ def configure(conf): emucreatordir = os.path.abspath(os.path.join(blddir, "src/emu")) conf.env.append_value('NS3_EXECUTABLE_PATH', emucreatordir) else: + # Add this module to the list of modules that won't be built + # if they are enabled. conf.env['MODULES_NOT_BUILT'].append('emu') def build(bld): diff --git a/src/openflow/wscript b/src/openflow/wscript index f0bb673cb..1c3c3939c 100644 --- a/src/openflow/wscript +++ b/src/openflow/wscript @@ -25,6 +25,11 @@ def configure(conf): if not conf.env['BOOST']: conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False, "Required boost libraries not found") + + # Add this module to the list of modules that won't be built + # if they are enabled. + conf.env['MODULES_NOT_BUILT'].append('openflow') + return if Options.options.with_openflow: @@ -41,6 +46,10 @@ def configure(conf): conf.check_message("OpenFlow location", '', False) conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False, "OpenFlow not enabled (see option --with-openflow)") + # Add this module to the list of modules that won't be built + # if they are enabled. + conf.env['MODULES_NOT_BUILT'].append('openflow') + return test_code = ''' @@ -112,10 +121,18 @@ int main() conf.env.append_value('CXXDEFINES', 'NS3_OPENFLOW') conf.env.append_value('CPPPATH', conf.env['CPPPATH_OPENFLOW']) conf.env.append_value('LIBPATH', conf.env['LIBPATH_OPENFLOW']) + else: + # Add this module to the list of modules that won't be built + # if they are enabled. + conf.env['MODULES_NOT_BUILT'].append('openflow') def build(bld): + # Don't do anything for this module if openflow's not enabled. + if 'openflow' in bld.env['MODULES_NOT_BUILT']: + return + # Build the Switch module obj = bld.create_ns3_module('openflow', ['internet']) obj.source = [ diff --git a/src/tap-bridge/wscript b/src/tap-bridge/wscript index 42c6f3758..4ee038ab5 100644 --- a/src/tap-bridge/wscript +++ b/src/tap-bridge/wscript @@ -18,31 +18,30 @@ def configure(conf): blddir = os.path.abspath(os.path.join(conf.blddir, conf.env.variant())) tapcreatordir = os.path.abspath(os.path.join(blddir, "src/tap-bridge")) conf.env.append_value('NS3_EXECUTABLE_PATH', tapcreatordir) + else: + # Add this module to the list of modules that won't be built + # if they are enabled. + conf.env['MODULES_NOT_BUILT'].append('tap-bridge') def build(bld): + # Don't do anything for this module if tap-bridge's not enabled. + if not bld.env['ENABLE_TAP']: + return + module = bld.create_ns3_module('tap-bridge', ['network', 'internet']) module.source = [ + 'model/tap-bridge.cc', + 'model/tap-encode-decode.cc', + 'helper/tap-bridge-helper.cc', ] headers = bld.new_task_gen('ns3header') headers.module = 'tap-bridge' headers.source = [ + 'model/tap-bridge.h', + 'helper/tap-bridge-helper.h', 'doc/tap.h', ] - if not bld.env['ENABLE_TAP']: - return - - module.source.extend([ - 'model/tap-bridge.cc', - 'model/tap-encode-decode.cc', - 'helper/tap-bridge-helper.cc', - ]) - headers.source.extend([ - 'model/tap-bridge.h', - 'helper/tap-bridge-helper.h', - ]) - - if not bld.env['PLATFORM'].startswith('freebsd'): obj = bld.create_suid_program('tap-creator') obj.source = [