Code

configure, src/Makefile: Check for nanosleep() in libposix4 as well. sh/collectd-4.8
authorSebastian Harl <sh@tokkee.org>
Fri, 26 Mar 2010 12:11:50 +0000 (13:11 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 26 Mar 2010 12:11:50 +0000 (13:11 +0100)
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.

configure.in
src/Makefile.am

index f46a3624518a9ef95373bc9af4a66fa7c0156c5e..f8bf90cc69308cb85a2ff3a3594a298472becf26 100644 (file)
@@ -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"])
index 0ed299b5fa48d830eb92cad8e6ddd77c1eed5bed..f533b12cea1744c4c09d5491e61b92027efe96bc 100644 (file)
@@ -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