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 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2596 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2598 AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])])
2600 if test "x$with_libdpdk" != "xno"
2602 if test "x$LIBDPDK_CPPFLAGS" = "x"
2604 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2606 SAVE_CPPFLAGS="$CPPFLAGS"
2607 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2608 AC_CHECK_HEADERS([rte_config.h],
2609 [with_libdpdk="yes"],
2610 [with_libdpdk="no (rte_config.h not found)"]
2612 CPPFLAGS="$SAVE_CPPFLAGS"
2615 if test "x$with_libdpdk" = "xyes"
2617 SAVE_LDFLAGS="$LDFLAGS"
2618 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2619 AC_CHECK_LIB([dpdk], [rte_eal_init],
2620 [with_libdpdk="yes"],
2621 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2623 LDFLAGS="$SAVE_LDFLAGS"
2629 with_java_home="$JAVA_HOME"
2630 if test "x$with_java_home" = "x"
2632 with_java_home="/usr/lib/jvm"
2636 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2638 if test "x$withval" = "xno"
2641 else if test "x$withval" = "xyes"
2645 with_java_home="$withval"
2650 if test "x$with_java" = "xyes"
2652 if test -d "$with_java_home"
2654 AC_MSG_CHECKING([for jni.h])
2655 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2656 if test "x$TMPVAR" != "x"
2658 AC_MSG_RESULT([found in $TMPVAR])
2659 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2661 AC_MSG_RESULT([not found])
2664 AC_MSG_CHECKING([for jni_md.h])
2665 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2666 if test "x$TMPVAR" != "x"
2668 AC_MSG_RESULT([found in $TMPVAR])
2669 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2671 AC_MSG_RESULT([not found])
2674 AC_MSG_CHECKING([for libjvm.so])
2675 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`
2676 if test "x$TMPVAR" != "x"
2678 AC_MSG_RESULT([found in $TMPVAR])
2679 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2681 AC_MSG_RESULT([not found])
2684 if test "x$JAVAC" = "x"
2686 AC_MSG_CHECKING([for javac])
2687 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2688 if test "x$TMPVAR" != "x"
2691 AC_MSG_RESULT([$JAVAC])
2693 AC_MSG_RESULT([not found])
2696 if test "x$JAR" = "x"
2698 AC_MSG_CHECKING([for jar])
2699 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2700 if test "x$TMPVAR" != "x"
2703 AC_MSG_RESULT([$JAR])
2705 AC_MSG_RESULT([not found])
2708 else if test "x$with_java_home" != "x"
2710 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2714 if test "x$JAVA_CPPFLAGS" != "x"
2716 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2718 if test "x$JAVA_CFLAGS" != "x"
2720 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2722 if test "x$JAVA_LDFLAGS" != "x"
2724 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2726 if test "x$JAVA_LIBS" != "x"
2728 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2730 if test "x$JAVAC" = "x"
2732 with_javac_path="$PATH"
2733 if test "x$with_java_home" != "x"
2735 with_javac_path="$with_java_home:with_javac_path"
2736 if test -d "$with_java_home/bin"
2738 with_javac_path="$with_java_home/bin:with_javac_path"
2742 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2744 if test "x$JAVAC" = "x"
2746 with_java="no (javac not found)"
2748 if test "x$JAR" = "x"
2750 with_jar_path="$PATH"
2751 if test "x$with_java_home" != "x"
2753 with_jar_path="$with_java_home:$with_jar_path"
2754 if test -d "$with_java_home/bin"
2756 with_jar_path="$with_java_home/bin:$with_jar_path"
2760 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2762 if test "x$JAR" = "x"
2764 with_java="no (jar not found)"
2767 SAVE_CPPFLAGS="$CPPFLAGS"
2768 SAVE_CFLAGS="$CFLAGS"
2769 SAVE_LDFLAGS="$LDFLAGS"
2771 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2772 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2773 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2774 LIBS="$LIBS $JAVA_LIBS"
2776 if test "x$with_java" = "xyes"
2778 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2780 if test "x$with_java" = "xyes"
2782 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2784 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2785 [$JAVA_LIBS $PTHREAD_LIBS])
2787 if test "x$with_java" = "xyes"
2789 JAVA_LIBS="$JAVA_LIBS -ljvm"
2790 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2793 CPPFLAGS="$SAVE_CPPFLAGS"
2794 CFLAGS="$SAVE_CFLAGS"
2795 LDFLAGS="$SAVE_LDFLAGS"
2798 AC_SUBST(JAVA_CPPFLAGS)
2799 AC_SUBST(JAVA_CFLAGS)
2800 AC_SUBST(JAVA_LDFLAGS)
2802 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2805 # --with-libldap {{{
2806 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2808 if test "x$withval" = "xyes"
2811 else if test "x$withval" = "xno"
2816 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2817 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2820 [with_libldap="yes"])
2822 SAVE_CPPFLAGS="$CPPFLAGS"
2823 SAVE_LDFLAGS="$LDFLAGS"
2825 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2826 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2828 if test "x$with_libldap" = "xyes"
2830 if test "x$LIBLDAP_CPPFLAGS" != "x"
2832 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2834 AC_CHECK_HEADERS(ldap.h,
2835 [with_libldap="yes"],
2836 [with_libldap="no ('ldap.h' not found)"])
2838 if test "x$with_libldap" = "xyes"
2840 if test "x$LIBLDAP_LDFLAGS" != "x"
2842 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2844 AC_CHECK_LIB(ldap, ldap_initialize,
2845 [with_libldap="yes"],
2846 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2850 CPPFLAGS="$SAVE_CPPFLAGS"
2851 LDFLAGS="$SAVE_LDFLAGS"
2853 if test "x$with_libldap" = "xyes"
2855 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2856 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2857 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2858 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
2860 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
2864 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
2865 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
2867 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
2868 [with_liblua="yes"],
2872 PKG_CHECK_MODULES([LUA], [lua],
2873 [with_liblua="yes"],
2875 PKG_CHECK_MODULES([LUA], [lua-5.3],
2876 [with_liblua="yes"],
2878 PKG_CHECK_MODULES([LUA], [lua5.3],
2879 [with_liblua="yes"],
2881 PKG_CHECK_MODULES([LUA], [lua-5.2],
2882 [with_liblua="yes"],
2884 PKG_CHECK_MODULES([LUA], [lua5.2],
2885 [with_liblua="yes"],
2887 PKG_CHECK_MODULES([LUA], [lua-5.1],
2888 [with_liblua="yes"],
2890 PKG_CHECK_MODULES([LUA], [lua5.1],
2891 [with_liblua="yes"],
2892 [with_liblua="no (pkg-config cannot find liblua)"]
2908 if test "x$with_liblua" = "xyes"
2910 SAVE_CPPFLAGS="$CPPFLAGS"
2911 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
2913 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
2914 [with_liblua="yes"],
2915 [with_liblua="no (header not found)"]
2918 CPPFLAGS="$SAVE_CPPFLAGS"
2921 if test "x$with_liblua" = "xyes"
2924 LIBS="$LIBS $LUA_LIBS"
2926 AC_CHECK_FUNC([lua_settop],
2927 [with_liblua="yes"],
2928 [with_liblua="no (symbol 'lua_settop' not found)"]
2934 if test "x$with_liblua" = "xyes"
2936 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
2937 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
2939 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
2940 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
2943 # --with-liblvm2app {{{
2944 with_liblvm2app_cppflags=""
2945 with_liblvm2app_ldflags=""
2946 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2948 if test "x$withval" = "xno"
2950 with_liblvm2app="no"
2952 with_liblvm2app="yes"
2953 if test "x$withval" != "xyes"
2955 with_liblvm2app_cppflags="-I$withval/include"
2956 with_liblvm2app_ldflags="-L$withval/lib"
2961 if test "x$ac_system" = "xLinux"
2963 with_liblvm2app="yes"
2965 with_liblvm2app="no (Linux only library)"
2968 if test "x$with_liblvm2app" = "xyes"
2970 SAVE_CPPFLAGS="$CPPFLAGS"
2971 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2973 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2975 CPPFLAGS="$SAVE_CPPFLAGS"
2978 if test "x$with_liblvm2app" = "xyes"
2980 SAVE_CPPFLAGS="$CPPFLAGS"
2981 SAVE_LDFLAGS="$LDFLAGS"
2982 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2983 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2985 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
2987 CPPFLAGS="$SAVE_CPPFLAGS"
2988 LDFLAGS="$SAVE_LDFLAGS"
2990 if test "x$with_liblvm2app" = "xyes"
2992 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2993 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2994 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2995 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2996 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2997 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2998 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
3000 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3003 # --with-libmemcached {{{
3004 with_libmemcached_cppflags=""
3005 with_libmemcached_ldflags=""
3006 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3008 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3010 with_libmemcached_cppflags="-I$withval/include"
3011 with_libmemcached_ldflags="-L$withval/lib"
3012 with_libmemcached="yes"
3014 with_libmemcached="$withval"
3018 with_libmemcached="yes"
3020 if test "x$with_libmemcached" = "xyes"
3022 SAVE_CPPFLAGS="$CPPFLAGS"
3023 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3025 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3027 CPPFLAGS="$SAVE_CPPFLAGS"
3029 if test "x$with_libmemcached" = "xyes"
3031 SAVE_CPPFLAGS="$CPPFLAGS"
3032 SAVE_LDFLAGS="$LDFLAGS"
3033 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3034 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3036 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3038 CPPFLAGS="$SAVE_CPPFLAGS"
3039 LDFLAGS="$SAVE_LDFLAGS"
3041 if test "x$with_libmemcached" = "xyes"
3043 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3044 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3045 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3046 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3047 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3048 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3049 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3051 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3054 # --with-libmicrohttpd {{{
3055 with_libmicrohttpd_cppflags=""
3056 with_libmicrohttpd_ldflags=""
3057 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3059 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3061 with_libmicrohttpd_cppflags="-I$withval/include"
3062 with_libmicrohttpd_ldflags="-L$withval/lib"
3063 with_libmicrohttpd="yes"
3065 if test "x$withval" = "xno"
3067 with_libmicrohttpd="no (disabled on command line)"
3072 if test "x$withval" = "xyes"
3074 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3075 [with_libmicrohttpd="yes"],
3076 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3080 if test "x$MICROHTTPD_LIBS" = "x"
3082 MICROHTTPD_LIBS="-lmicrohttpd"
3085 SAVE_CPPFLAGS="$CPPFLAGS"
3086 SAVE_LDFLAGS="$LDFLAGS"
3088 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3089 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3090 LIBS="$LIBS $MICROHTTPD_LIBS"
3092 if test "x$with_libmicrohttpd" = "xyes"
3094 AC_CHECK_HEADERS([microhttpd.h],
3095 [with_libmicrohttpd="yes"],
3096 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3099 if test "x$with_libmicrohttpd" = "xyes"
3101 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3102 [with_libmicrohttpd="yes"],
3103 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3106 CPPFLAGS="$SAVE_CPPFLAGS"
3107 LDFLAGS="$SAVE_LDFLAGS"
3110 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3111 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3112 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3113 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3114 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3115 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3118 # --with-libmodbus {{{
3119 with_libmodbus_config=""
3120 with_libmodbus_cflags=""
3121 with_libmodbus_libs=""
3122 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3124 if test "x$withval" = "xno"
3127 else if test "x$withval" = "xyes"
3129 with_libmodbus="use_pkgconfig"
3130 else if test -d "$with_libmodbus/lib"
3132 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3133 with_libmodbus_cflags="-I$withval/include"
3134 with_libmodbus_libs="-L$withval/lib -lmodbus"
3135 with_libmodbus="yes"
3138 [with_libmodbus="use_pkgconfig"])
3140 # configure using pkg-config
3141 if test "x$with_libmodbus" = "xuse_pkgconfig"
3143 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3144 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3147 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3150 if test "x$with_libmodbus" = "xuse_pkgconfig"
3152 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3155 with_libmodbus="no ($PKG_CONFIG failed)"
3157 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3160 with_libmodbus="no ($PKG_CONFIG failed)"
3163 if test "x$with_libmodbus" = "xuse_pkgconfig"
3165 with_libmodbus="yes"
3168 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3169 # the actual checks.
3170 if test "x$with_libmodbus" = "xyes"
3172 SAVE_CPPFLAGS="$CPPFLAGS"
3173 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3175 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3177 CPPFLAGS="$SAVE_CPPFLAGS"
3179 if test "x$with_libmodbus" = "xyes"
3181 SAVE_CPPFLAGS="$CPPFLAGS"
3182 SAVE_LDFLAGS="$LDFLAGS"
3184 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3185 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3187 AC_CHECK_LIB(modbus, modbus_connect,
3188 [with_libmodbus="yes"],
3189 [with_libmodbus="no (symbol modbus_connect not found)"])
3191 CPPFLAGS="$SAVE_CPPFLAGS"
3192 LDFLAGS="$SAVE_LDFLAGS"
3194 if test "x$with_libmodbus" = "xyes"
3196 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3197 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3198 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3199 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3203 # --with-libmongoc {{{
3204 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3206 if test "x$withval" = "xyes"
3208 with_libmongoc="yes"
3209 else if test "x$withval" = "xno"
3213 with_libmongoc="yes"
3214 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3215 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3218 [with_libmongoc="yes"])
3220 SAVE_CPPFLAGS="$CPPFLAGS"
3221 SAVE_LDFLAGS="$LDFLAGS"
3223 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3224 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3226 if test "x$with_libmongoc" = "xyes"
3228 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3230 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3232 AC_CHECK_HEADERS(mongo.h,
3233 [with_libmongoc="yes"],
3234 [with_libmongoc="no ('mongo.h' not found)"],
3236 # define MONGO_HAVE_STDINT 1
3238 # define MONGO_USE_LONG_LONG_INT 1
3242 if test "x$with_libmongoc" = "xyes"
3244 if test "x$LIBMONGOC_LDFLAGS" != "x"
3246 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3248 AC_CHECK_LIB(mongoc, mongo_run_command,
3249 [with_libmongoc="yes"],
3250 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3253 CPPFLAGS="$SAVE_CPPFLAGS"
3254 LDFLAGS="$SAVE_LDFLAGS"
3256 if test "x$with_libmongoc" = "xyes"
3258 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3259 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3260 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3261 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3263 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3266 # --with-libmosquitto {{{
3267 with_libmosquitto_cppflags=""
3268 with_libmosquitto_ldflags=""
3269 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3271 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3273 with_libmosquitto_cppflags="-I$withval/include"
3274 with_libmosquitto_ldflags="-L$withval/lib"
3275 with_libmosquitto="yes"
3277 with_libmosquitto="$withval"
3281 with_libmosquitto="yes"
3283 if test "x$with_libmosquitto" = "xyes"
3285 SAVE_CPPFLAGS="$CPPFLAGS"
3286 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3288 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3290 CPPFLAGS="$SAVE_CPPFLAGS"
3292 if test "x$with_libmosquitto" = "xyes"
3294 SAVE_LDFLAGS="$LDFLAGS"
3295 SAVE_CPPFLAGS="$CPPFLAGS"
3296 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3297 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3299 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3301 LDFLAGS="$SAVE_LDFLAGS"
3302 CPPFLAGS="$SAVE_CPPFLAGS"
3304 if test "x$with_libmosquitto" = "xyes"
3306 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3307 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3308 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3309 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3310 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3311 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3315 # --with-libmysql {{{
3316 with_mysql_config="mysql_config"
3317 with_mysql_cflags=""
3319 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3321 if test "x$withval" = "xno"
3324 else if test "x$withval" = "xyes"
3328 if test -f "$withval" && test -x "$withval";
3330 with_mysql_config="$withval"
3331 else if test -x "$withval/bin/mysql_config"
3333 with_mysql_config="$withval/bin/mysql_config"
3341 if test "x$with_libmysql" = "xyes"
3343 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3344 mysql_config_status=$?
3346 if test $mysql_config_status -ne 0
3348 with_libmysql="no ($with_mysql_config failed)"
3350 SAVE_CPPFLAGS="$CPPFLAGS"
3351 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3354 have_mysql_mysql_h="no"
3355 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3357 if test "x$have_mysql_h" = "xno"
3359 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3362 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3364 with_libmysql="no (mysql.h not found)"
3367 CPPFLAGS="$SAVE_CPPFLAGS"
3370 if test "x$with_libmysql" = "xyes"
3372 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3373 mysql_config_status=$?
3375 if test $mysql_config_status -ne 0
3377 with_libmysql="no ($with_mysql_config failed)"
3379 SAVE_CPPFLAGS="$CPPFLAGS"
3380 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3382 LIBS="$with_mysql_libs"
3383 AC_SEARCH_LIBS([mysql_get_server_version],
3385 [with_libmysql="yes"],
3386 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3388 CPPFLAGS="$SAVE_CPPFLAGS"
3392 if test "x$with_libmysql" = "xyes"
3394 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3395 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3396 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3397 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3399 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3403 with_libmnl_cflags=""
3405 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3407 echo "libmnl: withval = $withval"
3408 if test "x$withval" = "xyes"
3411 else if test "x$withval" = "xno"
3415 if test -d "$withval/include"
3417 with_libmnl_cflags="-I$withval/include"
3418 with_libmnl_libs="-L$withval/lib -lmnl"
3421 AC_MSG_ERROR("no such directory: $withval/include")
3426 if test "x$ac_system" = "xLinux"
3430 with_libmnl="no (Linux only library)"
3433 if test "x$with_libmnl" = "xyes"
3435 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3436 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3437 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3440 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3446 #include <sys/types.h>
3447 #include <asm/types.h>
3448 #include <sys/socket.h>
3449 #include <linux/netlink.h>
3450 #include <linux/rtnetlink.h>])
3451 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3453 #include <sys/types.h>
3454 #include <asm/types.h>
3455 #include <sys/socket.h>])
3457 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3460 #include <sys/types.h>
3461 #include <asm/types.h>
3462 #include <sys/socket.h>
3463 #include <linux/netlink.h>
3464 #include <linux/rtnetlink.h>
3467 int retval = TCA_STATS2;
3471 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3473 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3476 #include <sys/types.h>
3477 #include <asm/types.h>
3478 #include <sys/socket.h>
3479 #include <linux/netlink.h>
3480 #include <linux/rtnetlink.h>
3483 int retval = TCA_STATS;
3487 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3489 if test "x$with_libmnl" = "xyes"
3491 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3492 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3495 #include <linux/if_link.h>
3498 if test "x$with_libmnl" = "xyes"
3500 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3501 [with_libmnl="yes"],
3502 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3503 [$with_libmnl_libs])
3505 if test "x$with_libmnl" = "xyes"
3507 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3508 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3509 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3510 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3511 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3513 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3516 # --with-libnetapp {{{
3517 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3518 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3519 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3520 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3521 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3522 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3523 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3525 if test -d "$withval"
3527 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3528 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3529 with_libnetapp="yes"
3531 with_libnetapp="$withval"
3535 with_libnetapp="yes"
3538 SAVE_CPPFLAGS="$CPPFLAGS"
3539 SAVE_LDFLAGS="$LDFLAGS"
3540 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3541 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3543 if test "x$with_libnetapp" = "xyes"
3545 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3547 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3549 AC_CHECK_HEADERS(netapp_api.h,
3550 [with_libnetapp="yes"],
3551 [with_libnetapp="no (netapp_api.h not found)"])
3554 if test "x$with_libnetapp" = "xyes"
3556 if test "x$LIBNETAPP_LDFLAGS" != "x"
3558 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3561 if test "x$LIBNETAPP_LIBS" = "x"
3563 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3565 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3567 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3568 [with_libnetapp="yes"],
3569 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3571 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3574 CPPFLAGS="$SAVE_CPPFLAGS"
3575 LDFLAGS="$SAVE_LDFLAGS"
3577 if test "x$with_libnetapp" = "xyes"
3579 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3582 AC_SUBST(LIBNETAPP_CPPFLAGS)
3583 AC_SUBST(LIBNETAPP_LDFLAGS)
3584 AC_SUBST(LIBNETAPP_LIBS)
3585 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3588 # --with-libnetsnmp {{{
3589 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3591 if test "x$withval" = "xno"
3593 with_libnetsnmp="no"
3594 else if test "x$withval" = "xyes"
3596 with_libnetsnmp="yes"
3598 with_libnetsnmp_cppflags="-I$withval/include"
3599 with_libnetsnmp_ldflags="-I$withval/lib"
3600 with_libnetsnmp="yes"
3603 [with_libnetsnmp="yes"])
3604 if test "x$with_libnetsnmp" = "xyes"
3606 SAVE_CPPFLAGS="$CPPFLAGS"
3607 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3609 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3611 CPPFLAGS="$SAVE_CPPFLAGS"
3613 if test "x$with_libnetsnmp" = "xyes"
3615 SAVE_LDFLAGS="$LDFLAGS"
3616 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3618 AC_CHECK_LIB(netsnmp, init_snmp,
3619 [with_libnetsnmp="yes"],
3620 [with_libnetsnmp="no (libnetsnmp not found)"],
3623 LDFLAGS="$SAVE_LDFLAGS"
3625 if test "x$with_libnetsnmp" = "xyes"
3627 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3628 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3629 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3631 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3632 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3633 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3636 # --with-liboconfig {{{
3637 with_own_liboconfig="no"
3638 liboconfig_LDFLAGS="$LDFLAGS"
3639 liboconfig_CPPFLAGS="$CPPFLAGS"
3640 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3642 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3644 if test -d "$withval/lib"
3646 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3648 if test -d "$withval/include"
3650 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3653 if test "x$withval" = "xno"
3655 AC_MSG_ERROR("liboconfig is required")
3659 with_liboconfig="yes"
3662 save_LDFLAGS="$LDFLAGS"
3663 save_CPPFLAGS="$CPPFLAGS"
3664 LDFLAGS="$liboconfig_LDFLAGS"
3665 CPPFLAGS="$liboconfig_CPPFLAGS"
3666 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3668 with_liboconfig="yes"
3669 with_own_liboconfig="no"
3672 with_liboconfig="yes"
3673 with_own_liboconfig="yes"
3674 LDFLAGS="$save_LDFLAGS"
3675 CPPFLAGS="$save_CPPFLAGS"
3678 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3679 if test "x$with_own_liboconfig" = "xyes"
3681 with_liboconfig="yes (shipped version)"
3685 # --with-liboping {{{
3686 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3688 if test "x$withval" = "xyes"
3691 else if test "x$withval" = "xno"
3696 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3697 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3700 [with_liboping="yes"])
3702 SAVE_CPPFLAGS="$CPPFLAGS"
3703 SAVE_LDFLAGS="$LDFLAGS"
3705 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3706 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3708 if test "x$with_liboping" = "xyes"
3710 if test "x$LIBOPING_CPPFLAGS" != "x"
3712 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3714 AC_CHECK_HEADERS(oping.h,
3715 [with_liboping="yes"],
3716 [with_liboping="no (oping.h not found)"])
3718 if test "x$with_liboping" = "xyes"
3720 if test "x$LIBOPING_LDFLAGS" != "x"
3722 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3724 AC_CHECK_LIB(oping, ping_construct,
3725 [with_liboping="yes"],
3726 [with_liboping="no (symbol 'ping_construct' not found)"])
3729 CPPFLAGS="$SAVE_CPPFLAGS"
3730 LDFLAGS="$SAVE_LDFLAGS"
3732 if test "x$with_liboping" = "xyes"
3734 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3735 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3736 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3737 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3739 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3743 with_oracle_cppflags=""
3745 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3747 if test "x$withval" = "xyes"
3749 if test "x$ORACLE_HOME" = "x"
3751 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3754 else if test "x$withval" = "xno"
3759 ORACLE_HOME="$withval"
3763 if test "x$ORACLE_HOME" = "x"
3765 with_oracle="no (ORACLE_HOME is not set)"
3770 if test "x$ORACLE_HOME" != "x"
3772 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3774 if test -e "$ORACLE_HOME/lib/ldflags"
3776 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3778 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3779 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3781 if test "x$with_oracle" = "xyes"
3783 SAVE_CPPFLAGS="$CPPFLAGS"
3784 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3786 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3788 CPPFLAGS="$SAVE_CPPFLAGS"
3790 if test "x$with_oracle" = "xyes"
3792 SAVE_CPPFLAGS="$CPPFLAGS"
3794 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3795 LIBS="$LIBS $with_oracle_libs"
3797 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3799 CPPFLAGS="$SAVE_CPPFLAGS"
3802 if test "x$with_oracle" = "xyes"
3804 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3805 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3806 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3807 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3811 # --with-libowcapi {{{
3812 with_libowcapi_cppflags=""
3813 with_libowcapi_ldflags=""
3814 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3816 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3818 with_libowcapi_cppflags="-I$withval/include"
3819 with_libowcapi_ldflags="-L$withval/lib"
3820 with_libowcapi="yes"
3822 with_libowcapi="$withval"
3826 with_libowcapi="yes"
3828 if test "x$with_libowcapi" = "xyes"
3830 SAVE_CPPFLAGS="$CPPFLAGS"
3831 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3833 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3835 CPPFLAGS="$SAVE_CPPFLAGS"
3837 if test "x$with_libowcapi" = "xyes"
3839 SAVE_LDFLAGS="$LDFLAGS"
3840 SAVE_CPPFLAGS="$CPPFLAGS"
3841 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3842 CPPFLAGS="$with_libowcapi_cppflags"
3844 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3846 LDFLAGS="$SAVE_LDFLAGS"
3847 CPPFLAGS="$SAVE_CPPFLAGS"
3849 if test "x$with_libowcapi" = "xyes"
3851 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3852 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3853 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3854 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3855 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3856 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3860 # --with-libpcap {{{
3861 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3863 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3865 LDFLAGS="$LDFLAGS -L$withval/lib"
3866 CPPFLAGS="$CPPFLAGS -I$withval/include"
3869 with_libpcap="$withval"
3875 if test "x$with_libpcap" = "xyes"
3877 AC_CHECK_LIB(pcap, pcap_open_live,
3879 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3880 ], [with_libpcap="no (libpcap not found)"])
3882 if test "x$with_libpcap" = "xyes"
3884 AC_CHECK_HEADERS(pcap.h,,
3885 [with_libpcap="no (pcap.h not found)"])
3887 if test "x$with_libpcap" = "xyes"
3889 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3890 [c_cv_libpcap_have_pcap_error_iface_not_up],
3891 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3896 int val = PCAP_ERROR_IFACE_NOT_UP;
3900 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3901 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3903 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3905 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3907 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3910 # --with-libperl {{{
3911 perl_interpreter="perl"
3912 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3914 if test -f "$withval" && test -x "$withval"
3916 perl_interpreter="$withval"
3918 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3920 LDFLAGS="$LDFLAGS -L$withval/lib"
3921 CPPFLAGS="$CPPFLAGS -I$withval/include"
3922 perl_interpreter="$withval/bin/perl"
3925 with_libperl="$withval"
3932 AC_MSG_CHECKING([for perl])
3933 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3934 if test -x "$perl_interpreter"
3936 AC_MSG_RESULT([yes ($perl_interpreter)])
3942 AC_SUBST(PERL, "$perl_interpreter")
3944 if test "x$with_libperl" = "xyes" \
3945 && test -n "$perl_interpreter"
3947 SAVE_CFLAGS="$CFLAGS"
3949 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3950 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
3951 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3952 CFLAGS="$CFLAGS $PERL_CFLAGS"
3953 LIBS="$LIBS $PERL_LIBS"
3955 AC_CACHE_CHECK([for libperl],
3956 [c_cv_have_libperl],
3957 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3959 #define PERL_NO_GET_CONTEXT
3966 load_module (PERL_LOADMOD_NOIMPORT,
3967 newSVpv ("Collectd::Plugin::FooBar", 24),
3971 [c_cv_have_libperl="yes"],
3972 [c_cv_have_libperl="no"]
3976 if test "x$c_cv_have_libperl" = "xyes"
3978 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3979 AC_SUBST(PERL_CFLAGS)
3985 CFLAGS="$SAVE_CFLAGS"
3987 else if test -z "$perl_interpreter"; then
3988 with_libperl="no (no perl interpreter found)"
3989 c_cv_have_libperl="no"
3991 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3993 if test "x$with_libperl" = "xyes"
3995 SAVE_CFLAGS="$CFLAGS"
3997 CFLAGS="$CFLAGS $PERL_CFLAGS"
3998 LIBS="$LIBS $PERL_LIBS"
4000 AC_CACHE_CHECK([if perl supports ithreads],
4001 [c_cv_have_perl_ithreads],
4002 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4008 #if !defined(USE_ITHREADS)
4009 # error "Perl does not support ithreads!"
4010 #endif /* !defined(USE_ITHREADS) */
4014 [c_cv_have_perl_ithreads="yes"],
4015 [c_cv_have_perl_ithreads="no"]
4019 if test "x$c_cv_have_perl_ithreads" = "xyes"
4021 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4024 CFLAGS="$SAVE_CFLAGS"
4028 if test "x$with_libperl" = "xyes"
4030 SAVE_CFLAGS="$CFLAGS"
4032 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4033 # (see issues #41 and #42)
4034 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4035 LIBS="$LIBS $PERL_LIBS"
4037 AC_CACHE_CHECK([for broken Perl_load_module()],
4038 [c_cv_have_broken_perl_load_module],
4039 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4041 #define PERL_NO_GET_CONTEXT
4048 load_module (PERL_LOADMOD_NOIMPORT,
4049 newSVpv ("Collectd::Plugin::FooBar", 24),
4053 [c_cv_have_broken_perl_load_module="no"],
4054 [c_cv_have_broken_perl_load_module="yes"]
4058 CFLAGS="$SAVE_CFLAGS"
4061 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4062 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4064 if test "x$with_libperl" = "xyes"
4066 SAVE_CFLAGS="$CFLAGS"
4068 CFLAGS="$CFLAGS $PERL_CFLAGS"
4069 LIBS="$LIBS $PERL_LIBS"
4072 [struct mgvtbl.svt_local],
4073 [have_struct_mgvtbl_svt_local="yes"],
4074 [have_struct_mgvtbl_svt_local="no"],
4081 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4083 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4084 [Define if Perl's struct mgvtbl has member svt_local.])
4087 CFLAGS="$SAVE_CFLAGS"
4093 with_pg_config="pg_config"
4094 with_libpq_includedir=""
4095 with_libpq_libdir=""
4096 with_libpq_cppflags=""
4097 with_libpq_ldflags=""
4098 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4101 if test "x$withval" = "xno"
4104 else if test "x$withval" = "xyes"
4108 if test -f "$withval" && test -x "$withval";
4110 with_pg_config="$withval"
4111 else if test -x "$withval/bin/pg_config"
4113 with_pg_config="$withval/bin/pg_config"
4121 if test "x$with_libpq" = "xyes"
4123 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4126 if test $pg_config_status -eq 0
4128 if test -n "$with_libpq_includedir"; then
4129 for dir in $with_libpq_includedir; do
4130 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4134 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4137 SAVE_CPPFLAGS="$CPPFLAGS"
4138 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4140 AC_CHECK_HEADERS(libpq-fe.h, [],
4141 [with_libpq="no (libpq-fe.h not found)"], [])
4143 CPPFLAGS="$SAVE_CPPFLAGS"
4145 if test "x$with_libpq" = "xyes"
4147 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4150 if test $pg_config_status -eq 0
4152 if test -n "$with_libpq_libdir"; then
4153 for dir in $with_libpq_libdir; do
4154 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4158 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4161 SAVE_LDFLAGS="$LDFLAGS"
4162 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4164 AC_CHECK_LIB(pq, PQconnectdb,
4166 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4168 AC_CHECK_LIB(pq, PQserverVersion,
4170 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4172 LDFLAGS="$SAVE_LDFLAGS"
4174 if test "x$with_libpq" = "xyes"
4176 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4177 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4178 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4179 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4181 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4184 # --with-libpqos {{{
4185 with_libpqos_cppflags=""
4186 with_libpqos_ldflags=""
4187 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4189 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4191 with_libpqos_cppflags="-I$withval/include"
4192 with_libpqos_ldflags="-L$withval/lib"
4195 with_libpqos="$withval"
4201 if test "x$with_libpqos" = "xyes"
4203 SAVE_CPPFLAGS="$CPPFLAGS"
4204 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4206 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4208 CPPFLAGS="$SAVE_CPPFLAGS"
4210 if test "x$with_libpqos" = "xyes"
4212 SAVE_CPPFLAGS="$CPPFLAGS"
4213 SAVE_LDFLAGS="$LDFLAGS"
4214 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4215 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4217 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4219 CPPFLAGS="$SAVE_CPPFLAGS"
4220 LDFLAGS="$SAVE_LDFLAGS"
4222 if test "x$with_libpqos" = "xyes"
4224 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4225 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4226 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4227 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4228 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4229 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4233 # --with-libprotobuf {{{
4234 with_libprotobuf_cppflags=""
4235 with_libprotobuf_ldflags=""
4236 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4238 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4240 with_libprotobuf_cppflags="-I$withval/include"
4241 with_libprotobuf_ldflags="-L$withval/lib"
4242 with_libprotobuf="yes"
4244 if test "x$withval" = "xno"
4246 with_libprotobuf="no (disabled on command line)"
4251 if test "x$withval" = "xyes"
4253 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4254 [with_libprotobuf="yes"],
4255 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4259 if test "x$withval" != "xno"
4261 SAVE_LDFLAGS="$LDFLAGS"
4263 LDFLAGS="$with_libprotobuf_ldflags"
4264 LIBS="$PROTOBUF_LIBS $LIBS"
4266 AC_CHECK_LIB([protobuf], [main],
4268 SAVE_CPPFLAGS="$CPPFLAGS"
4269 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4270 if test "x$PROTOBUF_LIBS" = "x"
4272 PROTOBUF_LIBS="-lprotobuf"
4274 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4275 [with_libprotobuf="yes"],
4276 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4278 CPPFLAGS="$SAVE_CPPFLAGS"
4280 [with_libprotobuf="no (libprotobuf not found)"]
4283 LDFLAGS="$SAVE_LDFLAGS"
4286 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4287 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4288 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4289 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4290 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4291 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4294 # --with-libprotobuf-c {{{
4295 with_libprotobuf_c_cppflags=""
4296 with_libprotobuf_c_ldflags=""
4297 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4299 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4301 with_libprotobuf_c_cppflags="-I$withval/include"
4302 with_libprotobuf_c_ldflags="-L$withval/lib"
4303 with_libprotobuf_c="yes"
4305 if test "x$withval" = "xno"
4307 with_libprotobuf_c="no (disabled on command line)"
4312 if test "x$withval" = "xyes"
4314 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4315 [with_libprotobuf_c="yes"],
4316 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4320 if test "x$withval" != "xno"
4322 SAVE_LDFLAGS="$LDFLAGS"
4324 LDFLAGS="$with_libprotobuf_c_ldflags"
4325 LIBS="$PROTOBUF_C_LIBS $LIBS"
4326 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4328 SAVE_CPPFLAGS="$CPPFLAGS"
4329 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4330 if test "x$PROTOBUF_C_LIBS" = "x"
4332 PROTOBUF_C_LIBS="-lprotobuf-c"
4334 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4336 with_libprotobuf_c="yes"
4339 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4341 CPPFLAGS="$SAVE_CPPFLAGS"
4343 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4345 LDFLAGS="$SAVE_LDFLAGS"
4348 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4349 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4350 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4351 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4352 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4353 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4356 # --with-libpython {{{
4357 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4358 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4359 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4361 AC_ARG_WITH([libpython],
4362 [AS_HELP_STRING([--with-libpython],
4363 [if we should build with libpython @<:@default=yes@:>@])
4365 [with_libpython="$withval"],
4366 [with_libpython="check"]
4368 if test "$with_libpython" != "no"; then
4369 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4370 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4371 AC_PATH_PROGS([PYTHON_CONFIG],
4372 [python3-config python2-config python-config]
4374 if test "$PYTHON_CONFIG" = ""; then
4375 if test "$with_libpython" = "yes"; then
4376 AC_MSG_ERROR([Unable to find python-config])
4383 if test "$PYTHON_CONFIG" != ""; then
4384 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4385 if test $? -ne 0; then
4388 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4389 if test $? -ne 0; then
4392 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4393 if test $? -ne 0; then
4398 if test "$with_libpython" != "xno"; then
4399 SAVE_CPPFLAGS="$CPPFLAGS"
4400 SAVE_LDFLAGS="$LDFLAGS"
4402 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4403 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4404 LIBS="$LIBPYTHON_LIBS $LIBS"
4405 AC_CHECK_HEADERS([Python.h],
4407 AC_MSG_CHECKING([for libpython])
4408 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4409 [[#include <Python.h>]],
4410 [[Py_Initialize();]])
4412 [with_libpython="yes"],
4413 [with_libpython="no"]
4415 AC_MSG_RESULT([$with_libpython])
4417 [with_libpython="no"]
4419 CPPFLAGS="$SAVE_CPPFLAGS"
4420 LDFLAGS="$SAVE_LDFLAGS"
4423 # }}} --with-libpython
4425 # --with-librabbitmq {{{
4426 with_librabbitmq_cppflags=""
4427 with_librabbitmq_ldflags=""
4428 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4430 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4432 with_librabbitmq_cppflags="-I$withval/include"
4433 with_librabbitmq_ldflags="-L$withval/lib"
4434 with_librabbitmq="yes"
4436 with_librabbitmq="$withval"
4440 with_librabbitmq="yes"
4442 SAVE_CPPFLAGS="$CPPFLAGS"
4443 SAVE_LDFLAGS="$LDFLAGS"
4444 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4445 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4446 if test "x$with_librabbitmq" = "xyes"
4448 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4450 if test "x$with_librabbitmq" = "xyes"
4452 # librabbitmq up to version 0.9.1 provides "library_errno", later
4453 # versions use "library_error". The library does not provide a version
4454 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4455 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4458 # include <stdlib.h>
4464 # include <stdint.h>
4467 # include <inttypes.h>
4472 if test "x$with_librabbitmq" = "xyes"
4474 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4476 if test "x$with_librabbitmq" = "xyes"
4478 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4479 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4480 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4481 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4482 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4483 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4484 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4486 CPPFLAGS="$SAVE_CPPFLAGS"
4487 LDFLAGS="$SAVE_LDFLAGS"
4488 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4490 with_amqp_tcp_socket="no"
4491 if test "x$with_librabbitmq" = "xyes"
4493 SAVE_CPPFLAGS="$CPPFLAGS"
4494 SAVE_LDFLAGS="$LDFLAGS"
4496 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4497 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4500 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4501 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4502 if test "x$with_amqp_tcp_socket" = "xyes"
4504 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4505 [Define if librabbitmq provides the new TCP socket interface.])
4508 AC_CHECK_DECLS(amqp_socket_close,
4509 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4512 #ifdef HAVE_AMQP_TCP_SOCKET_H
4513 # include <amqp_tcp_socket.h>
4515 #ifdef HAVE_AMQP_SOCKET_H
4516 # include <amqp_socket.h>
4520 CPPFLAGS="$SAVE_CPPFLAGS"
4521 LDFLAGS="$SAVE_LDFLAGS"
4526 # --with-librdkafka {{{
4527 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4529 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4531 with_librdkafka_cppflags="-I$withval/include"
4532 with_librdkafka_ldflags="-L$withval/lib"
4533 with_librdkafka_rpath="$withval/lib"
4534 with_librdkafka="yes"
4536 with_librdkafka="$withval"
4540 with_librdkafka="yes"
4542 SAVE_CPPFLAGS="$CPPFLAGS"
4543 SAVE_LDFLAGS="$LDFLAGS"
4545 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4546 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4548 if test "x$with_librdkafka" = "xyes"
4550 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4553 if test "x$with_librdkafka" = "xyes"
4555 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4556 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4557 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4559 if test "x$with_librdkafka" = "xyes"
4561 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4562 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4563 if test "x$with_librdkafka_rpath" != "x"
4565 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4567 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4569 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4570 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4571 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4572 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4573 if test "x$with_librdkafka_log_cb" = "xyes"
4575 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4576 else if test "x$with_librdkafka_logger" = "xyes"
4578 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4581 CPPFLAGS="$SAVE_CPPFLAGS"
4582 LDFLAGS="$SAVE_LDFLAGS"
4583 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4587 # --with-librouteros {{{
4588 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4590 if test "x$withval" = "xyes"
4592 with_librouteros="yes"
4593 else if test "x$withval" = "xno"
4595 with_librouteros="no"
4597 with_librouteros="yes"
4598 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4599 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4602 [with_librouteros="yes"])
4604 SAVE_CPPFLAGS="$CPPFLAGS"
4605 SAVE_LDFLAGS="$LDFLAGS"
4607 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4608 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4610 if test "x$with_librouteros" = "xyes"
4612 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4614 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4616 AC_CHECK_HEADERS(routeros_api.h,
4617 [with_librouteros="yes"],
4618 [with_librouteros="no (routeros_api.h not found)"])
4620 if test "x$with_librouteros" = "xyes"
4622 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4624 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4626 AC_CHECK_LIB(routeros, ros_interface,
4627 [with_librouteros="yes"],
4628 [with_librouteros="no (symbol 'ros_interface' not found)"])
4631 CPPFLAGS="$SAVE_CPPFLAGS"
4632 LDFLAGS="$SAVE_LDFLAGS"
4634 if test "x$with_librouteros" = "xyes"
4636 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4637 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4638 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4639 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4641 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4647 librrd_threadsafe="no"
4648 librrd_rrdc_update="no"
4650 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4652 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4654 librrd_cflags="-I$withval/include"
4655 librrd_ldflags="-L$withval/lib"
4658 with_librrd="$withval"
4664 if test "x$with_librrd" = "xyes"
4666 SAVE_LDFLAGS="$LDFLAGS"
4667 LDFLAGS="$LDFLAGS $librrd_ldflags"
4668 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4670 AC_CHECK_LIB([rrd], [rrd_update_r],
4671 [librrd_threadsafe="yes"],
4674 AC_CHECK_LIB([rrd], [rrdc_update],
4675 [librrd_rrdc_update="yes"],
4680 LDFLAGS="$SAVE_LDFLAGS"
4682 SAVE_CPPFLAGS="$CPPFLAGS"
4683 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4685 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4687 CPPFLAGS="$SAVE_CPPFLAGS"
4690 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4692 SAVE_LDFLAGS="$LDFLAGS"
4693 LDFLAGS="$LDFLAGS $librrd_ldflags"
4695 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4697 librrd_ldflags="$librrd_ldflags -lrrd_th"
4698 librrd_threadsafe="yes"
4699 AC_CHECK_LIB([rrd_th], [rrdc_update],
4700 [librrd_rrdc_update="yes"],
4706 LDFLAGS="$SAVE_LDFLAGS"
4709 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4711 SAVE_LDFLAGS="$LDFLAGS"
4712 LDFLAGS="$LDFLAGS $librrd_ldflags"
4714 AC_CHECK_LIB([rrd], [rrd_update],
4716 librrd_ldflags="$librrd_ldflags -lrrd"
4717 AC_CHECK_LIB([rrd], [rrdc_update],
4718 [librrd_rrdc_update="yes"],
4722 [with_librrd="no (symbol 'rrd_update' not found)"]
4724 LDFLAGS="$SAVE_LDFLAGS"
4727 if test "x$with_librrd" = "xyes"
4729 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4730 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4731 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4732 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4733 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4734 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4736 if test "x$librrd_threadsafe" = "xyes"
4738 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4739 [Define to 1 if the rrd library is thread-safe]
4744 # --with-libsensors {{{
4745 with_sensors_cflags=""
4746 with_sensors_ldflags=""
4747 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4749 if test "x$withval" = "xno"
4751 with_libsensors="no"
4753 with_libsensors="yes"
4754 if test "x$withval" != "xyes"
4756 with_sensors_cflags="-I$withval/include"
4757 with_sensors_ldflags="-L$withval/lib"
4758 with_libsensors="yes"
4763 if test "x$ac_system" = "xLinux"
4765 with_libsensors="yes"
4767 with_libsensors="no (Linux only library)"
4770 if test "x$with_libsensors" = "xyes"
4772 SAVE_CPPFLAGS="$CPPFLAGS"
4773 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4775 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4777 CPPFLAGS="$SAVE_CPPFLAGS"
4779 if test "x$with_libsensors" = "xyes"
4781 SAVE_CPPFLAGS="$CPPFLAGS"
4782 SAVE_LDFLAGS="$LDFLAGS"
4783 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4784 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4786 AC_CHECK_LIB(sensors, sensors_init,
4788 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4790 [with_libsensors="no (libsensors not found)"])
4792 CPPFLAGS="$SAVE_CPPFLAGS"
4793 LDFLAGS="$SAVE_LDFLAGS"
4795 if test "x$with_libsensors" = "xyes"
4797 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4798 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4799 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4800 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4802 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4806 AC_SUBST([LIBSIGROK_CFLAGS])
4807 AC_SUBST([LIBSIGROK_LIBS])
4808 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4809 [with_libsigrok="yes"],
4810 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4814 # --with-libstatgrab {{{
4815 with_libstatgrab_cflags=""
4816 with_libstatgrab_ldflags=""
4817 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4819 if test "x$withval" != "xno" \
4820 && test "x$withval" != "xyes"
4822 with_libstatgrab_cflags="-I$withval/include"
4823 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4824 with_libstatgrab="yes"
4825 with_libstatgrab_pkg_config="no"
4827 with_libstatgrab="$withval"
4828 with_libstatgrab_pkg_config="yes"
4832 with_libstatgrab="yes"
4833 with_libstatgrab_pkg_config="yes"
4836 if test "x$with_libstatgrab" = "xyes" \
4837 && test "x$with_libstatgrab_pkg_config" = "xyes"
4839 AC_MSG_CHECKING([pkg-config for libstatgrab])
4841 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4844 with_libstatgrab_pkg_config="no"
4845 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4846 temp_result="not found"
4848 AC_MSG_RESULT([$temp_result])
4851 if test "x$with_libstatgrab" = "xyes" \
4852 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4853 && test "x$with_libstatgrab_cflags" = "x"
4855 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4856 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4859 with_libstatgrab_cflags="$temp_result"
4861 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4862 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4864 AC_MSG_RESULT([$temp_result])
4867 if test "x$with_libstatgrab" = "xyes" \
4868 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4869 && test "x$with_libstatgrab_ldflags" = "x"
4871 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4872 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4875 with_libstatgrab_ldflags="$temp_result"
4877 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4878 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4880 AC_MSG_RESULT([$temp_result])
4883 if test "x$with_libstatgrab" = "xyes"
4885 SAVE_CPPFLAGS="$CPPFLAGS"
4886 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4888 AC_CHECK_HEADERS(statgrab.h,
4889 [with_libstatgrab="yes"],
4890 [with_libstatgrab="no (statgrab.h not found)"])
4892 CPPFLAGS="$SAVE_CPPFLAGS"
4895 if test "x$with_libstatgrab" = "xyes"
4897 SAVE_CFLAGS="$CFLAGS"
4898 SAVE_LDFLAGS="$LDFLAGS"
4900 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4901 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4903 AC_CHECK_LIB(statgrab, sg_init,
4904 [with_libstatgrab="yes"],
4905 [with_libstatgrab="no (symbol sg_init not found)"])
4907 CFLAGS="$SAVE_CFLAGS"
4908 LDFLAGS="$SAVE_LDFLAGS"
4911 if test "x$with_libstatgrab" = "xyes"
4913 SAVE_CFLAGS="$CFLAGS"
4914 SAVE_LDFLAGS="$LDFLAGS"
4917 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4918 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4919 LIBS="-lstatgrab $LIBS"
4921 AC_CACHE_CHECK([if libstatgrab >= 0.90],
4922 [c_cv_have_libstatgrab_0_90],
4923 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4926 #include <statgrab.h>
4929 if (sg_init()) return 0;
4932 [c_cv_have_libstatgrab_0_90="no"],
4933 [c_cv_have_libstatgrab_0_90="yes"]
4937 CFLAGS="$SAVE_CFLAGS"
4938 LDFLAGS="$SAVE_LDFLAGS"
4942 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4943 if test "x$with_libstatgrab" = "xyes"
4945 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4946 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4947 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4948 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4949 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4950 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
4952 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
4957 # --with-libtokyotyrant {{{
4958 with_libtokyotyrant_cppflags=""
4959 with_libtokyotyrant_ldflags=""
4960 with_libtokyotyrant_libs=""
4961 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4963 if test "x$withval" = "xno"
4965 with_libtokyotyrant="no"
4966 else if test "x$withval" = "xyes"
4968 with_libtokyotyrant="yes"
4970 with_libtokyotyrant_cppflags="-I$withval/include"
4971 with_libtokyotyrant_ldflags="-L$withval/include"
4972 with_libtokyotyrant_libs="-ltokyotyrant"
4973 with_libtokyotyrant="yes"
4977 with_libtokyotyrant="yes"
4980 if test "x$with_libtokyotyrant" = "xyes"
4982 if $PKG_CONFIG --exists tokyotyrant
4984 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4985 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4986 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4990 SAVE_CPPFLAGS="$CPPFLAGS"
4991 SAVE_LDFLAGS="$LDFLAGS"
4992 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4993 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4995 if test "x$with_libtokyotyrant" = "xyes"
4997 AC_CHECK_HEADERS(tcrdb.h,
4999 AC_DEFINE(HAVE_TCRDB_H, 1,
5000 [Define to 1 if you have the <tcrdb.h> header file.])
5001 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5004 if test "x$with_libtokyotyrant" = "xyes"
5006 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5008 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5009 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5011 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5012 [$with_libtokyotyrant_libs])
5015 CPPFLAGS="$SAVE_CPPFLAGS"
5016 LDFLAGS="$SAVE_LDFLAGS"
5018 if test "x$with_libtokyotyrant" = "xyes"
5020 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5021 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5022 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5023 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5024 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5025 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5027 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5030 # --with-libudev {{{
5031 with_libudev_cflags=""
5032 with_libudev_ldflags=""
5033 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5035 if test "x$withval" = "xno"
5040 if test "x$withval" != "xyes"
5042 with_libudev_cflags="-I$withval/include"
5043 with_libudev_ldflags="-L$withval/lib"
5049 if test "x$ac_system" = "xLinux"
5053 with_libudev="no (Linux only library)"
5056 if test "x$with_libudev" = "xyes"
5058 SAVE_CPPFLAGS="$CPPFLAGS"
5059 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5061 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5063 CPPFLAGS="$SAVE_CPPFLAGS"
5065 if test "x$with_libudev" = "xyes"
5067 SAVE_CPPFLAGS="$CPPFLAGS"
5068 SAVE_LDFLAGS="$LDFLAGS"
5069 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5070 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5072 AC_CHECK_LIB(udev, udev_new,
5074 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5076 [with_libudev="no (libudev not found)"])
5078 CPPFLAGS="$SAVE_CPPFLAGS"
5079 LDFLAGS="$SAVE_LDFLAGS"
5081 if test "x$with_libudev" = "xyes"
5083 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5084 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5085 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5086 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5087 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5088 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5090 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5093 # --with-libupsclient {{{
5094 with_libupsclient_config=""
5095 with_libupsclient_cflags=""
5096 with_libupsclient_libs=""
5097 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5099 if test "x$withval" = "xno"
5101 with_libupsclient="no"
5102 else if test "x$withval" = "xyes"
5104 with_libupsclient="use_pkgconfig"
5106 if test -x "$withval"
5108 with_libupsclient_config="$withval"
5109 with_libupsclient="use_libupsclient_config"
5110 else if test -x "$withval/bin/libupsclient-config"
5112 with_libupsclient_config="$withval/bin/libupsclient-config"
5113 with_libupsclient="use_libupsclient_config"
5115 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5116 with_libupsclient_cflags="-I$withval/include"
5117 with_libupsclient_libs="-L$withval/lib -lupsclient"
5118 with_libupsclient="yes"
5122 [with_libupsclient="use_pkgconfig"])
5124 # configure using libupsclient-config
5125 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5127 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5128 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5131 with_libupsclient="no ($with_libupsclient_config failed)"
5133 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5136 with_libupsclient="no ($with_libupsclient_config failed)"
5139 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5141 with_libupsclient="yes"
5144 # configure using pkg-config
5145 if test "x$with_libupsclient" = "xuse_pkgconfig"
5147 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5148 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5151 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5154 if test "x$with_libupsclient" = "xuse_pkgconfig"
5156 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5159 with_libupsclient="no ($PKG_CONFIG failed)"
5161 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5164 with_libupsclient="no ($PKG_CONFIG failed)"
5167 if test "x$with_libupsclient" = "xuse_pkgconfig"
5169 with_libupsclient="yes"
5172 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5173 # the actual checks.
5174 if test "x$with_libupsclient" = "xyes"
5176 SAVE_CPPFLAGS="$CPPFLAGS"
5177 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5179 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5181 CPPFLAGS="$SAVE_CPPFLAGS"
5183 if test "x$with_libupsclient" = "xyes"
5185 SAVE_CPPFLAGS="$CPPFLAGS"
5186 SAVE_LDFLAGS="$LDFLAGS"
5188 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5189 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5191 AC_CHECK_LIB(upsclient, upscli_connect,
5192 [with_libupsclient="yes"],
5193 [with_libupsclient="no (symbol upscli_connect not found)"])
5195 CPPFLAGS="$SAVE_CPPFLAGS"
5196 LDFLAGS="$SAVE_LDFLAGS"
5198 if test "x$with_libupsclient" = "xyes"
5200 SAVE_CPPFLAGS="$CPPFLAGS"
5201 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5203 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5204 [#include <stdlib.h>
5206 #include <upsclient.h>])
5208 CPPFLAGS="$SAVE_CPPFLAGS"
5210 if test "x$with_libupsclient" = "xyes"
5212 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5213 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5214 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5215 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5219 # --with-libxenctrl {{{
5220 with_libxenctrl_cppflags=""
5221 with_libxenctrl_ldflags=""
5222 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5224 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5226 with_libxenctrl_cppflags="-I$withval/include"
5227 with_libxenctrl_ldflags="-L$withval/lib"
5228 with_libxenctrl="yes"
5230 with_libxenctrl="$withval"
5234 with_libxenctrl="yes"
5236 if test "x$with_libxenctrl" = "xyes"
5238 SAVE_CPPFLAGS="$CPPFLAGS"
5239 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5241 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5243 CPPFLAGS="$SAVE_CPPFLAGS"
5245 if test "x$with_libxenctrl" = "xyes"
5247 SAVE_CPPFLAGS="$CPPFLAGS"
5248 SAVE_LDFLAGS="$LDFLAGS"
5249 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5250 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5252 #Xen versions older than 3.4 has no xc_getcpuinfo()
5253 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5255 CPPFLAGS="$SAVE_CPPFLAGS"
5256 LDFLAGS="$SAVE_LDFLAGS"
5257 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5258 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5259 AC_SUBST(LIBXENCTL_CPPFLAGS)
5260 AC_SUBST(LIBXENCTL_LDFLAGS)
5264 # --with-libxmms {{{
5265 with_xmms_config="xmms-config"
5268 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5270 if test "x$withval" != "xno" \
5271 && test "x$withval" != "xyes"
5273 if test -f "$withval" && test -x "$withval";
5275 with_xmms_config="$withval"
5276 else if test -x "$withval/bin/xmms-config"
5278 with_xmms_config="$withval/bin/xmms-config"
5281 else if test "x$withval" = "xno"
5291 if test "x$with_libxmms" = "xyes"
5293 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5294 xmms_config_status=$?
5296 if test $xmms_config_status -ne 0
5301 if test "x$with_libxmms" = "xyes"
5303 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5304 xmms_config_status=$?
5306 if test $xmms_config_status -ne 0
5311 if test "x$with_libxmms" = "xyes"
5313 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5315 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5316 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5317 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5318 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5325 with_libxmms_numeric=0
5326 if test "x$with_libxmms" = "xyes"
5328 with_libxmms_numeric=1
5330 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5331 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5334 # --with-libyajl {{{
5335 with_libyajl_cppflags=""
5336 with_libyajl_ldflags=""
5337 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5339 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5341 with_libyajl_cppflags="-I$withval/include"
5342 with_libyajl_ldflags="-L$withval/lib"
5345 with_libyajl="$withval"
5351 if test "x$with_libyajl" = "xyes"
5353 SAVE_CPPFLAGS="$CPPFLAGS"
5354 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5356 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5357 AC_CHECK_HEADERS(yajl/yajl_version.h)
5359 CPPFLAGS="$SAVE_CPPFLAGS"
5361 if test "x$with_libyajl" = "xyes"
5363 SAVE_CPPFLAGS="$CPPFLAGS"
5364 SAVE_LDFLAGS="$LDFLAGS"
5365 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5366 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5368 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5370 CPPFLAGS="$SAVE_CPPFLAGS"
5371 LDFLAGS="$SAVE_LDFLAGS"
5373 if test "x$with_libyajl" = "xyes"
5375 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5376 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5377 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5378 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5379 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5380 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5381 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5383 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5387 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5388 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5390 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5392 if test "x$withval" = "xno"
5395 else if test "x$withval" = "xyes"
5398 else if test -d "$with_mic/lib"
5400 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5401 with_mic_cflags="-I$withval/include"
5402 with_mic_ldpath="-L$withval/lib/Linux"
5403 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5408 if test "x$with_mic" = "xyes"
5410 SAVE_CPPFLAGS="$CPPFLAGS"
5411 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5412 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5413 CPPFLAGS="$SAVE_CPPFLAGS"
5415 if test "x$with_mic" = "xyes"
5417 SAVE_CPPFLAGS="$CPPFLAGS"
5418 SAVE_LDFLAGS="$LDFLAGS"
5420 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5421 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5423 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5424 [with_mic_ldpath="$with_mic_ldpath"
5425 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5426 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5428 CPPFLAGS="$SAVE_CPPFLAGS"
5429 LDFLAGS="$SAVE_LDFLAGS"
5432 if test "x$with_mic" = "xyes"
5434 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5435 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5436 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5437 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5438 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5439 AC_SUBST(BUILD_WITH_MIC_LDADD)
5443 # --with-libvarnish {{{
5444 with_libvarnish_cppflags=""
5445 with_libvarnish_cflags=""
5446 with_libvarnish_libs=""
5447 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5449 if test "x$withval" = "xno"
5451 with_libvarnish="no"
5452 else if test "x$withval" = "xyes"
5454 with_libvarnish="use_pkgconfig"
5455 else if test -d "$with_libvarnish/lib"
5457 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5458 with_libvarnish_cflags="-I$withval/include"
5459 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5460 with_libvarnish="yes"
5463 [with_libvarnish="use_pkgconfig"])
5465 # configure using pkg-config
5466 if test "x$with_libvarnish" = "xuse_pkgconfig"
5468 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5469 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5472 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5475 if test "x$with_libvarnish" = "xuse_pkgconfig"
5477 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5480 with_libvarnish="no ($PKG_CONFIG failed)"
5482 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5485 with_libvarnish="no ($PKG_CONFIG failed)"
5488 if test "x$with_libvarnish" = "xuse_pkgconfig"
5490 with_libvarnish="yes"
5493 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5494 # the actual checks.
5495 if test "x$with_libvarnish" = "xyes"
5497 SAVE_CPPFLAGS="$CPPFLAGS"
5499 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5501 AC_CHECK_HEADERS(vapi/vsc.h,
5502 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5503 [AC_CHECK_HEADERS(vsc.h,
5504 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5505 [AC_CHECK_HEADERS(varnishapi.h,
5506 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5507 [with_libvarnish="no (found none of the varnish header files)"])])])
5509 CPPFLAGS="$SAVE_CPPFLAGS"
5511 if test "x$with_libvarnish" = "xyes"
5513 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5514 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5515 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5516 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5520 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5521 with_libxml2="no (pkg-config isn't available)"
5522 with_libxml2_cflags=""
5523 with_libxml2_ldflags=""
5524 with_libvirt="no (pkg-config isn't available)"
5525 with_libvirt_cflags=""
5526 with_libvirt_ldflags=""
5527 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5532 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5535 $PKG_CONFIG --exists libvirt 2>/dev/null
5540 with_libvirt="no (pkg-config doesn't know libvirt)"
5542 if test "x$with_libxml2" = "xyes"
5544 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5549 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5555 if test "x$with_libxml2" = "xyes"
5557 SAVE_CPPFLAGS="$CPPFLAGS"
5558 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5560 AC_CHECK_HEADERS(libxml/parser.h, [],
5561 [with_libxml2="no (libxml/parser.h not found)"])
5563 CPPFLAGS="$SAVE_CPPFLAGS"
5565 if test "x$with_libxml2" = "xyes"
5567 SAVE_CFLAGS="$CFLAGS"
5568 SAVE_LDFLAGS="$LDFLAGS"
5570 CFLAGS="$CFLAGS $with_libxml2_cflags"
5571 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5573 AC_CHECK_LIB(xml2, xmlXPathEval,
5574 [with_libxml2="yes"],
5575 [with_libxml2="no (symbol xmlXPathEval not found)"])
5577 CFLAGS="$SAVE_CFLAGS"
5578 LDFLAGS="$SAVE_LDFLAGS"
5580 dnl Add the right compiler flags and libraries.
5581 if test "x$with_libxml2" = "xyes"; then
5582 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5583 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5584 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5585 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5587 if test "x$with_libvirt" = "xyes"
5589 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5594 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5600 if test "x$with_libvirt" = "xyes"
5602 SAVE_CPPFLAGS="$CPPFLAGS"
5603 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5605 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5606 [with_libvirt="no (libvirt/libvirt.h not found)"])
5608 CPPFLAGS="$SAVE_CPPFLAGS"
5610 if test "x$with_libvirt" = "xyes"
5612 SAVE_CFLAGS="$CFLAGS"
5613 SAVE_LDFLAGS="$LDFLAGS"
5615 CFLAGS="$CFLAGS $with_libvirt_cflags"
5616 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5618 AC_CHECK_LIB(virt, virDomainBlockStats,
5619 [with_libvirt="yes"],
5620 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5622 CFLAGS="$SAVE_CFLAGS"
5623 LDFLAGS="$SAVE_LDFLAGS"
5625 dnl Add the right compiler flags and libraries.
5626 if test "x$with_libvirt" = "xyes"; then
5627 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5628 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5629 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5630 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5634 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5635 with_libopenipmipthread="yes"
5636 with_libopenipmipthread_cflags=""
5637 with_libopenipmipthread_libs=""
5639 if test "x$with_libopenipmipthread" = "xyes"
5641 AC_MSG_CHECKING([for libOpenIPMIpthread])
5642 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5645 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5647 AC_MSG_RESULT([$with_libopenipmipthread])
5650 if test "x$with_libopenipmipthread" = "xyes"
5652 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5653 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5656 with_libopenipmipthread_cflags="$temp_result"
5658 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5659 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5661 AC_MSG_RESULT([$temp_result])
5664 if test "x$with_libopenipmipthread" = "xyes"
5666 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5667 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5670 with_libopenipmipthread_ldflags="$temp_result"
5672 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5673 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5675 AC_MSG_RESULT([$temp_result])
5678 if test "x$with_libopenipmipthread" = "xyes"
5680 SAVE_CPPFLAGS="$CPPFLAGS"
5681 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5683 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5684 [with_libopenipmipthread="yes"],
5685 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5686 [#include <OpenIPMI/ipmiif.h>
5687 #include <OpenIPMI/ipmi_err.h>
5688 #include <OpenIPMI/ipmi_posix.h>
5689 #include <OpenIPMI/ipmi_conn.h>
5692 CPPFLAGS="$SAVE_CPPFLAGS"
5695 if test "x$with_libopenipmipthread" = "xyes"
5697 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5698 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5699 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5700 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5704 # --with-libatasmart {{{
5705 with_libatasmart_cppflags=""
5706 with_libatasmart_ldflags=""
5707 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5709 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5711 with_libatasmart_cppflags="-I$withval/include"
5712 with_libatasmart_ldflags="-L$withval/lib"
5713 with_libatasmart="yes"
5715 with_libatasmart="$withval"
5719 if test "x$ac_system" = "xLinux"
5721 with_libatasmart="yes"
5723 with_libatasmart="no (Linux only library)"
5726 if test "x$with_libatasmart" = "xyes"
5728 SAVE_CPPFLAGS="$CPPFLAGS"
5729 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5731 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5733 CPPFLAGS="$SAVE_CPPFLAGS"
5735 if test "x$with_libatasmart" = "xyes"
5737 SAVE_CPPFLAGS="$CPPFLAGS"
5738 SAVE_LDFLAGS="$LDFLAGS"
5739 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5740 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5742 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5744 CPPFLAGS="$SAVE_CPPFLAGS"
5745 LDFLAGS="$SAVE_LDFLAGS"
5747 if test "x$with_libatasmart" = "xyes"
5749 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5750 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5751 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5752 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5753 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5754 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5755 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5757 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5760 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5761 [with_libnotify="yes"],
5762 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5765 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5766 [with_libriemann_client="yes"],
5767 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5769 # Check for enabled/disabled features
5772 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5773 # ------------------------------------------------------------
5775 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5780 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5785 m4_define([EnDis],[disabled])dnl
5786 m4_define([YesNo],[no])dnl
5792 m4_define([EnDis],[enabled])dnl
5793 m4_define([YesNo],[yes])dnl
5796 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5800 m4_if([$3], [feature], [],
5804 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5810 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5812 enable_$1='[YesNo]'dnl
5814 if test "x$enable_$1" = "xno"
5818 if test "x$enable_$1" = "xyes"
5822 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5827 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5828 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5830 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5832 # AC_PLUGIN(name, default, info)
5833 # ------------------------------------------------------------
5840 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5842 if test "x$enableval" = "xyes"
5845 else if test "x$enableval" = "xforce"
5850 enable_plugin="no (disabled on command line)"
5854 if test "x$enable_all_plugins" = "xauto"
5856 if test "x$2" = "xyes"
5863 enable_plugin="$enable_all_plugins"
5866 if test "x$enable_plugin" = "xyes"
5868 if test "x$2" = "xyes" || test "x$force" = "xyes"
5870 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
5871 if test "x$2" != "xyes"
5873 dependency_warning="yes"
5875 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
5876 dependency_error="yes"
5877 enable_plugin="$2 (dependency error)"
5880 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
5881 enable_$1="$enable_plugin"
5883 )# AC_PLUGIN(name, default, info)
5885 m4_divert_once([HELP_ENABLE], [
5886 collectd features:])
5887 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
5888 AC_COLLECTD([debug], [enable], [feature], [debugging])
5889 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
5890 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
5891 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
5893 dependency_warning="no"
5894 dependency_error="no"
5897 plugin_barometer="no"
5902 plugin_conntrack="no"
5903 plugin_contextswitch="no"
5906 plugin_cpusleep="no"
5907 plugin_curl_json="no"
5908 plugin_curl_xml="no"
5912 plugin_dpdkstat="no"
5919 plugin_hugepages="no"
5920 plugin_intel_rdt="no"
5921 plugin_interface="no"
5926 plugin_log_logstash="no"
5928 plugin_multimeter="no"
5933 plugin_processes="no"
5934 plugin_protocols="no"
5940 plugin_tcpconns="no"
5943 plugin_turbostat="no"
5949 plugin_wireless="no"
5950 plugin_write_prometheus="no"
5954 plugin_zookeeper="no"
5957 if test "x$ac_system" = "xLinux"
5959 plugin_battery="yes"
5960 plugin_cgroups="yes"
5961 plugin_conntrack="yes"
5962 plugin_contextswitch="yes"
5964 plugin_cpufreq="yes"
5967 plugin_entropy="yes"
5968 plugin_fhcount="yes"
5969 plugin_fscache="yes"
5970 plugin_hugepages="yes"
5971 plugin_interface="yes"
5979 plugin_processes="yes"
5980 plugin_protocols="yes"
5983 plugin_tcpconns="yes"
5984 plugin_thermal="yes"
5987 plugin_vserver="yes"
5988 plugin_wireless="yes"
5989 plugin_zfs_arc="yes"
5991 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
5995 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
5997 plugin_turbostat="yes"
6000 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6002 plugin_cpusleep="yes"
6006 if test "x$ac_system" = "xOpenBSD"
6008 plugin_tcpconns="yes"
6011 if test "x$ac_system" = "xNetBSD"
6014 plugin_entropy="yes"
6016 plugin_processes="yes"
6020 if test "x$with_libiokit" = "xyes"
6022 plugin_battery="yes"
6028 if test "x$ac_system" = "xAIX"
6031 plugin_tcpconns="yes"
6036 if test "x$ac_system" = "xFreeBSD"
6039 plugin_zfs_arc="yes"
6043 if test "x$with_perfstat" = "xyes"
6045 plugin_contextswitch="yes"
6048 plugin_interface="yes"
6055 if test "x$with_procinfo" = "xyes"
6057 plugin_processes="yes"
6061 if test "x$with_kstat" = "xyes"
6064 plugin_processes="yes"
6066 plugin_zfs_arc="yes"
6070 if test "x$with_devinfo$with_kstat" = "xyesyes"
6074 plugin_interface="yes"
6080 if test "x$ac_system" = "xLinux"
6082 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6083 [with_libi2c="yes"],
6084 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6085 [[#include <stdlib.h>
6086 #include <linux/i2c-dev.h>]])
6088 with_libi2c="no (Linux only)"
6091 if test "x$with_libi2c" = "xyes"
6093 plugin_barometer="yes"
6098 if test "x$with_libstatgrab" = "xyes"
6102 plugin_interface="yes"
6109 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6112 if test "x$have_strptime" = "xyes"
6118 if test "x$with_libopenipmipthread" = "xyes"
6123 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6125 plugin_curl_json="yes"
6128 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6130 plugin_curl_xml="yes"
6133 if test "x$with_libyajl" = "xyes"
6138 if test "x$have_processor_info" = "xyes"
6142 if test "x$have_sysctl" = "xyes"
6147 if test "x$ac_system" = "xDarwin"
6152 if test "x$have_sysctlbyname" = "xyes"
6154 plugin_contextswitch="yes"
6157 plugin_tcpconns="yes"
6160 # Df plugin: Check if we know how to determine mount points first.
6161 #if test "x$have_listmntent" = "xyes"; then
6164 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6168 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6172 #if test "x$have_getmntent" = "xseq"
6176 if test "x$c_cv_have_one_getmntent" = "xyes"
6181 if test "x$c_cv_have_getmntent_r" = "xyes"
6186 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6187 if test "x$plugin_df" = "xyes"
6190 if test "x$have_statfs" = "xyes"
6194 if test "x$have_statvfs" = "xyes"
6200 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6202 plugin_ethstat="yes"
6205 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6210 if test "x$have_getifaddrs" = "xyes"
6212 plugin_interface="yes"
6215 if test "x$with_libgps" = "xyes"
6220 if test "x$have_getloadavg" = "xyes"
6225 if test "x$with_libyajl" = "xyes"
6227 plugin_log_logstash="yes"
6230 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6235 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6238 if test "x$with_libmicrohttpd" = "xyes"
6240 plugin_write_prometheus="yes"
6244 # Mac OS X memory interface
6245 if test "x$have_host_statistics" = "xyes"
6250 if test "x$have_termios_h" = "xyes"
6252 if test "x$ac_system" != "xAIX"
6254 plugin_multimeter="yes"
6259 if test "x$have_thread_info" = "xyes"
6261 plugin_processes="yes"
6264 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6266 plugin_processes="yes"
6269 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6271 plugin_processes="yes"
6274 if test "x$with_libpython" != "xno"
6279 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6284 if test "x$with_kvm_getswapinfo" = "xyes"
6289 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6294 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6299 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6301 plugin_tcpconns="yes"
6304 if test "x$have_getutent" = "xyes"
6308 if test "x$have_getutxent" = "xyes"
6313 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6318 if test "x$with_libxenctrl" = "xyes"
6323 if test "x$with_libdpdk" = "xyes"
6325 plugin_dpdkstat="yes"
6328 m4_divert_once([HELP_ENABLE], [
6331 AC_ARG_ENABLE([all-plugins],
6332 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6334 if test "x$enableval" = "xyes"
6336 enable_all_plugins="yes"
6337 else if test "x$enableval" = "xauto"
6339 enable_all_plugins="auto"
6341 enable_all_plugins="no"
6344 [enable_all_plugins="auto"])
6346 m4_divert_once([HELP_ENABLE], [])
6348 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6349 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6350 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6351 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6352 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6353 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6354 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6355 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6356 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6357 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6358 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6359 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6360 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6361 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6362 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6363 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6364 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6365 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6366 AC_PLUGIN([csv], [yes], [CSV output plugin])
6367 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6368 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6369 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6370 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6371 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6372 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6373 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6374 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats & Status from DPDK])
6375 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6376 AC_PLUGIN([email], [yes], [EMail statistics])
6377 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6378 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6379 AC_PLUGIN([exec], [yes], [Execution of external programs])
6380 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6381 AC_PLUGIN([filecount], [yes], [Count files in directories])
6382 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6383 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6384 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6385 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6386 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6387 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6388 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6389 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6390 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6391 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6392 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6393 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6394 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6395 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6396 AC_PLUGIN([load], [$plugin_load], [System load])
6397 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6398 AC_PLUGIN([logfile], [yes], [File logging plugin])
6399 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6400 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6401 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6402 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6403 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6404 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6405 AC_PLUGIN([match_regex], [yes], [The regex match])
6406 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6407 AC_PLUGIN([match_value], [yes], [The value match])
6408 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6409 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6410 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6411 AC_PLUGIN([memcached], [yes], [memcached statistics])
6412 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6413 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6414 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6415 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6416 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6417 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6418 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6419 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6420 AC_PLUGIN([network], [yes], [Network communication plugin])
6421 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6422 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6423 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6424 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6425 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6426 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6427 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6428 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6429 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6430 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6431 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6432 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6433 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6434 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6435 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6436 # FIXME: Check for libevent, too.
6437 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6438 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6439 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6440 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6441 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6442 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6443 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6444 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6445 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6446 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6447 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6448 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6449 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6450 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6451 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6452 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6453 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6454 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6455 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6456 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6457 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6458 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6459 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6460 AC_PLUGIN([target_notification], [yes], [The notification target])
6461 AC_PLUGIN([target_replace], [yes], [The replace target])
6462 AC_PLUGIN([target_scale], [yes], [The scale target])
6463 AC_PLUGIN([target_set], [yes], [The set target])
6464 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6465 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6466 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6467 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6468 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6469 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6470 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6471 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6472 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6473 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6474 AC_PLUGIN([users], [$plugin_users], [User statistics])
6475 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6476 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6477 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6478 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6479 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6480 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6481 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6482 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6483 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6484 AC_PLUGIN([write_log], [yes], [Log output plugin])
6485 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6486 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6487 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6488 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6489 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6490 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6491 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6492 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6493 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6494 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6495 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6497 dnl Default configuration file
6498 # Load either syslog or logfile
6499 LOAD_PLUGIN_SYSLOG=""
6500 LOAD_PLUGIN_LOGFILE=""
6501 LOAD_PLUGIN_LOG_LOGSTASH=""
6503 AC_MSG_CHECKING([which default log plugin to load])
6504 default_log_plugin="none"
6505 if test "x$enable_syslog" = "xyes"
6507 default_log_plugin="syslog"
6509 LOAD_PLUGIN_SYSLOG="##"
6512 if test "x$enable_logfile" = "xyes"
6514 if test "x$default_log_plugin" = "xnone"
6516 default_log_plugin="logfile"
6518 LOAD_PLUGIN_LOGFILE="#"
6521 LOAD_PLUGIN_LOGFILE="##"
6524 if test "x$enable_log_logstash" = "xyes"
6526 LOAD_PLUGIN_LOG_LOGSTASH="#"
6528 LOAD_PLUGIN_LOG_LOGSTASH="##"
6532 AC_MSG_RESULT([$default_log_plugin])
6534 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6535 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6536 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6538 DEFAULT_LOG_LEVEL="info"
6539 if test "x$enable_debug" = "xyes"
6541 DEFAULT_LOG_LEVEL="debug"
6543 AC_SUBST(DEFAULT_LOG_LEVEL)
6545 # Load only one of rrdtool, network, csv in the default config.
6546 LOAD_PLUGIN_RRDTOOL=""
6547 LOAD_PLUGIN_NETWORK=""
6550 AC_MSG_CHECKING([which default write plugin to load])
6551 default_write_plugin="none"
6552 if test "x$enable_rrdtool" = "xyes"
6554 default_write_plugin="rrdtool"
6556 LOAD_PLUGIN_RRDTOOL="##"
6559 if test "x$enable_network" = "xyes"
6561 if test "x$default_write_plugin" = "xnone"
6563 default_write_plugin="network"
6565 LOAD_PLUGIN_NETWORK="#"
6568 LOAD_PLUGIN_NETWORK="##"
6571 if test "x$enable_csv" = "xyes"
6573 if test "x$default_write_plugin" = "xnone"
6575 default_write_plugin="csv"
6580 LOAD_PLUGIN_CSV="##"
6582 AC_MSG_RESULT([$default_write_plugin])
6584 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6585 AC_SUBST(LOAD_PLUGIN_NETWORK)
6586 AC_SUBST(LOAD_PLUGIN_CSV)
6589 if test "x$ac_system" = "xLinux" \
6590 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6592 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6595 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6597 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6601 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6602 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6604 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6606 PERL_BINDINGS_OPTIONS="$withval"
6607 with_perl_bindings="yes"
6609 with_perl_bindings="$withval"
6613 if test -n "$perl_interpreter"
6615 with_perl_bindings="yes"
6617 with_perl_bindings="no (no perl interpreter found)"
6621 if test "x$with_perl_bindings" = "xyes"
6623 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6624 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6625 AC_MSG_RESULT([yes])
6628 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6632 if test "x$with_perl_bindings" = "xyes"
6634 PERL_BINDINGS="perl"
6638 AC_SUBST(PERL_BINDINGS)
6639 AC_SUBST(PERL_BINDINGS_OPTIONS)
6641 dnl libcollectdclient
6642 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6643 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6644 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6646 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6648 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6650 AC_SUBST(LCC_VERSION_MAJOR)
6651 AC_SUBST(LCC_VERSION_MINOR)
6652 AC_SUBST(LCC_VERSION_PATCH)
6653 AC_SUBST(LCC_VERSION_EXTRA)
6654 AC_SUBST(LCC_VERSION_STRING)
6656 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6660 if test "x$enable_werror" != "xno"
6662 AM_CFLAGS="$AM_CFLAGS -Werror"
6663 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6665 AC_SUBST([AM_CFLAGS])
6666 AC_SUBST([AM_CXXFLAGS])
6668 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])
6671 if test "x$with_librrd" = "xyes" \
6672 && test "x$librrd_threadsafe" != "xyes"
6674 with_librrd="yes (warning: librrd is not thread-safe)"
6677 if test "x$with_libperl" = "xyes"
6679 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6681 enable_perl="no (needs libperl)"
6684 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6686 enable_perl="no (libperl doesn't support ithreads)"
6689 if test "x$with_perl_bindings" = "xyes" \
6690 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6692 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6696 AC_MSG_RESULT([Configuration:])
6697 AC_MSG_RESULT([ Build:])
6698 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6699 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6700 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6701 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6702 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6703 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6704 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6705 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6706 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6707 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6708 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6709 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6711 AC_MSG_RESULT([ Libraries:])
6712 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6713 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6714 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6715 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6716 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6717 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6718 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6719 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6720 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6721 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6722 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6723 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6724 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6725 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6726 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6727 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6728 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6729 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6730 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6731 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6732 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6733 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6734 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6735 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6736 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6737 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6738 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6739 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6740 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6741 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6742 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6743 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6744 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6745 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6746 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6747 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6748 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6749 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6750 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6751 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6752 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6753 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6754 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6755 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6756 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6757 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6758 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6759 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6760 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6761 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6762 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6763 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6764 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6765 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6766 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6767 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6768 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6769 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6770 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6771 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6772 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6773 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6774 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6775 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6777 AC_MSG_RESULT([ Features:])
6778 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6779 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6781 AC_MSG_RESULT([ Bindings:])
6782 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6784 AC_MSG_RESULT([ Modules:])
6785 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6786 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6787 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6788 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6789 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6790 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6791 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6792 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6793 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6794 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6795 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6796 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6797 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6798 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6799 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6800 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6801 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6802 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6803 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6804 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6805 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6806 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6807 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6808 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6809 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6810 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6811 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6812 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6813 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6814 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6815 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6816 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6817 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6818 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6819 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6820 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6821 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6822 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6823 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6824 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6825 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6826 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6827 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6828 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6829 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6830 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6831 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6832 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6833 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6834 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6835 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6836 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6837 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6838 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6839 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6840 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6841 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6842 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6843 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6844 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6845 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6846 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6847 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6848 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
6849 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
6850 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
6851 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
6852 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
6853 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
6854 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
6855 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
6856 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
6857 AC_MSG_RESULT([ network . . . . . . . $enable_network])
6858 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
6859 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
6860 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
6861 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
6862 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
6863 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
6864 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
6865 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
6866 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
6867 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
6868 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
6869 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
6870 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
6871 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
6872 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
6873 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
6874 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
6875 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
6876 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
6877 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
6878 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
6879 AC_MSG_RESULT([ python . . . . . . . $enable_python])
6880 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
6881 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
6882 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
6883 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
6884 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
6885 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
6886 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
6887 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
6888 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
6889 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
6890 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
6891 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
6892 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
6893 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
6894 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
6895 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
6896 AC_MSG_RESULT([ target_notification . $enable_target_notification])
6897 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
6898 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
6899 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
6900 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
6901 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
6902 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
6903 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
6904 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
6905 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
6906 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
6907 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
6908 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
6909 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
6910 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
6911 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
6912 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
6913 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
6914 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
6915 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
6916 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
6917 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
6918 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
6919 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
6920 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
6921 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
6922 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
6923 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
6924 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
6925 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
6926 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
6927 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
6928 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
6929 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
6930 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
6931 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
6934 if test "x$dependency_error" = "xyes"; then
6935 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
6938 if test "x$dependency_warning" = "xyes"; then
6939 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
6942 # vim: set fdm=marker :