dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.6.0)
+AC_INIT(collectd, 3.8.3)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
dnl configure libtool
AC_DISABLE_STATIC
#
# 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(syslog.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(signal.h)
+AC_CHECK_HEADERS(assert.h)
+AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(netdb.h)
+AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/param.h)
-AC_CHECK_HEADERS(errno.h)
-AC_CHECK_HEADERS(syslog.h)
+
+# For ping library
+AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/in.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_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip_icmp.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
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+# include <netinet/ip.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip_var.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
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+# include <netinet/ip.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip6.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
+# include <netinet/in.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/icmp6.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
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+])
# 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)
-
# For users module
AC_CHECK_HEADERS(utmp.h)
AC_CHECK_HEADERS(utmpx.h)
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(gettimeofday select strdup strtol)
AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
-AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
+AC_CHECK_FUNCS(getaddrinfo getnameinfo)
AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
AC_CHECK_FUNCS(strncasecmp strcasecmp)
AC_CHECK_FUNCS(openlog syslog closelog)
# For mount interface
AC_CHECK_FUNCS(getfsent getvfsent listmntent)
+AC_CHECK_FUNCS(getfsstat)
+
+# Check for different versions of `getmntent' here..
AC_FUNC_GETMNTENT
+if test "x$ac_cv_lib_sun_getmntent" = "xyes"
+then
+ AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libsun.])
+fi
+if test "x$ac_cv_lib_seq_getmntent" = "xyes"
+then
+ AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libseq.])
+fi
+if test "x$ac_cv_lib_gen_getmntent" = "xyes"
+then
+ AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libgen.])
+fi
+
if test "x$ac_cv_func_getmntent" = "xyes"; then
saveCFLAGS="$CFLAGS"
CFLAGS="-Wall -Werror $CFLAGS"
esac
AC_MSG_RESULT([$ac_system])
-dnl Checks for libraries.
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(resolv, res_search)
+with_libsocket="yes"
+AC_CHECK_LIB(socket, socket,
+[
+ AC_DEFINE(HAVE_LIBSOCKET, 1, [Define to 1 if you have the 'socket' library (-lsocket).])
+],
+[with_libsocket="no"])
+AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$with_libsocket" = "xyes")
+
+with_libresolv="yes"
+AC_CHECK_LIB(resolv, res_search,
+[
+ AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
+],
+[with_libresolv="no"])
+AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
m4_divert_once([HELP_WITH], [
collectd additional packages:])
], [with_rrdtool="yes"])
if test "x$with_rrdtool" = "xyes"
then
- AC_CHECK_LIB(rrd, rrd_update,, [with_rrdtool="no (librrd not found)"], [-lm])
+ AC_CHECK_LIB(rrd, rrd_update,
+ [
+ AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
+ ],
+ [with_rrdtool="no (librrd not found)"], [-lm])
fi
if test "x$with_rrdtool" = "xyes"
then
])
if test "x$with_libmysql" = "xyes"
then
- AC_CHECK_LIB(mysqlclient, mysql_init,, [with_libmysql="no (libmysql not found)"])
+ AC_CHECK_LIB(mysqlclient, mysql_init,
+ [
+ AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
+ ], [with_libmysql="no (libmysql not found)"])
fi
if test "x$with_libmysql" = "xyes"
then
- AC_CHECK_HEADERS(mysql/mysql.h,, [with_libmysql="no (mysql/mysql.h not found)"])
+ AC_CHECK_HEADERS(mysql/mysql.h,
+ [
+ AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
+ ], [with_libmysql="no (mysql/mysql.h not found)"])
fi
if test "x$with_libmysql" = "xyes"
then
m4_divert_once([HELP_ENABLE], [
collectd modules:])
+AC_COLLECTD([battery], [disable], [module], [battery statistics])
AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
AC_COLLECTD([disk], [disable], [module], [disk/partition 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([wireless], [disable], [module], [wireless link statistics])
#m4_divert_once([HELP_ENABLE], [
#collectd modules:])
#AC_COLLECTD([users], [disable], [module], [user count statistics])
-AC_OUTPUT(Makefile src/libconfig/Makefile src/libping/Makefile src/Makefile)
+AC_OUTPUT(Makefile src/libconfig/Makefile src/liboping/Makefile src/Makefile)
cat <<EOF;
daemon mode . . . . $enable_daemon
Modules:
+ battery . . . . . . $enable_battery
cpu . . . . . . . . $enable_cpu
cpufreq . . . . . . $enable_cpufreq
df . . . . . . . . $enable_df
tape . . . . . . . $enable_tape
traffic . . . . . . $enable_traffic
users . . . . . . . $enable_users
+ wireless . . . . . $enable_wireless
EOF