Code

Copied src/utils_mount.[ch] from quota-branch to trunk
[collectd.git] / configure.in
index aeda992cd3232190ac195f3619a5b91dcfcf14ba..889706e4b8bff74e968b3e97c3cd688608a43614 100644 (file)
@@ -1,12 +1,14 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/collectd.c)
-AM_INIT_AUTOMAKE(collectd, 3.4.0)
+AM_INIT_AUTOMAKE(collectd, 3.5.alpha1)
 AM_CONFIG_HEADER(src/config.h src/libping/config.h)
 AC_LANG(C)
 
 AC_PREFIX_DEFAULT("/opt/collectd")
 
-dnl Checks for programs.
+#
+# Checks for programs.
+#
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
@@ -19,7 +21,9 @@ AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
 #AC_PROG_RANLIB
 
-dnl Checks for header files.
+#
+# Checks for header files.
+#
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h unistd.h)
@@ -31,31 +35,54 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h)
 AC_CHECK_HEADERS(sys/types.h)
 AC_CHECK_HEADERS(sys/resource.h)
 AC_CHECK_HEADERS(errno.h)
+AC_CHECK_HEADERS(syslog.h)
+AC_CHECK_HEADERS(dlfcn.h)
+
+# For cpu modules
+AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
+
+# For load module
+AC_CHECK_HEADERS(sys/loadavg.h)
+
+# For ping module
 AC_CHECK_HEADERS(arpa/inet.h)
 AC_CHECK_HEADERS(netinet/in.h)
 AC_CHECK_HEADERS(netdb.h)
-AC_CHECK_HEADERS(syslog.h)
-AC_CHECK_HEADERS(dlfcn.h)
+
+# For users module
 AC_CHECK_HEADERS(utmp.h)
 AC_CHECK_HEADERS(utmpx.h)
 
 dnl Checking for libraries
 AC_CHECK_LIB(m, ext)
 
-dnl Checks for typedefs, structures, and compiler characteristics.
+#
+# Checks for typedefs, structures, and compiler characteristics.
+#
 AC_C_CONST
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_HEADER_TIME
 
-dnl Checks for library functions.
+#
+# Checks for library functions.
+#
 AC_PROG_GCC_TRADITIONAL
 AC_CHECK_FUNCS(gettimeofday select socket strdup strstr strtol)
 AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
 AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
 AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
 AC_CHECK_FUNCS(strncasecmp strcasecmp strncmp)
-AC_CHECK_FUNCS(getutent getutxent)
+
+# For cpu module
+AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
+
+# For load module
+AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
+
+# For users module
+have_getutent="no"
+AC_CHECK_FUNCS(getutent getutxent, [have_getutent="yes"])
 
 AC_MSG_CHECKING([for kernel type ($host_os)])
 case $host_os in
@@ -130,6 +157,8 @@ AC_ARG_WITH(libstatgrab, AC_HELP_STRING([--with-libstatgrab@<:@=PFX@:>@], [Path
 ])
 if test "x$with_libstatgrab" = "xyes"
 then
+       AC_CHECK_LIB(devstat, getdevs)
+       AC_CHECK_LIB(kvm, kvm_getargv)
        AC_CHECK_LIB(statgrab, sg_init,, [with_libstatgrab="no (not found)"])
        AC_CHECK_HEADERS(statgrab.h,,    [with_libstatgrab="no (not found)"])
 fi
@@ -180,7 +209,7 @@ fi
 AC_ARG_ENABLE(cpu, AC_HELP_STRING([--disable-cpu], [Disable CPU usage statistics]),, [enable_cpu="yes"])
 if test "x$enable_cpu" != "xno"
 then
-       if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
+       if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$have_sysctlbyname" = "xyes"
        then
                enable_cpu="yes"
        else
@@ -235,7 +264,7 @@ AM_CONDITIONAL(BUILD_MODULE_HDDTEMP, test "x$enable_hddtemp" = "xyes")
 AC_ARG_ENABLE(load, AC_HELP_STRING([--disable-load], [Disable system load statistics]),, [enable_load="yes"])
 if test "x$enable_load" != "xno"
 then
-       if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$with_libstatgrab" = "xyes"
+       if test "x$have_getloadavg" = "xyes" -o "x$ac_system" = "xLinux" -o "x$with_libstatgrab" = "xyes"
        then
                enable_load="yes"
        else
@@ -390,7 +419,7 @@ AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes")
 AC_ARG_ENABLE(users, AC_HELP_STRING([--disable-users], [Disable user count statistics]),, [enable_users="yes"])
 if test "x$enable_users" != "xno"
 then
-       if test "x$ac_system" = "xLinux" -o "x$ac_system" = "xSolaris"
+       if test "x$have_getutent" = "xyes"
        then
                enable_users="yes"
        else