From 318bfe9d4f4308321dfa923d3da36230fc98d62e Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 15 Jan 2011 07:48:25 -0800 Subject: 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 --- SConstruct | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'SConstruct') 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 (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 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' ] ################################################### # -- cgit v1.2.3