X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=3ac7fc5892540399cce9955ffd95cc6d5cd09cdf;hb=ee1113650b0b565776fc3d62162d84741e234f05;hp=2f3fdc52e6c8edb6d8073139a07b5edfeaabbec2;hpb=010d7b9e256e51184d9e4c30852b9f7594826511;p=collectd.git diff --git a/configure.in b/configure.in index 2f3fdc52..3ac7fc58 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.8.2) +AC_INIT(collectd, 3.9.3) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) @@ -34,7 +34,9 @@ AC_HEADER_STDC 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) @@ -52,11 +54,17 @@ AC_CHECK_HEADERS(netinet/in_systm.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif ]) AC_CHECK_HEADERS(netinet/in.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -65,6 +73,9 @@ AC_CHECK_HEADERS(netinet/ip.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -76,6 +87,9 @@ AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -90,6 +104,9 @@ AC_CHECK_HEADERS(netinet/ip_var.h, [], [], [#if HAVE_STDINT_H # include #endif +#if HAVE_SYS_TYPES_H +# include +#endif #if HAVE_NETINET_IN_SYSTM_H # include #endif @@ -134,14 +151,90 @@ AC_CHECK_HEADERS(netinet/icmp6.h, [], [], # For cpu modules AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) +AC_CHECK_HEADERS(mach/mach_init.h) +AC_CHECK_HEADERS(mach/host_priv.h) +AC_CHECK_HEADERS(mach/mach_error.h) +AC_CHECK_HEADERS(mach/mach_host.h) +AC_CHECK_HEADERS(mach/mach_port.h) +AC_CHECK_HEADERS(mach/mach_types.h) +AC_CHECK_HEADERS(mach/message.h) +AC_CHECK_HEADERS(mach/processor_set.h) +AC_CHECK_HEADERS(mach/processor.h) +AC_CHECK_HEADERS(mach/processor_info.h) +AC_CHECK_HEADERS(mach/task.h) +AC_CHECK_HEADERS(mach/thread_act.h) +AC_CHECK_HEADERS(mach/vm_region.h) +AC_CHECK_HEADERS(mach/vm_map.h) +AC_CHECK_HEADERS(mach/vm_prot.h) +AC_CHECK_HEADERS(mach/vm_statistics.h) +AC_CHECK_HEADERS(mach/kern_return.h) + +# For hddtemp module +AC_CHECK_HEADERS(linux/major.h) + +# For the apple_sensors module +AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h) +AC_CHECK_HEADERS(IOKit/IOKitLib.h) +AC_CHECK_HEADERS(IOKit/IOTypes.h) + +# For the battery plugin +AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], +[ +#if HAVE_IOKIT_IOKITLIB_H +# include +#endif +#if HAVE_IOKIT_IOTYPES_H +# include +#endif +]) +AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h) # For load module AC_CHECK_HEADERS(sys/loadavg.h) +# For the swap module +AC_CHECK_HEADERS(sys/swap.h) + # For users module AC_CHECK_HEADERS(utmp.h) AC_CHECK_HEADERS(utmpx.h) +# For traffic plugin +AC_CHECK_HEADERS(ifaddrs.h) +AC_CHECK_HEADERS(net/if.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +]) +AC_CHECK_HEADERS(linux/if.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +]) +AC_CHECK_HEADERS(linux/netdevice.h, [], [], +[ +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_LINUX_IF_H +# include +#endif +]) + +# 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) @@ -185,12 +278,19 @@ AC_HEADER_TIME # AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(gettimeofday select strdup strtol) -AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket)) 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) +socket_needs_socket="no" +AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket))) +AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes") + +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") + # For cpu module AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) @@ -200,6 +300,9 @@ AC_CHECK_FUNCS(statfs statvfs) # For load module AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"]) +# For the `processes' plugin +AC_CHECK_FUNCS(thread_info) + # For users module AC_CHECK_FUNCS(getutent getutxent) @@ -207,6 +310,9 @@ AC_CHECK_FUNCS(getutent getutxent) 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) @@ -277,14 +383,33 @@ if test "x$fu_cv_getmntent2" = "xyes"; then ) 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 + #include + #include + ]) +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 + #include + #include + #include + ]) + AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in *linux*) - AC_DEFINE([KERNEL_LINUX], [], [True if program is to be compiled for a Linux kernel]) + AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel]) ac_system="Linux" ;; *solaris*) - AC_DEFINE([KERNEL_SOLARIS], [], [True if program is to be compiled for a Solaris kernel]) + AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel]) ac_system="Solaris" ;; *) @@ -292,14 +417,6 @@ case $host_os in esac AC_MSG_RESULT([$ac_system]) -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, [ @@ -308,6 +425,7 @@ AC_CHECK_LIB(resolv, res_search, [with_libresolv="no"]) AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes") + m4_divert_once([HELP_WITH], [ collectd additional packages:]) @@ -371,16 +489,19 @@ AM_CONDITIONAL(BUILD_WITH_RRDTOOL, test "x$with_rrdtool" = "xyes") if test "$ac_system" = "Solaris" then with_kstat="yes" + with_devinfo="yes" else with_kstat="no (Solaris only)" + with_devinfo="no (Solaris only)" fi + if test "x$with_kstat" = "xyes" then AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"]) fi if test "x$with_kstat" = "xyes" then - AC_CHECK_LIB(devinfo, di_init) + AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"]) AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"]) fi if test "x$with_kstat" = "xyes" @@ -391,11 +512,95 @@ else fi AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat], [Wether or not to use kstat library (Solaris)]) -AM_CONDITIONAL(BUILD_WITH_KSTAT, test "x$with_kstat" = "xyes") +AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") +AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "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 ### + +with_libiokit="no" +collectd_libiokit=0 +AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices, +[ + with_libiokit="yes" + collectd_libiokit=1 +], +[ + with_libiokit="no" + collectd_libiokit=0 +]) +AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library]) +AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes") 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" @@ -538,7 +743,7 @@ AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of if test $collectd_step -ne 10 then - AC_DEFINE_UNQUOTED(COLLECTD_STEP, $collectd_step, [Interval in which plugins are queried.]) + AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.]) fi if test $collectd_heartbeat -ne 25 then @@ -616,6 +821,8 @@ AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) m4_divert_once([HELP_ENABLE], [ collectd modules:]) +AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics]) +AC_COLLECTD([apple_sensors], [disable], [module], [Apple's hardware sensors]) AC_COLLECTD([battery], [disable], [module], [battery statistics]) AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics]) AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics]) @@ -860,6 +1067,8 @@ cat <