Hi Vincent,

On Fri, Mar 26, 2010 at 09:55:32AM +1100, Vincent McIntyre wrote:
> I found another discussion of this
>   http://lists.apple.com/archives/Darwin-development/2002/Apr/msg00408.html
> that suggests the patch is more like
> 
> - AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep,
> nanosleep_needs rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
> 
> + 
> AC_CHECK_FUNCS(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,LTHREAD_LIBS="$LTHREAD_LIBS
> -lrt",[AC_CHECK_LIB(posix4,nanosleep,LIB="$LTHREAD_LIBS -lposix4")])])

Thanks for reporting this and digging up a solution!

The attached patch should integrate this fix into the collectd build
system. Could you please verify that this works for you? I don't have
Solaris around to test the patch myself.

The patch is also available in the sh/collectd-4.8 branch in
git://git.tokkee.org/collectd.git (to be merged by Florian, who will
then merge it into 4.9 and master).

To apply the patch, do (in the toplevel source directory):

  patch -p1 < posix4-check.patch

To rebuild the build system, do:

  make configure

If that does not work (e.g., in case your autoconf version does not
match), do:

  ./build.sh

… and then re-run "configure".

TIA,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

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 f46a362..f8bf90c 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 0ed299b..f533b12 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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd

Reply via email to