Commit 60610640 authored by Ian Lynagh's avatar Ian Lynagh

Add a BeConservative setting to the make system

If it is set, we don't try to use clock_gettime
parent b59ce959
......@@ -291,6 +291,10 @@ else
GhcEnableTablesNextToCode=YES
endif
# When building bindists we set this to yes so that the binaries are as
# portable as possible.
BeConservative = NO
#
# Building various ways?
# (right now, empty if not).
......
......@@ -35,6 +35,10 @@ GhcRtsHcOpts=
GhcRtsCcOpts=-g -O0
endif
ifeq "$(BeConservative)" "YES"
GhcRtsCcOpts += -DBE_CONSERVATIVE
endif
# -----------------------------------------------------------------------------
# There's nothing for Haddock here...
......
......@@ -134,7 +134,7 @@ Ticks getThreadCPUTime(void)
}
return ((usec * TICKS_PER_SECOND) / 1000000);
#elif defined(HAVE_CLOCK_GETTIME) && defined (_POSIX_THREAD_CPUTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(HAVE_SYSCONF)
#elif !defined(BE_CONSERVATIVE) && defined(HAVE_CLOCK_GETTIME) && defined (_POSIX_THREAD_CPUTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(HAVE_SYSCONF)
if (sysconf(_POSIX_THREAD_CPUTIME) != -1) {
// clock_gettime() gives us per-thread CPU time. It isn't
// reliable on Linux, but it's the best we have.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment