This is needed on Solaris, apparently..
AC_CHECK_FUNCS(strncasecmp strcasecmp)
AC_CHECK_FUNCS(openlog syslog closelog)
+nanosleep_needs_rt="no"
+AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
+AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
+
# For cpu module
AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
if BUILD_WITH_RRDTOOL
collectd_LDFLAGS += -lm -lrrd
endif
+if BUILD_WITH_LIBRT
+collectd_LDFLAGS += -lrt
+endif
if BUILD_WITH_LIBSOCKET
collectd_LDFLAGS += -lsocket
endif