dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.10.0-alpha3)
+AC_INIT(collectd, 3.10.3)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
# For load module
AC_CHECK_HEADERS(sys/loadavg.h)
+# For the processes plugin
+AC_CHECK_HEADERS(linux/config.h)
+
# For the swap module
AC_CHECK_HEADERS(sys/swap.h)
# For the swap plugin, FreeBSD
AC_CHECK_HEADERS(kvm.h)
+# For the email plugin
+AC_CHECK_HEADERS(linux/un.h, [], [],
+[
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
+AC_CHECK_HEADERS(sys/un.h)
+AC_CHECK_HEADERS(grp.h)
+
# For debugging interface (variable number of arguments)
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_FUNCS(getifaddrs)
# 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.])
+#AC_CHECK_FUNCS(getfsent getvfsent)
+
+have_getfsstat="no"
+AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
+have_getvfsstat="no"
+AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
+have_listmntent="no"
+AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
+
+have_getmntent="no"
+AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
+if test "x$have_getmntent" = "xno"; then
+ AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
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.])
+if test "x$have_getmntent" = "xno"; then
+ AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
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.])
+if test "x$have_getmntent" = "xno"; then
+ AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
fi
-if test "x$ac_cv_func_getmntent" = "xyes"; then
- saveCFLAGS="$CFLAGS"
- CFLAGS="-Wall -Werror $CFLAGS"
+if test "x$have_getmntent" = "xc"; then
AC_CACHE_CHECK([whether getmntent takes one argument],
- [fu_cv_getmntent1],
+ [have_one_getmntent],
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+#include <mntent.h>
#include "$srcdir/src/utils_mount.h"]],
- [[(void)getmntent((FILE *)NULL);]]
+ [[
+ FILE *fh;
+ struct mntent *me;
+ fh = setmntent ("/etc/mtab", "r");
+ me = getmntent (fh);
+ ]]
),
- [fu_cv_getmntent1=yes],
- [fu_cv_getmntent1=no]
+ [have_one_getmntent="yes"],
+ [have_one_getmntent="no"]
)
)
- if test "x$fu_cv_getmntent1" = "xno"; then
- AC_CACHE_CHECK([whether getmntent takes two arguments],
- [fu_cv_getmntent2],
- AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+ AC_CACHE_CHECK([whether getmntent takes two arguments],
+ [have_two_getmntent],
+ AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
+#include <sys/mnttab.h>
#include "$srcdir/src/utils_mount.h"]],
- [[(void)getmntent((FILE *)NULL,
- (struct mnttab *)NULL);]]
- ),
- [fu_cv_getmntent2=yes],
- [fu_cv_getmntent2=no]
- )
+ [[
+ FILE *fh;
+ struct mnttab mt;
+ int status;
+ fh = fopen ("/etc/mnttab", "r");
+ status = getmntent (fh, &mt);
+ ]]
+ ),
+ [have_two_getmntent="yes"],
+ [have_two_getmntent="no"]
)
+ )
+fi
+
+# Check for different versions of `getmntent' here..
+
+if test "x$have_getmntent" = "xc"; then
+ if test "x$have_one_getmntent" = "xyes"; then
+ AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
+ [Define if the function getmntent exists and takes one argument.])
+ fi
+ if test "x$have_two_getmntent" = "xyes"; then
+ AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
+ [Define if the function getmntent exists and takes two arguments.])
fi
- CFLAGS="$saveCFLAGS"
-fi
-if test "x$fu_cv_getmntent1" = "xyes"; then
- AC_DEFINE(HAVE_GETMNTENT1,
- 1,
- [Define if there is a function named getmntent
- for reading the list of mounted filesystems, and
- that function takes a single argument. (4.3BSD,
- SunOS, HP-UX, Dynix, Irix, Linux)]
- )
fi
-if test "x$fu_cv_getmntent2" = "xyes"; then
- AC_DEFINE(HAVE_GETMNTENT2,
- 1,
- [Define if there is a function named getmntent
- for reading the list of mounted filesystems, and
- that function takes two arguments. (SVR4)]
- )
+if test "x$have_getmntent" = "xsun"; then
+ AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libsun.])
+fi
+if test "x$have_getmntent" = "xseq"; then
+ AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libseq.])
+fi
+if test "x$have_getmntent" = "xgen"; then
+ AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
+ [Define if the function getmntent exists. It's the version from libgen.])
fi
# Check for structures
AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.])
fi
-#
+dnl Check for regex
+AC_ARG_WITH(regex, [AS_HELP_STRING([--with-regex], [Use POSIX regular expression in config.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ with_regex="yes"
+ fi
+],
+[
+ with_regex="no"
+])
+if test "x$with_regex" = "xyes"
+then
+ AC_CHECK_FUNCS([regcomp regexec],
+ [with_regfuncs="yes"],
+ [with_regfuncs="no (regcomp & regexec not found)"])
+fi
+if test "x$with_regex" = "xyes"
+then
+ AC_CHECK_HEADERS(regex.h,
+ [with_regexh="yes"],
+ [with_regexh="no (regex.h not found)"])
+fi
+if test "x$with_regex" = "xyes" -a "x$with_regfuncs" = "xyes" -a "x$with_regexh" = "xyes"
+then
+ collect_regex=1
+else
+ collect_regex=0
+fi
+AC_DEFINE_UNQUOTED(COLLECT_REGEX, [$collect_regex],
+ [Wether or not to use regular expressions])
+AM_CONDITIONAL(BUILD_WITH_REGEX, test "x$with_regex" = "xyes")
+
# Check for enabled/disabled features
#
AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics])
AC_COLLECTD([disk], [disable], [module], [disk/partition statistics])
AC_COLLECTD([df], [disable], [module], [df statistics])
+AC_COLLECTD([email], [disable], [module], [email statistics])
AC_COLLECTD([quota], [enable], [module], [quota statistics (experimental)])
AC_COLLECTD([hddtemp], [disable], [module], [hdd temperature statistics])
AC_COLLECTD([load], [disable], [module], [system load statistics])
AC_COLLECTD([memory], [disable], [module], [memory statistics])
+AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
AC_COLLECTD([mysql], [disable], [module], [mysql statistics])
AC_COLLECTD([nfs], [disable], [module], [nfs statistics])
AC_COLLECTD([ntpd], [disable], [module], [nfs statistics])
libstatgrab . . . . $with_libstatgrab
libkstat . . . . . $with_kstat
libmysql . . . . . $with_libmysql
+ regex . . . . . . . $with_regex
Features:
debug . . . . . . . $enable_debug
cpufreq . . . . . . $enable_cpufreq
df . . . . . . . . $enable_df
disk . . . . . . . $enable_disk
+ email . . . . . . . $enable_email
hddtemp . . . . . . $enable_hddtemp
load . . . . . . . $enable_load
memory . . . . . . $enable_memory
+ multimeter . . . . $enable_multimeter
mysql . . . . . . . $enable_mysql
nfs . . . . . . . . $enable_nfs
ntpd . . . . . . . $enable_ntpd