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.
This commit is contained in:
Christian Thaeter 2010-05-11 18:41:19 +02:00
parent 030320352d
commit 5792d330b3

View file

@ -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