From e94efcbebba537ccee241af4c8b560a0aafc4348 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 6 Apr 2007 10:07:18 +0200 Subject: [PATCH] configure.in: Many fixes for Solaris. Especially check the `kstat_io_t'-type for it's members. Also changed `src/Makefile.am' to link `collectd-nagios' with `libsocket' if needed. --- configure.in | 34 ++++++++++++++++++++++++++++++++-- src/Makefile.am | 4 ++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index dad499a9..8f9e3be6 100644 --- a/configure.in +++ b/configure.in @@ -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 +#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 +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#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 +#endif + ]) + AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in *linux*) diff --git a/src/Makefile.am b/src/Makefile.am index 32bef648..23d82aa5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 = -- 2.11.0