Try to check for nsc if it was installed
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 30 Mar 2011 14:12:46 +0200
changeset 6979 5f5f1bde59c9
parent 6978 1e8184a60e21
child 6980 124487d6140b
Try to check for nsc if it was installed
src/internet/wscript
--- a/src/internet/wscript	Wed Mar 30 11:13:14 2011 +0100
+++ b/src/internet/wscript	Wed Mar 30 14:12:46 2011 +0200
@@ -73,21 +73,22 @@
 
     lib_to_check = 'liblinux2.6.26.so'
 
-    if not os.path.exists(os.path.join(conf.env['WITH_NSC'], lib_to_check)):
+    found = False
+    for path in ['.', 'lib', 'lib64']:
+        if os.path.exists(os.path.join(conf.env['WITH_NSC'], path, lib_to_check)):
+            # 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
+            # module to find the necessary NSC shared libraries.
+            found = True
+            for nsc_module in ['linux-2.6.18', 'linux-2.6.26']:
+                conf.env.append_value('NS3_MODULE_PATH',
+                                      os.path.abspath(os.path.join(conf.env['WITH_NSC'], path, nsc_module)))
+    if not found:
         conf.env['NSC_ENABLED'] = False
         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
-    # module to find the necessary NSC shared libraries.
-    for nsc_module in ['linux-2.6.18', 'linux-2.6.26']:
-        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, "")
-
+                                     "NSC library %s is missing: NSC has not been built?" % lib_to_check)
+    else:
+        conf.report_optional_feature("nsc", "Network Simulation Cradle", True, "")
 
 
 def build(bld):