configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt
AC_SEARCH_LIBS was finding the function correctly, but later on
AC_CHECK_FUNCS was not including the found LIBRARY_RT so the function
was not found, and hence HAVE_CLOCK_GETTIME ended up undefined (which in
turns disables support for osmo_clock_gettime() API).
This happened in systems like the soekris where the clock_gettime sybmol
is available in external lib -lrt.
Let's avoid double-checking for the function twice, and simply define
HAVE_CLOCK_GETTIME when AC_SEARCH_LIBS succeeds (the success action is
guaranteed to be called even if there's no extra lib required).
Change-Id: Iced1e0542cee6beb9f08f5299aad49fab142cfb4
diff --git a/configure.ac b/configure.ac
index 352648b..cba0a41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,9 @@
AX_PTHREAD
# check for old glibc < 2.17 to get clock_gettime
-AC_SEARCH_LIBS([clock_gettime], [rt posix4], [LIBRARY_RT="$LIBS";LIBS=""])
+AC_SEARCH_LIBS([clock_gettime], [rt posix4],
+ [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available])
+ LIBRARY_RT="$LIBS";LIBS="";])
AC_SUBST(LIBRARY_RT)
AC_ARG_ENABLE(doxygen,
@@ -103,7 +105,7 @@
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
-AC_CHECK_FUNCS(clock_gettime localtime_r)
+AC_CHECK_FUNCS(localtime_r)
AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
AC_CACHE_CHECK(