dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.8.2)
+AC_INIT(collectd, 3.9.0)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
AC_CHECK_HEADERS(stdint.h)
+AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(errno.h)
+AC_CHECK_HEADERS(math.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(signal.h)
# For cpu modules
AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
+AC_CHECK_HEADERS(mach/kern_return.h)
+AC_CHECK_HEADERS(mach/mach_init.h)
+AC_CHECK_HEADERS(mach/mach_host.h)
+AC_CHECK_HEADERS(mach/host_priv.h)
+AC_CHECK_HEADERS(mach/processor_info.h)
+AC_CHECK_HEADERS(mach/processor.h)
+AC_CHECK_HEADERS(mach/vm_statistics.h)
# For load module
AC_CHECK_HEADERS(sys/loadavg.h)
AC_CHECK_HEADERS(utmp.h)
AC_CHECK_HEADERS(utmpx.h)
+# For traffic plugin
+AC_CHECK_HEADERS(net/if.h)
+AC_CHECK_HEADERS(ifaddrs.h)
+AC_CHECK_HEADERS(linux/if.h, [], [],
+[
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
+AC_CHECK_HEADERS(linux/netdevice.h, [], [],
+[
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_LINUX_IF_H
+# include <linux/if.h>
+#endif
+])
+
# For apache plugin
AC_CHECK_HEADERS(curl/curl.h)
AC_CHECK_FUNCS(quotactl)
AC_CHECK_FUNCS(getgrgid getpwuid)
+# For traffic module
+AC_CHECK_FUNCS(getifaddrs)
+
# For mount interface
AC_CHECK_FUNCS(getfsent getvfsent listmntent)
AC_CHECK_FUNCS(getfsstat)
)
fi
+# Check for structures
+AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_obytes],
+ [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
+ [],
+ [#include <net/if.h>])
+AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_bytes],
+ [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
+ [],
+ [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <linux/if.h>
+ #include <linux/netdevice.h>
+ ])
+
AC_MSG_CHECKING([for kernel type ($host_os)])
case $host_os in
*linux*)
[with_libresolv="no"])
AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
-with_libcurl="yes"
-AC_CHECK_LIB(curl, curl_easy_init,
-[
- AC_DEFINE(HAVE_LIBCURL, 1, [Define to 1 if you have the 'curl' library (-lcurl).])
-],
-[with_libcurl="no"])
-AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
m4_divert_once([HELP_WITH], [
collectd additional packages:])
[Wether or not to use kstat library (Solaris)])
AM_CONDITIONAL(BUILD_WITH_KSTAT, test "x$with_kstat" = "xyes")
+### BEGIN of check for libcurl ###
+with_curl_config="curl-config"
+with_curl_prefix=0
+with_curl_libs=""
+AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
+[
+ if test "x$withval" != "xno" -a "x$withval" != "xyes"
+ then
+ if test -x "$withval/bin/curl-config"
+ then
+ with_curl_config="$withval/bin/curl-config"
+ with_curl_prefix=1
+ fi
+ fi
+ if test "x$withval" = "xno"
+ then
+ with_libcurl="no"
+ else
+ with_libcurl="yes"
+ fi
+],
+[
+ with_libcurl="yes"
+])
+if test "x$with_libcurl" = "xyes"
+then
+ with_curl_libs=`$with_curl_config --libs 2>/dev/null`
+ curl_config_status=$?
+
+ if test $curl_config_status -ne 0
+ then
+ with_libcurl="no"
+ else
+ AC_CHECK_LIB(curl, curl_easy_init,
+ [
+ BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
+ AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
+ ],
+ [
+ with_libcurl="no"
+ ],
+ [$with_curl_libs])
+ fi
+fi
+if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
+then
+ with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
+ curl_config_status=$?
+
+ if test $curl_config_status -ne 0
+ then
+ with_libcurl="no"
+ else
+ if test -d "$with_curl_prefix/include"
+ then
+ CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
+ fi
+ fi
+fi
+
+with_libcurl_numeric=0
+if test "x$with_libcurl" = "xyes"
+then
+ with_libcurl_numeric=1
+fi
+AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
+AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
+### END of check for libcurl ###
+
AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
[
- if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ if test "x$withval" != "xno" -a "x$withval" != "xyes"
then
LDFLAGS="$LDFLAGS -L$withval/lib"
CPPFLAGS="$CPPFLAGS -I$withval/include"
[Wether or not to use mysql library])
AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
+# Define `step' and `hearbeat' values..
+declare -i collectd_step=10
+declare -i collectd_heartbeat=25
+AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])],
+[
+ if test "x$withval" != "xno" -a "x$withval" != "xyes"
+ then
+ declare -i tmp_collectd_step="$withval"
+ if test $tmp_collectd_step -gt 0
+ then
+ collectd_step=$tmp_collectd_step
+ let "collectd_heartbeat=$collectd_step*2"
+ fi
+ fi
+], [])
+AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])],
+[
+ if test "x$withval" != "xno" -a "x$withval" != "xyes"
+ then
+ declare -i tmp_collectd_heartbeat="$withval"
+ if test $tmp_collectd_heartbeat -gt 0
+ then
+ collectd_heartbeat=$tmp_collectd_heartbeat
+ fi
+ fi
+], [])
+
+if test $collectd_step -ne 10
+then
+ AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.])
+fi
+if test $collectd_heartbeat -ne 25
+then
+ AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
+fi
+
#
# Check for enabled/disabled features
#
Features:
debug . . . . . . . $enable_debug
daemon mode . . . . $enable_daemon
+ step . . . . . . . $collectd_step seconds
+ heartbeat . . . . . $collectd_heartbeat seconds
Modules:
battery . . . . . . $enable_battery