Skip to content

Commit

Permalink
Add a BeConservative setting to the make system
Browse files Browse the repository at this point in the history
If it is set, we don't try to use clock_gettime
  • Loading branch information
igfoo committed Sep 10, 2007
1 parent b59ce95 commit 6061064
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mk/config.mk.in
Expand Up @@ -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).
Expand Down
4 changes: 4 additions & 0 deletions rts/Makefile
Expand Up @@ -35,6 +35,10 @@ GhcRtsHcOpts=
GhcRtsCcOpts=-g -O0
endif

ifeq "$(BeConservative)" "YES"
GhcRtsCcOpts += -DBE_CONSERVATIVE
endif

# -----------------------------------------------------------------------------

# There's nothing for Haddock here...
Expand Down
2 changes: 1 addition & 1 deletion rts/posix/GetTime.c
Expand Up @@ -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.
Expand Down

0 comments on commit 6061064

Please sign in to comment.