Merge branch 'collectd-4.5'
[collectd.git] / configure.in
index c8ce069..b7d989d 100644 (file)
@@ -65,6 +65,11 @@ then
        AC_SUBST(KERNEL_CFLAGS)
 fi
 
+if test "x$ac_system" = "xSolaris"
+then
+       CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+fi
+
 #
 # Checks for header files.
 #
@@ -240,7 +245,8 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
 ])
 
 # For the swap module
-AC_CHECK_HEADERS(sys/swap.h, [], [],
+have_sys_swap_h="yes"
+AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
 [
 #if HAVE_SYS_TYPES_H
 #  include <sys/types.h>
@@ -250,6 +256,11 @@ AC_CHECK_HEADERS(sys/swap.h, [], [],
 #endif
 ])
 
+if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
+then
+       AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
+fi
+
 # For load module
 # For the processes plugin
 # For users module
@@ -1001,6 +1012,15 @@ then
 fi
 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
 
+AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
+if test "x$with_kvm_openfiles" = "xyes"
+then
+       AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
+                 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
+       with_libkvm="yes"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
+
 # --with-libcurl {{{
 with_curl_config="curl-config"
 with_curl_cflags=""
@@ -2831,10 +2851,14 @@ then
        plugin_disk="yes"
        plugin_interface="yes"
        plugin_memory="yes"
-       plugin_swap="yes"
        plugin_tape="yes"
 fi
 
+if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
+then
+       plugin_swap="yes"
+fi
+
 # libstatgrab
 if test "x$with_libstatgrab" = "xyes"
 then
@@ -2923,7 +2947,7 @@ then
        plugin_swap="yes"
 fi
 
-if test "x$with_kvm_nlist" = "xyes"
+if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
 then
        plugin_tcpconns="yes"
 fi