From: Olof Johansson Date: Wed, 10 Feb 2016 09:39:50 +0000 (+0100) Subject: Fix: configure.ac: check for possibly required libs for clock_gettime X-Git-Tag: v0.10.0~53 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=8be0fb5f7bbd9148b6c49e5b498742248b0eb18a Fix: configure.ac: check for possibly required libs for clock_gettime On some platforms, you have to link with rt to get clock_gettime. This solves errors like: undefined reference to `clock_gettime' Fixes: #996 Signed-off-by: Olof Johansson Signed-off-by: Mathieu Desnoyers --- diff --git a/configure.ac b/configure.ac index 71a7d71..8ebfa8b 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,6 @@ AC_FUNC_MMAP AC_FUNC_FORK AC_CHECK_FUNCS([ \ atexit \ - clock_gettime \ getcpuid \ gettid \ gettimeofday \ @@ -216,6 +215,11 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ compat_futex_test=1 ]) +# Search for clock_gettime +AC_SEARCH_LIBS([clock_gettime], [rt], [], + [AC_MSG_ERROR([Cannot find clock_gettime function.])] +) + # Check for pthread AC_CHECK_LIB([pthread], [pthread_create], [AM_CONDITIONAL(LIBC_INCLUDES_PTHREAD, false)],