Make openflow and tap-bridge modules not be built if not appropriate
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user