X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=49f6ac3205a4c51290bfa77fb4a3a5252dfc3518;hb=863dfcdf274509e4e1836c2c8f1f10f09e1d13be;hp=9f83e63ea5d24ecd5351750e76a381bd1dbe7bf2;hpb=44a3f33ab78d420b2eeb358416dcaeb18d362f90;p=collectd.git diff --git a/configure.in b/configure.in index 9f83e63e..49f6ac32 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(collectd, 3.10.0-alpha3) +AC_INIT(collectd, 3.11.2) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) @@ -25,7 +25,7 @@ AC_SUBST(LIBLTDL) AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL #AC_PROG_RANLIB -AC_CONFIG_SUBDIRS(libltdl src/libconfig) +AC_CONFIG_SUBDIRS(libltdl) # # Checks for header files. @@ -149,6 +149,23 @@ AC_CHECK_HEADERS(netinet/icmp6.h, [], [], # include #endif ]) +AC_CHECK_HEADERS(netinet/udp.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +]) # For cpu modules AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) @@ -269,9 +286,29 @@ AC_CHECK_HEADERS(sys/vfstab.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 +#endif +]) +AC_CHECK_HEADERS(sys/un.h) +AC_CHECK_HEADERS(grp.h) + # For debugging interface (variable number of arguments) AC_CHECK_HEADERS(stdarg.h) +# Regular expressions for the ignorelist. +AC_CHECK_HEADERS(regex.h) + +# For the dns plugin +AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h) + +AC_CHECK_HEADERS(net/if_arp.h) +AC_CHECK_HEADERS(net/if_ppp.h) +AC_CHECK_HEADERS(netinet/if_ether.h) + dnl Checking for libraries AC_CHECK_LIB(m, ext) @@ -302,6 +339,9 @@ nanosleep_needs_rt="no" AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") +# Regular expressions for the ignorelist. +AC_CHECK_FUNCS(regcomp regerror regexec regfree) + # For cpu module AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) @@ -325,73 +365,88 @@ AC_CHECK_FUNCS(getgrgid getpwuid) 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 #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 #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 @@ -413,6 +468,47 @@ AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_p #include ]) +AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +#if HAVE_NETINET_UDP_H +# include +#endif +]) +AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +#if HAVE_NETINET_UDP_H +# include +#endif +]) + AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in *linux*) @@ -471,31 +567,36 @@ AC_DEFINE_UNQUOTED(COLLECT_RRDTOOL, [$collect_rrdtool], [Wether or not to use rrdtool library]) AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes") -#AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]), -#[ if test "x$withval" != "xno" && test "x$withval" != "xyes" -# then -# LDFLAGS="$LDFLAGS -L$withval/lib" -# CPPFLAGS="$CPPFLAGS -I$withval/include" -# with_pth="yes" -# fi -#], [with_pth="no"]) -#if test "x$with_pth" = "xyes" -#then -# AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], []) -#fi -#if test "x$with_pth" = "xyes" -#then -# AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"]) -#fi -#if test "x$with_pth" = "xyes" -#then -# collect_pth=1 -#else -# collect_pth=0 -#fi -#AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth], -# [Wether or not to use pth (portable threads) library]) -#AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes") +AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])], +[ if test "x$withval" != "xno" -a "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libpthread="yes" + else + if test "x$withval" = "xno" + then + with_libpthread="no (disabled)" + fi + fi +], [with_libpthread="yes"]) +if test "x$with_libpthread" = "xyes" +then + AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], []) +fi +if test "x$with_libpthread" = "xyes" +then + AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"]) +fi +if test "x$with_libpthread" = "xyes" +then + collect_pthread=1 +else + collect_pthread=0 +fi +AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], + [Wether or not to use pthread (POSIX threads) library]) +AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") if test "$ac_system" = "Solaris" then @@ -508,11 +609,11 @@ fi if test "x$with_kstat" = "xyes" then - AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"]) + AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], []) fi if test "x$with_kstat" = "xyes" then - AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"]) + AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], []) AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"]) fi if test "x$with_kstat" = "xyes" @@ -790,6 +891,42 @@ then with_liboping="yes (shipped version)" fi +AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libpcap="yes" + fi +], +[ + with_libpcap="yes" +]) +if test "x$with_libpcap" = "xyes" +then + AC_CHECK_LIB(pcap, pcap_open_live, + [ + AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).]) + ], [with_libpcap="no (libpcap not found)"]) +fi +if test "x$with_libpcap" = "xyes" +then + AC_CHECK_HEADERS(pcap.h, + [ + AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the header file.]) + ], [with_libpcap="no (pcap.h not found)"]) +fi +if test "x$with_libpcap" = "xyes" +then + collect_libpcap=1 +else + collect_libpcap=0 +fi +AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap], + [Wether or not to use the pcap library]) +AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes") + # Define `step' and `hearbeat' values.. declare -i collectd_step=10 declare -i collectd_heartbeat=25 @@ -826,7 +963,6 @@ then AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.]) fi -# # Check for enabled/disabled features # @@ -906,10 +1042,15 @@ 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([df], [disable], [module], [df statistics]) +AC_COLLECTD([dns], [disable], [module], [dns 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([iptables], [disable], [module], [IPtables statistics]) AC_COLLECTD([load], [disable], [module], [system load statistics]) +AC_COLLECTD([mbmon], [disable], [module], [motherboard monitor 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]) @@ -924,7 +1065,7 @@ AC_COLLECTD([users], [disable], [module], [user count statistics]) AC_COLLECTD([vserver], [disable], [module], [vserver statistics]) AC_COLLECTD([wireless], [disable], [module], [wireless link statistics]) -AC_OUTPUT(Makefile src/Makefile src/libconfig/Makefile src/liboping/Makefile) +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libconfig/Makefile src/liboping/Makefile src/libiptc/Makefile ) cat <