From: Sebastian Harl Date: Fri, 26 Mar 2010 12:11:50 +0000 (+0100) Subject: configure, src/Makefile: Check for nanosleep() in libposix4 as well. X-Git-Tag: collectd-4.8.4~4^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e428176dff22b00adf14fc082eee7fd7eb3ae040;p=collectd.git configure, src/Makefile: Check for nanosleep() in libposix4 as well. On, e.g., Solaris 2.6, nanosleep() is only available from that library. Thanks to Vincent McIntyre for reporting this and providing an initial patch. --- diff --git a/configure.in b/configure.in index f46a3624..f8bf90cc 100644 --- a/configure.in +++ b/configure.in @@ -528,8 +528,16 @@ AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="ye AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes") nanosleep_needs_rt="no" -AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) +nanosleep_needs_posix4="no" +AC_CHECK_FUNCS(nanosleep, + [], + AC_CHECK_LIB(rt, nanosleep, + [nanosleep_needs_rt="yes"], + AC_CHECK_LIB(posix4, nanosleep, + [nanosleep_needs_posix4="yes"], + AC_MSG_ERROR(cannot find nanosleep)))) AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") +AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$nanosleep_needs_posix4" = "xyes") AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"]) AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) diff --git a/src/Makefile.am b/src/Makefile.am index 0ed299b5..f533b12c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,6 +53,9 @@ collectd_DEPENDENCIES = if BUILD_WITH_LIBRT collectd_LDADD += -lrt endif +if BUILD_WITH_LIBPOSIX4 +collectd_LDADD += -lposix4 +endif if BUILD_WITH_LIBSOCKET collectd_LDADD += -lsocket endif