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:20:37 +0000 (08:20 -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 b86f371be22edcb8ff0eb3dd1653aba12978d979..fcad176c16e6c5aac0e349a084d32cd8d146c79a 100644 (file)
@@ -79,7 +79,6 @@ AC_FUNC_MMAP
 AC_FUNC_FORK
 AC_CHECK_FUNCS([ \
        atexit \
-       clock_gettime \
        getcpuid \
        gettid \
        gettimeofday \
@@ -215,6 +214,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.025416 seconds and 4 git commands to generate.