From cc43cfbb418ab7b4b2786123d33ede23b3cb5ea3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 14 Jan 2011 09:07:57 +0000 Subject: another workaround for systems with broken CLOCK_MONOTONIC This should also detect cases where CLOCK_MONOTONIC is available at build but not at runtime. --- ext/clogger_ext/extconf.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/clogger_ext/extconf.rb') diff --git a/ext/clogger_ext/extconf.rb b/ext/clogger_ext/extconf.rb index d87d8c2..85f2d30 100644 --- a/ext/clogger_ext/extconf.rb +++ b/ext/clogger_ext/extconf.rb @@ -13,10 +13,11 @@ begin have_macro('O_NONBLOCK', %w(unistd.h fcntl.h)) end - unless have_macro('CLOCK_MONOTONIC', 'time.h', '-D_POSIX_C_SOURCE=200112L') - $CPPFLAGS += '-D_POSIX_SOURCE_200112L' + $CPPFLAGS += '-D_POSIX_C_SOURCE=200112L' + unless have_macro('CLOCK_MONOTONIC', 'time.h') have_func('CLOCK_MONOTONIC', 'time.h') end + have_type('clockid_t', 'time.h') have_func('clock_gettime', 'time.h') have_func('localtime_r', 'time.h') or raise "localtime_r needed" have_func('gmtime_r', 'time.h') or raise "gmtime_r needed" -- cgit v1.2.3-24-ge0c7