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>
AC_FUNC_FORK
AC_CHECK_FUNCS([ \
atexit \
- clock_gettime \
getcpuid \
gettid \
gettimeofday \
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)],