Bumped version to 3.9.0 (which is due soon)
[collectd.git] / configure.in
index d1adcab..af5500e 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.8.1-alpha2)
+AC_INIT(collectd, 3.9.0)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
@@ -30,9 +30,12 @@ AC_CONFIG_SUBDIRS(libltdl src/libconfig)
 #
 # Checks for header files.
 #
+AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_HEADER_DIRENT
+AC_CHECK_HEADERS(stdint.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)
@@ -46,14 +49,24 @@ AC_CHECK_HEADERS(sys/resource.h)
 AC_CHECK_HEADERS(sys/param.h)
 
 # For ping library
-AC_CHECK_HEADERS(netinet/in_systm.h)
+AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+])
 AC_CHECK_HEADERS(netinet/in.h, [], [],
-[#if HAVE_NETINET_IN_SYSTM_H
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
 ])
 AC_CHECK_HEADERS(netinet/ip.h, [], [],
-[#if HAVE_NETINET_IN_SYSTM_H
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
 #if HAVE_NETINET_IN_H
@@ -61,7 +74,10 @@ AC_CHECK_HEADERS(netinet/ip.h, [], [],
 #endif
 ])
 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
-[#if HAVE_NETINET_IN_SYSTM_H
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
 #if HAVE_NETINET_IN_H
@@ -72,7 +88,10 @@ AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
 #endif
 ])
 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
-[#if HAVE_NETINET_IN_SYSTM_H
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
 #if HAVE_NETINET_IN_H
@@ -83,7 +102,13 @@ AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
 #endif
 ])
 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
-[#if HAVE_NETINET_IN_SYSTM_H
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
 #if HAVE_NETINET_IN_H
@@ -91,7 +116,13 @@ AC_CHECK_HEADERS(netinet/ip6.h, [], [],
 #endif
 ])
 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
-[#if HAVE_NETINET_IN_SYSTM_H
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
 #if HAVE_NETINET_IN_H
@@ -112,6 +143,9 @@ AC_CHECK_HEADERS(sys/loadavg.h)
 AC_CHECK_HEADERS(utmp.h)
 AC_CHECK_HEADERS(utmpx.h)
 
+# For apache plugin
+AC_CHECK_HEADERS(curl/curl.h)
+
 # For quota module
 AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
 AC_CHECK_HEADERS(ctype.h)
@@ -278,6 +312,31 @@ AC_CHECK_LIB(resolv, res_search,
 [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"])
+if test "x$with_libcurl" = "xyes"
+then
+       with_libcurl_libs=`curl-config --libs 2>/dev/null`
+       curl_config_status=$?
+
+       BUILD_WITH_LIBCURL_LIBS="-lcurl"
+       if test $curl_config_status -ne 0
+       then
+               with_libcurl="no"
+       else
+               if test "x$with_libcurl_libs" != "x"
+               then
+                       BUILD_WITH_LIBCURL_LIBS="$with_libcurl_libs";
+               fi
+       fi
+       AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
+
 m4_divert_once([HELP_WITH], [
 collectd additional packages:])
 
@@ -479,6 +538,42 @@ AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
        [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
 #
@@ -550,6 +645,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([battery],   [disable], [module], [battery statistics])
 AC_COLLECTD([cpu],       [disable], [module], [cpu usage statistics])
 AC_COLLECTD([cpufreq],   [disable], [module], [system cpu frequency statistics])
@@ -569,6 +665,7 @@ AC_COLLECTD([swap],      [disable], [module], [swap statistics])
 AC_COLLECTD([tape],      [disable], [module], [tape statistics])
 AC_COLLECTD([traffic],   [disable], [module], [system traffic statistics])
 AC_COLLECTD([users],     [disable], [module], [user count statistics])
+AC_COLLECTD([vserver],   [disable], [module], [vserver statistics])
 AC_COLLECTD([wireless],  [disable], [module], [wireless link statistics])
 
 #m4_divert_once([HELP_ENABLE], [
@@ -793,6 +890,7 @@ cat <<EOF;
 
 Configuration:
   Libraries:
+    libcurl . . . . . . $with_libcurl
     librrd  . . . . . . $with_rrdtool
     lm_sensors  . . . . $with_lm_sensors
     libstatgrab . . . . $with_libstatgrab
@@ -802,6 +900,8 @@ Configuration:
   Features:
     debug . . . . . . . $enable_debug
     daemon mode . . . . $enable_daemon
+    step  . . . . . . . $collectd_step seconds
+    heartbeat . . . . . $collectd_heartbeat seconds
 
   Modules:
     battery . . . . . . $enable_battery
@@ -822,6 +922,7 @@ Configuration:
     tape  . . . . . . . $enable_tape
     traffic . . . . . . $enable_traffic
     users . . . . . . . $enable_users
+    vserver . . . . . . $enable_vserver
     wireless  . . . . . $enable_wireless
 
 EOF