From ccd8b55b019c675aa4449069f796eaee63f09bc8 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 28 Oct 2011 23:29:56 +0200 Subject: [PATCH] linux: unbreak build if HAVE_MONOTONIC_CLOCK=0 --- src/platform_linux.cc | 6 ++++-- wscript | 17 ----------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/platform_linux.cc b/src/platform_linux.cc index ae281606c0..287ed3e306 100644 --- a/src/platform_linux.cc +++ b/src/platform_linux.cc @@ -42,8 +42,10 @@ #include #include -#if HAVE_MONOTONIC_CLOCK #include + +#ifndef CLOCK_MONOTONIC +# include #endif extern char **environ; @@ -296,7 +298,7 @@ int Platform::GetCPUInfo(Local *cpus) { } double Platform::GetUptimeImpl() { -#if HAVE_MONOTONIC_CLOCK +#ifdef CLOCK_MONOTONIC struct timespec now; if (0 == clock_gettime(CLOCK_MONOTONIC, &now)) { double uptime = now.tv_sec; diff --git a/wscript b/wscript index 7457339aa1..006b0d95ea 100644 --- a/wscript +++ b/wscript @@ -380,23 +380,6 @@ def configure(conf): have_librt = conf.check(lib='rt', uselib_store='RT') - have_monotonic = False - if have_librt: - code = """ - #include - int main(void) { - struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); - return 0; - } - """ - have_monotonic = conf.check_cc(lib="rt", msg="Checking for CLOCK_MONOTONIC", fragment=code) - - if have_monotonic: - conf.env.append_value('CPPFLAGS', '-DHAVE_MONOTONIC_CLOCK=1') - else: - conf.env.append_value('CPPFLAGS', '-DHAVE_MONOTONIC_CLOCK=0') - if sys.platform.startswith("sunos"): code = """ #include