Code

configure.in: Many fixes for Solaris. Especially check the `kstat_io_t'-type for...
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 6 Apr 2007 08:07:18 +0000 (10:07 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 6 Apr 2007 08:07:18 +0000 (10:07 +0200)
Also changed `src/Makefile.am' to link `collectd-nagios' with `libsocket' if needed.

configure.in
src/Makefile.am

index dad499a9ddec0e9aa185a04ebbb9c17faa21b969..8f9e3be6103847215ca28c39b0f826bb656e7af0 100644 (file)
@@ -50,6 +50,7 @@ AC_CHECK_HEADERS(netdb.h)
 AC_CHECK_HEADERS(arpa/inet.h)
 AC_CHECK_HEADERS(sys/resource.h)
 AC_CHECK_HEADERS(sys/param.h)
+AC_CHECK_HEADERS(kstat.h)
 
 # For ping library
 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
@@ -323,9 +324,29 @@ AC_CHECK_HEADERS(regex.h)
 # For the dns plugin
 AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h)
 
-AC_CHECK_HEADERS(net/if_arp.h)
+AC_CHECK_HEADERS(net/if_arp.h, [], [],
+[#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
 AC_CHECK_HEADERS(net/if_ppp.h)
-AC_CHECK_HEADERS(netinet/if_ether.h)
+AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+])
 
 # For the multimeter plugin
 AC_CHECK_HEADERS(termios.h)
@@ -628,6 +649,15 @@ AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
 #endif
 ])
 
+AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
+       [],
+       [],
+       [
+#if HAVE_KSTAT_H
+# include <kstat.h>
+#endif
+       ])
+
 AC_MSG_CHECKING([for kernel type ($host_os)])
 case $host_os in
        *linux*)
index 32bef648842279d049a14b26123c648074204adb..23d82aa5e563f57ddd0a1ebac1d255f11941a389 100644 (file)
@@ -63,6 +63,10 @@ collectd_LDADD = $(LIBLTDL) liboconfig/liboconfig.la "-dlopen" self
 collectd_DEPENDENCIES = $(LIBLTDL) liboconfig/liboconfig.la
 
 collectd_nagios_SOURCES = collectd-nagios.c
+collectd_nagios_LDFLAGS =
+if BUILD_WITH_LIBSOCKET
+collectd_nagios_LDFLAGS += -lsocket
+endif
 
 pkglib_LTLIBRARIES =