X-Git-Url: https://git.tokkee.org/?p=collectd.git;a=blobdiff_plain;f=configure.in;h=dbdc0589a0fee67ca9566f43c07ecb40012c3ae2;hp=f0f9cfb9af553b4013c2969e629e2282d5bd51d9;hb=HEAD;hpb=33e60ef35f745c56b1a5936272b1dd8b0cf63d12 diff --git a/configure.in b/configure.in index f0f9cfb9..dbdc0589 100644 --- a/configure.in +++ b/configure.in @@ -24,7 +24,7 @@ m4_ifdef([LT_PACKAGE_VERSION], ] ) -AM_INIT_AUTOMAKE(dist-bzip2) +AM_INIT_AUTOMAKE([tar-pax dist-bzip2]) AC_LANG(C) AC_PREFIX_DEFAULT("/opt/collectd") @@ -49,6 +49,13 @@ AC_PROG_YACC PKG_PROG_PKG_CONFIG AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no]) +AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h], + [have_protobuf_c_h="yes"], + [have_protobuf_c_h="no"]) +if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes" +then + have_protoc_c="no (unable to find )" +fi AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes") AC_MSG_CHECKING([for kernel type ($host_os)]) @@ -71,6 +78,10 @@ case $host_os in AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel]) ac_system="AIX" ;; + *freebsd*) + AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel]) + ac_system="FreeBSD" + ;; *) ac_system="unknown" esac @@ -270,7 +281,19 @@ if test "x$ac_system" = "xDarwin" then AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h) AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.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 +]) + fi + AC_CHECK_HEADERS(sys/sysctl.h, [], [], [ #if HAVE_SYS_TYPES_H @@ -315,17 +338,6 @@ else have_linux_raid_md_u_h="no" fi -# 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 -]) - # For the swap module have_linux_wireless_h="no" if test "x$ac_system" = "xLinux" @@ -536,7 +548,20 @@ AC_CHECK_HEADERS(netinet/if_ether.h, [], [], AC_CHECK_HEADERS(netinet/ip_compat.h) have_net_pfvar_h="no" -AC_CHECK_HEADERS(net/pfvar.h, [have_net_pfvar_h="yes"]) +AC_CHECK_HEADERS(net/pfvar.h, + [have_net_pfvar_h="yes"], + [have_net_pfvar_h="no"], +[ +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif +]) # For the multimeter plugin have_termios_h="no" @@ -569,13 +594,13 @@ fi AC_CACHE_CHECK([for strtok_r], [c_cv_have_strtok_r_default], AC_LINK_IFELSE( - AC_LANG_PROGRAM( - [[[[ + [AC_LANG_PROGRAM( +[[[ #include #include #include - ]]]], - [[[[ +]]], +[[[ char buffer[] = "foo,bar,baz"; char *token; char *dummy; @@ -585,10 +610,11 @@ AC_CACHE_CHECK([for strtok_r], saveptr = NULL; while ((token = strtok_r (dummy, ",", &saveptr)) != NULL) { - dummy = NULL; + dummy = NULL; printf ("token = %s;\n", token); } - ]]]]), +]]] + )], [c_cv_have_strtok_r_default="yes"], [c_cv_have_strtok_r_default="no"] ) @@ -601,13 +627,13 @@ then AC_CACHE_CHECK([if strtok_r needs _REENTRANT], [c_cv_have_strtok_r_reentrant], AC_LINK_IFELSE( - AC_LANG_PROGRAM( - [[[[ + [AC_LANG_PROGRAM( +[[[ #include #include #include - ]]]], - [[[[ +]]], +[[[ char buffer[] = "foo,bar,baz"; char *token; char *dummy; @@ -617,10 +643,11 @@ then saveptr = NULL; while ((token = strtok_r (dummy, ",", &saveptr)) != NULL) { - dummy = NULL; + dummy = NULL; printf ("token = %s;\n", token); } - ]]]]), +]]] + )], [c_cv_have_strtok_r_reentrant="yes"], [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])] ) @@ -698,16 +725,15 @@ if test "x$have_strptime" = "xyes" then AC_CACHE_CHECK([whether strptime is exported by default], [c_cv_have_strptime_default], - AC_COMPILE_IFELSE( -AC_LANG_PROGRAM( -[[ -AC_INCLUDES_DEFAULT + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ #include -]], -[[ +]]], +[[[ struct tm stm; (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm); -]]), +]]] + )], [c_cv_have_strptime_default="yes"], [c_cv_have_strptime_default="no"])) fi @@ -715,9 +741,8 @@ if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno then AC_CACHE_CHECK([whether strptime needs standards mode], [c_cv_have_strptime_standards], - AC_COMPILE_IFELSE( -AC_LANG_PROGRAM( -[[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ #ifndef _ISOC99_SOURCE # define _ISOC99_SOURCE 1 #endif @@ -727,13 +752,13 @@ AC_LANG_PROGRAM( #ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE 500 #endif -AC_INCLUDES_DEFAULT #include -]], -[[ +]]], +[[[ struct tm stm; (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm); -]]), +]]] + )], [c_cv_have_strptime_standards="yes"], [c_cv_have_strptime_standards="no"])) @@ -749,25 +774,25 @@ if test "x$GCC" = "xyes" then CFLAGS="$SAVE_CFLAGS" fi - # }}} Check for strptime AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"]) if test "x$have_swapctl" = "xyes"; then AC_CACHE_CHECK([whether swapctl takes two arguments], [c_cv_have_swapctl_two_args], - AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64 # undef _FILE_OFFSET_BITS # undef _LARGEFILE64_SOURCE #endif #include -#include ]], - [[ - int num = swapctl(0, NULL); - ]] - ), +#include +]]], +[[[ +int num = swapctl(0, NULL); +]]] + )], [c_cv_have_swapctl_two_args="yes"], [c_cv_have_swapctl_two_args="no"] ) @@ -775,17 +800,19 @@ if test "x$have_swapctl" = "xyes"; then AC_CACHE_CHECK([whether swapctl takes three arguments], [c_cv_have_swapctl_three_args], AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT + [AC_LANG_PROGRAM( +[[[ #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64 # undef _FILE_OFFSET_BITS # undef _LARGEFILE64_SOURCE #endif #include -#include ]], - [[ - int num = swapctl(0, NULL,0); - ]] - ), +#include +]]], +[[[ +int num = swapctl(0, NULL, 0); +]]] + )], [c_cv_have_swapctl_three_args="yes"], [c_cv_have_swapctl_three_args="no"] ) @@ -818,19 +845,19 @@ AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated if test "x$nan_type" = "xnone"; then AC_CACHE_CHECK([whether NAN is defined by default], [c_cv_have_nan_default], - AC_COMPILE_IFELSE( - AC_LANG_PROGRAM( - [[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include static double foo = NAN; - ]], - [[ +]]], +[[[ if (isnan (foo)) return 0; else return 1; - ]]), +]]] + )], [c_cv_have_nan_default="yes"], [c_cv_have_nan_default="no"] ) @@ -843,20 +870,20 @@ fi if test "x$nan_type" = "xnone"; then AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99], [c_cv_have_nan_isoc], - AC_COMPILE_IFELSE( - AC_LANG_PROGRAM( - [[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ #include #define __USE_ISOC99 1 #include static double foo = NAN; - ]], - [[ +]]], +[[[ if (isnan (foo)) return 0; else return 1; - ]]), +]]] + )], [c_cv_have_nan_isoc="yes"], [c_cv_have_nan_isoc="no"] ) @@ -871,9 +898,8 @@ if test "x$nan_type" = "xnone"; then LDFLAGS="$LDFLAGS -lm" AC_CACHE_CHECK([whether NAN can be defined by 0/0], [c_cv_have_nan_zero], - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [[ + AC_RUN_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include #ifdef NAN @@ -884,13 +910,14 @@ if test "x$nan_type" = "xnone"; then # define isnan(f) ((f) != (f)) #endif static double foo = NAN; - ]], - [[ +]]], +[[[ if (isnan (foo)) return 0; else return 1; - ]]), +]]] + )], [c_cv_have_nan_zero="yes"], [c_cv_have_nan_zero="no"] ) @@ -932,9 +959,8 @@ fi; fi; fi if test "x$fp_layout_type" = "xunknown"; then AC_CACHE_CHECK([if doubles are stored in x86 representation], [c_cv_fp_layout_need_nothing], - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [[[[ + AC_RUN_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include #include @@ -947,8 +973,8 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDBOOL_H # include #endif - ]]]], - [[[[ +]]], +[[[ uint64_t i0; uint64_t i1; uint8_t c[8]; @@ -967,7 +993,8 @@ if test "x$fp_layout_type" = "xunknown"; then return (0); else return (1); - ]]]]), +]]] + )], [c_cv_fp_layout_need_nothing="yes"], [c_cv_fp_layout_need_nothing="no"] ) @@ -979,9 +1006,8 @@ fi if test "x$fp_layout_type" = "xunknown"; then AC_CACHE_CHECK([if endianflip converts to x86 representation], [c_cv_fp_layout_need_endianflip], - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [[[[ + AC_RUN_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include #include @@ -1002,8 +1028,8 @@ if test "x$fp_layout_type" = "xunknown"; then (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \ (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \ (((uint64_t)(A) & 0x00000000000000ffLL) << 56)) - ]]]], - [[[[ +]]], +[[[ uint64_t i0; uint64_t i1; uint8_t c[8]; @@ -1022,7 +1048,8 @@ if test "x$fp_layout_type" = "xunknown"; then return (0); else return (1); - ]]]]), +]]] + )], [c_cv_fp_layout_need_endianflip="yes"], [c_cv_fp_layout_need_endianflip="no"] ) @@ -1034,9 +1061,8 @@ fi if test "x$fp_layout_type" = "xunknown"; then AC_CACHE_CHECK([if intswap converts to x86 representation], [c_cv_fp_layout_need_intswap], - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [[[[ + AC_RUN_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include #include @@ -1051,8 +1077,8 @@ if test "x$fp_layout_type" = "xunknown"; then #endif #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \ (((uint64_t)(A) & 0x00000000ffffffffLL) << 32)) - ]]]], - [[[[ +]]], +[[[ uint64_t i0; uint64_t i1; uint8_t c[8]; @@ -1071,7 +1097,8 @@ if test "x$fp_layout_type" = "xunknown"; then return (0); else return (1); - ]]]]), +]]] + )], [c_cv_fp_layout_need_intswap="yes"], [c_cv_fp_layout_need_intswap="no"] ) @@ -1117,15 +1144,17 @@ if test "x$have_getmntent" = "xc"; then AC_CACHE_CHECK([whether getmntent takes one argument], [c_cv_have_one_getmntent], AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT -#include "$srcdir/src/utils_mount.h"]], - [[ - FILE *fh; - struct mntent *me; - fh = setmntent ("/etc/mtab", "r"); - me = getmntent (fh); - ]] - ), + [AC_LANG_PROGRAM( +[[[ +#include "$srcdir/src/utils_mount.h" +]]], +[[[ +FILE *fh; +struct mntent *me; +fh = setmntent ("/etc/mtab", "r"); +me = getmntent (fh); +]]] + )], [c_cv_have_one_getmntent="yes"], [c_cv_have_one_getmntent="no"] ) @@ -1133,16 +1162,18 @@ if test "x$have_getmntent" = "xc"; then AC_CACHE_CHECK([whether getmntent takes two arguments], [c_cv_have_two_getmntent], AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT -#include "$srcdir/src/utils_mount.h"]], - [[ + [AC_LANG_PROGRAM( +[[[ +#include "$srcdir/src/utils_mount.h" +]]], +[[[ FILE *fh; struct mnttab mt; int status; fh = fopen ("/etc/mnttab", "r"); status = getmntent (fh, &mt); - ]] - ), +]]] + )], [c_cv_have_two_getmntent="yes"], [c_cv_have_two_getmntent="no"] ) @@ -1178,17 +1209,19 @@ fi AC_MSG_CHECKING([if have htonll defined]) have_htonll="no" - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([ + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include #if HAVE_INTTYPES_H # include #endif - ], [ +]]], +[[[ return htonll(0); - ]) - ], [ +]]] + )], + [ have_htonll="yes" AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.]) ]) @@ -1231,7 +1264,6 @@ AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct have_struct_kinfo_proc_freebsd="no" ], [ -AC_INCLUDES_DEFAULT #include #include #include @@ -1248,7 +1280,6 @@ AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc], have_struct_kinfo_proc_openbsd="no" ], [ -AC_INCLUDES_DEFAULT #include #include #include @@ -1335,6 +1366,8 @@ fi m4_divert_once([HELP_WITH], [ collectd additional packages:]) +AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"]) + AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"]) if test "x$ac_system" = "xAIX" @@ -1817,6 +1850,8 @@ then if test "$with_libgcrypt" != "no"; then AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)") + GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS" + GCRYPT_LIBS="$LIBGCRYPT_LIBS" fi fi @@ -1980,31 +2015,31 @@ then if test -d "$with_java_home" then AC_MSG_CHECKING([for jni.h]) - TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` - if test "x$TMPDIR" != "x" + TMPVAR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` + if test "x$TMPVAR" != "x" then - AC_MSG_RESULT([found in $TMPDIR]) - JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR" + AC_MSG_RESULT([found in $TMPVAR]) + JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR" else AC_MSG_RESULT([not found]) fi AC_MSG_CHECKING([for jni_md.h]) - TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` - if test "x$TMPDIR" != "x" + TMPVAR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` + if test "x$TMPVAR" != "x" then - AC_MSG_RESULT([found in $TMPDIR]) - JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR" + AC_MSG_RESULT([found in $TMPVAR]) + JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR" else AC_MSG_RESULT([not found]) fi AC_MSG_CHECKING([for libjvm.so]) - TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` - if test "x$TMPDIR" != "x" + TMPVAR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` + if test "x$TMPVAR" != "x" then - AC_MSG_RESULT([found in $TMPDIR]) - JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR" + AC_MSG_RESULT([found in $TMPVAR]) + JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR" else AC_MSG_RESULT([not found]) fi @@ -2012,10 +2047,10 @@ then if test "x$JAVAC" = "x" then AC_MSG_CHECKING([for javac]) - TMPDIR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1` - if test "x$TMPDIR" != "x" + TMPVAR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1` + if test "x$TMPVAR" != "x" then - JAVAC="$TMPDIR" + JAVAC="$TMPVAR" AC_MSG_RESULT([$JAVAC]) else AC_MSG_RESULT([not found]) @@ -2024,10 +2059,10 @@ then if test "x$JAR" = "x" then AC_MSG_CHECKING([for jar]) - TMPDIR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1` - if test "x$TMPDIR" != "x" + TMPVAR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1` + if test "x$TMPVAR" != "x" then - JAR="$TMPDIR" + JAR="$TMPVAR" AC_MSG_RESULT([$JAR]) else AC_MSG_RESULT([not found]) @@ -2123,6 +2158,58 @@ AC_SUBST(JAVA_LIBS) AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes") # }}} +# --with-liblvm2app {{{ +with_liblvm2app_cppflags="" +with_liblvm2app_ldflags="" +AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + with_liblvm2app_cppflags="-I$withval/include" + with_liblvm2app_ldflags="-L$withval/lib" + with_liblvm2app="yes" + else + with_liblvm2app="$withval" + fi +], +[ + with_liblvm2app="yes" +]) +if test "x$with_liblvm2app" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags" + + AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" +fi + +if test "x$with_liblvm2app" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags" + LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags" + + AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi +if test "x$with_liblvm2app" = "xyes" +then + BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags" + BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags" + BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app" + AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS) + AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS) + AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes") +# }}} + # --with-libmemcached {{{ with_libmemcached_cppflags="" with_libmemcached_ldflags="" @@ -2470,35 +2557,36 @@ then #include ]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [ - #include - #include - #include - #include - #include - #include - ], [ - int retval = TCA_STATS2; - return (retval); - ] - )], - [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])]) - - AC_COMPILE_IFELSE( -[#include +[[[ +#include #include #include #include #include #include - -int main (void) -{ - int retval = TCA_STATS; - return (retval); -}], - [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])] - []); +]]], +[[[ +int retval = TCA_STATS2; +return (retval); +]]] + )], + [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[[ +#include +#include +#include +#include +#include +#include +]]], +[[[ +int retval = TCA_STATS; +return (retval); +]]] + )], + [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]) CFLAGS="$SAVE_CFLAGS" fi @@ -2518,8 +2606,9 @@ then [if function 'rtnl_dump_filter' expects five arguments], [c_cv_rtnl_dump_filter_five_args], AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [ -AC_INCLUDES_DEFAULT +[[[ +#include +#include #include #include #if HAVE_LIBNETLINK_H @@ -2529,24 +2618,25 @@ AC_INCLUDES_DEFAULT #elif HAVE_LINUX_LIBNETLINK_H # include #endif - ], - [ +]]], +[[[ if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL)) return 1; return 0; - ] - )], - [c_cv_rtnl_dump_filter_five_args="yes"], - [c_cv_rtnl_dump_filter_five_args="no"] - ) +]]] + )], + [c_cv_rtnl_dump_filter_five_args="yes"], + [c_cv_rtnl_dump_filter_five_args="no"] ) +) AC_CACHE_CHECK( [if function 'rtnl_dump_filter' expects three arguments], [c_cv_rtnl_dump_filter_three_args], AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [ -AC_INCLUDES_DEFAULT +[[[ +#include +#include #include #include #if HAVE_LIBNETLINK_H @@ -2556,17 +2646,17 @@ AC_INCLUDES_DEFAULT #elif HAVE_LINUX_LIBNETLINK_H # include #endif - ], - [ +]]], +[[[ if (rtnl_dump_filter(NULL, NULL, NULL)) return 1; return 0; - ] - )], - [c_cv_rtnl_dump_filter_three_args="yes"], - [c_cv_rtnl_dump_filter_three_args="no"] - ) +]]] + )], + [c_cv_rtnl_dump_filter_three_args="yes"], + [c_cv_rtnl_dump_filter_three_args="no"] ) +) CFLAGS="$SAVE_CFLAGS" @@ -3031,20 +3121,20 @@ dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string AC_CACHE_CHECK([for libperl], [c_cv_have_libperl], - AC_LINK_IFELSE( - AC_LANG_PROGRAM( - [[ + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ #define PERL_NO_GET_CONTEXT #include #include #include - ]], - [[ +]]], +[[[ dTHX; load_module (PERL_LOADMOD_NOIMPORT, newSVpv ("Collectd::Plugin::FooBar", 24), Nullsv); - ]]), +]]] + )], [c_cv_have_libperl="yes"], [c_cv_have_libperl="no"] ) @@ -3076,9 +3166,8 @@ then AC_CACHE_CHECK([if perl supports ithreads], [c_cv_have_perl_ithreads], - AC_LINK_IFELSE( - AC_LANG_PROGRAM( - [[ + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ #include #include #include @@ -3086,8 +3175,9 @@ then #if !defined(USE_ITHREADS) # error "Perl does not support ithreads!" #endif /* !defined(USE_ITHREADS) */ - ]], - [[ ]]), +]]], +[[[ ]]] + )], [c_cv_have_perl_ithreads="yes"], [c_cv_have_perl_ithreads="no"] ) @@ -3113,20 +3203,20 @@ then AC_CACHE_CHECK([for broken Perl_load_module()], [c_cv_have_broken_perl_load_module], - AC_LINK_IFELSE( - AC_LANG_PROGRAM( - [[ + AC_LINK_IFELSE([AC_LANG_PROGRAM( +[[[ #define PERL_NO_GET_CONTEXT #include #include #include - ]], - [[ +]]], +[[[ dTHX; load_module (PERL_LOADMOD_NOIMPORT, newSVpv ("Collectd::Plugin::FooBar", 24), Nullsv); - ]]), +]]] + )], [c_cv_have_broken_perl_load_module="no"], [c_cv_have_broken_perl_load_module="yes"] ) @@ -3677,6 +3767,74 @@ fi AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes") # }}} +# --with-libsigrok {{{ +with_libsigrok_cflags="" +with_libsigrok_ldflags="" +AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])], +[ + if test "x$withval" = "xno" + then + with_libsigrok="no" + else + with_libsigrok="yes" + if test "x$withval" != "xyes" + then + with_libsigrok_cflags="-I$withval/include" + with_libsigrok_ldflags="-L$withval/lib" + fi + fi +],[]) + +# libsigrok has a glib dependency +if test "x$with_libsigrok" = "xyes" +then + if test -z "m4_ifdef([AM_PATH_GLIB_2_0], [yes], [])" + then + with_libsigrok="no (glib not available)" + else + AM_PATH_GLIB_2_0([2.28.0], + [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"]) + fi +fi + +# libsigrok headers +if test "x$with_libsigrok" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags" + + AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" +fi + +# libsigrok library +if test "x$with_libsigrok" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags" + LDFLAGS="$LDFLAGS $with_libsigrok_ldflags" + + AC_CHECK_LIB(sigrok, sr_init, + [ + AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).]) + ], + [with_libsigrok="no (libsigrok not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi +if test "x$with_libsigrok" = "xyes" +then + BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags" + BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags" + AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS) + AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS) +fi +AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes") +# }}} + # --with-libstatgrab {{{ with_libstatgrab_cflags="" with_libstatgrab_ldflags="" @@ -4120,6 +4278,63 @@ fi AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes") # }}} +# --with-mic {{{ +with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include" +with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux" +with_mic_libs="" +AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])], +[ + if test "x$withval" = "xno" + then + with_mic="no" + else if test "x$withval" = "xyes" + then + with_mic="yes" + else if test -d "$with_mic/lib" + then + AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured]) + with_mic_cflags="-I$withval/include" + with_mic_ldpath="-L$withval/lib/Linux" + with_mic_libs="-lMicAccessSDK -lscif -lpthread" + with_mic="yes" + fi; fi; fi +], +[with_mic="yes"]) +if test "x$with_mic" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_mic_cflags" + AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"]) + CPPFLAGS="$SAVE_CPPFLAGS" +fi +if test "x$with_mic" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + + CPPFLAGS="$CPPFLAGS $with_mic_cflags" + LDFLAGS="$LDFLAGS $with_mic_ldpath" + + AC_CHECK_LIB(MicAccessSDK, MicInitAPI, + [with_mic_ldpath="$with_mic_ldpath" + with_mic_libs="-lMicAccessSDK -lscif -lpthread"], + [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread]) + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi + +if test "x$with_mic" = "xyes" +then + BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags" + BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath" + BUILD_WITH_MIC_LDADD="$with_mic_libs" + AC_SUBST(BUILD_WITH_MIC_CPPFLAGS) + AC_SUBST(BUILD_WITH_MIC_LIBPATH) + AC_SUBST(BUILD_WITH_MIC_LDADD) +fi +#}}} + # --with-libvarnish {{{ with_libvarnish_cppflags="" with_libvarnish_cflags="" @@ -4546,6 +4761,7 @@ dependency_error="no" plugin_ascent="no" plugin_battery="no" plugin_bind="no" +plugin_cgroups="no" plugin_conntrack="no" plugin_contextswitch="no" plugin_cpu="no" @@ -4589,6 +4805,7 @@ then plugin_battery="yes" plugin_conntrack="yes" plugin_contextswitch="yes" + plugin_cgroups="yes" plugin_cpu="yes" plugin_cpufreq="yes" plugin_disk="yes" @@ -4597,6 +4814,7 @@ then plugin_interface="yes" plugin_irq="yes" plugin_load="yes" + plugin_lvm="yes" plugin_memory="yes" plugin_nfs="yes" plugin_numa="yes" @@ -4636,6 +4854,14 @@ then plugin_tcpconns="yes" fi +# FreeBSD + +if test "x$ac_system" = "xFreeBSD" +then + plugin_zfs_arc="yes" +fi + + if test "x$with_perfstat" = "xyes" then plugin_cpu="yes" @@ -4871,6 +5097,7 @@ AC_PLUGIN([csv], [yes], [CSV output plugin]) AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics]) AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics]) AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics]) +AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting]) AC_PLUGIN([dbi], [$with_libdbi], [General database statistics]) AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) @@ -4893,6 +5120,7 @@ AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) AC_PLUGIN([load], [$plugin_load], [System load]) AC_PLUGIN([logfile], [yes], [File logging plugin]) AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics]) +AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics]) AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics]) AC_PLUGIN([match_empty_counter], [yes], [The empty counter match]) AC_PLUGIN([match_hashed], [yes], [The hashed match]) @@ -4904,6 +5132,7 @@ AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) de AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics]) AC_PLUGIN([memcached], [yes], [memcached statistics]) AC_PLUGIN([memory], [$plugin_memory], [Memory usage]) +AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats]) AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin]) AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values]) AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics]) @@ -4937,11 +5166,14 @@ AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin]) AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin]) AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics]) AC_PLUGIN([serial], [$plugin_serial], [serial port traffic]) +AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources]) AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin]) +AC_PLUGIN([statsd], [yes], [StatsD plugin]) AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics]) AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin]) AC_PLUGIN([table], [yes], [Parsing of tabular data]) AC_PLUGIN([tail], [yes], [Parsing of logfiles]) +AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files]) AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics]) AC_PLUGIN([target_notification], [yes], [The notification target]) AC_PLUGIN([target_replace], [yes], [The replace target]) @@ -4964,8 +5196,9 @@ AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics]) AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics]) AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin]) AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin]) -AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin]) AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin]) +AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin]) +AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin]) AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics]) AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics]) @@ -5062,6 +5295,7 @@ then fi dnl Perl bindings +PERL_BINDINGS_OPTIONS="PREFIX=${prefix}" AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])], [ if test "x$withval" != "xno" && test "x$withval" != "xyes" @@ -5069,12 +5303,10 @@ AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@ PERL_BINDINGS_OPTIONS="$withval" with_perl_bindings="yes" else - PERL_BINDINGS_OPTIONS="" with_perl_bindings="$withval" fi ], [ - PERL_BINDINGS_OPTIONS="" if test -n "$perl_interpreter" then with_perl_bindings="yes" @@ -5138,6 +5370,7 @@ cat <