From ea7b334d42727f0d00297f42cbca76662aa21c06 Mon Sep 17 00:00:00 2001 From: Sam Jansen Date: Wed, 22 Sep 2010 12:42:07 -0700 Subject: [PATCH] Fix bug980: nsc library not detected --- src/internet-stack/wscript | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/internet-stack/wscript b/src/internet-stack/wscript index 23cbdcdec..95bf530dd 100644 --- a/src/internet-stack/wscript +++ b/src/internet-stack/wscript @@ -46,6 +46,7 @@ def configure(conf): conf.env['WITH_NSC'] = os.path.abspath(nsc_release_dir) del nsc_dir del nsc_release_dir + if not conf.env['WITH_NSC']: conf.check_message("NSC location", '', False) conf.report_optional_feature("nsc", "Network Simulation Cradle", False, @@ -57,14 +58,24 @@ def configure(conf): else: arch = None ok = False - if arch == 'x86_64' or arch == 'i686' or arch == 'i586' or arch == 'i486' or arch == 'i386': + if arch in ('x86_64', 'i686', 'i586', 'i486', 'i386'): conf.env['NSC_ENABLED'] = 'yes' conf.env.append_value('CXXDEFINES', 'NETWORK_SIMULATION_CRADLE') conf.check(mandatory=True, lib='dl', define_name='HAVE_DL', uselib='DL') ok = True conf.check_message('NSC supported architecture', arch, ok) - conf.report_optional_feature("nsc", "Network Simulation Cradle", ok, - "architecture %r not supported" % arch) + + if not ok: + conf.report_optional_feature("nsc", "Network Simulation Cradle", False, + "architecture %r not supported" % arch) + return + + lib_to_check = 'liblinux2.6.26.so' + + if not os.path.exists(os.path.join(conf.env['WITH_NSC'], lib_to_check)): + conf.report_optional_feature("nsc", "Network Simulation Cradle", False, + "NSC library %s is missing: NSC has not been built?" % lib_to_check) + return # append the NSC kernel dirs to the module path so that these dirs # will end up in the LD_LIBRARY_PATH, thus allowing the NSC NS-3 @@ -73,6 +84,8 @@ def configure(conf): conf.env.append_value('NS3_MODULE_PATH', os.path.abspath(os.path.join(conf.env['WITH_NSC'], nsc_module))) + conf.report_optional_feature("nsc", "Network Simulation Cradle", True, "") + def build(bld):