1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
4 AC_CONFIG_SRCDIR(src/target_set.c)
5 AC_CONFIG_HEADERS(src/config.h)
6 AC_CONFIG_AUX_DIR([build-aux])
7 AC_CONFIG_MACRO_DIR([m4])
9 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
10 dnl we don't really need the 'u' even in older toolchains. Then there is
11 dnl older libtool, which spelled it AR_FLAGS
12 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
16 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
17 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20 AC_PREFIX_DEFAULT("/opt/collectd")
25 # Checks for programs.
28 [AC_MSG_ERROR([No compiler found that supports C99])]
37 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
43 AC_PATH_PROG([VALGRIND], [valgrind])
45 # Warn when pkg.m4 is missing
46 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
50 AC_CACHE_CHECK([if bison is the parser generator],
51 [collectd_cv_prog_bison],
52 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
53 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
57 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
59 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
62 AS_IF([test "x$lt_cv_dlopen" = "xno"],
63 [AC_MSG_ERROR([Your system does not support dlopen])]
66 AC_SUBST([DLOPEN_LIBS], [$lt_cv_dlopen_libs])
68 AC_ARG_VAR([PROTOC], [path to the protoc binary])
69 AC_PATH_PROG([PROTOC], [protoc])
71 if test "x$PROTOC" != "x"; then
72 AC_MSG_CHECKING([for protoc 3.0.0+])
73 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
74 protoc3="yes (`$PROTOC --version`)"
77 protoc3="no (`$PROTOC --version`)"
79 AC_MSG_RESULT([$protoc3])
81 AM_CONDITIONAL(HAVE_PROTOC3, test "x$have_protoc3" = "xyes")
83 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
84 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
85 AM_CONDITIONAL(HAVE_GRPC_CPP, test "x$GRPC_CPP_PLUGIN" != "x")
87 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
88 AC_PATH_PROG([PROTOC_C], [protoc-c])
89 if test "x$PROTOC_C" = "x"
91 have_protoc_c="no (protoc-c compiler not found)"
96 AC_MSG_CHECKING([for kernel type ($host_os)])
99 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
103 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
107 AC_DEFINE([KERNEL_DARWIN], 1, [True if program is to be compiled for a Darwin kernel])
111 AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel])
115 AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel])
119 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
123 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
129 AC_MSG_RESULT([$ac_system])
131 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
132 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
133 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
134 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
135 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
136 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
138 if test "x$ac_system" = "xLinux"
140 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
141 if test -z "$KERNEL_DIR"
143 KERNEL_DIR="/lib/modules/`uname -r`/source"
146 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
147 AC_SUBST(KERNEL_CFLAGS)
150 if test "x$ac_system" = "xSolaris"
152 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
153 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
155 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
156 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
158 # error "Compiler not in 64bit mode."
161 [AC_MSG_RESULT([yes])],
164 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
168 if test "x$ac_system" = "xAIX"
170 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
173 # Where to install .pc files.
174 pkgconfigdir="${libdir}/pkgconfig"
175 AC_SUBST(pkgconfigdir)
177 # Check for standards compliance mode
178 AC_ARG_ENABLE(standards,
179 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
180 [enable_standards="$enableval"],
181 [enable_standards="no"])
182 if test "x$enable_standards" = "xyes"
184 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
185 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
186 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
187 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
188 if test "x$GCC" = "xyes"
190 CFLAGS="$CFLAGS -std=c99"
193 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
196 # Checks for header files.
252 # For entropy plugin on newer NetBSD
253 AC_CHECK_HEADERS(sys/rndio.h, [], [],
254 [#if HAVE_SYS_TYPES_H
255 # include <sys/types.h>
258 # include <sys/ioctl.h>
261 # include <sys/param.h>
266 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
271 # include <sys/types.h>
274 AC_CHECK_HEADERS(netinet/in.h, [], [],
279 # include <sys/types.h>
281 #if HAVE_NETINET_IN_SYSTM_H
282 # include <netinet/in_systm.h>
285 AC_CHECK_HEADERS(netinet/ip.h, [], [],
290 # include <sys/types.h>
292 #if HAVE_NETINET_IN_SYSTM_H
293 # include <netinet/in_systm.h>
295 #if HAVE_NETINET_IN_H
296 # include <netinet/in.h>
299 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
304 # include <sys/types.h>
306 #if HAVE_NETINET_IN_SYSTM_H
307 # include <netinet/in_systm.h>
309 #if HAVE_NETINET_IN_H
310 # include <netinet/in.h>
312 #if HAVE_NETINET_IP_H
313 # include <netinet/ip.h>
316 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
321 # include <sys/types.h>
323 #if HAVE_NETINET_IN_SYSTM_H
324 # include <netinet/in_systm.h>
326 #if HAVE_NETINET_IN_H
327 # include <netinet/in.h>
329 #if HAVE_NETINET_IP_H
330 # include <netinet/ip.h>
333 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
338 # include <sys/types.h>
340 #if HAVE_NETINET_IN_SYSTM_H
341 # include <netinet/in_systm.h>
343 #if HAVE_NETINET_IN_H
344 # include <netinet/in.h>
347 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
352 # include <sys/types.h>
354 #if HAVE_NETINET_IN_SYSTM_H
355 # include <netinet/in_systm.h>
357 #if HAVE_NETINET_IN_H
358 # include <netinet/in.h>
360 #if HAVE_NETINET_IP6_H
361 # include <netinet/ip6.h>
364 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
369 # include <sys/types.h>
371 #if HAVE_NETINET_IN_SYSTM_H
372 # include <netinet/in_systm.h>
374 #if HAVE_NETINET_IN_H
375 # include <netinet/in.h>
377 #if HAVE_NETINET_IP_H
378 # include <netinet/ip.h>
381 AC_CHECK_HEADERS(netinet/udp.h, [], [],
386 # include <sys/types.h>
388 #if HAVE_NETINET_IN_SYSTM_H
389 # include <netinet/in_systm.h>
391 #if HAVE_NETINET_IN_H
392 # include <netinet/in.h>
394 #if HAVE_NETINET_IP_H
395 # include <netinet/ip.h>
400 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
405 # include <sys/types.h>
407 #if HAVE_NETINET_IN_SYSTM_H
408 # include <netinet/in_systm.h>
410 #if HAVE_NETINET_IN_H
411 # include <netinet/in.h>
413 #if HAVE_NETINET_IP6_H
414 # include <netinet/ip6.h>
418 if test "x$have_ip6_ext" = "xno"; then
419 SAVE_CFLAGS="$CFLAGS"
420 CFLAGS="$CFLAGS -DSOLARIS2=8"
422 AC_CHECK_TYPES([struct ip6_ext],
423 [have_ip6_ext="yes, with -DSOLARIS2=8"],
429 # include <sys/types.h>
431 #if HAVE_NETINET_IN_SYSTM_H
432 # include <netinet/in_systm.h>
434 #if HAVE_NETINET_IN_H
435 # include <netinet/in.h>
437 #if HAVE_NETINET_IP6_H
438 # include <netinet/ip6.h>
442 if test "x$have_ip6_ext" = "xno"; then
443 CFLAGS="$SAVE_CFLAGS"
448 AC_CHECK_HEADERS(sys/dkstat.h)
449 if test "x$ac_system" = "xDarwin"
451 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)
452 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
453 # For the battery plugin
454 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
456 #if HAVE_IOKIT_IOKITLIB_H
457 # include <IOKit/IOKitLib.h>
459 #if HAVE_IOKIT_IOTYPES_H
460 # include <IOKit/IOTypes.h>
466 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
469 # include <sys/types.h>
472 # include <sys/param.h>
476 AC_MSG_CHECKING([for sysctl kern.cp_times])
477 if test -x /sbin/sysctl
479 /sbin/sysctl kern.cp_times >/dev/null 2>&1
483 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
484 [Define if sysctl supports kern.cp_times])
492 AC_MSG_CHECKING([for sysctl kern.cp_time])
493 if test -x /sbin/sysctl
495 /sbin/sysctl kern.cp_time >/dev/null 2>&1
499 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1,
500 [Define if sysctl supports kern.cp_time])
509 AC_CHECK_HEADERS(linux/major.h)
511 # For md module (Linux only)
512 if test "x$ac_system" = "xLinux"
514 AC_CHECK_HEADERS(linux/raid/md_u.h,
515 [have_linux_raid_md_u_h="yes"],
516 [have_linux_raid_md_u_h="no"],
518 #include <sys/ioctl.h>
519 #include <linux/major.h>
520 #include <linux/types.h>
522 AC_CHECK_HEADERS([sys/sysmacros.h])
524 have_linux_raid_md_u_h="no"
527 # For the wireless module
528 have_linux_wireless_h="no"
529 if test "x$ac_system" = "xLinux"
531 AC_CHECK_HEADERS(linux/wireless.h,
532 [have_linux_wireless_h="yes"],
533 [have_linux_wireless_h="no"],
536 #include <sys/ioctl.h>
537 #include <sys/socket.h>
541 # For the swap module
542 have_sys_swap_h="yes"
543 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
545 #undef _FILE_OFFSET_BITS
546 #undef _LARGEFILE64_SOURCE
548 # include <sys/types.h>
551 # include <sys/param.h>
556 # For the processes plugin
558 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
560 # For interface plugin
561 AC_CHECK_HEADERS(ifaddrs.h)
562 AC_CHECK_HEADERS(net/if.h, [], [],
565 # include <sys/types.h>
567 #if HAVE_SYS_SOCKET_H
568 # include <sys/socket.h>
571 AC_CHECK_HEADERS(linux/if.h, [], [],
574 # include <sys/types.h>
576 #if HAVE_SYS_SOCKET_H
577 # include <sys/socket.h>
580 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
583 # include <sys/types.h>
585 #if HAVE_SYS_SOCKET_H
586 # include <sys/socket.h>
588 #if HAVE_LINUX_INET_DIAG_H
589 # include <linux/inet_diag.h>
592 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
595 # include <sys/types.h>
597 #if HAVE_SYS_SOCKET_H
598 # include <sys/socket.h>
601 # include <linux/if.h>
606 AC_CHECK_HEADERS(linux/sockios.h,
607 [have_linux_sockios_h="yes"],
608 [have_linux_sockios_h="no"],
611 # include <sys/ioctl.h>
617 AC_CHECK_HEADERS(linux/ethtool.h,
618 [have_linux_ethtool_h="yes"],
619 [have_linux_ethtool_h="no"],
622 # include <sys/ioctl.h>
627 #if HAVE_LINUX_SOCKIOS_H
628 # include <linux/sockios.h>
633 have_linux_ip_vs_h="no"
634 have_net_ip_vs_h="no"
636 ip_vs_h_needs_kernel_cflags="no"
637 if test "x$ac_system" = "xLinux"
639 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
640 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
641 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
643 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
645 SAVE_CFLAGS="$CFLAGS"
646 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
648 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
650 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
651 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
652 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
654 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
656 ip_vs_h_needs_kernel_cflags="yes"
659 CFLAGS="$SAVE_CFLAGS"
662 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
665 AC_CHECK_HEADERS(sys/ucred.h, [], [],
668 # include <sys/types.h>
671 # include <sys/param.h>
675 # For mount interface
676 AC_CHECK_HEADERS(sys/mount.h, [], [],
679 # include <sys/types.h>
682 # include <sys/param.h>
686 # For the email plugin
687 AC_CHECK_HEADERS(linux/un.h, [], [],
689 #if HAVE_SYS_SOCKET_H
690 # include <sys/socket.h>
696 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
701 if test "x$enable_xfs" != "xno"; then
702 AC_CHECK_HEADERS([xfs/xqm.h],
705 if test "x$enable_xfs" = "xyes"; then
706 AC_MSG_ERROR([xfs/xqm.h not found])
709 [[#define _GNU_SOURCE]]
716 AC_CHECK_HEADERS(arpa/nameser.h)
717 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
719 #if HAVE_ARPA_NAMESER_H
720 # include <arpa/nameser.h>
724 AC_CHECK_HEADERS(net/if_arp.h, [], [],
725 [#if HAVE_SYS_SOCKET_H
726 # include <sys/socket.h>
729 AC_CHECK_HEADERS(net/ppp_defs.h)
730 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
731 [#if HAVE_NET_PPP_DEFS_H
732 # include <net/ppp_defs.h>
735 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
740 # include <sys/types.h>
742 #if HAVE_SYS_SOCKET_H
743 # include <sys/socket.h>
748 #if HAVE_NETINET_IN_H
749 # include <netinet/in.h>
753 have_net_pfvar_h="no"
754 AC_CHECK_HEADERS(net/pfvar.h,
755 [have_net_pfvar_h="yes"],
756 [have_net_pfvar_h="no"],
759 # include <sys/ioctl.h>
761 #if HAVE_SYS_SOCKET_H
762 # include <sys/socket.h>
767 #if HAVE_NETINET_IN_H
768 # include <netinet/in.h>
772 # For the multimeter plugin
774 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
776 # For cpusleep plugin
777 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
778 [c_cv_have_clock_boottime_monotonic],
779 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
784 struct timespec b, m;
785 clock_gettime(CLOCK_BOOTTIME, &b );
786 clock_gettime(CLOCK_MONOTONIC, &m );
789 [c_cv_have_clock_boottime_monotonic="yes"],
790 [c_cv_have_clock_boottime_monotonic="no"]))
793 # For the turbostat plugin
794 have_asm_msrindex_h="no"
795 AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
797 if test "x$have_asm_msrindex_h" = "xyes"
799 AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
800 [c_cv_have_usable_asm_msrindex_h],
801 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
803 #include<asm/msr-index.h>
806 int y = MSR_PKG_C10_RESIDENCY;
810 [c_cv_have_usable_asm_msrindex_h="yes"],
811 [c_cv_have_usable_asm_msrindex_h="no"],
817 AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
819 have_capability="yes"
820 AC_CHECK_HEADERS(sys/capability.h,
821 [have_capability="yes"],
822 [have_capability="no (<sys/capability.h> not found)"])
823 if test "x$have_capability" = "xyes"; then
824 AC_CHECK_LIB(cap, cap_get_bound,
825 [have_capability="yes"],
826 [have_capability="no (cap_get_bound() not found)"])
828 if test "x$have_capability" = "xyes"; then
829 AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_bound() (-lcap).])
831 AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes")
834 # Checks for typedefs, structures, and compiler characteristics.
843 # Checks for library functions.
845 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname setlocale asprintf)
852 AC_LANG_SOURCE([[int main(void){}]])
854 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
861 SAVE_CFLAGS="$CFLAGS"
862 # Emulate behavior of src/Makefile.am
863 if test "x$GCC" = "xyes"
865 CFLAGS="$CFLAGS -Wall -Werror"
868 AC_CACHE_CHECK([for strtok_r],
869 [c_cv_have_strtok_r_default],
878 char buffer[] = "foo,bar,baz";
885 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
888 printf ("token = %s;\n", token);
892 [c_cv_have_strtok_r_default="yes"],
893 [c_cv_have_strtok_r_default="no"]
897 if test "x$c_cv_have_strtok_r_default" = "xno"
899 CFLAGS="$CFLAGS -D_REENTRANT=1"
901 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
902 [c_cv_have_strtok_r_reentrant],
911 char buffer[] = "foo,bar,baz";
918 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
921 printf ("token = %s;\n", token);
925 [c_cv_have_strtok_r_reentrant="yes"],
926 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
931 CFLAGS="$SAVE_CFLAGS"
932 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
934 CFLAGS="$CFLAGS -D_REENTRANT=1"
937 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
939 socket_needs_socket="no"
940 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
941 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
943 clock_gettime_needs_rt="no"
944 clock_gettime_needs_posix4="no"
945 have_clock_gettime="no"
946 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
947 if test "x$have_clock_gettime" = "xno"
949 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
950 have_clock_gettime="yes"])
952 if test "x$have_clock_gettime" = "xno"
954 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
955 have_clock_gettime="yes"])
957 if test "x$have_clock_gettime" = "xyes"
959 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
962 nanosleep_needs_rt="no"
963 nanosleep_needs_posix4="no"
964 AC_CHECK_FUNCS(nanosleep,
966 AC_CHECK_LIB(rt, nanosleep,
967 [nanosleep_needs_rt="yes"],
968 AC_CHECK_LIB(posix4, nanosleep,
969 [nanosleep_needs_posix4="yes"],
970 AC_MSG_ERROR(cannot find nanosleep))))
972 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
973 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
975 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
976 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
977 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
978 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
979 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
980 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
981 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
982 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
983 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
984 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
985 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
986 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
988 # Check for strptime {{{
989 if test "x$GCC" = "xyes"
991 SAVE_CFLAGS="$CFLAGS"
992 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
995 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
996 if test "x$have_strptime" = "xyes"
998 AC_CACHE_CHECK([whether strptime is exported by default],
999 [c_cv_have_strptime_default],
1000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1006 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1009 [c_cv_have_strptime_default="yes"],
1010 [c_cv_have_strptime_default="no"]))
1012 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
1014 AC_CACHE_CHECK([whether strptime needs standards mode],
1015 [c_cv_have_strptime_standards],
1016 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1018 #ifndef _ISOC99_SOURCE
1019 # define _ISOC99_SOURCE 1
1021 #ifndef _POSIX_C_SOURCE
1022 # define _POSIX_C_SOURCE 200112L
1024 #ifndef _XOPEN_SOURCE
1025 # define _XOPEN_SOURCE 500
1031 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1034 [c_cv_have_strptime_standards="yes"],
1035 [c_cv_have_strptime_standards="no"]))
1037 if test "x$c_cv_have_strptime_standards" = "xyes"
1039 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
1045 if test "x$GCC" = "xyes"
1047 CFLAGS="$SAVE_CFLAGS"
1049 # }}} Check for strptime
1051 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
1052 if test "x$have_swapctl" = "xyes"; then
1053 AC_CACHE_CHECK([whether swapctl takes two arguments],
1054 [c_cv_have_swapctl_two_args],
1055 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1057 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1058 # undef _FILE_OFFSET_BITS
1059 # undef _LARGEFILE64_SOURCE
1061 #include <sys/stat.h>
1062 #include <sys/param.h>
1063 #include <sys/swap.h>
1067 int num = swapctl(0, NULL);
1070 [c_cv_have_swapctl_two_args="yes"],
1071 [c_cv_have_swapctl_two_args="no"]
1074 AC_CACHE_CHECK([whether swapctl takes three arguments],
1075 [c_cv_have_swapctl_three_args],
1079 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1080 # undef _FILE_OFFSET_BITS
1081 # undef _LARGEFILE64_SOURCE
1083 #include <sys/stat.h>
1084 #include <sys/param.h>
1085 #include <sys/swap.h>
1089 int num = swapctl(0, NULL, 0);
1092 [c_cv_have_swapctl_three_args="yes"],
1093 [c_cv_have_swapctl_three_args="no"]
1097 # Check for different versions of `swapctl' here..
1098 if test "x$have_swapctl" = "xyes"; then
1099 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1100 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
1101 [Define if the function swapctl exists and takes two arguments.])
1103 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1104 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
1105 [Define if the function swapctl exists and takes three arguments.])
1110 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1112 if test "x$withval" = "xno"; then
1114 else if test "x$withval" = "xyes"; then
1121 if test "x$nan_type" = "xnone"; then
1122 AC_CACHE_CHECK([whether NAN is defined by default],
1123 [c_cv_have_nan_default],
1124 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1128 static double foo = NAN;
1137 [c_cv_have_nan_default="yes"],
1138 [c_cv_have_nan_default="no"]
1141 if test "x$c_cv_have_nan_default" = "xyes"
1146 if test "x$nan_type" = "xnone"; then
1147 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1148 [c_cv_have_nan_isoc],
1149 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1152 #define __USE_ISOC99 1
1154 static double foo = NAN;
1163 [c_cv_have_nan_isoc="yes"],
1164 [c_cv_have_nan_isoc="no"]
1167 if test "x$c_cv_have_nan_isoc" = "xyes"
1172 if test "x$nan_type" = "xnone"; then
1173 SAVE_LDFLAGS=$LDFLAGS
1174 LDFLAGS="$LDFLAGS -lm"
1175 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1176 [c_cv_have_nan_zero],
1177 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1184 #define NAN (0.0 / 0.0)
1186 # define isnan(f) ((f) != (f))
1188 static double foo = NAN;
1197 [c_cv_have_nan_zero="yes"],
1198 [c_cv_have_nan_zero="no"]
1201 LDFLAGS=$SAVE_LDFLAGS
1202 if test "x$c_cv_have_nan_zero" = "xyes"
1208 if test "x$nan_type" = "xdefault"; then
1209 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1210 [Define if NAN is defined by default and can initialize static variables.])
1211 else if test "x$nan_type" = "xisoc99"; then
1212 AC_DEFINE(NAN_STATIC_ISOC, 1,
1213 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1214 else if test "x$nan_type" = "xzero"; then
1215 AC_DEFINE(NAN_ZERO_ZERO, 1,
1216 [Define if NAN can be defined as (0.0 / 0.0)])
1218 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1221 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1223 if test "x$withval" = "xnothing"; then
1224 fp_layout_type="nothing"
1225 else if test "x$withval" = "xendianflip"; then
1226 fp_layout_type="endianflip"
1227 else if test "x$withval" = "xintswap"; then
1228 fp_layout_type="intswap"
1230 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1233 [fp_layout_type="unknown"])
1235 if test "x$fp_layout_type" = "xunknown"; then
1236 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1237 [c_cv_fp_layout_need_nothing],
1238 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1244 # include <stdint.h>
1247 # include <inttypes.h>
1250 # include <stdbool.h>
1260 memcpy ((void *) &i0, (void *) &d, 8);
1263 memcpy ((void *) c, (void *) &i1, 8);
1265 if ((c[0] == 0x2f) && (c[1] == 0x25)
1266 && (c[2] == 0xc0) && (c[3] == 0xc7)
1267 && (c[4] == 0x43) && (c[5] == 0x2b)
1268 && (c[6] == 0x1f) && (c[7] == 0x5b))
1274 [c_cv_fp_layout_need_nothing="yes"],
1275 [c_cv_fp_layout_need_nothing="no"]
1278 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1279 fp_layout_type="nothing"
1282 if test "x$fp_layout_type" = "xunknown"; then
1283 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1284 [c_cv_fp_layout_need_endianflip],
1285 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1291 # include <stdint.h>
1294 # include <inttypes.h>
1297 # include <stdbool.h>
1299 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1300 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1301 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1302 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1303 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1304 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1305 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1306 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1315 memcpy ((void *) &i0, (void *) &d, 8);
1317 i1 = endianflip (i0);
1318 memcpy ((void *) c, (void *) &i1, 8);
1320 if ((c[0] == 0x2f) && (c[1] == 0x25)
1321 && (c[2] == 0xc0) && (c[3] == 0xc7)
1322 && (c[4] == 0x43) && (c[5] == 0x2b)
1323 && (c[6] == 0x1f) && (c[7] == 0x5b))
1329 [c_cv_fp_layout_need_endianflip="yes"],
1330 [c_cv_fp_layout_need_endianflip="no"]
1333 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1334 fp_layout_type="endianflip"
1337 if test "x$fp_layout_type" = "xunknown"; then
1338 AC_CACHE_CHECK([if intswap converts to x86 representation],
1339 [c_cv_fp_layout_need_intswap],
1340 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1346 # include <stdint.h>
1349 # include <inttypes.h>
1352 # include <stdbool.h>
1354 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1355 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1364 memcpy ((void *) &i0, (void *) &d, 8);
1367 memcpy ((void *) c, (void *) &i1, 8);
1369 if ((c[0] == 0x2f) && (c[1] == 0x25)
1370 && (c[2] == 0xc0) && (c[3] == 0xc7)
1371 && (c[4] == 0x43) && (c[5] == 0x2b)
1372 && (c[6] == 0x1f) && (c[7] == 0x5b))
1378 [c_cv_fp_layout_need_intswap="yes"],
1379 [c_cv_fp_layout_need_intswap="no"]
1382 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1383 fp_layout_type="intswap"
1387 if test "x$fp_layout_type" = "xnothing"; then
1388 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1389 [Define if doubles are stored in x86 representation.])
1390 else if test "x$fp_layout_type" = "xendianflip"; then
1391 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1392 [Define if endianflip is needed to convert to x86 representation.])
1393 else if test "x$fp_layout_type" = "xintswap"; then
1394 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1395 [Define if intswap is needed to convert to x86 representation.])
1397 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1400 # --with-useragent {{{
1401 AC_ARG_WITH(useragent, [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1403 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1405 AC_DEFINE_UNQUOTED(COLLECTD_USERAGENT, ["$withval"], [User agent for http requests])
1411 # --with-data-max-name-len {{{
1412 AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1414 if test "x$withval" != "x" && test $withval -gt 0
1416 AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
1418 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1421 [ AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
1426 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1427 have_getvfsstat="no"
1428 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1429 have_listmntent="no"
1430 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1431 have_getmntent_r="no"
1432 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1435 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1436 if test "x$have_getmntent" = "xno"; then
1437 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1439 if test "x$have_getmntent" = "xno"; then
1440 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1442 if test "x$have_getmntent" = "xno"; then
1443 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1446 if test "x$have_getmntent" = "xc"; then
1447 AC_CACHE_CHECK([whether getmntent takes one argument],
1448 [c_cv_have_one_getmntent],
1452 #include "$srcdir/src/utils_mount.h"
1457 fh = setmntent ("/etc/mtab", "r");
1458 me = getmntent (fh);
1459 return(me->mnt_passno);
1462 [c_cv_have_one_getmntent="yes"],
1463 [c_cv_have_one_getmntent="no"]
1466 AC_CACHE_CHECK([whether getmntent takes two arguments],
1467 [c_cv_have_two_getmntent],
1471 #include "$srcdir/src/utils_mount.h"
1477 fh = fopen ("/etc/mnttab", "r");
1478 status = getmntent (fh, &mt);
1482 [c_cv_have_two_getmntent="yes"],
1483 [c_cv_have_two_getmntent="no"]
1488 # Check for different versions of `getmntent' here..
1490 if test "x$have_getmntent" = "xc"; then
1491 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1492 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1493 [Define if the function getmntent exists and takes one argument.])
1495 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1496 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1497 [Define if the function getmntent exists and takes two arguments.])
1500 if test "x$have_getmntent" = "xsun"; then
1501 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1502 [Define if the function getmntent exists. It is the version from libsun.])
1504 if test "x$have_getmntent" = "xseq"; then
1505 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1506 [Define if the function getmntent exists. It is the version from libseq.])
1508 if test "x$have_getmntent" = "xgen"; then
1509 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1510 [Define if the function getmntent exists. It is the version from libgen.])
1514 AC_CACHE_CHECK([if have htonll defined],
1516 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1518 #include <sys/types.h>
1519 #include <netinet/in.h>
1521 # include <inttypes.h>
1528 [c_cv_have_htonll="yes"],
1529 [c_cv_have_htonll="no"]
1532 if test "x$c_cv_have_htonll" = "xyes"
1534 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1537 # Check for structures
1538 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1539 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1542 #include <sys/types.h>
1543 #include <sys/socket.h>
1546 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1547 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1550 #include <sys/types.h>
1551 #include <sys/socket.h>
1552 #include <linux/if.h>
1553 #include <linux/netdevice.h>
1555 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1556 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1559 #include <linux/inet_diag.h>
1563 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1566 #include <netinet/in.h>
1570 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1572 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1573 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1574 have_struct_kinfo_proc_freebsd="yes"
1577 have_struct_kinfo_proc_freebsd="no"
1581 #include <sys/param.h>
1582 #include <sys/sysctl.h>
1583 #include <sys/user.h>
1586 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1588 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1589 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1590 have_struct_kinfo_proc_openbsd="yes"
1593 have_struct_kinfo_proc_openbsd="no"
1596 #include <sys/param.h>
1597 #include <sys/sysctl.h>
1602 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1604 AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
1605 [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1606 have_struct_kinfo_proc2_netbsd="yes"
1609 have_struct_kinfo_proc2_netbsd="no"
1612 #include <sys/param.h>
1613 #include <sys/sysctl.h>
1619 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1620 [#define _BSD_SOURCE
1621 #define _DEFAULT_SOURCE
1623 # include <stdint.h>
1625 #if HAVE_SYS_TYPES_H
1626 # include <sys/types.h>
1628 #if HAVE_NETINET_IN_SYSTM_H
1629 # include <netinet/in_systm.h>
1631 #if HAVE_NETINET_IN_H
1632 # include <netinet/in.h>
1634 #if HAVE_NETINET_IP_H
1635 # include <netinet/ip.h>
1637 #if HAVE_NETINET_UDP_H
1638 # include <netinet/udp.h>
1641 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1642 [#define _BSD_SOURCE
1643 #define _DEFAULT_SOURCE
1645 # include <stdint.h>
1647 #if HAVE_SYS_TYPES_H
1648 # include <sys/types.h>
1650 #if HAVE_NETINET_IN_SYSTM_H
1651 # include <netinet/in_systm.h>
1653 #if HAVE_NETINET_IN_H
1654 # include <netinet/in.h>
1656 #if HAVE_NETINET_IP_H
1657 # include <netinet/ip.h>
1659 #if HAVE_NETINET_UDP_H
1660 # include <netinet/udp.h>
1664 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1673 # check for pthread_setname_np
1674 SAVE_LDFLAGS="$LDFLAGS"
1675 LDFLAGS="$LDFLAGS -lpthread"
1677 AC_MSG_CHECKING([for pthread_setname_np])
1678 have_pthread_setname_np="no"
1679 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1682 #include <pthread.h>
1685 pthread_setname_np((pthread_t) {0}, "conftest");
1688 have_pthread_setname_np="yes"
1689 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1692 AC_MSG_RESULT([$have_pthread_setname_np])
1694 # check for pthread_set_name_np(3) (FreeBSD)
1695 AC_MSG_CHECKING([for pthread_set_name_np])
1696 have_pthread_set_name_np="no"
1697 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1699 #include <pthread_np.h>
1702 pthread_set_name_np((pthread_t) {0}, "conftest");
1705 have_pthread_set_name_np="yes"
1706 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1708 AC_MSG_RESULT([$have_pthread_set_name_np])
1710 LDFLAGS="$SAVE_LDFLAGS"
1713 # Checks for libraries begin here
1716 with_libresolv="yes"
1717 AC_CHECK_LIB(resolv, res_search,
1719 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1721 [with_libresolv="no"])
1722 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1724 dnl Check for HAL (hardware abstraction library)
1726 PKG_CHECK_MODULES([HAL], [hal],
1729 LIBS="$HAL_LIBS $LIBS"
1730 AC_CHECK_LIB([hal], [libhal_device_property_exists],
1732 SAVE_CPPFLAGS="$CPPFLAGS"
1733 CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
1734 AC_CHECK_HEADERS([libhal.h],
1737 BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
1738 BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
1740 CPPFLAGS="$SAVE_CPPFLAGS"
1748 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1749 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1753 AC_CHECK_LIB([pthread],
1756 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
1759 PTHREAD_LIBS="$LIBS"
1762 AC_CHECK_HEADERS([pthread.h],
1764 [AC_MSG_ERROR([pthread.h not found])]
1766 AC_SUBST([PTHREAD_LIBS])
1768 m4_divert_once([HELP_WITH], [
1769 collectd additional packages:])
1771 if test "x$ac_system" = "xAIX"
1776 with_perfstat="no (AIX only)"
1777 with_procinfo="no (AIX only)"
1780 if test "x$with_perfstat" = "xyes"
1782 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1783 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1785 if test "x$with_perfstat" = "xyes"
1787 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1788 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1789 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1790 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1792 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1795 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1797 # Processes plugin under AIX.
1798 if test "x$with_procinfo" = "xyes"
1800 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1802 if test "x$with_procinfo" = "xyes"
1804 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1807 if test "x$ac_system" = "xSolaris"
1812 with_kstat="no (Solaris only)"
1813 with_devinfo="no (Solaris only)"
1816 if test "x$with_kstat" = "xyes"
1818 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1820 if test "x$with_kstat" = "xyes"
1822 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1823 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1825 if test "x$with_kstat" = "xyes"
1827 AC_DEFINE(HAVE_LIBKSTAT, 1,
1828 [Define to 1 if you have the 'kstat' library (-lkstat)])
1830 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1831 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1834 if test "x$ac_system" = "xDarwin"
1840 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1843 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1844 if test "x$with_kvm_getprocs" = "xyes"
1846 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1847 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1850 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1852 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1853 if test "x$with_kvm_getswapinfo" = "xyes"
1855 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1856 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1859 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1861 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1862 if test "x$with_kvm_nlist" = "xyes"
1864 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1865 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1866 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1869 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1871 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1872 if test "x$with_kvm_openfiles" = "xyes"
1874 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1875 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1878 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1880 # --with-libaquaero5 {{{
1881 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1883 if test "x$withval" = "xyes"
1885 with_libaquaero5="yes"
1886 else if test "x$withval" = "xno"
1888 with_libaquaero5="no"
1890 with_libaquaero5="yes"
1891 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1892 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1895 [with_libaquaero5="yes"])
1897 SAVE_CPPFLAGS="$CPPFLAGS"
1898 SAVE_LDFLAGS="$LDFLAGS"
1900 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1901 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1903 if test "x$with_libaquaero5" = "xyes"
1905 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1907 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1909 AC_CHECK_HEADERS(libaquaero5.h,
1910 [with_libaquaero5="yes"],
1911 [with_libaquaero5="no (libaquaero5.h not found)"])
1913 if test "x$with_libaquaero5" = "xyes"
1915 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1917 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1919 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1920 [with_libaquaero5="yes"],
1921 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1924 CPPFLAGS="$SAVE_CPPFLAGS"
1925 LDFLAGS="$SAVE_LDFLAGS"
1927 if test "x$with_libaquaero5" = "xyes"
1929 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1930 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1931 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1932 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1934 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1937 # --with-libhiredis {{{
1938 AC_ARG_WITH(libhiredis, [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@],
1939 [Path to libhiredis.])],
1941 if test "x$withval" = "xyes"
1943 with_libhiredis="yes"
1944 else if test "x$withval" = "xno"
1946 with_libhiredis="no"
1948 with_libhiredis="yes"
1949 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
1950 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
1953 [with_libhiredis="yes"])
1955 SAVE_CPPFLAGS="$CPPFLAGS"
1956 SAVE_LDFLAGS="$LDFLAGS"
1958 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
1959 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
1961 if test "x$with_libhiredis" = "xyes"
1963 if test "x$LIBHIREDIS_CPPFLAGS" != "x"
1965 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
1967 AC_CHECK_HEADERS(hiredis/hiredis.h,
1968 [with_libhiredis="yes"],
1969 [with_libhiredis="no (hiredis.h not found)"])
1971 if test "x$with_libhiredis" = "xyes"
1973 if test "x$LIBHIREDIS_LDFLAGS" != "x"
1975 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
1977 AC_CHECK_LIB(hiredis, redisCommand,
1978 [with_libhiredis="yes"],
1979 [with_libhiredis="no (symbol 'redisCommand' not found)"])
1983 CPPFLAGS="$SAVE_CPPFLAGS"
1984 LDFLAGS="$SAVE_LDFLAGS"
1986 if test "x$with_libhiredis" = "xyes"
1988 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
1989 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
1990 AC_SUBST(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
1991 AC_SUBST(BUILD_WITH_LIBHIREDIS_LDFLAGS)
1993 AM_CONDITIONAL(BUILD_WITH_LIBHIREDIS, test "x$with_libhiredis" = "xyes")
1996 # --with-libcurl {{{
1997 with_curl_config="curl-config"
2000 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2002 if test "x$withval" = "xno"
2005 else if test "x$withval" = "xyes"
2009 if test -f "$withval" && test -x "$withval"
2011 with_curl_config="$withval"
2013 else if test -x "$withval/bin/curl-config"
2015 with_curl_config="$withval/bin/curl-config"
2024 if test "x$with_libcurl" = "xyes"
2026 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2027 curl_config_status=$?
2029 if test $curl_config_status -ne 0
2031 with_libcurl="no ($with_curl_config failed)"
2033 SAVE_CPPFLAGS="$CPPFLAGS"
2034 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2036 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
2038 CPPFLAGS="$SAVE_CPPFLAGS"
2041 if test "x$with_libcurl" = "xyes"
2043 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2044 curl_config_status=$?
2046 if test $curl_config_status -ne 0
2048 with_libcurl="no ($with_curl_config failed)"
2050 AC_CHECK_LIB(curl, curl_easy_init,
2051 [with_libcurl="yes"],
2052 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2054 AC_CHECK_DECL(CURLOPT_USERNAME,
2055 [have_curlopt_username="yes"],
2056 [have_curlopt_username="no"],
2057 [[#include <curl/curl.h>]])
2058 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2059 [have_curlopt_timeout="yes"],
2060 [have_curlopt_timeout="no"],
2061 [[#include <curl/curl.h>]])
2064 if test "x$with_libcurl" = "xyes"
2066 SAVE_CPPFLAGS="$CPPFLAGS"
2067 SAVE_LDFLAGS="$LDFLAGS"
2068 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2069 LDFLAGS="$LDFLAGS $with_curl_libs"
2070 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2071 [c_cv_have_curlinfo_appconnect_time],
2072 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2074 #include <curl/curl.h>
2077 int val = CURLINFO_APPCONNECT_TIME;
2081 [c_cv_have_curlinfo_appconnect_time="yes"],
2082 [c_cv_have_curlinfo_appconnect_time="no"]
2085 CPPFLAGS="$SAVE_CPPFLAGS"
2086 LDFLAGS="$SAVE_LDFLAGS"
2088 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
2089 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
2091 AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
2094 if test "x$with_libcurl" = "xyes"
2096 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2097 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2098 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2099 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2101 if test "x$have_curlopt_username" = "xyes"
2103 AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
2106 if test "x$have_curlopt_timeout" = "xyes"
2108 AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
2114 with_libdbi_cppflags=""
2115 with_libdbi_ldflags=""
2116 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2118 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2120 with_libdbi_cppflags="-I$withval/include"
2121 with_libdbi_ldflags="-L$withval/lib"
2124 with_libdbi="$withval"
2130 if test "x$with_libdbi" = "xyes"
2132 SAVE_CPPFLAGS="$CPPFLAGS"
2133 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2135 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
2137 CPPFLAGS="$SAVE_CPPFLAGS"
2139 if test "x$with_libdbi" = "xyes"
2141 SAVE_CPPFLAGS="$CPPFLAGS"
2142 SAVE_LDFLAGS="$LDFLAGS"
2143 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2144 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2146 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
2148 CPPFLAGS="$SAVE_CPPFLAGS"
2149 LDFLAGS="$SAVE_LDFLAGS"
2151 if test "x$with_libdbi" = "xyes"
2153 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2154 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2155 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2156 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2157 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2158 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2160 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
2163 # --with-libesmtp {{{
2164 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2166 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2168 LDFLAGS="$LDFLAGS -L$withval/lib"
2169 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
2172 with_libesmtp="$withval"
2178 if test "x$with_libesmtp" = "xyes"
2180 AC_CHECK_LIB(esmtp, smtp_create_session,
2182 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
2183 ], [with_libesmtp="no (libesmtp not found)"])
2185 if test "x$with_libesmtp" = "xyes"
2187 AC_CHECK_HEADERS(libesmtp.h,
2189 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
2190 ], [with_libesmtp="no (libesmtp.h not found)"])
2192 if test "x$with_libesmtp" = "xyes"
2198 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
2199 [Wether or not to use the esmtp library])
2200 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
2203 # --with-libganglia {{{
2204 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2206 if test -f "$withval" && test -x "$withval"
2208 with_libganglia_config="$withval"
2209 with_libganglia="yes"
2210 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
2212 with_libganglia_config="$withval/bin/ganglia-config"
2213 with_libganglia="yes"
2214 else if test -d "$withval"
2216 GANGLIA_CPPFLAGS="-I$withval/include"
2217 GANGLIA_LDFLAGS="-L$withval/lib"
2218 with_libganglia="yes"
2220 with_libganglia="$withval"
2224 with_libganglia="yes"
2227 if test "x$with_libganglia" = "xyes"
2229 if test "x$with_libganglia_config" != "x"
2231 if test "x$GANGLIA_CPPFLAGS" = "x"
2233 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2236 if test "x$GANGLIA_LDFLAGS" = "x"
2238 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2241 if test "x$GANGLIA_LIBS" = "x"
2243 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2246 GANGLIA_LIBS="-lganglia"
2250 SAVE_CPPFLAGS="$CPPFLAGS"
2251 SAVE_LDFLAGS="$LDFLAGS"
2252 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2253 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2255 if test "x$with_libganglia" = "xyes"
2257 AC_CHECK_HEADERS(gm_protocol.h,
2259 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
2260 [Define to 1 if you have the <gm_protocol.h> header file.])
2261 ], [with_libganglia="no (gm_protocol.h not found)"])
2264 if test "x$with_libganglia" = "xyes"
2266 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
2268 AC_DEFINE(HAVE_LIBGANGLIA, 1,
2269 [Define to 1 if you have the ganglia library (-lganglia).])
2270 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
2273 CPPFLAGS="$SAVE_CPPFLAGS"
2274 LDFLAGS="$SAVE_LDFLAGS"
2276 AC_SUBST(GANGLIA_CPPFLAGS)
2277 AC_SUBST(GANGLIA_LDFLAGS)
2278 AC_SUBST(GANGLIA_LIBS)
2279 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
2282 # --with-libgcrypt {{{
2283 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2284 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2285 GCRYPT_LIBS="$GCRYPT_LIBS"
2286 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2288 if test -f "$withval" && test -x "$withval"
2290 with_libgcrypt_config="$withval"
2291 with_libgcrypt="yes"
2292 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
2294 with_libgcrypt_config="$withval/bin/gcrypt-config"
2295 with_libgcrypt="yes"
2296 else if test -d "$withval"
2298 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2299 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2300 with_libgcrypt="yes"
2302 with_libgcrypt_config="gcrypt-config"
2303 with_libgcrypt="$withval"
2307 with_libgcrypt_config="libgcrypt-config"
2308 with_libgcrypt="yes"
2311 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2313 if test "x$GCRYPT_CPPFLAGS" = "x"
2315 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2318 if test "x$GCRYPT_LIBS" = "x"
2320 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2324 SAVE_CPPFLAGS="$CPPFLAGS"
2325 SAVE_LDFLAGS="$LDFLAGS"
2327 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2328 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2329 LIBS="$LIBS $GCRYPT_LIBS"
2331 if test "x$with_libgcrypt" = "xyes"
2333 if test "x$GCRYPT_CPPFLAGS" != "x"
2335 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2337 AC_CHECK_HEADERS(gcrypt.h,
2338 [with_libgcrypt="yes"],
2339 [with_libgcrypt="no (gcrypt.h not found)"])
2342 if test "x$with_libgcrypt" = "xyes"
2344 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2345 [with_libgcrypt="yes"],
2346 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2349 CPPFLAGS="$SAVE_CPPFLAGS"
2350 LDFLAGS="$SAVE_LDFLAGS"
2353 if test "x$with_libgcrypt" = "xyes"
2355 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2358 AC_SUBST(GCRYPT_CPPFLAGS)
2359 AC_SUBST(GCRYPT_LDFLAGS)
2360 AC_SUBST(GCRYPT_LIBS)
2361 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2365 with_libgps_cflags=""
2366 with_libgps_ldflags=""
2367 AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2369 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2371 with_libgps_cflags="-I$withval/include"
2372 with_libgps_ldflags="-L$withval/lib"
2375 with_libgps="$withval"
2381 if test "x$with_libgps" = "xyes"
2383 SAVE_CFLAGS="$CFLAGS"
2384 CFLAGS="$CFLAGS $with_libgps_cflags"
2386 AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
2388 CFLAGS="$SAVE_CFLAGS"
2390 if test "x$with_libgps" = "xyes"
2392 SAVE_CFLAGS="$CFLAGS"
2393 SAVE_LDFLAGS="$LDFLAGS"
2394 CFLAGS="$CFLAGS $with_libgps_cflags"
2395 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2397 AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
2399 CFLAGS="$SAVE_CFLAGS"
2400 LDFLAGS="$SAVE_LDFLAGS"
2402 if test "x$with_libgps" = "xyes"
2404 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2405 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2406 BUILD_WITH_LIBGPS_LIBS="-lgps"
2407 AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
2408 AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
2409 AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
2411 AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
2414 # --with-libgrpc++ {{{
2415 with_libgrpcpp_cppflags=""
2416 with_libgrpcpp_ldflags=""
2417 AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2419 with_grpcpp="$withval"
2420 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2422 with_libgrpcpp_cppflags="-I$withval/include"
2423 with_libgrpcpp_ldflags="-L$withval/lib"
2424 with_libgrpcpp="yes"
2426 if test "x$withval" = "xno"
2428 with_libgrpcpp="no (disabled on command line)"
2433 if test "x$withval" = "xyes"
2435 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2436 [with_libgrpcpp="yes"],
2437 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2441 if test "x$withval" != "xno"
2443 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2444 if test_cxx_flags -std=c++11; then
2445 AC_MSG_RESULT([yes])
2448 with_libgrpcpp="no (requires C++11 support)"
2452 if test "x$with_libgrpcpp" = "xyes"
2455 SAVE_CPPFLAGS="$CPPFLAGS"
2456 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2457 AC_CHECK_HEADERS([grpc++/grpc++.h], [],
2458 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2460 CPPFLAGS="$SAVE_CPPFLAGS"
2463 if test "x$with_libgrpcpp" = "xyes"
2466 SAVE_CPPFLAGS="$CPPFLAGS"
2467 SAVE_LDFLAGS="$LDFLAGS"
2469 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2470 LDFLAGS="$with_libgrpcpp_ldflags"
2471 if test "x$GRPCPP_LIBS" = "x"
2479 [[#include <grpc++/grpc++.h>]],
2480 [[grpc::ServerBuilder sb;]]
2483 with_libgrpcpp="yes"
2484 if test "x$GRPCPP_LIBS" = "x"
2486 GRPCPP_LIBS="-lgrpc++"
2489 [with_libgrpcpp="no (libgrpc++ not found)"]
2491 CPPFLAGS="$SAVE_CPPFLAGS"
2492 LDFLAGS="$SAVE_LDFLAGS"
2496 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2497 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2498 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2499 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2500 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2501 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2504 # --with-libiptc {{{
2505 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2507 if test "x$withval" = "xyes"
2509 with_libiptc="pkgconfig"
2510 else if test "x$withval" = "xno"
2515 with_libiptc_cflags="-I$withval/include"
2516 with_libiptc_libs="-L$withval/lib"
2520 if test "x$ac_system" = "xLinux"
2522 with_libiptc="pkgconfig"
2524 with_libiptc="no (Linux only)"
2528 if test "x$with_libiptc" = "xpkgconfig"
2530 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2533 with_libiptc="no (pkg-config doesn't know libiptc)"
2536 if test "x$with_libiptc" = "xpkgconfig"
2538 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2541 with_libiptc="no ($PKG_CONFIG failed)"
2543 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2546 with_libiptc="no ($PKG_CONFIG failed)"
2550 SAVE_CPPFLAGS="$CPPFLAGS"
2551 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2553 # check whether the header file for libiptc is available.
2554 if test "x$with_libiptc" = "xpkgconfig"
2556 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2557 [with_libiptc="no (header file missing)"])
2559 # If the header file is available, check for the required type declaractions.
2560 # They may be missing in old versions of libiptc. In that case, they will be
2561 # declared in the iptables plugin.
2562 if test "x$with_libiptc" = "xpkgconfig"
2564 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2566 # Check for the iptc_init symbol in the library.
2567 # This could be in iptc or ip4tc
2568 if test "x$with_libiptc" = "xpkgconfig"
2571 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2572 [with_libiptc="pkgconfig"],
2573 [with_libiptc="no"],
2574 [$with_libiptc_libs])
2577 if test "x$with_libiptc" = "xpkgconfig"
2582 CPPFLAGS="$SAVE_CPPFLAGS"
2584 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2585 if test "x$with_libiptc" = "xyes"
2587 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2588 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2589 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2590 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2594 # --with-libdpdk {{{
2595 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2597 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2598 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2600 AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])])
2602 if test "x$with_libdpdk" != "xno"
2604 SAVE_CPPFLAGS="$CPPFLAGS"
2605 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2606 AC_CHECK_HEADERS([rte_config.h],
2607 [with_libdpdk="yes"],
2608 [with_libdpdk="no (rte_config.h not found)"]
2610 CPPFLAGS="$SAVE_CPPFLAGS"
2613 if test "x$with_libdpdk" = "xyes"
2615 SAVE_LDFLAGS="$LDFLAGS"
2616 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2617 AC_CHECK_LIB([dpdk], [rte_eal_init],
2618 [with_libdpkd="yes"],
2619 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2621 LDFLAGS="$SAVE_LDFLAGS"
2627 with_java_home="$JAVA_HOME"
2628 if test "x$with_java_home" = "x"
2630 with_java_home="/usr/lib/jvm"
2634 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2636 if test "x$withval" = "xno"
2639 else if test "x$withval" = "xyes"
2643 with_java_home="$withval"
2648 if test "x$with_java" = "xyes"
2650 if test -d "$with_java_home"
2652 AC_MSG_CHECKING([for jni.h])
2653 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2654 if test "x$TMPVAR" != "x"
2656 AC_MSG_RESULT([found in $TMPVAR])
2657 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2659 AC_MSG_RESULT([not found])
2662 AC_MSG_CHECKING([for jni_md.h])
2663 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2664 if test "x$TMPVAR" != "x"
2666 AC_MSG_RESULT([found in $TMPVAR])
2667 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2669 AC_MSG_RESULT([not found])
2672 AC_MSG_CHECKING([for libjvm.so])
2673 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2674 if test "x$TMPVAR" != "x"
2676 AC_MSG_RESULT([found in $TMPVAR])
2677 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2679 AC_MSG_RESULT([not found])
2682 if test "x$JAVAC" = "x"
2684 AC_MSG_CHECKING([for javac])
2685 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2686 if test "x$TMPVAR" != "x"
2689 AC_MSG_RESULT([$JAVAC])
2691 AC_MSG_RESULT([not found])
2694 if test "x$JAR" = "x"
2696 AC_MSG_CHECKING([for jar])
2697 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2698 if test "x$TMPVAR" != "x"
2701 AC_MSG_RESULT([$JAR])
2703 AC_MSG_RESULT([not found])
2706 else if test "x$with_java_home" != "x"
2708 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2712 if test "x$JAVA_CPPFLAGS" != "x"
2714 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2716 if test "x$JAVA_CFLAGS" != "x"
2718 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2720 if test "x$JAVA_LDFLAGS" != "x"
2722 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2724 if test "x$JAVA_LIBS" != "x"
2726 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2728 if test "x$JAVAC" = "x"
2730 with_javac_path="$PATH"
2731 if test "x$with_java_home" != "x"
2733 with_javac_path="$with_java_home:with_javac_path"
2734 if test -d "$with_java_home/bin"
2736 with_javac_path="$with_java_home/bin:with_javac_path"
2740 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2742 if test "x$JAVAC" = "x"
2744 with_java="no (javac not found)"
2746 if test "x$JAR" = "x"
2748 with_jar_path="$PATH"
2749 if test "x$with_java_home" != "x"
2751 with_jar_path="$with_java_home:$with_jar_path"
2752 if test -d "$with_java_home/bin"
2754 with_jar_path="$with_java_home/bin:$with_jar_path"
2758 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2760 if test "x$JAR" = "x"
2762 with_java="no (jar not found)"
2765 SAVE_CPPFLAGS="$CPPFLAGS"
2766 SAVE_CFLAGS="$CFLAGS"
2767 SAVE_LDFLAGS="$LDFLAGS"
2769 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2770 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2771 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2772 LIBS="$LIBS $JAVA_LIBS"
2774 if test "x$with_java" = "xyes"
2776 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2778 if test "x$with_java" = "xyes"
2780 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2782 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2783 [$JAVA_LIBS $PTHREAD_LIBS])
2785 if test "x$with_java" = "xyes"
2787 JAVA_LIBS="$JAVA_LIBS -ljvm"
2788 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2791 CPPFLAGS="$SAVE_CPPFLAGS"
2792 CFLAGS="$SAVE_CFLAGS"
2793 LDFLAGS="$SAVE_LDFLAGS"
2796 AC_SUBST(JAVA_CPPFLAGS)
2797 AC_SUBST(JAVA_CFLAGS)
2798 AC_SUBST(JAVA_LDFLAGS)
2800 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2803 # --with-libldap {{{
2804 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2806 if test "x$withval" = "xyes"
2809 else if test "x$withval" = "xno"
2814 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2815 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2818 [with_libldap="yes"])
2820 SAVE_CPPFLAGS="$CPPFLAGS"
2821 SAVE_LDFLAGS="$LDFLAGS"
2823 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2824 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2826 if test "x$with_libldap" = "xyes"
2828 if test "x$LIBLDAP_CPPFLAGS" != "x"
2830 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2832 AC_CHECK_HEADERS(ldap.h,
2833 [with_libldap="yes"],
2834 [with_libldap="no ('ldap.h' not found)"])
2836 if test "x$with_libldap" = "xyes"
2838 if test "x$LIBLDAP_LDFLAGS" != "x"
2840 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2842 AC_CHECK_LIB(ldap, ldap_initialize,
2843 [with_libldap="yes"],
2844 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2848 CPPFLAGS="$SAVE_CPPFLAGS"
2849 LDFLAGS="$SAVE_LDFLAGS"
2851 if test "x$with_libldap" = "xyes"
2853 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2854 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2855 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2856 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
2858 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
2862 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
2863 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
2865 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
2866 [with_liblua="yes"],
2870 PKG_CHECK_MODULES([LUA], [lua],
2871 [with_liblua="yes"],
2873 PKG_CHECK_MODULES([LUA], [lua-5.3],
2874 [with_liblua="yes"],
2876 PKG_CHECK_MODULES([LUA], [lua5.3],
2877 [with_liblua="yes"],
2879 PKG_CHECK_MODULES([LUA], [lua-5.2],
2880 [with_liblua="yes"],
2882 PKG_CHECK_MODULES([LUA], [lua5.2],
2883 [with_liblua="yes"],
2885 PKG_CHECK_MODULES([LUA], [lua-5.1],
2886 [with_liblua="yes"],
2888 PKG_CHECK_MODULES([LUA], [lua5.1],
2889 [with_liblua="yes"],
2890 [with_liblua="no (pkg-config cannot find liblua)"]
2906 if test "x$with_liblua" = "xyes"
2908 SAVE_CPPFLAGS="$CPPFLAGS"
2909 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
2911 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
2912 [with_liblua="yes"],
2913 [with_liblua="no (header not found)"]
2916 CPPFLAGS="$SAVE_CPPFLAGS"
2919 if test "x$with_liblua" = "xyes"
2922 LIBS="$LIBS $LUA_LIBS"
2924 AC_CHECK_FUNC([lua_settop],
2925 [with_liblua="yes"],
2926 [with_liblua="no (symbol 'lua_settop' not found)"]
2932 if test "x$with_liblua" = "xyes"
2934 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
2935 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
2937 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
2938 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
2941 # --with-liblvm2app {{{
2942 with_liblvm2app_cppflags=""
2943 with_liblvm2app_ldflags=""
2944 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2946 if test "x$withval" = "xno"
2948 with_liblvm2app="no"
2950 with_liblvm2app="yes"
2951 if test "x$withval" != "xyes"
2953 with_liblvm2app_cppflags="-I$withval/include"
2954 with_liblvm2app_ldflags="-L$withval/lib"
2959 if test "x$ac_system" = "xLinux"
2961 with_liblvm2app="yes"
2963 with_liblvm2app="no (Linux only library)"
2966 if test "x$with_liblvm2app" = "xyes"
2968 SAVE_CPPFLAGS="$CPPFLAGS"
2969 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2971 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2973 CPPFLAGS="$SAVE_CPPFLAGS"
2976 if test "x$with_liblvm2app" = "xyes"
2978 SAVE_CPPFLAGS="$CPPFLAGS"
2979 SAVE_LDFLAGS="$LDFLAGS"
2980 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2981 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2983 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
2985 CPPFLAGS="$SAVE_CPPFLAGS"
2986 LDFLAGS="$SAVE_LDFLAGS"
2988 if test "x$with_liblvm2app" = "xyes"
2990 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2991 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2992 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2993 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2994 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2995 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2996 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2998 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3001 # --with-libmemcached {{{
3002 with_libmemcached_cppflags=""
3003 with_libmemcached_ldflags=""
3004 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3006 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3008 with_libmemcached_cppflags="-I$withval/include"
3009 with_libmemcached_ldflags="-L$withval/lib"
3010 with_libmemcached="yes"
3012 with_libmemcached="$withval"
3016 with_libmemcached="yes"
3018 if test "x$with_libmemcached" = "xyes"
3020 SAVE_CPPFLAGS="$CPPFLAGS"
3021 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3023 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3025 CPPFLAGS="$SAVE_CPPFLAGS"
3027 if test "x$with_libmemcached" = "xyes"
3029 SAVE_CPPFLAGS="$CPPFLAGS"
3030 SAVE_LDFLAGS="$LDFLAGS"
3031 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3032 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3034 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3036 CPPFLAGS="$SAVE_CPPFLAGS"
3037 LDFLAGS="$SAVE_LDFLAGS"
3039 if test "x$with_libmemcached" = "xyes"
3041 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3042 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3043 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3044 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3045 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3046 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3047 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3049 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3052 # --with-libmicrohttpd {{{
3053 with_libmicrohttpd_cppflags=""
3054 with_libmicrohttpd_ldflags=""
3055 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3057 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3059 with_libmicrohttpd_cppflags="-I$withval/include"
3060 with_libmicrohttpd_ldflags="-L$withval/lib"
3061 with_libmicrohttpd="yes"
3063 if test "x$withval" = "xno"
3065 with_libmicrohttpd="no (disabled on command line)"
3070 if test "x$withval" = "xyes"
3072 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3073 [with_libmicrohttpd="yes"],
3074 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3078 if test "x$MICROHTTPD_LIBS" = "x"
3080 MICROHTTPD_LIBS="-lmicrohttpd"
3083 SAVE_CPPFLAGS="$CPPFLAGS"
3084 SAVE_LDFLAGS="$LDFLAGS"
3086 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3087 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3088 LIBS="$LIBS $MICROHTTPD_LIBS"
3090 if test "x$with_libmicrohttpd" = "xyes"
3092 AC_CHECK_HEADERS([microhttpd.h],
3093 [with_libmicrohttpd="yes"],
3094 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3097 if test "x$with_libmicrohttpd" = "xyes"
3099 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3100 [with_libmicrohttpd="yes"],
3101 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3104 CPPFLAGS="$SAVE_CPPFLAGS"
3105 LDFLAGS="$SAVE_LDFLAGS"
3108 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3109 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3110 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3111 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3112 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3113 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3116 # --with-libmodbus {{{
3117 with_libmodbus_config=""
3118 with_libmodbus_cflags=""
3119 with_libmodbus_libs=""
3120 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3122 if test "x$withval" = "xno"
3125 else if test "x$withval" = "xyes"
3127 with_libmodbus="use_pkgconfig"
3128 else if test -d "$with_libmodbus/lib"
3130 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3131 with_libmodbus_cflags="-I$withval/include"
3132 with_libmodbus_libs="-L$withval/lib -lmodbus"
3133 with_libmodbus="yes"
3136 [with_libmodbus="use_pkgconfig"])
3138 # configure using pkg-config
3139 if test "x$with_libmodbus" = "xuse_pkgconfig"
3141 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3142 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3145 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3148 if test "x$with_libmodbus" = "xuse_pkgconfig"
3150 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3153 with_libmodbus="no ($PKG_CONFIG failed)"
3155 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3158 with_libmodbus="no ($PKG_CONFIG failed)"
3161 if test "x$with_libmodbus" = "xuse_pkgconfig"
3163 with_libmodbus="yes"
3166 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3167 # the actual checks.
3168 if test "x$with_libmodbus" = "xyes"
3170 SAVE_CPPFLAGS="$CPPFLAGS"
3171 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3173 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3175 CPPFLAGS="$SAVE_CPPFLAGS"
3177 if test "x$with_libmodbus" = "xyes"
3179 SAVE_CPPFLAGS="$CPPFLAGS"
3180 SAVE_LDFLAGS="$LDFLAGS"
3182 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3183 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3185 AC_CHECK_LIB(modbus, modbus_connect,
3186 [with_libmodbus="yes"],
3187 [with_libmodbus="no (symbol modbus_connect not found)"])
3189 CPPFLAGS="$SAVE_CPPFLAGS"
3190 LDFLAGS="$SAVE_LDFLAGS"
3192 if test "x$with_libmodbus" = "xyes"
3194 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3195 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3196 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3197 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3201 # --with-libmongoc {{{
3202 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3204 if test "x$withval" = "xyes"
3206 with_libmongoc="yes"
3207 else if test "x$withval" = "xno"
3211 with_libmongoc="yes"
3212 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3213 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3216 [with_libmongoc="yes"])
3218 SAVE_CPPFLAGS="$CPPFLAGS"
3219 SAVE_LDFLAGS="$LDFLAGS"
3221 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3222 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3224 if test "x$with_libmongoc" = "xyes"
3226 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3228 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3230 AC_CHECK_HEADERS(mongo.h,
3231 [with_libmongoc="yes"],
3232 [with_libmongoc="no ('mongo.h' not found)"],
3234 # define MONGO_HAVE_STDINT 1
3236 # define MONGO_USE_LONG_LONG_INT 1
3240 if test "x$with_libmongoc" = "xyes"
3242 if test "x$LIBMONGOC_LDFLAGS" != "x"
3244 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3246 AC_CHECK_LIB(mongoc, mongo_run_command,
3247 [with_libmongoc="yes"],
3248 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3251 CPPFLAGS="$SAVE_CPPFLAGS"
3252 LDFLAGS="$SAVE_LDFLAGS"
3254 if test "x$with_libmongoc" = "xyes"
3256 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3257 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3258 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3259 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3261 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3264 # --with-libmosquitto {{{
3265 with_libmosquitto_cppflags=""
3266 with_libmosquitto_ldflags=""
3267 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3269 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3271 with_libmosquitto_cppflags="-I$withval/include"
3272 with_libmosquitto_ldflags="-L$withval/lib"
3273 with_libmosquitto="yes"
3275 with_libmosquitto="$withval"
3279 with_libmosquitto="yes"
3281 if test "x$with_libmosquitto" = "xyes"
3283 SAVE_CPPFLAGS="$CPPFLAGS"
3284 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3286 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3288 CPPFLAGS="$SAVE_CPPFLAGS"
3290 if test "x$with_libmosquitto" = "xyes"
3292 SAVE_LDFLAGS="$LDFLAGS"
3293 SAVE_CPPFLAGS="$CPPFLAGS"
3294 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3295 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3297 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3299 LDFLAGS="$SAVE_LDFLAGS"
3300 CPPFLAGS="$SAVE_CPPFLAGS"
3302 if test "x$with_libmosquitto" = "xyes"
3304 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3305 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3306 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3307 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3308 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3309 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3313 # --with-libmysql {{{
3314 with_mysql_config="mysql_config"
3315 with_mysql_cflags=""
3317 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3319 if test "x$withval" = "xno"
3322 else if test "x$withval" = "xyes"
3326 if test -f "$withval" && test -x "$withval";
3328 with_mysql_config="$withval"
3329 else if test -x "$withval/bin/mysql_config"
3331 with_mysql_config="$withval/bin/mysql_config"
3339 if test "x$with_libmysql" = "xyes"
3341 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3342 mysql_config_status=$?
3344 if test $mysql_config_status -ne 0
3346 with_libmysql="no ($with_mysql_config failed)"
3348 SAVE_CPPFLAGS="$CPPFLAGS"
3349 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3352 have_mysql_mysql_h="no"
3353 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3355 if test "x$have_mysql_h" = "xno"
3357 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3360 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3362 with_libmysql="no (mysql.h not found)"
3365 CPPFLAGS="$SAVE_CPPFLAGS"
3368 if test "x$with_libmysql" = "xyes"
3370 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3371 mysql_config_status=$?
3373 if test $mysql_config_status -ne 0
3375 with_libmysql="no ($with_mysql_config failed)"
3377 SAVE_CPPFLAGS="$CPPFLAGS"
3378 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3380 LIBS="$with_mysql_libs"
3381 AC_SEARCH_LIBS([mysql_get_server_version],
3383 [with_libmysql="yes"],
3384 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3386 CPPFLAGS="$SAVE_CPPFLAGS"
3390 if test "x$with_libmysql" = "xyes"
3392 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3393 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3394 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3395 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3397 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3401 with_libmnl_cflags=""
3403 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3405 echo "libmnl: withval = $withval"
3406 if test "x$withval" = "xyes"
3409 else if test "x$withval" = "xno"
3413 if test -d "$withval/include"
3415 with_libmnl_cflags="-I$withval/include"
3416 with_libmnl_libs="-L$withval/lib -lmnl"
3419 AC_MSG_ERROR("no such directory: $withval/include")
3424 if test "x$ac_system" = "xLinux"
3428 with_libmnl="no (Linux only library)"
3431 if test "x$with_libmnl" = "xyes"
3433 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3434 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3435 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3438 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3444 #include <sys/types.h>
3445 #include <asm/types.h>
3446 #include <sys/socket.h>
3447 #include <linux/netlink.h>
3448 #include <linux/rtnetlink.h>])
3449 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3451 #include <sys/types.h>
3452 #include <asm/types.h>
3453 #include <sys/socket.h>])
3455 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3458 #include <sys/types.h>
3459 #include <asm/types.h>
3460 #include <sys/socket.h>
3461 #include <linux/netlink.h>
3462 #include <linux/rtnetlink.h>
3465 int retval = TCA_STATS2;
3469 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3471 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3474 #include <sys/types.h>
3475 #include <asm/types.h>
3476 #include <sys/socket.h>
3477 #include <linux/netlink.h>
3478 #include <linux/rtnetlink.h>
3481 int retval = TCA_STATS;
3485 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3487 if test "x$with_libmnl" = "xyes"
3489 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3490 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3493 #include <linux/if_link.h>
3496 if test "x$with_libmnl" = "xyes"
3498 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3499 [with_libmnl="yes"],
3500 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3501 [$with_libmnl_libs])
3503 if test "x$with_libmnl" = "xyes"
3505 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3506 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3507 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3508 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3509 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3511 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3514 # --with-libnetapp {{{
3515 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3516 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3517 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3518 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3519 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3520 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3521 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3523 if test -d "$withval"
3525 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3526 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3527 with_libnetapp="yes"
3529 with_libnetapp="$withval"
3533 with_libnetapp="yes"
3536 SAVE_CPPFLAGS="$CPPFLAGS"
3537 SAVE_LDFLAGS="$LDFLAGS"
3538 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3539 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3541 if test "x$with_libnetapp" = "xyes"
3543 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3545 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3547 AC_CHECK_HEADERS(netapp_api.h,
3548 [with_libnetapp="yes"],
3549 [with_libnetapp="no (netapp_api.h not found)"])
3552 if test "x$with_libnetapp" = "xyes"
3554 if test "x$LIBNETAPP_LDFLAGS" != "x"
3556 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3559 if test "x$LIBNETAPP_LIBS" = "x"
3561 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3563 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3565 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3566 [with_libnetapp="yes"],
3567 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3569 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3572 CPPFLAGS="$SAVE_CPPFLAGS"
3573 LDFLAGS="$SAVE_LDFLAGS"
3575 if test "x$with_libnetapp" = "xyes"
3577 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3580 AC_SUBST(LIBNETAPP_CPPFLAGS)
3581 AC_SUBST(LIBNETAPP_LDFLAGS)
3582 AC_SUBST(LIBNETAPP_LIBS)
3583 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3586 # --with-libnetsnmp {{{
3587 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3589 if test "x$withval" = "xno"
3591 with_libnetsnmp="no"
3592 else if test "x$withval" = "xyes"
3594 with_libnetsnmp="yes"
3596 with_libnetsnmp_cppflags="-I$withval/include"
3597 with_libnetsnmp_ldflags="-I$withval/lib"
3598 with_libnetsnmp="yes"
3601 [with_libnetsnmp="yes"])
3602 if test "x$with_libnetsnmp" = "xyes"
3604 SAVE_CPPFLAGS="$CPPFLAGS"
3605 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3607 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3609 CPPFLAGS="$SAVE_CPPFLAGS"
3611 if test "x$with_libnetsnmp" = "xyes"
3613 SAVE_LDFLAGS="$LDFLAGS"
3614 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3616 AC_CHECK_LIB(netsnmp, init_snmp,
3617 [with_libnetsnmp="yes"],
3618 [with_libnetsnmp="no (libnetsnmp not found)"],
3621 LDFLAGS="$SAVE_LDFLAGS"
3623 if test "x$with_libnetsnmp" = "xyes"
3625 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3626 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3627 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3629 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3630 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3631 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3634 # --with-liboconfig {{{
3635 with_own_liboconfig="no"
3636 liboconfig_LDFLAGS="$LDFLAGS"
3637 liboconfig_CPPFLAGS="$CPPFLAGS"
3638 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3640 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3642 if test -d "$withval/lib"
3644 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3646 if test -d "$withval/include"
3648 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3651 if test "x$withval" = "xno"
3653 AC_MSG_ERROR("liboconfig is required")
3657 with_liboconfig="yes"
3660 save_LDFLAGS="$LDFLAGS"
3661 save_CPPFLAGS="$CPPFLAGS"
3662 LDFLAGS="$liboconfig_LDFLAGS"
3663 CPPFLAGS="$liboconfig_CPPFLAGS"
3664 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3666 with_liboconfig="yes"
3667 with_own_liboconfig="no"
3670 with_liboconfig="yes"
3671 with_own_liboconfig="yes"
3672 LDFLAGS="$save_LDFLAGS"
3673 CPPFLAGS="$save_CPPFLAGS"
3676 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3677 if test "x$with_own_liboconfig" = "xyes"
3679 with_liboconfig="yes (shipped version)"
3683 # --with-liboping {{{
3684 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3686 if test "x$withval" = "xyes"
3689 else if test "x$withval" = "xno"
3694 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3695 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3698 [with_liboping="yes"])
3700 SAVE_CPPFLAGS="$CPPFLAGS"
3701 SAVE_LDFLAGS="$LDFLAGS"
3703 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3704 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3706 if test "x$with_liboping" = "xyes"
3708 if test "x$LIBOPING_CPPFLAGS" != "x"
3710 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3712 AC_CHECK_HEADERS(oping.h,
3713 [with_liboping="yes"],
3714 [with_liboping="no (oping.h not found)"])
3716 if test "x$with_liboping" = "xyes"
3718 if test "x$LIBOPING_LDFLAGS" != "x"
3720 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3722 AC_CHECK_LIB(oping, ping_construct,
3723 [with_liboping="yes"],
3724 [with_liboping="no (symbol 'ping_construct' not found)"])
3727 CPPFLAGS="$SAVE_CPPFLAGS"
3728 LDFLAGS="$SAVE_LDFLAGS"
3730 if test "x$with_liboping" = "xyes"
3732 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3733 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3734 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3735 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3737 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3741 with_oracle_cppflags=""
3743 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3745 if test "x$withval" = "xyes"
3747 if test "x$ORACLE_HOME" = "x"
3749 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3752 else if test "x$withval" = "xno"
3757 ORACLE_HOME="$withval"
3761 if test "x$ORACLE_HOME" = "x"
3763 with_oracle="no (ORACLE_HOME is not set)"
3768 if test "x$ORACLE_HOME" != "x"
3770 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3772 if test -e "$ORACLE_HOME/lib/ldflags"
3774 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3776 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3777 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3779 if test "x$with_oracle" = "xyes"
3781 SAVE_CPPFLAGS="$CPPFLAGS"
3782 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3784 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3786 CPPFLAGS="$SAVE_CPPFLAGS"
3788 if test "x$with_oracle" = "xyes"
3790 SAVE_CPPFLAGS="$CPPFLAGS"
3792 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3793 LIBS="$LIBS $with_oracle_libs"
3795 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3797 CPPFLAGS="$SAVE_CPPFLAGS"
3800 if test "x$with_oracle" = "xyes"
3802 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3803 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3804 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3805 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3809 # --with-libowcapi {{{
3810 with_libowcapi_cppflags=""
3811 with_libowcapi_ldflags=""
3812 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3814 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3816 with_libowcapi_cppflags="-I$withval/include"
3817 with_libowcapi_ldflags="-L$withval/lib"
3818 with_libowcapi="yes"
3820 with_libowcapi="$withval"
3824 with_libowcapi="yes"
3826 if test "x$with_libowcapi" = "xyes"
3828 SAVE_CPPFLAGS="$CPPFLAGS"
3829 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3831 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3833 CPPFLAGS="$SAVE_CPPFLAGS"
3835 if test "x$with_libowcapi" = "xyes"
3837 SAVE_LDFLAGS="$LDFLAGS"
3838 SAVE_CPPFLAGS="$CPPFLAGS"
3839 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3840 CPPFLAGS="$with_libowcapi_cppflags"
3842 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3844 LDFLAGS="$SAVE_LDFLAGS"
3845 CPPFLAGS="$SAVE_CPPFLAGS"
3847 if test "x$with_libowcapi" = "xyes"
3849 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3850 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3851 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3852 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3853 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3854 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3858 # --with-libpcap {{{
3859 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3861 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3863 LDFLAGS="$LDFLAGS -L$withval/lib"
3864 CPPFLAGS="$CPPFLAGS -I$withval/include"
3867 with_libpcap="$withval"
3873 if test "x$with_libpcap" = "xyes"
3875 AC_CHECK_LIB(pcap, pcap_open_live,
3877 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3878 ], [with_libpcap="no (libpcap not found)"])
3880 if test "x$with_libpcap" = "xyes"
3882 AC_CHECK_HEADERS(pcap.h,,
3883 [with_libpcap="no (pcap.h not found)"])
3885 if test "x$with_libpcap" = "xyes"
3887 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3888 [c_cv_libpcap_have_pcap_error_iface_not_up],
3889 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3894 int val = PCAP_ERROR_IFACE_NOT_UP;
3898 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3899 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3901 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3903 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3905 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3908 # --with-libperl {{{
3909 perl_interpreter="perl"
3910 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3912 if test -f "$withval" && test -x "$withval"
3914 perl_interpreter="$withval"
3916 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3918 LDFLAGS="$LDFLAGS -L$withval/lib"
3919 CPPFLAGS="$CPPFLAGS -I$withval/include"
3920 perl_interpreter="$withval/bin/perl"
3923 with_libperl="$withval"
3930 AC_MSG_CHECKING([for perl])
3931 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3932 if test -x "$perl_interpreter"
3934 AC_MSG_RESULT([yes ($perl_interpreter)])
3940 AC_SUBST(PERL, "$perl_interpreter")
3942 if test "x$with_libperl" = "xyes" \
3943 && test -n "$perl_interpreter"
3945 SAVE_CFLAGS="$CFLAGS"
3947 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3948 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
3949 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3950 CFLAGS="$CFLAGS $PERL_CFLAGS"
3951 LIBS="$LIBS $PERL_LIBS"
3953 AC_CACHE_CHECK([for libperl],
3954 [c_cv_have_libperl],
3955 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3957 #define PERL_NO_GET_CONTEXT
3964 load_module (PERL_LOADMOD_NOIMPORT,
3965 newSVpv ("Collectd::Plugin::FooBar", 24),
3969 [c_cv_have_libperl="yes"],
3970 [c_cv_have_libperl="no"]
3974 if test "x$c_cv_have_libperl" = "xyes"
3976 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3977 AC_SUBST(PERL_CFLAGS)
3983 CFLAGS="$SAVE_CFLAGS"
3985 else if test -z "$perl_interpreter"; then
3986 with_libperl="no (no perl interpreter found)"
3987 c_cv_have_libperl="no"
3989 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3991 if test "x$with_libperl" = "xyes"
3993 SAVE_CFLAGS="$CFLAGS"
3995 CFLAGS="$CFLAGS $PERL_CFLAGS"
3996 LIBS="$LIBS $PERL_LIBS"
3998 AC_CACHE_CHECK([if perl supports ithreads],
3999 [c_cv_have_perl_ithreads],
4000 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4006 #if !defined(USE_ITHREADS)
4007 # error "Perl does not support ithreads!"
4008 #endif /* !defined(USE_ITHREADS) */
4012 [c_cv_have_perl_ithreads="yes"],
4013 [c_cv_have_perl_ithreads="no"]
4017 if test "x$c_cv_have_perl_ithreads" = "xyes"
4019 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4022 CFLAGS="$SAVE_CFLAGS"
4026 if test "x$with_libperl" = "xyes"
4028 SAVE_CFLAGS="$CFLAGS"
4030 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4031 # (see issues #41 and #42)
4032 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4033 LIBS="$LIBS $PERL_LIBS"
4035 AC_CACHE_CHECK([for broken Perl_load_module()],
4036 [c_cv_have_broken_perl_load_module],
4037 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4039 #define PERL_NO_GET_CONTEXT
4046 load_module (PERL_LOADMOD_NOIMPORT,
4047 newSVpv ("Collectd::Plugin::FooBar", 24),
4051 [c_cv_have_broken_perl_load_module="no"],
4052 [c_cv_have_broken_perl_load_module="yes"]
4056 CFLAGS="$SAVE_CFLAGS"
4059 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4060 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4062 if test "x$with_libperl" = "xyes"
4064 SAVE_CFLAGS="$CFLAGS"
4066 CFLAGS="$CFLAGS $PERL_CFLAGS"
4067 LIBS="$LIBS $PERL_LIBS"
4070 [struct mgvtbl.svt_local],
4071 [have_struct_mgvtbl_svt_local="yes"],
4072 [have_struct_mgvtbl_svt_local="no"],
4079 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4081 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4082 [Define if Perl's struct mgvtbl has member svt_local.])
4085 CFLAGS="$SAVE_CFLAGS"
4091 with_pg_config="pg_config"
4092 with_libpq_includedir=""
4093 with_libpq_libdir=""
4094 with_libpq_cppflags=""
4095 with_libpq_ldflags=""
4096 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4099 if test "x$withval" = "xno"
4102 else if test "x$withval" = "xyes"
4106 if test -f "$withval" && test -x "$withval";
4108 with_pg_config="$withval"
4109 else if test -x "$withval/bin/pg_config"
4111 with_pg_config="$withval/bin/pg_config"
4119 if test "x$with_libpq" = "xyes"
4121 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4124 if test $pg_config_status -eq 0
4126 if test -n "$with_libpq_includedir"; then
4127 for dir in $with_libpq_includedir; do
4128 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4132 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4135 SAVE_CPPFLAGS="$CPPFLAGS"
4136 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4138 AC_CHECK_HEADERS(libpq-fe.h, [],
4139 [with_libpq="no (libpq-fe.h not found)"], [])
4141 CPPFLAGS="$SAVE_CPPFLAGS"
4143 if test "x$with_libpq" = "xyes"
4145 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4148 if test $pg_config_status -eq 0
4150 if test -n "$with_libpq_libdir"; then
4151 for dir in $with_libpq_libdir; do
4152 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4156 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4159 SAVE_LDFLAGS="$LDFLAGS"
4160 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4162 AC_CHECK_LIB(pq, PQconnectdb,
4164 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4166 AC_CHECK_LIB(pq, PQserverVersion,
4168 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4170 LDFLAGS="$SAVE_LDFLAGS"
4172 if test "x$with_libpq" = "xyes"
4174 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4175 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4176 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4177 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4179 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4182 # --with-libpqos {{{
4183 with_libpqos_cppflags=""
4184 with_libpqos_ldflags=""
4185 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4187 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4189 with_libpqos_cppflags="-I$withval/include"
4190 with_libpqos_ldflags="-L$withval/lib"
4193 with_libpqos="$withval"
4199 if test "x$with_libpqos" = "xyes"
4201 SAVE_CPPFLAGS="$CPPFLAGS"
4202 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4204 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4206 CPPFLAGS="$SAVE_CPPFLAGS"
4208 if test "x$with_libpqos" = "xyes"
4210 SAVE_CPPFLAGS="$CPPFLAGS"
4211 SAVE_LDFLAGS="$LDFLAGS"
4212 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4213 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4215 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4217 CPPFLAGS="$SAVE_CPPFLAGS"
4218 LDFLAGS="$SAVE_LDFLAGS"
4220 if test "x$with_libpqos" = "xyes"
4222 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4223 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4224 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4225 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4226 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4227 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4231 # --with-libprotobuf {{{
4232 with_libprotobuf_cppflags=""
4233 with_libprotobuf_ldflags=""
4234 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4236 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4238 with_libprotobuf_cppflags="-I$withval/include"
4239 with_libprotobuf_ldflags="-L$withval/lib"
4240 with_libprotobuf="yes"
4242 if test "x$withval" = "xno"
4244 with_libprotobuf="no (disabled on command line)"
4249 if test "x$withval" = "xyes"
4251 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4252 [with_libprotobuf="yes"],
4253 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4257 if test "x$withval" != "xno"
4259 SAVE_LDFLAGS="$LDFLAGS"
4261 LDFLAGS="$with_libprotobuf_ldflags"
4262 LIBS="$PROTOBUF_LIBS $LIBS"
4264 AC_CHECK_LIB([protobuf], [main],
4266 SAVE_CPPFLAGS="$CPPFLAGS"
4267 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4268 if test "x$PROTOBUF_LIBS" = "x"
4270 PROTOBUF_LIBS="-lprotobuf"
4272 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4273 [with_libprotobuf="yes"],
4274 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4276 CPPFLAGS="$SAVE_CPPFLAGS"
4278 [with_libprotobuf="no (libprotobuf not found)"]
4281 LDFLAGS="$SAVE_LDFLAGS"
4284 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4285 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4286 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4287 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4288 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4289 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4292 # --with-libprotobuf-c {{{
4293 with_libprotobuf_c_cppflags=""
4294 with_libprotobuf_c_ldflags=""
4295 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4297 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4299 with_libprotobuf_c_cppflags="-I$withval/include"
4300 with_libprotobuf_c_ldflags="-L$withval/lib"
4301 with_libprotobuf_c="yes"
4303 if test "x$withval" = "xno"
4305 with_libprotobuf_c="no (disabled on command line)"
4310 if test "x$withval" = "xyes"
4312 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4313 [with_libprotobuf_c="yes"],
4314 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4318 if test "x$withval" != "xno"
4320 SAVE_LDFLAGS="$LDFLAGS"
4322 LDFLAGS="$with_libprotobuf_c_ldflags"
4323 LIBS="$PROTOBUF_C_LIBS $LIBS"
4324 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4326 SAVE_CPPFLAGS="$CPPFLAGS"
4327 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4328 if test "x$PROTOBUF_C_LIBS" = "x"
4330 PROTOBUF_C_LIBS="-lprotobuf-c"
4332 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4334 with_libprotobuf_c="yes"
4337 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4339 CPPFLAGS="$SAVE_CPPFLAGS"
4341 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4343 LDFLAGS="$SAVE_LDFLAGS"
4346 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4347 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4348 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4349 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4350 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4351 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4354 # --with-libpython {{{
4355 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4356 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4357 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4359 AC_ARG_WITH([libpython],
4360 [AS_HELP_STRING([--with-libpython],
4361 [if we should build with libpython @<:@default=yes@:>@])
4363 [with_libpython="$withval"],
4364 [with_libpython="check"]
4366 if test "$with_libpython" != "no"; then
4367 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4368 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4369 AC_PATH_PROGS([PYTHON_CONFIG],
4370 [python3-config python2-config python-config]
4372 if test "$PYTHON_CONFIG" = ""; then
4373 if test "$with_libpython" = "yes"; then
4374 AC_MSG_ERROR([Unable to find python-config])
4381 if test "$PYTHON_CONFIG" != ""; then
4382 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4383 if test $? -ne 0; then
4386 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4387 if test $? -ne 0; then
4390 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4391 if test $? -ne 0; then
4396 if test "$with_libpython" != "xno"; then
4397 SAVE_CPPFLAGS="$CPPFLAGS"
4398 SAVE_LDFLAGS="$LDFLAGS"
4400 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4401 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4402 LIBS="$LIBPYTHON_LIBS $LIBS"
4403 AC_CHECK_HEADERS([Python.h],
4405 AC_MSG_CHECKING([for libpython])
4406 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4407 [[#include <Python.h>]],
4408 [[Py_Initialize();]])
4410 [with_libpython="yes"],
4411 [with_libpython="no"]
4413 AC_MSG_RESULT([$with_libpython])
4415 [with_libpython="no"]
4417 CPPFLAGS="$SAVE_CPPFLAGS"
4418 LDFLAGS="$SAVE_LDFLAGS"
4421 # }}} --with-libpython
4423 # --with-librabbitmq {{{
4424 with_librabbitmq_cppflags=""
4425 with_librabbitmq_ldflags=""
4426 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4428 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4430 with_librabbitmq_cppflags="-I$withval/include"
4431 with_librabbitmq_ldflags="-L$withval/lib"
4432 with_librabbitmq="yes"
4434 with_librabbitmq="$withval"
4438 with_librabbitmq="yes"
4440 SAVE_CPPFLAGS="$CPPFLAGS"
4441 SAVE_LDFLAGS="$LDFLAGS"
4442 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4443 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4444 if test "x$with_librabbitmq" = "xyes"
4446 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4448 if test "x$with_librabbitmq" = "xyes"
4450 # librabbitmq up to version 0.9.1 provides "library_errno", later
4451 # versions use "library_error". The library does not provide a version
4452 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4453 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4456 # include <stdlib.h>
4462 # include <stdint.h>
4465 # include <inttypes.h>
4470 if test "x$with_librabbitmq" = "xyes"
4472 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4474 if test "x$with_librabbitmq" = "xyes"
4476 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4477 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4478 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4479 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4480 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4481 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4482 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4484 CPPFLAGS="$SAVE_CPPFLAGS"
4485 LDFLAGS="$SAVE_LDFLAGS"
4486 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4488 with_amqp_tcp_socket="no"
4489 if test "x$with_librabbitmq" = "xyes"
4491 SAVE_CPPFLAGS="$CPPFLAGS"
4492 SAVE_LDFLAGS="$LDFLAGS"
4494 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4495 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4498 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4499 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4500 if test "x$with_amqp_tcp_socket" = "xyes"
4502 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4503 [Define if librabbitmq provides the new TCP socket interface.])
4506 AC_CHECK_DECLS(amqp_socket_close,
4507 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4510 #ifdef HAVE_AMQP_TCP_SOCKET_H
4511 # include <amqp_tcp_socket.h>
4513 #ifdef HAVE_AMQP_SOCKET_H
4514 # include <amqp_socket.h>
4518 CPPFLAGS="$SAVE_CPPFLAGS"
4519 LDFLAGS="$SAVE_LDFLAGS"
4524 # --with-librdkafka {{{
4525 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4527 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4529 with_librdkafka_cppflags="-I$withval/include"
4530 with_librdkafka_ldflags="-L$withval/lib"
4531 with_librdkafka_rpath="$withval/lib"
4532 with_librdkafka="yes"
4534 with_librdkafka="$withval"
4538 with_librdkafka="yes"
4540 SAVE_CPPFLAGS="$CPPFLAGS"
4541 SAVE_LDFLAGS="$LDFLAGS"
4543 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4544 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4546 if test "x$with_librdkafka" = "xyes"
4548 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4551 if test "x$with_librdkafka" = "xyes"
4553 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4554 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4555 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4557 if test "x$with_librdkafka" = "xyes"
4559 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4560 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4561 if test "x$with_librdkafka_rpath" != "x"
4563 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4565 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4567 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4568 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4569 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4570 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4571 if test "x$with_librdkafka_log_cb" = "xyes"
4573 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4574 else if test "x$with_librdkafka_logger" = "xyes"
4576 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4579 CPPFLAGS="$SAVE_CPPFLAGS"
4580 LDFLAGS="$SAVE_LDFLAGS"
4581 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4585 # --with-librouteros {{{
4586 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4588 if test "x$withval" = "xyes"
4590 with_librouteros="yes"
4591 else if test "x$withval" = "xno"
4593 with_librouteros="no"
4595 with_librouteros="yes"
4596 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4597 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4600 [with_librouteros="yes"])
4602 SAVE_CPPFLAGS="$CPPFLAGS"
4603 SAVE_LDFLAGS="$LDFLAGS"
4605 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4606 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4608 if test "x$with_librouteros" = "xyes"
4610 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4612 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4614 AC_CHECK_HEADERS(routeros_api.h,
4615 [with_librouteros="yes"],
4616 [with_librouteros="no (routeros_api.h not found)"])
4618 if test "x$with_librouteros" = "xyes"
4620 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4622 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4624 AC_CHECK_LIB(routeros, ros_interface,
4625 [with_librouteros="yes"],
4626 [with_librouteros="no (symbol 'ros_interface' not found)"])
4629 CPPFLAGS="$SAVE_CPPFLAGS"
4630 LDFLAGS="$SAVE_LDFLAGS"
4632 if test "x$with_librouteros" = "xyes"
4634 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4635 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4636 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4637 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4639 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4645 librrd_threadsafe="no"
4646 librrd_rrdc_update="no"
4648 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4650 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4652 librrd_cflags="-I$withval/include"
4653 librrd_ldflags="-L$withval/lib"
4656 with_librrd="$withval"
4662 if test "x$with_librrd" = "xyes"
4664 SAVE_LDFLAGS="$LDFLAGS"
4665 LDFLAGS="$LDFLAGS $librrd_ldflags"
4666 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4668 AC_CHECK_LIB([rrd], [rrd_update_r],
4669 [librrd_threadsafe="yes"],
4672 AC_CHECK_LIB([rrd], [rrdc_update],
4673 [librrd_rrdc_update="yes"],
4678 LDFLAGS="$SAVE_LDFLAGS"
4680 SAVE_CPPFLAGS="$CPPFLAGS"
4681 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4683 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4685 CPPFLAGS="$SAVE_CPPFLAGS"
4688 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4690 SAVE_LDFLAGS="$LDFLAGS"
4691 LDFLAGS="$LDFLAGS $librrd_ldflags"
4693 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4695 librrd_ldflags="$librrd_ldflags -lrrd_th"
4696 librrd_threadsafe="yes"
4697 AC_CHECK_LIB([rrd_th], [rrdc_update],
4698 [librrd_rrdc_update="yes"],
4704 LDFLAGS="$SAVE_LDFLAGS"
4707 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4709 SAVE_LDFLAGS="$LDFLAGS"
4710 LDFLAGS="$LDFLAGS $librrd_ldflags"
4712 AC_CHECK_LIB([rrd], [rrd_update],
4714 librrd_ldflags="$librrd_ldflags -lrrd"
4715 AC_CHECK_LIB([rrd], [rrdc_update],
4716 [librrd_rrdc_update="yes"],
4720 [with_librrd="no (symbol 'rrd_update' not found)"]
4722 LDFLAGS="$SAVE_LDFLAGS"
4725 if test "x$with_librrd" = "xyes"
4727 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4728 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4729 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4730 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4731 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4732 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4734 if test "x$librrd_threadsafe" = "xyes"
4736 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4737 [Define to 1 if the rrd library is thread-safe]
4742 # --with-libsensors {{{
4743 with_sensors_cflags=""
4744 with_sensors_ldflags=""
4745 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4747 if test "x$withval" = "xno"
4749 with_libsensors="no"
4751 with_libsensors="yes"
4752 if test "x$withval" != "xyes"
4754 with_sensors_cflags="-I$withval/include"
4755 with_sensors_ldflags="-L$withval/lib"
4756 with_libsensors="yes"
4761 if test "x$ac_system" = "xLinux"
4763 with_libsensors="yes"
4765 with_libsensors="no (Linux only library)"
4768 if test "x$with_libsensors" = "xyes"
4770 SAVE_CPPFLAGS="$CPPFLAGS"
4771 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4773 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4775 CPPFLAGS="$SAVE_CPPFLAGS"
4777 if test "x$with_libsensors" = "xyes"
4779 SAVE_CPPFLAGS="$CPPFLAGS"
4780 SAVE_LDFLAGS="$LDFLAGS"
4781 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4782 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4784 AC_CHECK_LIB(sensors, sensors_init,
4786 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4788 [with_libsensors="no (libsensors not found)"])
4790 CPPFLAGS="$SAVE_CPPFLAGS"
4791 LDFLAGS="$SAVE_LDFLAGS"
4793 if test "x$with_libsensors" = "xyes"
4795 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4796 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4797 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4798 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4800 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4804 AC_SUBST([LIBSIGROK_CFLAGS])
4805 AC_SUBST([LIBSIGROK_LIBS])
4806 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4807 [with_libsigrok="yes"],
4808 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4812 # --with-libstatgrab {{{
4813 with_libstatgrab_cflags=""
4814 with_libstatgrab_ldflags=""
4815 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4817 if test "x$withval" != "xno" \
4818 && test "x$withval" != "xyes"
4820 with_libstatgrab_cflags="-I$withval/include"
4821 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4822 with_libstatgrab="yes"
4823 with_libstatgrab_pkg_config="no"
4825 with_libstatgrab="$withval"
4826 with_libstatgrab_pkg_config="yes"
4830 with_libstatgrab="yes"
4831 with_libstatgrab_pkg_config="yes"
4834 if test "x$with_libstatgrab" = "xyes" \
4835 && test "x$with_libstatgrab_pkg_config" = "xyes"
4837 AC_MSG_CHECKING([pkg-config for libstatgrab])
4839 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4842 with_libstatgrab_pkg_config="no"
4843 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4844 temp_result="not found"
4846 AC_MSG_RESULT([$temp_result])
4849 if test "x$with_libstatgrab" = "xyes" \
4850 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4851 && test "x$with_libstatgrab_cflags" = "x"
4853 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4854 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4857 with_libstatgrab_cflags="$temp_result"
4859 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4860 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4862 AC_MSG_RESULT([$temp_result])
4865 if test "x$with_libstatgrab" = "xyes" \
4866 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4867 && test "x$with_libstatgrab_ldflags" = "x"
4869 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4870 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4873 with_libstatgrab_ldflags="$temp_result"
4875 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4876 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4878 AC_MSG_RESULT([$temp_result])
4881 if test "x$with_libstatgrab" = "xyes"
4883 SAVE_CPPFLAGS="$CPPFLAGS"
4884 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4886 AC_CHECK_HEADERS(statgrab.h,
4887 [with_libstatgrab="yes"],
4888 [with_libstatgrab="no (statgrab.h not found)"])
4890 CPPFLAGS="$SAVE_CPPFLAGS"
4893 if test "x$with_libstatgrab" = "xyes"
4895 SAVE_CFLAGS="$CFLAGS"
4896 SAVE_LDFLAGS="$LDFLAGS"
4898 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4899 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4901 AC_CHECK_LIB(statgrab, sg_init,
4902 [with_libstatgrab="yes"],
4903 [with_libstatgrab="no (symbol sg_init not found)"])
4905 CFLAGS="$SAVE_CFLAGS"
4906 LDFLAGS="$SAVE_LDFLAGS"
4909 if test "x$with_libstatgrab" = "xyes"
4911 SAVE_CFLAGS="$CFLAGS"
4912 SAVE_LDFLAGS="$LDFLAGS"
4915 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4916 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4917 LIBS="-lstatgrab $LIBS"
4919 AC_CACHE_CHECK([if libstatgrab >= 0.90],
4920 [c_cv_have_libstatgrab_0_90],
4921 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4924 #include <statgrab.h>
4927 if (sg_init()) return 0;
4930 [c_cv_have_libstatgrab_0_90="no"],
4931 [c_cv_have_libstatgrab_0_90="yes"]
4935 CFLAGS="$SAVE_CFLAGS"
4936 LDFLAGS="$SAVE_LDFLAGS"
4940 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4941 if test "x$with_libstatgrab" = "xyes"
4943 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4944 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4945 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4946 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4947 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4948 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
4950 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
4955 # --with-libtokyotyrant {{{
4956 with_libtokyotyrant_cppflags=""
4957 with_libtokyotyrant_ldflags=""
4958 with_libtokyotyrant_libs=""
4959 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4961 if test "x$withval" = "xno"
4963 with_libtokyotyrant="no"
4964 else if test "x$withval" = "xyes"
4966 with_libtokyotyrant="yes"
4968 with_libtokyotyrant_cppflags="-I$withval/include"
4969 with_libtokyotyrant_ldflags="-L$withval/include"
4970 with_libtokyotyrant_libs="-ltokyotyrant"
4971 with_libtokyotyrant="yes"
4975 with_libtokyotyrant="yes"
4978 if test "x$with_libtokyotyrant" = "xyes"
4980 if $PKG_CONFIG --exists tokyotyrant
4982 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4983 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4984 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4988 SAVE_CPPFLAGS="$CPPFLAGS"
4989 SAVE_LDFLAGS="$LDFLAGS"
4990 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4991 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4993 if test "x$with_libtokyotyrant" = "xyes"
4995 AC_CHECK_HEADERS(tcrdb.h,
4997 AC_DEFINE(HAVE_TCRDB_H, 1,
4998 [Define to 1 if you have the <tcrdb.h> header file.])
4999 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5002 if test "x$with_libtokyotyrant" = "xyes"
5004 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5006 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5007 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5009 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5010 [$with_libtokyotyrant_libs])
5013 CPPFLAGS="$SAVE_CPPFLAGS"
5014 LDFLAGS="$SAVE_LDFLAGS"
5016 if test "x$with_libtokyotyrant" = "xyes"
5018 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5019 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5020 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5021 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5022 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5023 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5025 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5028 # --with-libudev {{{
5029 with_libudev_cflags=""
5030 with_libudev_ldflags=""
5031 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5033 if test "x$withval" = "xno"
5038 if test "x$withval" != "xyes"
5040 with_libudev_cflags="-I$withval/include"
5041 with_libudev_ldflags="-L$withval/lib"
5047 if test "x$ac_system" = "xLinux"
5051 with_libudev="no (Linux only library)"
5054 if test "x$with_libudev" = "xyes"
5056 SAVE_CPPFLAGS="$CPPFLAGS"
5057 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5059 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5061 CPPFLAGS="$SAVE_CPPFLAGS"
5063 if test "x$with_libudev" = "xyes"
5065 SAVE_CPPFLAGS="$CPPFLAGS"
5066 SAVE_LDFLAGS="$LDFLAGS"
5067 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5068 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5070 AC_CHECK_LIB(udev, udev_new,
5072 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5074 [with_libudev="no (libudev not found)"])
5076 CPPFLAGS="$SAVE_CPPFLAGS"
5077 LDFLAGS="$SAVE_LDFLAGS"
5079 if test "x$with_libudev" = "xyes"
5081 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5082 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5083 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5084 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5085 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5086 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5088 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5091 # --with-libupsclient {{{
5092 with_libupsclient_config=""
5093 with_libupsclient_cflags=""
5094 with_libupsclient_libs=""
5095 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5097 if test "x$withval" = "xno"
5099 with_libupsclient="no"
5100 else if test "x$withval" = "xyes"
5102 with_libupsclient="use_pkgconfig"
5104 if test -x "$withval"
5106 with_libupsclient_config="$withval"
5107 with_libupsclient="use_libupsclient_config"
5108 else if test -x "$withval/bin/libupsclient-config"
5110 with_libupsclient_config="$withval/bin/libupsclient-config"
5111 with_libupsclient="use_libupsclient_config"
5113 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5114 with_libupsclient_cflags="-I$withval/include"
5115 with_libupsclient_libs="-L$withval/lib -lupsclient"
5116 with_libupsclient="yes"
5120 [with_libupsclient="use_pkgconfig"])
5122 # configure using libupsclient-config
5123 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5125 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5126 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5129 with_libupsclient="no ($with_libupsclient_config failed)"
5131 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5134 with_libupsclient="no ($with_libupsclient_config failed)"
5137 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5139 with_libupsclient="yes"
5142 # configure using pkg-config
5143 if test "x$with_libupsclient" = "xuse_pkgconfig"
5145 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5146 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5149 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5152 if test "x$with_libupsclient" = "xuse_pkgconfig"
5154 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5157 with_libupsclient="no ($PKG_CONFIG failed)"
5159 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5162 with_libupsclient="no ($PKG_CONFIG failed)"
5165 if test "x$with_libupsclient" = "xuse_pkgconfig"
5167 with_libupsclient="yes"
5170 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5171 # the actual checks.
5172 if test "x$with_libupsclient" = "xyes"
5174 SAVE_CPPFLAGS="$CPPFLAGS"
5175 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5177 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5179 CPPFLAGS="$SAVE_CPPFLAGS"
5181 if test "x$with_libupsclient" = "xyes"
5183 SAVE_CPPFLAGS="$CPPFLAGS"
5184 SAVE_LDFLAGS="$LDFLAGS"
5186 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5187 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5189 AC_CHECK_LIB(upsclient, upscli_connect,
5190 [with_libupsclient="yes"],
5191 [with_libupsclient="no (symbol upscli_connect not found)"])
5193 CPPFLAGS="$SAVE_CPPFLAGS"
5194 LDFLAGS="$SAVE_LDFLAGS"
5196 if test "x$with_libupsclient" = "xyes"
5198 SAVE_CPPFLAGS="$CPPFLAGS"
5199 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5201 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5202 [#include <stdlib.h>
5204 #include <upsclient.h>])
5206 CPPFLAGS="$SAVE_CPPFLAGS"
5208 if test "x$with_libupsclient" = "xyes"
5210 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5211 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5212 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5213 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5217 # --with-libxenctrl {{{
5218 with_libxenctrl_cppflags=""
5219 with_libxenctrl_ldflags=""
5220 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5222 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5224 with_libxenctrl_cppflags="-I$withval/include"
5225 with_libxenctrl_ldflags="-L$withval/lib"
5226 with_libxenctrl="yes"
5228 with_libxenctrl="$withval"
5232 with_libxenctrl="yes"
5234 if test "x$with_libxenctrl" = "xyes"
5236 SAVE_CPPFLAGS="$CPPFLAGS"
5237 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5239 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5241 CPPFLAGS="$SAVE_CPPFLAGS"
5243 if test "x$with_libxenctrl" = "xyes"
5245 SAVE_CPPFLAGS="$CPPFLAGS"
5246 SAVE_LDFLAGS="$LDFLAGS"
5247 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5248 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5250 #Xen versions older than 3.4 has no xc_getcpuinfo()
5251 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5253 CPPFLAGS="$SAVE_CPPFLAGS"
5254 LDFLAGS="$SAVE_LDFLAGS"
5255 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5256 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5257 AC_SUBST(LIBXENCTL_CPPFLAGS)
5258 AC_SUBST(LIBXENCTL_LDFLAGS)
5262 # --with-libxmms {{{
5263 with_xmms_config="xmms-config"
5266 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5268 if test "x$withval" != "xno" \
5269 && test "x$withval" != "xyes"
5271 if test -f "$withval" && test -x "$withval";
5273 with_xmms_config="$withval"
5274 else if test -x "$withval/bin/xmms-config"
5276 with_xmms_config="$withval/bin/xmms-config"
5279 else if test "x$withval" = "xno"
5289 if test "x$with_libxmms" = "xyes"
5291 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5292 xmms_config_status=$?
5294 if test $xmms_config_status -ne 0
5299 if test "x$with_libxmms" = "xyes"
5301 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5302 xmms_config_status=$?
5304 if test $xmms_config_status -ne 0
5309 if test "x$with_libxmms" = "xyes"
5311 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5313 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5314 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5315 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5316 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5323 with_libxmms_numeric=0
5324 if test "x$with_libxmms" = "xyes"
5326 with_libxmms_numeric=1
5328 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5329 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5332 # --with-libyajl {{{
5333 with_libyajl_cppflags=""
5334 with_libyajl_ldflags=""
5335 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5337 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5339 with_libyajl_cppflags="-I$withval/include"
5340 with_libyajl_ldflags="-L$withval/lib"
5343 with_libyajl="$withval"
5349 if test "x$with_libyajl" = "xyes"
5351 SAVE_CPPFLAGS="$CPPFLAGS"
5352 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5354 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5355 AC_CHECK_HEADERS(yajl/yajl_version.h)
5357 CPPFLAGS="$SAVE_CPPFLAGS"
5359 if test "x$with_libyajl" = "xyes"
5361 SAVE_CPPFLAGS="$CPPFLAGS"
5362 SAVE_LDFLAGS="$LDFLAGS"
5363 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5364 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5366 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5368 CPPFLAGS="$SAVE_CPPFLAGS"
5369 LDFLAGS="$SAVE_LDFLAGS"
5371 if test "x$with_libyajl" = "xyes"
5373 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5374 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5375 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5376 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5377 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5378 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5379 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5381 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5385 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5386 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5388 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5390 if test "x$withval" = "xno"
5393 else if test "x$withval" = "xyes"
5396 else if test -d "$with_mic/lib"
5398 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5399 with_mic_cflags="-I$withval/include"
5400 with_mic_ldpath="-L$withval/lib/Linux"
5401 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5406 if test "x$with_mic" = "xyes"
5408 SAVE_CPPFLAGS="$CPPFLAGS"
5409 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5410 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5411 CPPFLAGS="$SAVE_CPPFLAGS"
5413 if test "x$with_mic" = "xyes"
5415 SAVE_CPPFLAGS="$CPPFLAGS"
5416 SAVE_LDFLAGS="$LDFLAGS"
5418 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5419 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5421 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5422 [with_mic_ldpath="$with_mic_ldpath"
5423 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5424 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5426 CPPFLAGS="$SAVE_CPPFLAGS"
5427 LDFLAGS="$SAVE_LDFLAGS"
5430 if test "x$with_mic" = "xyes"
5432 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5433 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5434 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5435 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5436 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5437 AC_SUBST(BUILD_WITH_MIC_LDADD)
5441 # --with-libvarnish {{{
5442 with_libvarnish_cppflags=""
5443 with_libvarnish_cflags=""
5444 with_libvarnish_libs=""
5445 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5447 if test "x$withval" = "xno"
5449 with_libvarnish="no"
5450 else if test "x$withval" = "xyes"
5452 with_libvarnish="use_pkgconfig"
5453 else if test -d "$with_libvarnish/lib"
5455 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5456 with_libvarnish_cflags="-I$withval/include"
5457 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5458 with_libvarnish="yes"
5461 [with_libvarnish="use_pkgconfig"])
5463 # configure using pkg-config
5464 if test "x$with_libvarnish" = "xuse_pkgconfig"
5466 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5467 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5470 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5473 if test "x$with_libvarnish" = "xuse_pkgconfig"
5475 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5478 with_libvarnish="no ($PKG_CONFIG failed)"
5480 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5483 with_libvarnish="no ($PKG_CONFIG failed)"
5486 if test "x$with_libvarnish" = "xuse_pkgconfig"
5488 with_libvarnish="yes"
5491 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5492 # the actual checks.
5493 if test "x$with_libvarnish" = "xyes"
5495 SAVE_CPPFLAGS="$CPPFLAGS"
5497 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5499 AC_CHECK_HEADERS(vapi/vsc.h,
5500 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5501 [AC_CHECK_HEADERS(vsc.h,
5502 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5503 [AC_CHECK_HEADERS(varnishapi.h,
5504 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5505 [with_libvarnish="no (found none of the varnish header files)"])])])
5507 CPPFLAGS="$SAVE_CPPFLAGS"
5509 if test "x$with_libvarnish" = "xyes"
5511 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5512 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5513 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5514 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5518 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5519 with_libxml2="no (pkg-config isn't available)"
5520 with_libxml2_cflags=""
5521 with_libxml2_ldflags=""
5522 with_libvirt="no (pkg-config isn't available)"
5523 with_libvirt_cflags=""
5524 with_libvirt_ldflags=""
5525 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5530 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5533 $PKG_CONFIG --exists libvirt 2>/dev/null
5538 with_libvirt="no (pkg-config doesn't know libvirt)"
5540 if test "x$with_libxml2" = "xyes"
5542 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5547 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5553 if test "x$with_libxml2" = "xyes"
5555 SAVE_CPPFLAGS="$CPPFLAGS"
5556 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5558 AC_CHECK_HEADERS(libxml/parser.h, [],
5559 [with_libxml2="no (libxml/parser.h not found)"])
5561 CPPFLAGS="$SAVE_CPPFLAGS"
5563 if test "x$with_libxml2" = "xyes"
5565 SAVE_CFLAGS="$CFLAGS"
5566 SAVE_LDFLAGS="$LDFLAGS"
5568 CFLAGS="$CFLAGS $with_libxml2_cflags"
5569 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5571 AC_CHECK_LIB(xml2, xmlXPathEval,
5572 [with_libxml2="yes"],
5573 [with_libxml2="no (symbol xmlXPathEval not found)"])
5575 CFLAGS="$SAVE_CFLAGS"
5576 LDFLAGS="$SAVE_LDFLAGS"
5578 dnl Add the right compiler flags and libraries.
5579 if test "x$with_libxml2" = "xyes"; then
5580 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5581 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5582 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5583 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5585 if test "x$with_libvirt" = "xyes"
5587 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5592 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5598 if test "x$with_libvirt" = "xyes"
5600 SAVE_CPPFLAGS="$CPPFLAGS"
5601 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5603 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5604 [with_libvirt="no (libvirt/libvirt.h not found)"])
5606 CPPFLAGS="$SAVE_CPPFLAGS"
5608 if test "x$with_libvirt" = "xyes"
5610 SAVE_CFLAGS="$CFLAGS"
5611 SAVE_LDFLAGS="$LDFLAGS"
5613 CFLAGS="$CFLAGS $with_libvirt_cflags"
5614 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5616 AC_CHECK_LIB(virt, virDomainBlockStats,
5617 [with_libvirt="yes"],
5618 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5620 CFLAGS="$SAVE_CFLAGS"
5621 LDFLAGS="$SAVE_LDFLAGS"
5623 dnl Add the right compiler flags and libraries.
5624 if test "x$with_libvirt" = "xyes"; then
5625 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5626 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5627 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5628 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5632 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5633 with_libopenipmipthread="yes"
5634 with_libopenipmipthread_cflags=""
5635 with_libopenipmipthread_libs=""
5637 if test "x$with_libopenipmipthread" = "xyes"
5639 AC_MSG_CHECKING([for libOpenIPMIpthread])
5640 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5643 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5645 AC_MSG_RESULT([$with_libopenipmipthread])
5648 if test "x$with_libopenipmipthread" = "xyes"
5650 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5651 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5654 with_libopenipmipthread_cflags="$temp_result"
5656 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5657 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5659 AC_MSG_RESULT([$temp_result])
5662 if test "x$with_libopenipmipthread" = "xyes"
5664 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5665 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5668 with_libopenipmipthread_ldflags="$temp_result"
5670 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5671 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5673 AC_MSG_RESULT([$temp_result])
5676 if test "x$with_libopenipmipthread" = "xyes"
5678 SAVE_CPPFLAGS="$CPPFLAGS"
5679 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5681 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5682 [with_libopenipmipthread="yes"],
5683 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5684 [#include <OpenIPMI/ipmiif.h>
5685 #include <OpenIPMI/ipmi_err.h>
5686 #include <OpenIPMI/ipmi_posix.h>
5687 #include <OpenIPMI/ipmi_conn.h>
5690 CPPFLAGS="$SAVE_CPPFLAGS"
5693 if test "x$with_libopenipmipthread" = "xyes"
5695 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5696 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5697 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5698 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5702 # --with-libatasmart {{{
5703 with_libatasmart_cppflags=""
5704 with_libatasmart_ldflags=""
5705 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5707 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5709 with_libatasmart_cppflags="-I$withval/include"
5710 with_libatasmart_ldflags="-L$withval/lib"
5711 with_libatasmart="yes"
5713 with_libatasmart="$withval"
5717 if test "x$ac_system" = "xLinux"
5719 with_libatasmart="yes"
5721 with_libatasmart="no (Linux only library)"
5724 if test "x$with_libatasmart" = "xyes"
5726 SAVE_CPPFLAGS="$CPPFLAGS"
5727 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5729 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5731 CPPFLAGS="$SAVE_CPPFLAGS"
5733 if test "x$with_libatasmart" = "xyes"
5735 SAVE_CPPFLAGS="$CPPFLAGS"
5736 SAVE_LDFLAGS="$LDFLAGS"
5737 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5738 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5740 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5742 CPPFLAGS="$SAVE_CPPFLAGS"
5743 LDFLAGS="$SAVE_LDFLAGS"
5745 if test "x$with_libatasmart" = "xyes"
5747 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5748 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5749 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5750 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5751 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5752 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5753 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5755 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5758 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5759 [with_libnotify="yes"],
5760 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5763 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5764 [with_libriemann_client="yes"],
5765 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5767 # Check for enabled/disabled features
5770 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5771 # ------------------------------------------------------------
5773 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5778 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5783 m4_define([EnDis],[disabled])dnl
5784 m4_define([YesNo],[no])dnl
5790 m4_define([EnDis],[enabled])dnl
5791 m4_define([YesNo],[yes])dnl
5794 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5798 m4_if([$3], [feature], [],
5802 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5808 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5810 enable_$1='[YesNo]'dnl
5812 if test "x$enable_$1" = "xno"
5816 if test "x$enable_$1" = "xyes"
5820 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5825 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5826 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5828 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5830 # AC_PLUGIN(name, default, info)
5831 # ------------------------------------------------------------
5838 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5840 if test "x$enableval" = "xyes"
5843 else if test "x$enableval" = "xforce"
5848 enable_plugin="no (disabled on command line)"
5852 if test "x$enable_all_plugins" = "xauto"
5854 if test "x$2" = "xyes"
5861 enable_plugin="$enable_all_plugins"
5864 if test "x$enable_plugin" = "xyes"
5866 if test "x$2" = "xyes" || test "x$force" = "xyes"
5868 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
5869 if test "x$2" != "xyes"
5871 dependency_warning="yes"
5873 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
5874 dependency_error="yes"
5875 enable_plugin="$2 (dependency error)"
5878 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
5879 enable_$1="$enable_plugin"
5881 )# AC_PLUGIN(name, default, info)
5883 m4_divert_once([HELP_ENABLE], [
5884 collectd features:])
5885 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
5886 AC_COLLECTD([debug], [enable], [feature], [debugging])
5887 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
5888 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
5889 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
5891 dependency_warning="no"
5892 dependency_error="no"
5895 plugin_barometer="no"
5900 plugin_conntrack="no"
5901 plugin_contextswitch="no"
5904 plugin_cpusleep="no"
5905 plugin_curl_json="no"
5906 plugin_curl_xml="no"
5910 plugin_dpdkstat="no"
5917 plugin_hugepages="no"
5918 plugin_intel_rdt="no"
5919 plugin_interface="no"
5924 plugin_log_logstash="no"
5926 plugin_multimeter="no"
5931 plugin_processes="no"
5932 plugin_protocols="no"
5938 plugin_tcpconns="no"
5941 plugin_turbostat="no"
5947 plugin_wireless="no"
5948 plugin_write_prometheus="no"
5952 plugin_zookeeper="no"
5955 if test "x$ac_system" = "xLinux"
5957 plugin_battery="yes"
5958 plugin_cgroups="yes"
5959 plugin_conntrack="yes"
5960 plugin_contextswitch="yes"
5962 plugin_cpufreq="yes"
5965 plugin_entropy="yes"
5966 plugin_fhcount="yes"
5967 plugin_fscache="yes"
5968 plugin_hugepages="yes"
5969 plugin_interface="yes"
5977 plugin_processes="yes"
5978 plugin_protocols="yes"
5981 plugin_tcpconns="yes"
5982 plugin_thermal="yes"
5985 plugin_vserver="yes"
5986 plugin_wireless="yes"
5987 plugin_zfs_arc="yes"
5989 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
5993 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
5995 plugin_turbostat="yes"
5998 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6000 plugin_cpusleep="yes"
6004 if test "x$ac_system" = "xOpenBSD"
6006 plugin_tcpconns="yes"
6009 if test "x$ac_system" = "xNetBSD"
6012 plugin_entropy="yes"
6014 plugin_processes="yes"
6018 if test "x$with_libiokit" = "xyes"
6020 plugin_battery="yes"
6026 if test "x$ac_system" = "xAIX"
6029 plugin_tcpconns="yes"
6034 if test "x$ac_system" = "xFreeBSD"
6037 plugin_zfs_arc="yes"
6041 if test "x$with_perfstat" = "xyes"
6043 plugin_contextswitch="yes"
6046 plugin_interface="yes"
6053 if test "x$with_procinfo" = "xyes"
6055 plugin_processes="yes"
6059 if test "x$with_kstat" = "xyes"
6062 plugin_processes="yes"
6064 plugin_zfs_arc="yes"
6068 if test "x$with_devinfo$with_kstat" = "xyesyes"
6072 plugin_interface="yes"
6078 if test "x$ac_system" = "xLinux"
6080 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6081 [with_libi2c="yes"],
6082 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6083 [[#include <stdlib.h>
6084 #include <linux/i2c-dev.h>]])
6086 with_libi2c="no (Linux only)"
6089 if test "x$with_libi2c" = "xyes"
6091 plugin_barometer="yes"
6096 if test "x$with_libstatgrab" = "xyes"
6100 plugin_interface="yes"
6107 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6110 if test "x$have_strptime" = "xyes"
6116 if test "x$with_libopenipmipthread" = "xyes"
6121 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6123 plugin_curl_json="yes"
6126 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6128 plugin_curl_xml="yes"
6131 if test "x$with_libyajl" = "xyes"
6136 if test "x$have_processor_info" = "xyes"
6140 if test "x$have_sysctl" = "xyes"
6145 if test "x$ac_system" = "xDarwin"
6150 if test "x$have_sysctlbyname" = "xyes"
6152 plugin_contextswitch="yes"
6155 plugin_tcpconns="yes"
6158 # Df plugin: Check if we know how to determine mount points first.
6159 #if test "x$have_listmntent" = "xyes"; then
6162 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6166 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6170 #if test "x$have_getmntent" = "xseq"
6174 if test "x$c_cv_have_one_getmntent" = "xyes"
6179 if test "x$c_cv_have_getmntent_r" = "xyes"
6184 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6185 if test "x$plugin_df" = "xyes"
6188 if test "x$have_statfs" = "xyes"
6192 if test "x$have_statvfs" = "xyes"
6198 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6200 plugin_ethstat="yes"
6203 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6208 if test "x$have_getifaddrs" = "xyes"
6210 plugin_interface="yes"
6213 if test "x$with_libgps" = "xyes"
6218 if test "x$have_getloadavg" = "xyes"
6223 if test "x$with_libyajl" = "xyes"
6225 plugin_log_logstash="yes"
6228 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6233 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6236 if test "x$with_libmicrohttpd" = "xyes"
6238 plugin_write_prometheus="yes"
6242 # Mac OS X memory interface
6243 if test "x$have_host_statistics" = "xyes"
6248 if test "x$have_termios_h" = "xyes"
6250 if test "x$ac_system" != "xAIX"
6252 plugin_multimeter="yes"
6257 if test "x$have_thread_info" = "xyes"
6259 plugin_processes="yes"
6262 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6264 plugin_processes="yes"
6267 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6269 plugin_processes="yes"
6272 if test "x$with_libpython" != "xno"
6277 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6282 if test "x$with_kvm_getswapinfo" = "xyes"
6287 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6292 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6297 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6299 plugin_tcpconns="yes"
6302 if test "x$have_getutent" = "xyes"
6306 if test "x$have_getutxent" = "xyes"
6311 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6316 if test "x$with_libxenctrl" = "xyes"
6321 if test "x$with_libdpkd" = "xyes"
6323 plugin_dpdkstat="yes"
6326 m4_divert_once([HELP_ENABLE], [
6329 AC_ARG_ENABLE([all-plugins],
6330 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6332 if test "x$enableval" = "xyes"
6334 enable_all_plugins="yes"
6335 else if test "x$enableval" = "xauto"
6337 enable_all_plugins="auto"
6339 enable_all_plugins="no"
6342 [enable_all_plugins="auto"])
6344 m4_divert_once([HELP_ENABLE], [])
6346 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6347 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6348 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6349 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6350 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6351 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6352 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6353 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6354 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6355 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6356 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6357 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6358 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6359 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6360 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6361 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6362 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6363 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6364 AC_PLUGIN([csv], [yes], [CSV output plugin])
6365 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6366 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6367 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6368 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6369 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6370 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6371 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6372 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats & Status from DPDK])
6373 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6374 AC_PLUGIN([email], [yes], [EMail statistics])
6375 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6376 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6377 AC_PLUGIN([exec], [yes], [Execution of external programs])
6378 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6379 AC_PLUGIN([filecount], [yes], [Count files in directories])
6380 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6381 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6382 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6383 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6384 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6385 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6386 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6387 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6388 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6389 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6390 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6391 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6392 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6393 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6394 AC_PLUGIN([load], [$plugin_load], [System load])
6395 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6396 AC_PLUGIN([logfile], [yes], [File logging plugin])
6397 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6398 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6399 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6400 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6401 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6402 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6403 AC_PLUGIN([match_regex], [yes], [The regex match])
6404 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6405 AC_PLUGIN([match_value], [yes], [The value match])
6406 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6407 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6408 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6409 AC_PLUGIN([memcached], [yes], [memcached statistics])
6410 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6411 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6412 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6413 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6414 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6415 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6416 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6417 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6418 AC_PLUGIN([network], [yes], [Network communication plugin])
6419 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6420 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6421 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6422 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6423 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6424 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6425 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6426 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6427 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6428 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6429 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6430 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6431 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6432 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6433 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6434 # FIXME: Check for libevent, too.
6435 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6436 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6437 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6438 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6439 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6440 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6441 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6442 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6443 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6444 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6445 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6446 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6447 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6448 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6449 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6450 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6451 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6452 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6453 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6454 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6455 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6456 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6457 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6458 AC_PLUGIN([target_notification], [yes], [The notification target])
6459 AC_PLUGIN([target_replace], [yes], [The replace target])
6460 AC_PLUGIN([target_scale], [yes], [The scale target])
6461 AC_PLUGIN([target_set], [yes], [The set target])
6462 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6463 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6464 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6465 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6466 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6467 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6468 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6469 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6470 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6471 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6472 AC_PLUGIN([users], [$plugin_users], [User statistics])
6473 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6474 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6475 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6476 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6477 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6478 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6479 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6480 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6481 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6482 AC_PLUGIN([write_log], [yes], [Log output plugin])
6483 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6484 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6485 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6486 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6487 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6488 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6489 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6490 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6491 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6492 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6493 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6495 dnl Default configuration file
6496 # Load either syslog or logfile
6497 LOAD_PLUGIN_SYSLOG=""
6498 LOAD_PLUGIN_LOGFILE=""
6499 LOAD_PLUGIN_LOG_LOGSTASH=""
6501 AC_MSG_CHECKING([which default log plugin to load])
6502 default_log_plugin="none"
6503 if test "x$enable_syslog" = "xyes"
6505 default_log_plugin="syslog"
6507 LOAD_PLUGIN_SYSLOG="##"
6510 if test "x$enable_logfile" = "xyes"
6512 if test "x$default_log_plugin" = "xnone"
6514 default_log_plugin="logfile"
6516 LOAD_PLUGIN_LOGFILE="#"
6519 LOAD_PLUGIN_LOGFILE="##"
6522 if test "x$enable_log_logstash" = "xyes"
6524 LOAD_PLUGIN_LOG_LOGSTASH="#"
6526 LOAD_PLUGIN_LOG_LOGSTASH="##"
6530 AC_MSG_RESULT([$default_log_plugin])
6532 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6533 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6534 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6536 DEFAULT_LOG_LEVEL="info"
6537 if test "x$enable_debug" = "xyes"
6539 DEFAULT_LOG_LEVEL="debug"
6541 AC_SUBST(DEFAULT_LOG_LEVEL)
6543 # Load only one of rrdtool, network, csv in the default config.
6544 LOAD_PLUGIN_RRDTOOL=""
6545 LOAD_PLUGIN_NETWORK=""
6548 AC_MSG_CHECKING([which default write plugin to load])
6549 default_write_plugin="none"
6550 if test "x$enable_rrdtool" = "xyes"
6552 default_write_plugin="rrdtool"
6554 LOAD_PLUGIN_RRDTOOL="##"
6557 if test "x$enable_network" = "xyes"
6559 if test "x$default_write_plugin" = "xnone"
6561 default_write_plugin="network"
6563 LOAD_PLUGIN_NETWORK="#"
6566 LOAD_PLUGIN_NETWORK="##"
6569 if test "x$enable_csv" = "xyes"
6571 if test "x$default_write_plugin" = "xnone"
6573 default_write_plugin="csv"
6578 LOAD_PLUGIN_CSV="##"
6580 AC_MSG_RESULT([$default_write_plugin])
6582 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6583 AC_SUBST(LOAD_PLUGIN_NETWORK)
6584 AC_SUBST(LOAD_PLUGIN_CSV)
6587 if test "x$ac_system" = "xLinux" \
6588 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6590 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6593 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6595 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6599 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6600 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6602 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6604 PERL_BINDINGS_OPTIONS="$withval"
6605 with_perl_bindings="yes"
6607 with_perl_bindings="$withval"
6611 if test -n "$perl_interpreter"
6613 with_perl_bindings="yes"
6615 with_perl_bindings="no (no perl interpreter found)"
6619 if test "x$with_perl_bindings" = "xyes"
6621 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6622 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6623 AC_MSG_RESULT([yes])
6626 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6630 if test "x$with_perl_bindings" = "xyes"
6632 PERL_BINDINGS="perl"
6636 AC_SUBST(PERL_BINDINGS)
6637 AC_SUBST(PERL_BINDINGS_OPTIONS)
6639 dnl libcollectdclient
6640 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6641 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6642 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6644 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6646 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6648 AC_SUBST(LCC_VERSION_MAJOR)
6649 AC_SUBST(LCC_VERSION_MINOR)
6650 AC_SUBST(LCC_VERSION_PATCH)
6651 AC_SUBST(LCC_VERSION_EXTRA)
6652 AC_SUBST(LCC_VERSION_STRING)
6654 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6658 if test "x$enable_werror" != "xno"
6660 AM_CFLAGS="$AM_CFLAGS -Werror"
6661 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6663 AC_SUBST([AM_CFLAGS])
6664 AC_SUBST([AM_CXXFLAGS])
6666 AC_CONFIG_FILES([Makefile proto/Makefile src/Makefile src/daemon/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
6669 if test "x$with_librrd" = "xyes" \
6670 && test "x$librrd_threadsafe" != "xyes"
6672 with_librrd="yes (warning: librrd is not thread-safe)"
6675 if test "x$with_libperl" = "xyes"
6677 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6679 enable_perl="no (needs libperl)"
6682 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6684 enable_perl="no (libperl doesn't support ithreads)"
6687 if test "x$with_perl_bindings" = "xyes" \
6688 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6690 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6694 AC_MSG_RESULT([Configuration:])
6695 AC_MSG_RESULT([ Build:])
6696 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6697 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6698 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6699 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6700 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6701 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6702 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6703 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6704 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6705 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6706 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6707 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6709 AC_MSG_RESULT([ Libraries:])
6710 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6711 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6712 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6713 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6714 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6715 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6716 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6717 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6718 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6719 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6720 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6721 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6722 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6723 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6724 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6725 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6726 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6727 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6728 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6729 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6730 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6731 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6732 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6733 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6734 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6735 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6736 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6737 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6738 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6739 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6740 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6741 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6742 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6743 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6744 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6745 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6746 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6747 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6748 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6749 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6750 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6751 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6752 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6753 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6754 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6755 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6756 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6757 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6758 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6759 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6760 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6761 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6762 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6763 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6764 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6765 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6766 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6767 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6768 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6769 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6770 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6771 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6772 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6773 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6775 AC_MSG_RESULT([ Features:])
6776 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6777 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6779 AC_MSG_RESULT([ Bindings:])
6780 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6782 AC_MSG_RESULT([ Modules:])
6783 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6784 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6785 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6786 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6787 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6788 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6789 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6790 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6791 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6792 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6793 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6794 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6795 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6796 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6797 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6798 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6799 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6800 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6801 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6802 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6803 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6804 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6805 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6806 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6807 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6808 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6809 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6810 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6811 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6812 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6813 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6814 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6815 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6816 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6817 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6818 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6819 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6820 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6821 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6822 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6823 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6824 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6825 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6826 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6827 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6828 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6829 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6830 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6831 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6832 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6833 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6834 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6835 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6836 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6837 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6838 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6839 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6840 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6841 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6842 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6843 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6844 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6845 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6846 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
6847 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
6848 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
6849 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
6850 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
6851 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
6852 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
6853 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
6854 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
6855 AC_MSG_RESULT([ network . . . . . . . $enable_network])
6856 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
6857 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
6858 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
6859 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
6860 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
6861 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
6862 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
6863 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
6864 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
6865 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
6866 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
6867 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
6868 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
6869 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
6870 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
6871 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
6872 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
6873 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
6874 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
6875 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
6876 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
6877 AC_MSG_RESULT([ python . . . . . . . $enable_python])
6878 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
6879 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
6880 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
6881 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
6882 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
6883 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
6884 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
6885 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
6886 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
6887 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
6888 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
6889 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
6890 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
6891 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
6892 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
6893 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
6894 AC_MSG_RESULT([ target_notification . $enable_target_notification])
6895 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
6896 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
6897 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
6898 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
6899 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
6900 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
6901 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
6902 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
6903 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
6904 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
6905 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
6906 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
6907 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
6908 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
6909 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
6910 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
6911 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
6912 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
6913 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
6914 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
6915 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
6916 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
6917 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
6918 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
6919 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
6920 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
6921 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
6922 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
6923 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
6924 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
6925 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
6926 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
6927 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
6928 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
6929 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
6932 if test "x$dependency_error" = "xyes"; then
6933 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
6936 if test "x$dependency_warning" = "xyes"; then
6937 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
6940 # vim: set fdm=marker :