summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-01-15 07:48:25 -0800
committerNathan Binkert <nate@binkert.org>2011-01-15 07:48:25 -0800
commit318bfe9d4f4308321dfa923d3da36230fc98d62e (patch)
treeb1bc3ef3a778ed7c2a6fd263f06728c861d73fce /SConstruct
parentc82a8979a3909037a1654fc66cb215b5bacadb08 (diff)
downloadgem5-318bfe9d4f4308321dfa923d3da36230fc98d62e.tar.xz
time: improve time datastructure
Use posix clock functions (and librt) if it is available. Inline a bunch of functions and implement more operators. * * * time: more cleanup
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct11
1 files changed, 10 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 18ebea2af..6127113b6 100755
--- a/SConstruct
+++ b/SConstruct
@@ -703,6 +703,13 @@ if not conf.CheckLibWithHeader('z', 'zlib.h', 'C++','zlibVersion();'):
print ' Please install zlib and try again.'
Exit(1)
+# Check for librt.
+have_posix_clock = conf.CheckLib(None, 'clock_nanosleep', 'time.h') or \
+ conf.CheckLib('rt', 'clock_nanosleep', 'time.h')
+
+if not have_posix_clock:
+ print "Can't find library for POSIX clocks."
+
# Check for <fenv.h> (C99 FP environment control)
have_fenv = conf.CheckHeader('fenv.h', '<>')
if not have_fenv:
@@ -819,6 +826,7 @@ sticky_vars.AddVariables(
'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
False),
BoolVariable('USE_MYSQL', 'Use MySQL for stats output', have_mysql),
+ BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
BoolVariable('USE_CHECKER', 'Use checker for detailed CPU models', False),
BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
@@ -828,7 +836,8 @@ sticky_vars.AddVariables(
# These variables get exported to #defines in config/*.hh (see src/SConscript).
export_vars += ['FULL_SYSTEM', 'USE_FENV', 'USE_MYSQL',
'NO_FAST_ALLOC', 'FAST_ALLOC_DEBUG', 'FAST_ALLOC_STATS',
- 'SS_COMPATIBLE_FP', 'USE_CHECKER', 'TARGET_ISA', 'CP_ANNOTATE']
+ 'SS_COMPATIBLE_FP', 'USE_CHECKER', 'TARGET_ISA', 'CP_ANNOTATE',
+ 'USE_POSIX_CLOCK' ]
###################################################
#