Link the `disk' plugin against `IOKitLib' when available..
[collectd.git] / configure.in
index 6a33174..f2573a3 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.9.0-alpha1)
+AC_INIT(collectd, 3.9.0)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
@@ -138,7 +138,7 @@ AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
 AC_CHECK_HEADERS(mach/mach_init.h)
 AC_CHECK_HEADERS(mach/host_priv.h)
-AC_CHECK_HEADERS(mach/host_error.h)
+AC_CHECK_HEADERS(mach/mach_error.h)
 AC_CHECK_HEADERS(mach/mach_host.h)
 AC_CHECK_HEADERS(mach/mach_port.h)
 AC_CHECK_HEADERS(mach/mach_types.h)
@@ -154,6 +154,30 @@ AC_CHECK_HEADERS(mach/vm_prot.h)
 AC_CHECK_HEADERS(mach/vm_statistics.h)
 AC_CHECK_HEADERS(mach/kern_return.h)
 
+# For hddtemp module
+AC_CHECK_HEADERS(linux/major.h)
+
+# For the apple_sensors module
+AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
+AC_CHECK_HEADERS(IOKit/IOKitLib.h)
+AC_CHECK_HEADERS(IOKit/IOTypes.h)
+
+# For the battery plugin
+AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
+[
+#if HAVE_IOKIT_IOKITLIB_H
+#  include <IOKit/IOKitLib.h>
+#endif
+#if HAVE_IOKIT_IOTYPES_H
+#  include <IOKit/IOTypes.h>
+#endif
+])
+AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h)
+
+# For the `disk' plugin
+AC_CHECK_HEADERS(IOKit/IOBSD.h)
+AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h)
+
 # For load module
 AC_CHECK_HEADERS(sys/loadavg.h)
 
@@ -543,6 +567,20 @@ AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you ha
 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
 ### END of check for libcurl ###
 
+with_libiokit="no"
+collectd_libiokit=0
+AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
+[
+       with_libiokit="yes"
+       collectd_libiokit=1
+], 
+[
+       with_libiokit="no"
+       collectd_libiokit=0
+])
+AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
+AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
+
 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
 [
        if test "x$withval" != "xno" -a "x$withval" != "xyes"
@@ -767,6 +805,7 @@ AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
 m4_divert_once([HELP_ENABLE], [
 collectd modules:])
 AC_COLLECTD([apache],    [disable], [module], [Apache httpd statistics])
+AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors])
 AC_COLLECTD([battery],   [disable], [module], [battery statistics])
 AC_COLLECTD([cpu],       [disable], [module], [cpu usage statistics])
 AC_COLLECTD([cpufreq],   [disable], [module], [system cpu frequency statistics])
@@ -1012,6 +1051,7 @@ cat <<EOF;
 Configuration:
   Libraries:
     libcurl . . . . . . $with_libcurl
+    libiokit  . . . . . $with_libiokit
     librrd  . . . . . . $with_rrdtool
     lm_sensors  . . . . $with_lm_sensors
     libstatgrab . . . . $with_libstatgrab
@@ -1025,6 +1065,8 @@ Configuration:
     heartbeat . . . . . $collectd_heartbeat seconds
 
   Modules:
+    apache  . . . . . . $enable_apache
+    apple_sensors . . . $enable_apple_sensors
     battery . . . . . . $enable_battery
     cpu . . . . . . . . $enable_cpu
     cpufreq . . . . . . $enable_cpufreq