From: octo Date: Fri, 21 Apr 2006 07:33:37 +0000 (+0000) Subject: Check for `nanosleep'. If not found, look for `librt'. Abort if `nanosleep' is missing. X-Git-Tag: svn-trunk~60 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4ca5457f3a98ee807345e9bbd2f4e8311942dba8;p=collectd.git Check for `nanosleep'. If not found, look for `librt'. Abort if `nanosleep' is missing. This is needed on Solaris, apparently.. --- 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