From 37a1358b81b4d3379f3662a0ed1defcb1e54c2fb Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 28 Feb 2013 19:13:07 -0800 Subject: [PATCH] glibc needs -lrt to get clock_gettime() Reported by csosstudy --- configure.ac | 2 ++ src/curvecp/libcurvecp/nanoseconds.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c546a169..f34d433c 100644 --- a/configure.ac +++ b/configure.ac @@ -153,6 +153,8 @@ AC_C_BIGENDIAN dnl Checks for functions and headers +AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)]) + AC_CHECK_FUNCS([SecureZeroMemory]) dnl Switches. diff --git a/src/curvecp/libcurvecp/nanoseconds.c b/src/curvecp/libcurvecp/nanoseconds.c index de5309d5..65e6d9f8 100644 --- a/src/curvecp/libcurvecp/nanoseconds.c +++ b/src/curvecp/libcurvecp/nanoseconds.c @@ -7,7 +7,7 @@ long long nanoseconds(void) { -#ifdef CLOCK_REALTIME +#if defined(CLOCK_REALTIME) && defined(HAVE_CLOCK_GETTIME) struct timespec t; if (clock_gettime(CLOCK_REALTIME,&t) != 0) return -1; return t.tv_sec * 1000000000LL + t.tv_nsec;