librt is need not for threading primitives but for the real time scheduler
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Sat, 24 Jan 2009 18:47:47 +0000
changeset 4120 51f223987b89
parent 4119 9ffcf2400aa5
child 4121 4bbe798b0dab
librt is need not for threading primitives but for the real time scheduler
src/core/wscript
src/simulator/wscript
--- a/src/core/wscript	Sat Jan 24 18:09:29 2009 +0000
+++ b/src/core/wscript	Sat Jan 24 18:47:47 2009 +0000
@@ -9,8 +9,6 @@
 
     conf.check(header_name='signal.h', define_name='HAVE_SIGNAL_H')
 
-    conf.check(lib='rt', uselib='RT', define_name='HAVE_RT')
-
     conf.env['ENABLE_THREADING'] = conf.check(header_name='pthread.h', define_name='HAVE_PTHREAD_H')
 
     conf.report_optional_feature("Threading", "Threading Primitives",
@@ -54,7 +52,6 @@
         'config.cc',
         'callback.cc',
         ]
-    core.uselib = 'RT'
 
     headers = bld.new_task_gen('ns3header')
     headers.module = 'core'
--- a/src/simulator/wscript	Sat Jan 24 18:09:29 2009 +0000
+++ b/src/simulator/wscript	Sat Jan 24 18:47:47 2009 +0000
@@ -33,9 +33,14 @@
 
     conf.write_config_header('ns3/simulator-config.h')
 
-    conf.report_optional_feature("RealTime", "Real Time Simulator",
-                                 conf.env['ENABLE_THREADING'],
-                                 "threading not enabled")
+    if not conf.check(lib='rt', uselib='RT', define_name='HAVE_RT'):
+        conf.report_optional_feature("RealTime", "Real Time Simulator",
+                                     False, "librt is not available")
+    else:
+        conf.report_optional_feature("RealTime", "Real Time Simulator",
+                                     conf.env['ENABLE_THREADING'],
+                                     "threading not enabled")
+        conf.env["ENABLE_REAL_TIME"] = conf.env['ENABLE_THREADING']
 
 
 def build(bld):
@@ -101,7 +106,7 @@
             'cairo-wideint-private.h',
             ])
 
-    if env['ENABLE_THREADING']:
+    if env['ENABLE_REAL_TIME']:
         headers.source.extend([
                 'realtime-simulator-impl.h',
                 'wall-clock-synchronizer.h',
@@ -110,4 +115,6 @@
                 'realtime-simulator-impl.cc',
                 'wall-clock-synchronizer.cc',
                 ])
+        sim.uselib = 'RT'
 
+