From 4ca5457f3a98ee807345e9bbd2f4e8311942dba8 Mon Sep 17 00:00:00 2001 From: octo Date: Fri, 21 Apr 2006 07:33:37 +0000 Subject: [PATCH] Check for `nanosleep'. If not found, look for `librt'. Abort if `nanosleep' is missing. This is needed on Solaris, apparently.. --- configure.in | 4 ++++ src/Makefile.am | 3 +++ 2 files changed, 7 insertions(+) diff --git a/configure.in b/configure.in index f2573a32..7100049e 100644 --- a/configure.in +++ b/configure.in @@ -270,6 +270,10 @@ AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen) 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"]) diff --git a/src/Makefile.am b/src/Makefile.am index 025548a1..e3cf843c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,9 @@ collectd_LDFLAGS = -export-dynamic 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 -- 2.30.2