Fix: configure.ac: check for possibly required libs for clock_gettime
authorOlof Johansson <olof.johansson@axis.com>
Wed, 10 Feb 2016 09:39:50 +0000 (10:39 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Feb 2016 13:19:59 +0000 (08:19 -0500)
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 <olof.johansson@axis.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac

index 71a7d71f2dd86c634ce0112a8e0006d8206dbec8..8ebfa8b50905725faf92588e0567f26b8347985b 100644 (file)
@@ -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)],
This page took 0.026384 seconds and 4 git commands to generate.