From 5792d330b3de0d4cacd3542e032a1b4914ddec15 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Tue, 11 May 2010 18:41:19 +0200 Subject: [PATCH] FIX #618: test if -lrt is required for linking This checks for clock_gettime availability in the clib and in librt and adds -lrt to LUMIERA_LIBS when the function is available in librt. The check is only done for autotools based builds, scons may need something else. Other functions from the realtime need to be added on demand. --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 34091e389..16d89f628 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,18 @@ LUMIERA_LIBS="$NOBUGMT_LIBS" AC_SUBST(LUMIERA_CFLAGS) AC_SUBST(LUMIERA_LIBS) +#functions from realtime library +AC_LANG_PUSH([C]) + +AC_CHECK_FUNCS(clock_gettime, + AC_MSG_NOTICE([clock_gettime is in the clib]), + AC_CHECK_LIB(rt, clock_gettime, + [LUMIERA_LIBS="$LUMIERA_LIBS -lrt"], + AC_MSG_ERROR([No library providing clock_gettime found]) + ) +) + +AC_LANG_POP([C]) #boost # C++ headers and libraries