--- i/wscript +++ i/wscript @@ -241,6 +241,9 @@ def options(opt): opt.add_option('--cxx-standard', help=('Compile NS-3 with the given C++ standard'), type='string', default='-std=c++11', dest='cxx_standard') + opt.add_option('--disable-modules', + help=('Explicitly disable modules (comma-separated) from the build.'), + type='string', default='', dest='disable_modules') # options provided in subdirectories opt.recurse('src') @@ -507,6 +510,32 @@ def configure(conf): conf.env['NS3_ENABLED_MODULES'] = _enabled_mods conf.env['NS3_ENABLED_CONTRIBUTED_MODULES'] = _enabled_contrib_mods + to_remove = [] + not_removed = [] + if Options.options.disable_modules: + for mod in Options.options.disable_modules.split(','): + name = '' + if mod.startswith('ns3-'): + name = mod[4:] + else: + name = mod + mod = 'ns3-' + mod + + if mod in conf.env['NS3_ENABLED_MODULES']: + to_remove.append(name) + conf.env['MODULES_NOT_BUILT'].append(name) + elif mod in conf.env['NS3_ENABLED_CONTRIBUTED_MODULES']: + to_remove.append(name) + conf.env['MODULES_NOT_BUILT'].append(name) + else: + not_removed.append(name) + + if len(to_remove) > 0: + conf.report_optional_feature("Modules Disabled", "Disable modules (" + ','.join(to_remove) + ")", True, None) + if len(not_removed) > 0: + conf.report_optional_feature("Modules Not Disabled", "Disable modules error (" + ','.join(not_removed) + ")", + False, "Module(s) not found in the list. Spelling error?") + # Add the template module to the list of enabled modules that # should not be built if this is a static build on Darwin. They # don't work there for the template module, and this is probably