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([libltdl/config])
8 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
9 dnl we don't really need the 'u' even in older toolchains. Then there is
10 dnl older libtool, which spelled it AR_FLAGS
11 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
13 m4_ifdef([LT_PACKAGE_VERSION],
16 LT_CONFIG_LTDL_DIR([libltdl])
18 LTDL_INIT([convenience])
19 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
24 AC_LIBLTDL_CONVENIENCE
28 AC_CONFIG_SUBDIRS(libltdl)
29 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
33 AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
35 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 AC_PREFIX_DEFAULT("/opt/collectd")
44 # Checks for programs.
47 [AC_MSG_ERROR([No compiler found that supports C99])]
56 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
63 AC_PATH_PROG([VALGRIND], [valgrind])
65 # Warn when pkg.m4 is missing
66 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
70 AC_CACHE_CHECK([if bison is the parser generator],
71 [collectd_cv_prog_bison],
72 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
73 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
77 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
79 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
82 AC_ARG_VAR([PROTOC], [path to the protoc binary])
83 AC_PATH_PROG([PROTOC], [protoc])
85 if test "x$PROTOC" != "x"; then
86 AC_MSG_CHECKING([for protoc 3.0.0+])
87 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
88 protoc3="yes (`$PROTOC --version`)"
91 protoc3="no (`$PROTOC --version`)"
93 AC_MSG_RESULT([$protoc3])
95 AM_CONDITIONAL(HAVE_PROTOC3, test "x$have_protoc3" = "xyes")
97 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
98 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
99 AM_CONDITIONAL(HAVE_GRPC_CPP, test "x$GRPC_CPP_PLUGIN" != "x")
101 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
102 AC_PATH_PROG([PROTOC_C], [protoc-c])
103 if test "x$PROTOC_C" = "x"
105 have_protoc_c="no (protoc-c compiler not found)"
110 AC_MSG_CHECKING([for kernel type ($host_os)])
113 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
117 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
121 AC_DEFINE([KERNEL_DARWIN], 1, [True if program is to be compiled for a Darwin kernel])
125 AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel])
129 AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel])
133 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
137 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
143 AC_MSG_RESULT([$ac_system])
145 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
146 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
147 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
148 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
149 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
150 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
152 if test "x$ac_system" = "xLinux"
154 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
155 if test -z "$KERNEL_DIR"
157 KERNEL_DIR="/lib/modules/`uname -r`/source"
160 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
161 AC_SUBST(KERNEL_CFLAGS)
164 if test "x$ac_system" = "xSolaris"
166 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
167 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
169 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
170 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
172 # error "Compiler not in 64bit mode."
175 [AC_MSG_RESULT([yes])],
178 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
182 if test "x$ac_system" = "xAIX"
184 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
187 # Where to install .pc files.
188 pkgconfigdir="${libdir}/pkgconfig"
189 AC_SUBST(pkgconfigdir)
191 # Check for standards compliance mode
192 AC_ARG_ENABLE(standards,
193 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
194 [enable_standards="$enableval"],
195 [enable_standards="no"])
196 if test "x$enable_standards" = "xyes"
198 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
199 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
200 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
201 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
202 if test "x$GCC" = "xyes"
204 CFLAGS="$CFLAGS -std=c99"
207 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
210 # Checks for header files.
266 # For entropy plugin on newer NetBSD
267 AC_CHECK_HEADERS(sys/rndio.h, [], [],
268 [#if HAVE_SYS_TYPES_H
269 # include <sys/types.h>
272 # include <sys/ioctl.h>
275 # include <sys/param.h>
280 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
285 # include <sys/types.h>
288 AC_CHECK_HEADERS(netinet/in.h, [], [],
293 # include <sys/types.h>
295 #if HAVE_NETINET_IN_SYSTM_H
296 # include <netinet/in_systm.h>
299 AC_CHECK_HEADERS(netinet/ip.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>
313 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
318 # include <sys/types.h>
320 #if HAVE_NETINET_IN_SYSTM_H
321 # include <netinet/in_systm.h>
323 #if HAVE_NETINET_IN_H
324 # include <netinet/in.h>
326 #if HAVE_NETINET_IP_H
327 # include <netinet/ip.h>
330 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
335 # include <sys/types.h>
337 #if HAVE_NETINET_IN_SYSTM_H
338 # include <netinet/in_systm.h>
340 #if HAVE_NETINET_IN_H
341 # include <netinet/in.h>
343 #if HAVE_NETINET_IP_H
344 # include <netinet/ip.h>
347 AC_CHECK_HEADERS(netinet/ip6.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>
361 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
366 # include <sys/types.h>
368 #if HAVE_NETINET_IN_SYSTM_H
369 # include <netinet/in_systm.h>
371 #if HAVE_NETINET_IN_H
372 # include <netinet/in.h>
374 #if HAVE_NETINET_IP6_H
375 # include <netinet/ip6.h>
378 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
383 # include <sys/types.h>
385 #if HAVE_NETINET_IN_SYSTM_H
386 # include <netinet/in_systm.h>
388 #if HAVE_NETINET_IN_H
389 # include <netinet/in.h>
391 #if HAVE_NETINET_IP_H
392 # include <netinet/ip.h>
395 AC_CHECK_HEADERS(netinet/udp.h, [], [],
400 # include <sys/types.h>
402 #if HAVE_NETINET_IN_SYSTM_H
403 # include <netinet/in_systm.h>
405 #if HAVE_NETINET_IN_H
406 # include <netinet/in.h>
408 #if HAVE_NETINET_IP_H
409 # include <netinet/ip.h>
414 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
419 # include <sys/types.h>
421 #if HAVE_NETINET_IN_SYSTM_H
422 # include <netinet/in_systm.h>
424 #if HAVE_NETINET_IN_H
425 # include <netinet/in.h>
427 #if HAVE_NETINET_IP6_H
428 # include <netinet/ip6.h>
432 if test "x$have_ip6_ext" = "xno"; then
433 SAVE_CFLAGS="$CFLAGS"
434 CFLAGS="$CFLAGS -DSOLARIS2=8"
436 AC_CHECK_TYPES([struct ip6_ext],
437 [have_ip6_ext="yes, with -DSOLARIS2=8"],
443 # include <sys/types.h>
445 #if HAVE_NETINET_IN_SYSTM_H
446 # include <netinet/in_systm.h>
448 #if HAVE_NETINET_IN_H
449 # include <netinet/in.h>
451 #if HAVE_NETINET_IP6_H
452 # include <netinet/ip6.h>
456 if test "x$have_ip6_ext" = "xno"; then
457 CFLAGS="$SAVE_CFLAGS"
462 AC_CHECK_HEADERS(sys/dkstat.h)
463 if test "x$ac_system" = "xDarwin"
465 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)
466 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
467 # For the battery plugin
468 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
470 #if HAVE_IOKIT_IOKITLIB_H
471 # include <IOKit/IOKitLib.h>
473 #if HAVE_IOKIT_IOTYPES_H
474 # include <IOKit/IOTypes.h>
480 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
483 # include <sys/types.h>
486 # include <sys/param.h>
490 AC_MSG_CHECKING([for sysctl kern.cp_times])
491 if test -x /sbin/sysctl
493 /sbin/sysctl kern.cp_times >/dev/null 2>&1
497 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
498 [Define if sysctl supports kern.cp_times])
506 AC_MSG_CHECKING([for sysctl kern.cp_time])
507 if test -x /sbin/sysctl
509 /sbin/sysctl kern.cp_time >/dev/null 2>&1
513 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1,
514 [Define if sysctl supports kern.cp_time])
523 AC_CHECK_HEADERS(linux/major.h)
525 # For md module (Linux only)
526 if test "x$ac_system" = "xLinux"
528 AC_CHECK_HEADERS(linux/raid/md_u.h,
529 [have_linux_raid_md_u_h="yes"],
530 [have_linux_raid_md_u_h="no"],
532 #include <sys/ioctl.h>
533 #include <linux/major.h>
534 #include <linux/types.h>
536 AC_CHECK_HEADERS([sys/sysmacros.h])
538 have_linux_raid_md_u_h="no"
541 # For the wireless module
542 have_linux_wireless_h="no"
543 if test "x$ac_system" = "xLinux"
545 AC_CHECK_HEADERS(linux/wireless.h,
546 [have_linux_wireless_h="yes"],
547 [have_linux_wireless_h="no"],
550 #include <sys/ioctl.h>
551 #include <sys/socket.h>
555 # For the swap module
556 have_sys_swap_h="yes"
557 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
559 #undef _FILE_OFFSET_BITS
560 #undef _LARGEFILE64_SOURCE
562 # include <sys/types.h>
565 # include <sys/param.h>
570 # For the processes plugin
572 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
574 # For interface plugin
575 AC_CHECK_HEADERS(ifaddrs.h)
576 AC_CHECK_HEADERS(net/if.h, [], [],
579 # include <sys/types.h>
581 #if HAVE_SYS_SOCKET_H
582 # include <sys/socket.h>
585 AC_CHECK_HEADERS(linux/if.h, [], [],
588 # include <sys/types.h>
590 #if HAVE_SYS_SOCKET_H
591 # include <sys/socket.h>
594 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
597 # include <sys/types.h>
599 #if HAVE_SYS_SOCKET_H
600 # include <sys/socket.h>
602 #if HAVE_LINUX_INET_DIAG_H
603 # include <linux/inet_diag.h>
606 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
609 # include <sys/types.h>
611 #if HAVE_SYS_SOCKET_H
612 # include <sys/socket.h>
615 # include <linux/if.h>
620 AC_CHECK_HEADERS(linux/sockios.h,
621 [have_linux_sockios_h="yes"],
622 [have_linux_sockios_h="no"],
625 # include <sys/ioctl.h>
631 AC_CHECK_HEADERS(linux/ethtool.h,
632 [have_linux_ethtool_h="yes"],
633 [have_linux_ethtool_h="no"],
636 # include <sys/ioctl.h>
641 #if HAVE_LINUX_SOCKIOS_H
642 # include <linux/sockios.h>
647 have_linux_ip_vs_h="no"
648 have_net_ip_vs_h="no"
650 ip_vs_h_needs_kernel_cflags="no"
651 if test "x$ac_system" = "xLinux"
653 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
654 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
655 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
657 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
659 SAVE_CFLAGS="$CFLAGS"
660 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
662 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
664 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
665 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
666 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
668 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
670 ip_vs_h_needs_kernel_cflags="yes"
673 CFLAGS="$SAVE_CFLAGS"
676 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
679 AC_CHECK_HEADERS(sys/ucred.h, [], [],
682 # include <sys/types.h>
685 # include <sys/param.h>
689 # For mount interface
690 AC_CHECK_HEADERS(sys/mount.h, [], [],
693 # include <sys/types.h>
696 # include <sys/param.h>
700 # For the email plugin
701 AC_CHECK_HEADERS(linux/un.h, [], [],
703 #if HAVE_SYS_SOCKET_H
704 # include <sys/socket.h>
710 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
715 if test "x$enable_xfs" != "xno"; then
716 AC_CHECK_HEADERS([xfs/xqm.h],
719 if test "x$enable_xfs" = "xyes"; then
720 AC_MSG_ERROR([xfs/xqm.h not found])
723 [[#define _GNU_SOURCE]]
730 AC_CHECK_HEADERS(arpa/nameser.h)
731 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
733 #if HAVE_ARPA_NAMESER_H
734 # include <arpa/nameser.h>
738 AC_CHECK_HEADERS(net/if_arp.h, [], [],
739 [#if HAVE_SYS_SOCKET_H
740 # include <sys/socket.h>
743 AC_CHECK_HEADERS(net/ppp_defs.h)
744 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
745 [#if HAVE_NET_PPP_DEFS_H
746 # include <net/ppp_defs.h>
749 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
754 # include <sys/types.h>
756 #if HAVE_SYS_SOCKET_H
757 # include <sys/socket.h>
762 #if HAVE_NETINET_IN_H
763 # include <netinet/in.h>
767 have_net_pfvar_h="no"
768 AC_CHECK_HEADERS(net/pfvar.h,
769 [have_net_pfvar_h="yes"],
770 [have_net_pfvar_h="no"],
773 # include <sys/ioctl.h>
775 #if HAVE_SYS_SOCKET_H
776 # include <sys/socket.h>
781 #if HAVE_NETINET_IN_H
782 # include <netinet/in.h>
786 # For the multimeter plugin
788 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
790 # For cpusleep plugin
791 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
792 [c_cv_have_clock_boottime_monotonic],
793 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
798 struct timespec b, m;
799 clock_gettime(CLOCK_BOOTTIME, &b );
800 clock_gettime(CLOCK_MONOTONIC, &m );
803 [c_cv_have_clock_boottime_monotonic="yes"],
804 [c_cv_have_clock_boottime_monotonic="no"]))
807 # For the turbostat plugin
808 have_asm_msrindex_h="no"
809 AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
811 if test "x$have_asm_msrindex_h" = "xyes"
813 AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
814 [c_cv_have_usable_asm_msrindex_h],
815 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
817 #include<asm/msr-index.h>
820 int y = MSR_PKG_C10_RESIDENCY;
824 [c_cv_have_usable_asm_msrindex_h="yes"],
825 [c_cv_have_usable_asm_msrindex_h="no"],
831 AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
833 have_capability="yes"
834 AC_CHECK_HEADERS(sys/capability.h,
835 [have_capability="yes"],
836 [have_capability="no (<sys/capability.h> not found)"])
837 if test "x$have_capability" = "xyes"; then
838 AC_CHECK_LIB(cap, cap_get_proc,
839 [have_capability="yes"],
840 [have_capability="no (cap_get_proc() not found)"])
842 if test "x$have_capability" = "xyes"; then
843 AC_CHECK_DECL([CAP_IS_SUPPORTED],
844 [have_capability="yes"],
845 [have_capability="no (CAP_IS_SUPPORTED not found)"],
846 [[#include <sys/capability.h>]])
848 if test "x$have_capability" = "xyes"; then
849 AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_proc() (-lcap).])
851 AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes")
854 # Checks for typedefs, structures, and compiler characteristics.
863 # Checks for library functions.
865 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)
872 AC_LANG_SOURCE([[int main(void){}]])
874 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
881 SAVE_CFLAGS="$CFLAGS"
882 # Emulate behavior of src/Makefile.am
883 if test "x$GCC" = "xyes"
885 CFLAGS="$CFLAGS -Wall -Werror"
888 AC_CACHE_CHECK([for strtok_r],
889 [c_cv_have_strtok_r_default],
898 char buffer[] = "foo,bar,baz";
905 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
908 printf ("token = %s;\n", token);
912 [c_cv_have_strtok_r_default="yes"],
913 [c_cv_have_strtok_r_default="no"]
917 if test "x$c_cv_have_strtok_r_default" = "xno"
919 CFLAGS="$CFLAGS -D_REENTRANT=1"
921 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
922 [c_cv_have_strtok_r_reentrant],
931 char buffer[] = "foo,bar,baz";
938 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
941 printf ("token = %s;\n", token);
945 [c_cv_have_strtok_r_reentrant="yes"],
946 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
951 CFLAGS="$SAVE_CFLAGS"
952 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
954 CFLAGS="$CFLAGS -D_REENTRANT=1"
957 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
959 socket_needs_socket="no"
960 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
961 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
963 clock_gettime_needs_rt="no"
964 clock_gettime_needs_posix4="no"
965 have_clock_gettime="no"
966 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
967 if test "x$have_clock_gettime" = "xno"
969 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
970 have_clock_gettime="yes"])
972 if test "x$have_clock_gettime" = "xno"
974 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
975 have_clock_gettime="yes"])
977 if test "x$have_clock_gettime" = "xyes"
979 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
982 nanosleep_needs_rt="no"
983 nanosleep_needs_posix4="no"
984 AC_CHECK_FUNCS(nanosleep,
986 AC_CHECK_LIB(rt, nanosleep,
987 [nanosleep_needs_rt="yes"],
988 AC_CHECK_LIB(posix4, nanosleep,
989 [nanosleep_needs_posix4="yes"],
990 AC_MSG_ERROR(cannot find nanosleep))))
992 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
993 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
995 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
996 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
997 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
998 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
999 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
1000 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
1001 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
1002 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
1003 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
1004 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
1005 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
1006 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
1008 # Check for strptime {{{
1009 if test "x$GCC" = "xyes"
1011 SAVE_CFLAGS="$CFLAGS"
1012 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
1015 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
1016 if test "x$have_strptime" = "xyes"
1018 AC_CACHE_CHECK([whether strptime is exported by default],
1019 [c_cv_have_strptime_default],
1020 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1026 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1029 [c_cv_have_strptime_default="yes"],
1030 [c_cv_have_strptime_default="no"]))
1032 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
1034 AC_CACHE_CHECK([whether strptime needs standards mode],
1035 [c_cv_have_strptime_standards],
1036 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1038 #ifndef _ISOC99_SOURCE
1039 # define _ISOC99_SOURCE 1
1041 #ifndef _POSIX_C_SOURCE
1042 # define _POSIX_C_SOURCE 200112L
1044 #ifndef _XOPEN_SOURCE
1045 # define _XOPEN_SOURCE 500
1051 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1054 [c_cv_have_strptime_standards="yes"],
1055 [c_cv_have_strptime_standards="no"]))
1057 if test "x$c_cv_have_strptime_standards" = "xyes"
1059 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
1065 if test "x$GCC" = "xyes"
1067 CFLAGS="$SAVE_CFLAGS"
1069 # }}} Check for strptime
1071 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
1072 if test "x$have_swapctl" = "xyes"; then
1073 AC_CACHE_CHECK([whether swapctl takes two arguments],
1074 [c_cv_have_swapctl_two_args],
1075 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1077 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1078 # undef _FILE_OFFSET_BITS
1079 # undef _LARGEFILE64_SOURCE
1081 #include <sys/stat.h>
1082 #include <sys/param.h>
1083 #include <sys/swap.h>
1087 int num = swapctl(0, NULL);
1090 [c_cv_have_swapctl_two_args="yes"],
1091 [c_cv_have_swapctl_two_args="no"]
1094 AC_CACHE_CHECK([whether swapctl takes three arguments],
1095 [c_cv_have_swapctl_three_args],
1099 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1100 # undef _FILE_OFFSET_BITS
1101 # undef _LARGEFILE64_SOURCE
1103 #include <sys/stat.h>
1104 #include <sys/param.h>
1105 #include <sys/swap.h>
1109 int num = swapctl(0, NULL, 0);
1112 [c_cv_have_swapctl_three_args="yes"],
1113 [c_cv_have_swapctl_three_args="no"]
1117 # Check for different versions of `swapctl' here..
1118 if test "x$have_swapctl" = "xyes"; then
1119 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1120 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
1121 [Define if the function swapctl exists and takes two arguments.])
1123 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1124 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
1125 [Define if the function swapctl exists and takes three arguments.])
1130 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1132 if test "x$withval" = "xno"; then
1134 else if test "x$withval" = "xyes"; then
1141 if test "x$nan_type" = "xnone"; then
1142 AC_CACHE_CHECK([whether NAN is defined by default],
1143 [c_cv_have_nan_default],
1144 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1148 static double foo = NAN;
1157 [c_cv_have_nan_default="yes"],
1158 [c_cv_have_nan_default="no"]
1161 if test "x$c_cv_have_nan_default" = "xyes"
1166 if test "x$nan_type" = "xnone"; then
1167 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1168 [c_cv_have_nan_isoc],
1169 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1172 #define __USE_ISOC99 1
1174 static double foo = NAN;
1183 [c_cv_have_nan_isoc="yes"],
1184 [c_cv_have_nan_isoc="no"]
1187 if test "x$c_cv_have_nan_isoc" = "xyes"
1192 if test "x$nan_type" = "xnone"; then
1193 SAVE_LDFLAGS=$LDFLAGS
1194 LDFLAGS="$LDFLAGS -lm"
1195 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1196 [c_cv_have_nan_zero],
1197 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1204 #define NAN (0.0 / 0.0)
1206 # define isnan(f) ((f) != (f))
1208 static double foo = NAN;
1217 [c_cv_have_nan_zero="yes"],
1218 [c_cv_have_nan_zero="no"]
1221 LDFLAGS=$SAVE_LDFLAGS
1222 if test "x$c_cv_have_nan_zero" = "xyes"
1228 if test "x$nan_type" = "xdefault"; then
1229 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1230 [Define if NAN is defined by default and can initialize static variables.])
1231 else if test "x$nan_type" = "xisoc99"; then
1232 AC_DEFINE(NAN_STATIC_ISOC, 1,
1233 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1234 else if test "x$nan_type" = "xzero"; then
1235 AC_DEFINE(NAN_ZERO_ZERO, 1,
1236 [Define if NAN can be defined as (0.0 / 0.0)])
1238 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1241 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1243 if test "x$withval" = "xnothing"; then
1244 fp_layout_type="nothing"
1245 else if test "x$withval" = "xendianflip"; then
1246 fp_layout_type="endianflip"
1247 else if test "x$withval" = "xintswap"; then
1248 fp_layout_type="intswap"
1250 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1253 [fp_layout_type="unknown"])
1255 if test "x$fp_layout_type" = "xunknown"; then
1256 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1257 [c_cv_fp_layout_need_nothing],
1258 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1264 # include <stdint.h>
1267 # include <inttypes.h>
1270 # include <stdbool.h>
1280 memcpy ((void *) &i0, (void *) &d, 8);
1283 memcpy ((void *) c, (void *) &i1, 8);
1285 if ((c[0] == 0x2f) && (c[1] == 0x25)
1286 && (c[2] == 0xc0) && (c[3] == 0xc7)
1287 && (c[4] == 0x43) && (c[5] == 0x2b)
1288 && (c[6] == 0x1f) && (c[7] == 0x5b))
1294 [c_cv_fp_layout_need_nothing="yes"],
1295 [c_cv_fp_layout_need_nothing="no"]
1298 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1299 fp_layout_type="nothing"
1302 if test "x$fp_layout_type" = "xunknown"; then
1303 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1304 [c_cv_fp_layout_need_endianflip],
1305 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1311 # include <stdint.h>
1314 # include <inttypes.h>
1317 # include <stdbool.h>
1319 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1320 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1321 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1322 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1323 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1324 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1325 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1326 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1335 memcpy ((void *) &i0, (void *) &d, 8);
1337 i1 = endianflip (i0);
1338 memcpy ((void *) c, (void *) &i1, 8);
1340 if ((c[0] == 0x2f) && (c[1] == 0x25)
1341 && (c[2] == 0xc0) && (c[3] == 0xc7)
1342 && (c[4] == 0x43) && (c[5] == 0x2b)
1343 && (c[6] == 0x1f) && (c[7] == 0x5b))
1349 [c_cv_fp_layout_need_endianflip="yes"],
1350 [c_cv_fp_layout_need_endianflip="no"]
1353 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1354 fp_layout_type="endianflip"
1357 if test "x$fp_layout_type" = "xunknown"; then
1358 AC_CACHE_CHECK([if intswap converts to x86 representation],
1359 [c_cv_fp_layout_need_intswap],
1360 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1366 # include <stdint.h>
1369 # include <inttypes.h>
1372 # include <stdbool.h>
1374 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1375 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1384 memcpy ((void *) &i0, (void *) &d, 8);
1387 memcpy ((void *) c, (void *) &i1, 8);
1389 if ((c[0] == 0x2f) && (c[1] == 0x25)
1390 && (c[2] == 0xc0) && (c[3] == 0xc7)
1391 && (c[4] == 0x43) && (c[5] == 0x2b)
1392 && (c[6] == 0x1f) && (c[7] == 0x5b))
1398 [c_cv_fp_layout_need_intswap="yes"],
1399 [c_cv_fp_layout_need_intswap="no"]
1402 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1403 fp_layout_type="intswap"
1407 if test "x$fp_layout_type" = "xnothing"; then
1408 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1409 [Define if doubles are stored in x86 representation.])
1410 else if test "x$fp_layout_type" = "xendianflip"; then
1411 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1412 [Define if endianflip is needed to convert to x86 representation.])
1413 else if test "x$fp_layout_type" = "xintswap"; then
1414 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1415 [Define if intswap is needed to convert to x86 representation.])
1417 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1420 # --with-useragent {{{
1421 AC_ARG_WITH(useragent, [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1423 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1425 AC_DEFINE_UNQUOTED(COLLECTD_USERAGENT, ["$withval"], [User agent for http requests])
1431 # --with-data-max-name-len {{{
1432 AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1434 if test "x$withval" != "x" && test $withval -gt 0
1436 AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
1438 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1441 [ AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
1446 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1447 have_getvfsstat="no"
1448 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1449 have_listmntent="no"
1450 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1451 have_getmntent_r="no"
1452 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1455 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1456 if test "x$have_getmntent" = "xno"; then
1457 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1459 if test "x$have_getmntent" = "xno"; then
1460 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1462 if test "x$have_getmntent" = "xno"; then
1463 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1466 if test "x$have_getmntent" = "xc"; then
1467 AC_CACHE_CHECK([whether getmntent takes one argument],
1468 [c_cv_have_one_getmntent],
1472 #include "$srcdir/src/utils_mount.h"
1477 fh = setmntent ("/etc/mtab", "r");
1478 me = getmntent (fh);
1479 return(me->mnt_passno);
1482 [c_cv_have_one_getmntent="yes"],
1483 [c_cv_have_one_getmntent="no"]
1486 AC_CACHE_CHECK([whether getmntent takes two arguments],
1487 [c_cv_have_two_getmntent],
1491 #include "$srcdir/src/utils_mount.h"
1497 fh = fopen ("/etc/mnttab", "r");
1498 status = getmntent (fh, &mt);
1502 [c_cv_have_two_getmntent="yes"],
1503 [c_cv_have_two_getmntent="no"]
1508 # Check for different versions of `getmntent' here..
1510 if test "x$have_getmntent" = "xc"; then
1511 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1512 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1513 [Define if the function getmntent exists and takes one argument.])
1515 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1516 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1517 [Define if the function getmntent exists and takes two arguments.])
1520 if test "x$have_getmntent" = "xsun"; then
1521 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1522 [Define if the function getmntent exists. It is the version from libsun.])
1524 if test "x$have_getmntent" = "xseq"; then
1525 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1526 [Define if the function getmntent exists. It is the version from libseq.])
1528 if test "x$have_getmntent" = "xgen"; then
1529 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1530 [Define if the function getmntent exists. It is the version from libgen.])
1534 AC_CACHE_CHECK([if have htonll defined],
1536 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1538 #include <sys/types.h>
1539 #include <netinet/in.h>
1541 # include <inttypes.h>
1548 [c_cv_have_htonll="yes"],
1549 [c_cv_have_htonll="no"]
1552 if test "x$c_cv_have_htonll" = "xyes"
1554 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1557 # Check for structures
1558 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1559 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1562 #include <sys/types.h>
1563 #include <sys/socket.h>
1566 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1567 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1570 #include <sys/types.h>
1571 #include <sys/socket.h>
1572 #include <linux/if.h>
1573 #include <linux/netdevice.h>
1575 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1576 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1579 #include <linux/inet_diag.h>
1583 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1586 #include <netinet/in.h>
1590 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1592 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1593 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1594 have_struct_kinfo_proc_freebsd="yes"
1597 have_struct_kinfo_proc_freebsd="no"
1601 #include <sys/param.h>
1602 #include <sys/sysctl.h>
1603 #include <sys/user.h>
1606 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1608 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1609 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1610 have_struct_kinfo_proc_openbsd="yes"
1613 have_struct_kinfo_proc_openbsd="no"
1616 #include <sys/param.h>
1617 #include <sys/sysctl.h>
1622 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1624 AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
1625 [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1626 have_struct_kinfo_proc2_netbsd="yes"
1629 have_struct_kinfo_proc2_netbsd="no"
1632 #include <sys/param.h>
1633 #include <sys/sysctl.h>
1639 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1640 [#define _BSD_SOURCE
1641 #define _DEFAULT_SOURCE
1643 # include <stdint.h>
1645 #if HAVE_SYS_TYPES_H
1646 # include <sys/types.h>
1648 #if HAVE_NETINET_IN_SYSTM_H
1649 # include <netinet/in_systm.h>
1651 #if HAVE_NETINET_IN_H
1652 # include <netinet/in.h>
1654 #if HAVE_NETINET_IP_H
1655 # include <netinet/ip.h>
1657 #if HAVE_NETINET_UDP_H
1658 # include <netinet/udp.h>
1661 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1662 [#define _BSD_SOURCE
1663 #define _DEFAULT_SOURCE
1665 # include <stdint.h>
1667 #if HAVE_SYS_TYPES_H
1668 # include <sys/types.h>
1670 #if HAVE_NETINET_IN_SYSTM_H
1671 # include <netinet/in_systm.h>
1673 #if HAVE_NETINET_IN_H
1674 # include <netinet/in.h>
1676 #if HAVE_NETINET_IP_H
1677 # include <netinet/ip.h>
1679 #if HAVE_NETINET_UDP_H
1680 # include <netinet/udp.h>
1684 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1693 # check for pthread_setname_np
1694 SAVE_LDFLAGS="$LDFLAGS"
1695 LDFLAGS="$LDFLAGS -lpthread"
1697 AC_MSG_CHECKING([for pthread_setname_np])
1698 have_pthread_setname_np="no"
1699 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1702 #include <pthread.h>
1705 pthread_setname_np((pthread_t) {0}, "conftest");
1708 have_pthread_setname_np="yes"
1709 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1712 AC_MSG_RESULT([$have_pthread_setname_np])
1714 # check for pthread_set_name_np(3) (FreeBSD)
1715 AC_MSG_CHECKING([for pthread_set_name_np])
1716 have_pthread_set_name_np="no"
1717 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1719 #include <pthread_np.h>
1722 pthread_set_name_np((pthread_t) {0}, "conftest");
1725 have_pthread_set_name_np="yes"
1726 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1728 AC_MSG_RESULT([$have_pthread_set_name_np])
1730 LDFLAGS="$SAVE_LDFLAGS"
1733 # Checks for libraries begin here
1736 with_libresolv="yes"
1737 AC_CHECK_LIB(resolv, res_search,
1739 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1741 [with_libresolv="no"])
1742 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1744 dnl Check for HAL (hardware abstraction library)
1746 PKG_CHECK_MODULES([HAL], [hal],
1749 LIBS="$HAL_LIBS $LIBS"
1750 AC_CHECK_LIB([hal], [libhal_device_property_exists],
1752 SAVE_CPPFLAGS="$CPPFLAGS"
1753 CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
1754 AC_CHECK_HEADERS([libhal.h],
1757 BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
1758 BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
1760 CPPFLAGS="$SAVE_CPPFLAGS"
1768 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1769 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1773 AC_CHECK_LIB([pthread],
1776 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
1779 PTHREAD_LIBS="$LIBS"
1782 AC_CHECK_HEADERS([pthread.h],
1784 [AC_MSG_ERROR([pthread.h not found])]
1786 AC_SUBST([PTHREAD_LIBS])
1788 m4_divert_once([HELP_WITH], [
1789 collectd additional packages:])
1791 if test "x$ac_system" = "xAIX"
1796 with_perfstat="no (AIX only)"
1797 with_procinfo="no (AIX only)"
1800 if test "x$with_perfstat" = "xyes"
1802 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1803 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1805 if test "x$with_perfstat" = "xyes"
1807 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1808 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1809 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1810 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1812 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1815 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1817 # Processes plugin under AIX.
1818 if test "x$with_procinfo" = "xyes"
1820 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1822 if test "x$with_procinfo" = "xyes"
1824 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1827 if test "x$ac_system" = "xSolaris"
1832 with_kstat="no (Solaris only)"
1833 with_devinfo="no (Solaris only)"
1836 if test "x$with_kstat" = "xyes"
1838 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1840 if test "x$with_kstat" = "xyes"
1842 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1843 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1845 if test "x$with_kstat" = "xyes"
1847 AC_DEFINE(HAVE_LIBKSTAT, 1,
1848 [Define to 1 if you have the 'kstat' library (-lkstat)])
1850 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1851 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1854 if test "x$ac_system" = "xDarwin"
1860 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1863 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1864 if test "x$with_kvm_getprocs" = "xyes"
1866 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1867 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1870 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1872 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1873 if test "x$with_kvm_getswapinfo" = "xyes"
1875 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1876 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1879 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1881 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1882 if test "x$with_kvm_nlist" = "xyes"
1884 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1885 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1886 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1889 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1891 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1892 if test "x$with_kvm_openfiles" = "xyes"
1894 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1895 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1898 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1900 # --with-libaquaero5 {{{
1901 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1903 if test "x$withval" = "xyes"
1905 with_libaquaero5="yes"
1906 else if test "x$withval" = "xno"
1908 with_libaquaero5="no"
1910 with_libaquaero5="yes"
1911 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1912 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1915 [with_libaquaero5="yes"])
1917 SAVE_CPPFLAGS="$CPPFLAGS"
1918 SAVE_LDFLAGS="$LDFLAGS"
1920 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1921 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1923 if test "x$with_libaquaero5" = "xyes"
1925 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1927 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1929 AC_CHECK_HEADERS(libaquaero5.h,
1930 [with_libaquaero5="yes"],
1931 [with_libaquaero5="no (libaquaero5.h not found)"])
1933 if test "x$with_libaquaero5" = "xyes"
1935 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1937 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1939 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1940 [with_libaquaero5="yes"],
1941 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1944 CPPFLAGS="$SAVE_CPPFLAGS"
1945 LDFLAGS="$SAVE_LDFLAGS"
1947 if test "x$with_libaquaero5" = "xyes"
1949 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1950 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1951 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1952 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1954 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1957 # --with-libhiredis {{{
1958 AC_ARG_WITH(libhiredis, [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@],
1959 [Path to libhiredis.])],
1961 if test "x$withval" = "xyes"
1963 with_libhiredis="yes"
1964 else if test "x$withval" = "xno"
1966 with_libhiredis="no"
1968 with_libhiredis="yes"
1969 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
1970 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
1973 [with_libhiredis="yes"])
1975 SAVE_CPPFLAGS="$CPPFLAGS"
1976 SAVE_LDFLAGS="$LDFLAGS"
1978 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
1979 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
1981 if test "x$with_libhiredis" = "xyes"
1983 if test "x$LIBHIREDIS_CPPFLAGS" != "x"
1985 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
1987 AC_CHECK_HEADERS(hiredis/hiredis.h,
1988 [with_libhiredis="yes"],
1989 [with_libhiredis="no (hiredis.h not found)"])
1991 if test "x$with_libhiredis" = "xyes"
1993 if test "x$LIBHIREDIS_LDFLAGS" != "x"
1995 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
1997 AC_CHECK_LIB(hiredis, redisCommand,
1998 [with_libhiredis="yes"],
1999 [with_libhiredis="no (symbol 'redisCommand' not found)"])
2003 CPPFLAGS="$SAVE_CPPFLAGS"
2004 LDFLAGS="$SAVE_LDFLAGS"
2006 if test "x$with_libhiredis" = "xyes"
2008 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2009 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2010 AC_SUBST(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
2011 AC_SUBST(BUILD_WITH_LIBHIREDIS_LDFLAGS)
2013 AM_CONDITIONAL(BUILD_WITH_LIBHIREDIS, test "x$with_libhiredis" = "xyes")
2016 # --with-libcurl {{{
2017 with_curl_config="curl-config"
2020 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2022 if test "x$withval" = "xno"
2025 else if test "x$withval" = "xyes"
2029 if test -f "$withval" && test -x "$withval"
2031 with_curl_config="$withval"
2033 else if test -x "$withval/bin/curl-config"
2035 with_curl_config="$withval/bin/curl-config"
2044 if test "x$with_libcurl" = "xyes"
2046 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2047 curl_config_status=$?
2049 if test $curl_config_status -ne 0
2051 with_libcurl="no ($with_curl_config failed)"
2053 SAVE_CPPFLAGS="$CPPFLAGS"
2054 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2056 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
2058 CPPFLAGS="$SAVE_CPPFLAGS"
2061 if test "x$with_libcurl" = "xyes"
2063 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2064 curl_config_status=$?
2066 if test $curl_config_status -ne 0
2068 with_libcurl="no ($with_curl_config failed)"
2070 AC_CHECK_LIB(curl, curl_easy_init,
2071 [with_libcurl="yes"],
2072 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2074 AC_CHECK_DECL(CURLOPT_USERNAME,
2075 [have_curlopt_username="yes"],
2076 [have_curlopt_username="no"],
2077 [[#include <curl/curl.h>]])
2078 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2079 [have_curlopt_timeout="yes"],
2080 [have_curlopt_timeout="no"],
2081 [[#include <curl/curl.h>]])
2084 if test "x$with_libcurl" = "xyes"
2086 SAVE_CPPFLAGS="$CPPFLAGS"
2087 SAVE_LDFLAGS="$LDFLAGS"
2088 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2089 LDFLAGS="$LDFLAGS $with_curl_libs"
2090 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2091 [c_cv_have_curlinfo_appconnect_time],
2092 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2094 #include <curl/curl.h>
2097 int val = CURLINFO_APPCONNECT_TIME;
2101 [c_cv_have_curlinfo_appconnect_time="yes"],
2102 [c_cv_have_curlinfo_appconnect_time="no"]
2105 CPPFLAGS="$SAVE_CPPFLAGS"
2106 LDFLAGS="$SAVE_LDFLAGS"
2108 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
2109 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
2111 AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
2114 if test "x$with_libcurl" = "xyes"
2116 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2117 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2118 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2119 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2121 if test "x$have_curlopt_username" = "xyes"
2123 AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
2126 if test "x$have_curlopt_timeout" = "xyes"
2128 AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
2134 with_libdbi_cppflags=""
2135 with_libdbi_ldflags=""
2136 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2138 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2140 with_libdbi_cppflags="-I$withval/include"
2141 with_libdbi_ldflags="-L$withval/lib"
2144 with_libdbi="$withval"
2150 if test "x$with_libdbi" = "xyes"
2152 SAVE_CPPFLAGS="$CPPFLAGS"
2153 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2155 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
2157 CPPFLAGS="$SAVE_CPPFLAGS"
2159 if test "x$with_libdbi" = "xyes"
2161 SAVE_CPPFLAGS="$CPPFLAGS"
2162 SAVE_LDFLAGS="$LDFLAGS"
2163 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2164 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2166 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
2168 CPPFLAGS="$SAVE_CPPFLAGS"
2169 LDFLAGS="$SAVE_LDFLAGS"
2171 if test "x$with_libdbi" = "xyes"
2173 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2174 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2175 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2176 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2177 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2178 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2180 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
2183 # --with-libesmtp {{{
2184 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2186 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2188 LDFLAGS="$LDFLAGS -L$withval/lib"
2189 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
2192 with_libesmtp="$withval"
2198 if test "x$with_libesmtp" = "xyes"
2200 AC_CHECK_LIB(esmtp, smtp_create_session,
2202 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
2203 ], [with_libesmtp="no (libesmtp not found)"])
2205 if test "x$with_libesmtp" = "xyes"
2207 AC_CHECK_HEADERS(libesmtp.h,
2209 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
2210 ], [with_libesmtp="no (libesmtp.h not found)"])
2212 if test "x$with_libesmtp" = "xyes"
2218 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
2219 [Wether or not to use the esmtp library])
2220 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
2223 # --with-libganglia {{{
2224 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2226 if test -f "$withval" && test -x "$withval"
2228 with_libganglia_config="$withval"
2229 with_libganglia="yes"
2230 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
2232 with_libganglia_config="$withval/bin/ganglia-config"
2233 with_libganglia="yes"
2234 else if test -d "$withval"
2236 GANGLIA_CPPFLAGS="-I$withval/include"
2237 GANGLIA_LDFLAGS="-L$withval/lib"
2238 with_libganglia="yes"
2240 with_libganglia="$withval"
2244 with_libganglia="yes"
2247 if test "x$with_libganglia" = "xyes"
2249 if test "x$with_libganglia_config" != "x"
2251 if test "x$GANGLIA_CPPFLAGS" = "x"
2253 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2256 if test "x$GANGLIA_LDFLAGS" = "x"
2258 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2261 if test "x$GANGLIA_LIBS" = "x"
2263 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2266 GANGLIA_LIBS="-lganglia"
2270 SAVE_CPPFLAGS="$CPPFLAGS"
2271 SAVE_LDFLAGS="$LDFLAGS"
2272 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2273 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2275 if test "x$with_libganglia" = "xyes"
2277 AC_CHECK_HEADERS(gm_protocol.h,
2279 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
2280 [Define to 1 if you have the <gm_protocol.h> header file.])
2281 ], [with_libganglia="no (gm_protocol.h not found)"])
2284 if test "x$with_libganglia" = "xyes"
2286 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
2288 AC_DEFINE(HAVE_LIBGANGLIA, 1,
2289 [Define to 1 if you have the ganglia library (-lganglia).])
2290 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
2293 CPPFLAGS="$SAVE_CPPFLAGS"
2294 LDFLAGS="$SAVE_LDFLAGS"
2296 AC_SUBST(GANGLIA_CPPFLAGS)
2297 AC_SUBST(GANGLIA_LDFLAGS)
2298 AC_SUBST(GANGLIA_LIBS)
2299 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
2302 # --with-libgcrypt {{{
2303 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2304 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2305 GCRYPT_LIBS="$GCRYPT_LIBS"
2306 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2308 if test -f "$withval" && test -x "$withval"
2310 with_libgcrypt_config="$withval"
2311 with_libgcrypt="yes"
2312 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
2314 with_libgcrypt_config="$withval/bin/gcrypt-config"
2315 with_libgcrypt="yes"
2316 else if test -d "$withval"
2318 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2319 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2320 with_libgcrypt="yes"
2322 with_libgcrypt_config="gcrypt-config"
2323 with_libgcrypt="$withval"
2327 with_libgcrypt_config="libgcrypt-config"
2328 with_libgcrypt="yes"
2331 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2333 if test "x$GCRYPT_CPPFLAGS" = "x"
2335 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2338 if test "x$GCRYPT_LIBS" = "x"
2340 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2344 SAVE_CPPFLAGS="$CPPFLAGS"
2345 SAVE_LDFLAGS="$LDFLAGS"
2347 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2348 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2349 LIBS="$LIBS $GCRYPT_LIBS"
2351 if test "x$with_libgcrypt" = "xyes"
2353 if test "x$GCRYPT_CPPFLAGS" != "x"
2355 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2357 AC_CHECK_HEADERS(gcrypt.h,
2358 [with_libgcrypt="yes"],
2359 [with_libgcrypt="no (gcrypt.h not found)"])
2362 if test "x$with_libgcrypt" = "xyes"
2364 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2365 [with_libgcrypt="yes"],
2366 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2369 CPPFLAGS="$SAVE_CPPFLAGS"
2370 LDFLAGS="$SAVE_LDFLAGS"
2373 if test "x$with_libgcrypt" = "xyes"
2375 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2378 AC_SUBST(GCRYPT_CPPFLAGS)
2379 AC_SUBST(GCRYPT_LDFLAGS)
2380 AC_SUBST(GCRYPT_LIBS)
2381 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2385 with_libgps_cflags=""
2386 with_libgps_ldflags=""
2387 AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2389 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2391 with_libgps_cflags="-I$withval/include"
2392 with_libgps_ldflags="-L$withval/lib"
2395 with_libgps="$withval"
2401 if test "x$with_libgps" = "xyes"
2403 SAVE_CFLAGS="$CFLAGS"
2404 CFLAGS="$CFLAGS $with_libgps_cflags"
2406 AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
2408 CFLAGS="$SAVE_CFLAGS"
2410 if test "x$with_libgps" = "xyes"
2412 SAVE_CFLAGS="$CFLAGS"
2413 SAVE_LDFLAGS="$LDFLAGS"
2414 CFLAGS="$CFLAGS $with_libgps_cflags"
2415 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2417 AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
2419 CFLAGS="$SAVE_CFLAGS"
2420 LDFLAGS="$SAVE_LDFLAGS"
2422 if test "x$with_libgps" = "xyes"
2424 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2425 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2426 BUILD_WITH_LIBGPS_LIBS="-lgps"
2427 AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
2428 AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
2429 AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
2431 AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
2434 # --with-libgrpc++ {{{
2435 with_libgrpcpp_cppflags=""
2436 with_libgrpcpp_ldflags=""
2437 AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2439 with_grpcpp="$withval"
2440 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2442 with_libgrpcpp_cppflags="-I$withval/include"
2443 with_libgrpcpp_ldflags="-L$withval/lib"
2444 with_libgrpcpp="yes"
2446 if test "x$withval" = "xno"
2448 with_libgrpcpp="no (disabled on command line)"
2453 if test "x$withval" = "xyes"
2455 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2456 [with_libgrpcpp="yes"],
2457 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2461 if test "x$withval" != "xno"
2463 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2464 if test_cxx_flags -std=c++11; then
2465 AC_MSG_RESULT([yes])
2468 with_libgrpcpp="no (requires C++11 support)"
2472 if test "x$with_libgrpcpp" = "xyes"
2475 SAVE_CPPFLAGS="$CPPFLAGS"
2476 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2477 AC_CHECK_HEADERS([grpc++/grpc++.h], [],
2478 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2480 CPPFLAGS="$SAVE_CPPFLAGS"
2483 if test "x$with_libgrpcpp" = "xyes"
2486 SAVE_CPPFLAGS="$CPPFLAGS"
2487 SAVE_LDFLAGS="$LDFLAGS"
2489 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2490 LDFLAGS="$with_libgrpcpp_ldflags"
2491 if test "x$GRPCPP_LIBS" = "x"
2499 [[#include <grpc++/grpc++.h>]],
2500 [[grpc::ServerBuilder sb;]]
2503 with_libgrpcpp="yes"
2504 if test "x$GRPCPP_LIBS" = "x"
2506 GRPCPP_LIBS="-lgrpc++"
2509 [with_libgrpcpp="no (libgrpc++ not found)"]
2511 CPPFLAGS="$SAVE_CPPFLAGS"
2512 LDFLAGS="$SAVE_LDFLAGS"
2516 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2517 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2518 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2519 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2520 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2521 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2524 # --with-libiptc {{{
2525 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2527 if test "x$withval" = "xyes"
2529 with_libiptc="pkgconfig"
2530 else if test "x$withval" = "xno"
2535 with_libiptc_cflags="-I$withval/include"
2536 with_libiptc_libs="-L$withval/lib"
2540 if test "x$ac_system" = "xLinux"
2542 with_libiptc="pkgconfig"
2544 with_libiptc="no (Linux only)"
2548 if test "x$with_libiptc" = "xpkgconfig"
2550 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2553 with_libiptc="no (pkg-config doesn't know libiptc)"
2556 if test "x$with_libiptc" = "xpkgconfig"
2558 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2561 with_libiptc="no ($PKG_CONFIG failed)"
2563 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2566 with_libiptc="no ($PKG_CONFIG failed)"
2570 SAVE_CPPFLAGS="$CPPFLAGS"
2571 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2573 # check whether the header file for libiptc is available.
2574 if test "x$with_libiptc" = "xpkgconfig"
2576 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2577 [with_libiptc="no (header file missing)"])
2579 # If the header file is available, check for the required type declaractions.
2580 # They may be missing in old versions of libiptc. In that case, they will be
2581 # declared in the iptables plugin.
2582 if test "x$with_libiptc" = "xpkgconfig"
2584 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2586 # Check for the iptc_init symbol in the library.
2587 # This could be in iptc or ip4tc
2588 if test "x$with_libiptc" = "xpkgconfig"
2591 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2592 [with_libiptc="pkgconfig"],
2593 [with_libiptc="no"],
2594 [$with_libiptc_libs])
2597 if test "x$with_libiptc" = "xpkgconfig"
2602 CPPFLAGS="$SAVE_CPPFLAGS"
2604 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2605 if test "x$with_libiptc" = "xyes"
2607 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2608 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2609 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2610 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2614 # --with-libdpdk {{{
2615 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2616 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2618 AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])])
2620 if test "x$with_libdpdk" != "xno"
2622 if test "x$LIBDPDK_CPPFLAGS" = "x"
2624 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2626 SAVE_CPPFLAGS="$CPPFLAGS"
2627 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2628 AC_CHECK_HEADERS([rte_config.h],
2629 [with_libdpdk="yes"],
2630 [with_libdpdk="no (rte_config.h not found)"]
2632 CPPFLAGS="$SAVE_CPPFLAGS"
2635 if test "x$with_libdpdk" = "xyes"
2637 SAVE_LDFLAGS="$LDFLAGS"
2638 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2639 AC_CHECK_LIB([dpdk], [rte_eal_init],
2640 [with_libdpdk="yes"],
2641 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2643 LDFLAGS="$SAVE_LDFLAGS"
2649 with_java_home="$JAVA_HOME"
2650 if test "x$with_java_home" = "x"
2652 with_java_home="/usr/lib/jvm"
2656 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2658 if test "x$withval" = "xno"
2661 else if test "x$withval" = "xyes"
2665 with_java_home="$withval"
2670 if test "x$with_java" = "xyes"
2672 if test -d "$with_java_home"
2674 AC_MSG_CHECKING([for jni.h])
2675 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -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_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2681 AC_MSG_RESULT([not found])
2684 AC_MSG_CHECKING([for jni_md.h])
2685 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2686 if test "x$TMPVAR" != "x"
2688 AC_MSG_RESULT([found in $TMPVAR])
2689 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2691 AC_MSG_RESULT([not found])
2694 AC_MSG_CHECKING([for libjvm.so])
2695 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`
2696 if test "x$TMPVAR" != "x"
2698 AC_MSG_RESULT([found in $TMPVAR])
2699 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2701 AC_MSG_RESULT([not found])
2704 if test "x$JAVAC" = "x"
2706 AC_MSG_CHECKING([for javac])
2707 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2708 if test "x$TMPVAR" != "x"
2711 AC_MSG_RESULT([$JAVAC])
2713 AC_MSG_RESULT([not found])
2716 if test "x$JAR" = "x"
2718 AC_MSG_CHECKING([for jar])
2719 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2720 if test "x$TMPVAR" != "x"
2723 AC_MSG_RESULT([$JAR])
2725 AC_MSG_RESULT([not found])
2728 else if test "x$with_java_home" != "x"
2730 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2734 if test "x$JAVA_CPPFLAGS" != "x"
2736 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2738 if test "x$JAVA_CFLAGS" != "x"
2740 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2742 if test "x$JAVA_LDFLAGS" != "x"
2744 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2746 if test "x$JAVA_LIBS" != "x"
2748 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2750 if test "x$JAVAC" = "x"
2752 with_javac_path="$PATH"
2753 if test "x$with_java_home" != "x"
2755 with_javac_path="$with_java_home:with_javac_path"
2756 if test -d "$with_java_home/bin"
2758 with_javac_path="$with_java_home/bin:with_javac_path"
2762 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2764 if test "x$JAVAC" = "x"
2766 with_java="no (javac not found)"
2768 if test "x$JAR" = "x"
2770 with_jar_path="$PATH"
2771 if test "x$with_java_home" != "x"
2773 with_jar_path="$with_java_home:$with_jar_path"
2774 if test -d "$with_java_home/bin"
2776 with_jar_path="$with_java_home/bin:$with_jar_path"
2780 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2782 if test "x$JAR" = "x"
2784 with_java="no (jar not found)"
2787 SAVE_CPPFLAGS="$CPPFLAGS"
2788 SAVE_CFLAGS="$CFLAGS"
2789 SAVE_LDFLAGS="$LDFLAGS"
2791 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2792 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2793 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2794 LIBS="$LIBS $JAVA_LIBS"
2796 if test "x$with_java" = "xyes"
2798 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2800 if test "x$with_java" = "xyes"
2802 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2804 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2805 [$JAVA_LIBS $PTHREAD_LIBS])
2807 if test "x$with_java" = "xyes"
2809 JAVA_LIBS="$JAVA_LIBS -ljvm"
2810 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2813 CPPFLAGS="$SAVE_CPPFLAGS"
2814 CFLAGS="$SAVE_CFLAGS"
2815 LDFLAGS="$SAVE_LDFLAGS"
2818 AC_SUBST(JAVA_CPPFLAGS)
2819 AC_SUBST(JAVA_CFLAGS)
2820 AC_SUBST(JAVA_LDFLAGS)
2822 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2825 # --with-libldap {{{
2826 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2828 if test "x$withval" = "xyes"
2831 else if test "x$withval" = "xno"
2836 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2837 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2840 [with_libldap="yes"])
2842 SAVE_CPPFLAGS="$CPPFLAGS"
2843 SAVE_LDFLAGS="$LDFLAGS"
2845 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2846 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2848 if test "x$with_libldap" = "xyes"
2850 if test "x$LIBLDAP_CPPFLAGS" != "x"
2852 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2854 AC_CHECK_HEADERS(ldap.h,
2855 [with_libldap="yes"],
2856 [with_libldap="no ('ldap.h' not found)"])
2858 if test "x$with_libldap" = "xyes"
2860 if test "x$LIBLDAP_LDFLAGS" != "x"
2862 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2864 AC_CHECK_LIB(ldap, ldap_initialize,
2865 [with_libldap="yes"],
2866 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2870 CPPFLAGS="$SAVE_CPPFLAGS"
2871 LDFLAGS="$SAVE_LDFLAGS"
2873 if test "x$with_libldap" = "xyes"
2875 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2876 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2877 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2878 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
2880 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
2884 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
2885 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
2887 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
2888 [with_liblua="yes"],
2892 PKG_CHECK_MODULES([LUA], [lua],
2893 [with_liblua="yes"],
2895 PKG_CHECK_MODULES([LUA], [lua-5.3],
2896 [with_liblua="yes"],
2898 PKG_CHECK_MODULES([LUA], [lua5.3],
2899 [with_liblua="yes"],
2901 PKG_CHECK_MODULES([LUA], [lua-5.2],
2902 [with_liblua="yes"],
2904 PKG_CHECK_MODULES([LUA], [lua5.2],
2905 [with_liblua="yes"],
2907 PKG_CHECK_MODULES([LUA], [lua-5.1],
2908 [with_liblua="yes"],
2910 PKG_CHECK_MODULES([LUA], [lua5.1],
2911 [with_liblua="yes"],
2912 [with_liblua="no (pkg-config cannot find liblua)"]
2928 if test "x$with_liblua" = "xyes"
2930 SAVE_CPPFLAGS="$CPPFLAGS"
2931 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
2933 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
2934 [with_liblua="yes"],
2935 [with_liblua="no (header not found)"]
2938 CPPFLAGS="$SAVE_CPPFLAGS"
2941 if test "x$with_liblua" = "xyes"
2944 LIBS="$LIBS $LUA_LIBS"
2946 AC_CHECK_FUNC([lua_settop],
2947 [with_liblua="yes"],
2948 [with_liblua="no (symbol 'lua_settop' not found)"]
2954 if test "x$with_liblua" = "xyes"
2956 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
2957 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
2959 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
2960 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
2963 # --with-liblvm2app {{{
2964 with_liblvm2app_cppflags=""
2965 with_liblvm2app_ldflags=""
2966 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2968 if test "x$withval" = "xno"
2970 with_liblvm2app="no"
2972 with_liblvm2app="yes"
2973 if test "x$withval" != "xyes"
2975 with_liblvm2app_cppflags="-I$withval/include"
2976 with_liblvm2app_ldflags="-L$withval/lib"
2981 if test "x$ac_system" = "xLinux"
2983 with_liblvm2app="yes"
2985 with_liblvm2app="no (Linux only library)"
2988 if test "x$with_liblvm2app" = "xyes"
2990 SAVE_CPPFLAGS="$CPPFLAGS"
2991 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2993 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2995 CPPFLAGS="$SAVE_CPPFLAGS"
2998 if test "x$with_liblvm2app" = "xyes"
3000 SAVE_CPPFLAGS="$CPPFLAGS"
3001 SAVE_LDFLAGS="$LDFLAGS"
3002 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3003 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
3005 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
3007 CPPFLAGS="$SAVE_CPPFLAGS"
3008 LDFLAGS="$SAVE_LDFLAGS"
3010 if test "x$with_liblvm2app" = "xyes"
3012 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
3013 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
3014 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
3015 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
3016 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
3017 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
3018 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
3020 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3023 # --with-libmemcached {{{
3024 with_libmemcached_cppflags=""
3025 with_libmemcached_ldflags=""
3026 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3028 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3030 with_libmemcached_cppflags="-I$withval/include"
3031 with_libmemcached_ldflags="-L$withval/lib"
3032 with_libmemcached="yes"
3034 with_libmemcached="$withval"
3038 with_libmemcached="yes"
3040 if test "x$with_libmemcached" = "xyes"
3042 SAVE_CPPFLAGS="$CPPFLAGS"
3043 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3045 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3047 CPPFLAGS="$SAVE_CPPFLAGS"
3049 if test "x$with_libmemcached" = "xyes"
3051 SAVE_CPPFLAGS="$CPPFLAGS"
3052 SAVE_LDFLAGS="$LDFLAGS"
3053 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3054 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3056 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3058 CPPFLAGS="$SAVE_CPPFLAGS"
3059 LDFLAGS="$SAVE_LDFLAGS"
3061 if test "x$with_libmemcached" = "xyes"
3063 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3064 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3065 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3066 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3067 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3068 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3069 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3071 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3074 # --with-libmicrohttpd {{{
3075 with_libmicrohttpd_cppflags=""
3076 with_libmicrohttpd_ldflags=""
3077 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3079 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3081 with_libmicrohttpd_cppflags="-I$withval/include"
3082 with_libmicrohttpd_ldflags="-L$withval/lib"
3083 with_libmicrohttpd="yes"
3085 if test "x$withval" = "xno"
3087 with_libmicrohttpd="no (disabled on command line)"
3092 if test "x$withval" = "xyes"
3094 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3095 [with_libmicrohttpd="yes"],
3096 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3100 if test "x$MICROHTTPD_LIBS" = "x"
3102 MICROHTTPD_LIBS="-lmicrohttpd"
3105 SAVE_CPPFLAGS="$CPPFLAGS"
3106 SAVE_LDFLAGS="$LDFLAGS"
3108 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3109 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3110 LIBS="$LIBS $MICROHTTPD_LIBS"
3112 if test "x$with_libmicrohttpd" = "xyes"
3114 AC_CHECK_HEADERS([microhttpd.h],
3115 [with_libmicrohttpd="yes"],
3116 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3119 if test "x$with_libmicrohttpd" = "xyes"
3121 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3122 [with_libmicrohttpd="yes"],
3123 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3126 CPPFLAGS="$SAVE_CPPFLAGS"
3127 LDFLAGS="$SAVE_LDFLAGS"
3130 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3131 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3132 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3133 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3134 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3135 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3138 # --with-libmodbus {{{
3139 with_libmodbus_config=""
3140 with_libmodbus_cflags=""
3141 with_libmodbus_libs=""
3142 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3144 if test "x$withval" = "xno"
3147 else if test "x$withval" = "xyes"
3149 with_libmodbus="use_pkgconfig"
3150 else if test -d "$with_libmodbus/lib"
3152 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3153 with_libmodbus_cflags="-I$withval/include"
3154 with_libmodbus_libs="-L$withval/lib -lmodbus"
3155 with_libmodbus="yes"
3158 [with_libmodbus="use_pkgconfig"])
3160 # configure using pkg-config
3161 if test "x$with_libmodbus" = "xuse_pkgconfig"
3163 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3164 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3167 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3170 if test "x$with_libmodbus" = "xuse_pkgconfig"
3172 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3175 with_libmodbus="no ($PKG_CONFIG failed)"
3177 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3180 with_libmodbus="no ($PKG_CONFIG failed)"
3183 if test "x$with_libmodbus" = "xuse_pkgconfig"
3185 with_libmodbus="yes"
3188 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3189 # the actual checks.
3190 if test "x$with_libmodbus" = "xyes"
3192 SAVE_CPPFLAGS="$CPPFLAGS"
3193 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3195 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3197 CPPFLAGS="$SAVE_CPPFLAGS"
3199 if test "x$with_libmodbus" = "xyes"
3201 SAVE_CPPFLAGS="$CPPFLAGS"
3202 SAVE_LDFLAGS="$LDFLAGS"
3204 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3205 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3207 AC_CHECK_LIB(modbus, modbus_connect,
3208 [with_libmodbus="yes"],
3209 [with_libmodbus="no (symbol modbus_connect not found)"])
3211 CPPFLAGS="$SAVE_CPPFLAGS"
3212 LDFLAGS="$SAVE_LDFLAGS"
3214 if test "x$with_libmodbus" = "xyes"
3216 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3217 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3218 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3219 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3223 # --with-libmongoc {{{
3224 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3226 if test "x$withval" = "xyes"
3228 with_libmongoc="yes"
3229 else if test "x$withval" = "xno"
3233 with_libmongoc="yes"
3234 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3235 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3238 [with_libmongoc="yes"])
3240 SAVE_CPPFLAGS="$CPPFLAGS"
3241 SAVE_LDFLAGS="$LDFLAGS"
3243 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3244 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3246 if test "x$with_libmongoc" = "xyes"
3248 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3250 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3252 AC_CHECK_HEADERS(mongo.h,
3253 [with_libmongoc="yes"],
3254 [with_libmongoc="no ('mongo.h' not found)"],
3256 # define MONGO_HAVE_STDINT 1
3258 # define MONGO_USE_LONG_LONG_INT 1
3262 if test "x$with_libmongoc" = "xyes"
3264 if test "x$LIBMONGOC_LDFLAGS" != "x"
3266 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3268 AC_CHECK_LIB(mongoc, mongo_run_command,
3269 [with_libmongoc="yes"],
3270 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3273 CPPFLAGS="$SAVE_CPPFLAGS"
3274 LDFLAGS="$SAVE_LDFLAGS"
3276 if test "x$with_libmongoc" = "xyes"
3278 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3279 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3280 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3281 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3283 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3286 # --with-libmosquitto {{{
3287 with_libmosquitto_cppflags=""
3288 with_libmosquitto_ldflags=""
3289 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3291 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3293 with_libmosquitto_cppflags="-I$withval/include"
3294 with_libmosquitto_ldflags="-L$withval/lib"
3295 with_libmosquitto="yes"
3297 with_libmosquitto="$withval"
3301 with_libmosquitto="yes"
3303 if test "x$with_libmosquitto" = "xyes"
3305 SAVE_CPPFLAGS="$CPPFLAGS"
3306 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3308 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3310 CPPFLAGS="$SAVE_CPPFLAGS"
3312 if test "x$with_libmosquitto" = "xyes"
3314 SAVE_LDFLAGS="$LDFLAGS"
3315 SAVE_CPPFLAGS="$CPPFLAGS"
3316 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3317 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3319 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3321 LDFLAGS="$SAVE_LDFLAGS"
3322 CPPFLAGS="$SAVE_CPPFLAGS"
3324 if test "x$with_libmosquitto" = "xyes"
3326 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3327 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3328 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3329 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3330 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3331 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3335 # --with-libmysql {{{
3336 with_mysql_config="mysql_config"
3337 with_mysql_cflags=""
3339 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3341 if test "x$withval" = "xno"
3344 else if test "x$withval" = "xyes"
3348 if test -f "$withval" && test -x "$withval";
3350 with_mysql_config="$withval"
3351 else if test -x "$withval/bin/mysql_config"
3353 with_mysql_config="$withval/bin/mysql_config"
3361 if test "x$with_libmysql" = "xyes"
3363 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3364 mysql_config_status=$?
3366 if test $mysql_config_status -ne 0
3368 with_libmysql="no ($with_mysql_config failed)"
3370 SAVE_CPPFLAGS="$CPPFLAGS"
3371 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3374 have_mysql_mysql_h="no"
3375 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3377 if test "x$have_mysql_h" = "xno"
3379 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3382 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3384 with_libmysql="no (mysql.h not found)"
3387 CPPFLAGS="$SAVE_CPPFLAGS"
3390 if test "x$with_libmysql" = "xyes"
3392 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3393 mysql_config_status=$?
3395 if test $mysql_config_status -ne 0
3397 with_libmysql="no ($with_mysql_config failed)"
3399 SAVE_CPPFLAGS="$CPPFLAGS"
3400 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3402 LIBS="$with_mysql_libs"
3403 AC_SEARCH_LIBS([mysql_get_server_version],
3405 [with_libmysql="yes"],
3406 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3408 CPPFLAGS="$SAVE_CPPFLAGS"
3412 if test "x$with_libmysql" = "xyes"
3414 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3415 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3416 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3417 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3419 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3423 with_libmnl_cflags=""
3425 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3427 echo "libmnl: withval = $withval"
3428 if test "x$withval" = "xyes"
3431 else if test "x$withval" = "xno"
3435 if test -d "$withval/include"
3437 with_libmnl_cflags="-I$withval/include"
3438 with_libmnl_libs="-L$withval/lib -lmnl"
3441 AC_MSG_ERROR("no such directory: $withval/include")
3446 if test "x$ac_system" = "xLinux"
3450 with_libmnl="no (Linux only library)"
3453 if test "x$with_libmnl" = "xyes"
3455 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3456 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3457 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3460 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3466 #include <sys/types.h>
3467 #include <asm/types.h>
3468 #include <sys/socket.h>
3469 #include <linux/netlink.h>
3470 #include <linux/rtnetlink.h>])
3471 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3473 #include <sys/types.h>
3474 #include <asm/types.h>
3475 #include <sys/socket.h>])
3477 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3480 #include <sys/types.h>
3481 #include <asm/types.h>
3482 #include <sys/socket.h>
3483 #include <linux/netlink.h>
3484 #include <linux/rtnetlink.h>
3487 int retval = TCA_STATS2;
3491 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3493 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3496 #include <sys/types.h>
3497 #include <asm/types.h>
3498 #include <sys/socket.h>
3499 #include <linux/netlink.h>
3500 #include <linux/rtnetlink.h>
3503 int retval = TCA_STATS;
3507 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3509 if test "x$with_libmnl" = "xyes"
3511 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3512 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3515 #include <linux/if_link.h>
3518 if test "x$with_libmnl" = "xyes"
3520 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3521 [with_libmnl="yes"],
3522 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3523 [$with_libmnl_libs])
3525 if test "x$with_libmnl" = "xyes"
3527 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3528 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3529 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3530 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3531 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3533 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3536 # --with-libnetapp {{{
3537 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3538 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3539 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3540 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3541 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3542 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3543 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3545 if test -d "$withval"
3547 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3548 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3549 with_libnetapp="yes"
3551 with_libnetapp="$withval"
3555 with_libnetapp="yes"
3558 SAVE_CPPFLAGS="$CPPFLAGS"
3559 SAVE_LDFLAGS="$LDFLAGS"
3560 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3561 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3563 if test "x$with_libnetapp" = "xyes"
3565 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3567 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3569 AC_CHECK_HEADERS(netapp_api.h,
3570 [with_libnetapp="yes"],
3571 [with_libnetapp="no (netapp_api.h not found)"])
3574 if test "x$with_libnetapp" = "xyes"
3576 if test "x$LIBNETAPP_LDFLAGS" != "x"
3578 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3581 if test "x$LIBNETAPP_LIBS" = "x"
3583 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3585 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3587 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3588 [with_libnetapp="yes"],
3589 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3591 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3594 CPPFLAGS="$SAVE_CPPFLAGS"
3595 LDFLAGS="$SAVE_LDFLAGS"
3597 if test "x$with_libnetapp" = "xyes"
3599 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3602 AC_SUBST(LIBNETAPP_CPPFLAGS)
3603 AC_SUBST(LIBNETAPP_LDFLAGS)
3604 AC_SUBST(LIBNETAPP_LIBS)
3605 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3608 # --with-libnetsnmp {{{
3609 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3611 if test "x$withval" = "xno"
3613 with_libnetsnmp="no"
3614 else if test "x$withval" = "xyes"
3616 with_libnetsnmp="yes"
3618 with_libnetsnmp_cppflags="-I$withval/include"
3619 with_libnetsnmp_ldflags="-I$withval/lib"
3620 with_libnetsnmp="yes"
3623 [with_libnetsnmp="yes"])
3624 if test "x$with_libnetsnmp" = "xyes"
3626 SAVE_CPPFLAGS="$CPPFLAGS"
3627 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3629 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3631 CPPFLAGS="$SAVE_CPPFLAGS"
3633 if test "x$with_libnetsnmp" = "xyes"
3635 SAVE_LDFLAGS="$LDFLAGS"
3636 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3638 AC_CHECK_LIB(netsnmp, init_snmp,
3639 [with_libnetsnmp="yes"],
3640 [with_libnetsnmp="no (libnetsnmp not found)"],
3643 LDFLAGS="$SAVE_LDFLAGS"
3645 if test "x$with_libnetsnmp" = "xyes"
3647 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3648 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3649 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3651 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3652 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3653 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3656 # --with-liboconfig {{{
3657 with_own_liboconfig="no"
3658 liboconfig_LDFLAGS="$LDFLAGS"
3659 liboconfig_CPPFLAGS="$CPPFLAGS"
3660 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3662 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3664 if test -d "$withval/lib"
3666 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3668 if test -d "$withval/include"
3670 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3673 if test "x$withval" = "xno"
3675 AC_MSG_ERROR("liboconfig is required")
3679 with_liboconfig="yes"
3682 save_LDFLAGS="$LDFLAGS"
3683 save_CPPFLAGS="$CPPFLAGS"
3684 LDFLAGS="$liboconfig_LDFLAGS"
3685 CPPFLAGS="$liboconfig_CPPFLAGS"
3686 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3688 with_liboconfig="yes"
3689 with_own_liboconfig="no"
3692 with_liboconfig="yes"
3693 with_own_liboconfig="yes"
3694 LDFLAGS="$save_LDFLAGS"
3695 CPPFLAGS="$save_CPPFLAGS"
3698 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3699 if test "x$with_own_liboconfig" = "xyes"
3701 with_liboconfig="yes (shipped version)"
3705 # --with-liboping {{{
3706 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3708 if test "x$withval" = "xyes"
3711 else if test "x$withval" = "xno"
3716 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3717 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3720 [with_liboping="yes"])
3722 SAVE_CPPFLAGS="$CPPFLAGS"
3723 SAVE_LDFLAGS="$LDFLAGS"
3725 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3726 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3728 if test "x$with_liboping" = "xyes"
3730 if test "x$LIBOPING_CPPFLAGS" != "x"
3732 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3734 AC_CHECK_HEADERS(oping.h,
3735 [with_liboping="yes"],
3736 [with_liboping="no (oping.h not found)"])
3738 if test "x$with_liboping" = "xyes"
3740 if test "x$LIBOPING_LDFLAGS" != "x"
3742 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3744 AC_CHECK_LIB(oping, ping_construct,
3745 [with_liboping="yes"],
3746 [with_liboping="no (symbol 'ping_construct' not found)"])
3749 CPPFLAGS="$SAVE_CPPFLAGS"
3750 LDFLAGS="$SAVE_LDFLAGS"
3752 if test "x$with_liboping" = "xyes"
3754 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3755 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3756 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3757 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3759 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3763 with_oracle_cppflags=""
3765 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3767 if test "x$withval" = "xyes"
3769 if test "x$ORACLE_HOME" = "x"
3771 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3774 else if test "x$withval" = "xno"
3779 ORACLE_HOME="$withval"
3783 if test "x$ORACLE_HOME" = "x"
3785 with_oracle="no (ORACLE_HOME is not set)"
3790 if test "x$ORACLE_HOME" != "x"
3792 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3794 if test -e "$ORACLE_HOME/lib/ldflags"
3796 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3798 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3799 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3801 if test "x$with_oracle" = "xyes"
3803 SAVE_CPPFLAGS="$CPPFLAGS"
3804 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3806 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3808 CPPFLAGS="$SAVE_CPPFLAGS"
3810 if test "x$with_oracle" = "xyes"
3812 SAVE_CPPFLAGS="$CPPFLAGS"
3814 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3815 LIBS="$LIBS $with_oracle_libs"
3817 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3819 CPPFLAGS="$SAVE_CPPFLAGS"
3822 if test "x$with_oracle" = "xyes"
3824 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3825 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3826 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3827 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3831 # --with-libowcapi {{{
3832 with_libowcapi_cppflags=""
3833 with_libowcapi_ldflags=""
3834 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3836 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3838 with_libowcapi_cppflags="-I$withval/include"
3839 with_libowcapi_ldflags="-L$withval/lib"
3840 with_libowcapi="yes"
3842 with_libowcapi="$withval"
3846 with_libowcapi="yes"
3848 if test "x$with_libowcapi" = "xyes"
3850 SAVE_CPPFLAGS="$CPPFLAGS"
3851 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3853 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3855 CPPFLAGS="$SAVE_CPPFLAGS"
3857 if test "x$with_libowcapi" = "xyes"
3859 SAVE_LDFLAGS="$LDFLAGS"
3860 SAVE_CPPFLAGS="$CPPFLAGS"
3861 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3862 CPPFLAGS="$with_libowcapi_cppflags"
3864 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3866 LDFLAGS="$SAVE_LDFLAGS"
3867 CPPFLAGS="$SAVE_CPPFLAGS"
3869 if test "x$with_libowcapi" = "xyes"
3871 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3872 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3873 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3874 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3875 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3876 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3880 # --with-libpcap {{{
3881 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3883 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3885 LDFLAGS="$LDFLAGS -L$withval/lib"
3886 CPPFLAGS="$CPPFLAGS -I$withval/include"
3889 with_libpcap="$withval"
3895 if test "x$with_libpcap" = "xyes"
3897 AC_CHECK_LIB(pcap, pcap_open_live,
3899 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3900 ], [with_libpcap="no (libpcap not found)"])
3902 if test "x$with_libpcap" = "xyes"
3904 AC_CHECK_HEADERS(pcap.h,,
3905 [with_libpcap="no (pcap.h not found)"])
3907 if test "x$with_libpcap" = "xyes"
3909 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3910 [c_cv_libpcap_have_pcap_error_iface_not_up],
3911 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3916 int val = PCAP_ERROR_IFACE_NOT_UP;
3920 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3921 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3923 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3925 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3927 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3930 # --with-libperl {{{
3931 perl_interpreter="perl"
3932 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3934 if test -f "$withval" && test -x "$withval"
3936 perl_interpreter="$withval"
3938 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3940 LDFLAGS="$LDFLAGS -L$withval/lib"
3941 CPPFLAGS="$CPPFLAGS -I$withval/include"
3942 perl_interpreter="$withval/bin/perl"
3945 with_libperl="$withval"
3952 AC_MSG_CHECKING([for perl])
3953 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3954 if test -x "$perl_interpreter"
3956 AC_MSG_RESULT([yes ($perl_interpreter)])
3962 AC_SUBST(PERL, "$perl_interpreter")
3964 if test "x$with_libperl" = "xyes" \
3965 && test -n "$perl_interpreter"
3967 SAVE_CFLAGS="$CFLAGS"
3969 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3970 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
3971 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3972 CFLAGS="$CFLAGS $PERL_CFLAGS"
3973 LIBS="$LIBS $PERL_LIBS"
3975 AC_CACHE_CHECK([for libperl],
3976 [c_cv_have_libperl],
3977 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3979 #define PERL_NO_GET_CONTEXT
3986 load_module (PERL_LOADMOD_NOIMPORT,
3987 newSVpv ("Collectd::Plugin::FooBar", 24),
3991 [c_cv_have_libperl="yes"],
3992 [c_cv_have_libperl="no"]
3996 if test "x$c_cv_have_libperl" = "xyes"
3998 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3999 AC_SUBST(PERL_CFLAGS)
4005 CFLAGS="$SAVE_CFLAGS"
4007 else if test -z "$perl_interpreter"; then
4008 with_libperl="no (no perl interpreter found)"
4009 c_cv_have_libperl="no"
4011 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
4013 if test "x$with_libperl" = "xyes"
4015 SAVE_CFLAGS="$CFLAGS"
4017 CFLAGS="$CFLAGS $PERL_CFLAGS"
4018 LIBS="$LIBS $PERL_LIBS"
4020 AC_CACHE_CHECK([if perl supports ithreads],
4021 [c_cv_have_perl_ithreads],
4022 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4028 #if !defined(USE_ITHREADS)
4029 # error "Perl does not support ithreads!"
4030 #endif /* !defined(USE_ITHREADS) */
4034 [c_cv_have_perl_ithreads="yes"],
4035 [c_cv_have_perl_ithreads="no"]
4039 if test "x$c_cv_have_perl_ithreads" = "xyes"
4041 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4044 CFLAGS="$SAVE_CFLAGS"
4048 if test "x$with_libperl" = "xyes"
4050 SAVE_CFLAGS="$CFLAGS"
4052 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4053 # (see issues #41 and #42)
4054 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4055 LIBS="$LIBS $PERL_LIBS"
4057 AC_CACHE_CHECK([for broken Perl_load_module()],
4058 [c_cv_have_broken_perl_load_module],
4059 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4061 #define PERL_NO_GET_CONTEXT
4068 load_module (PERL_LOADMOD_NOIMPORT,
4069 newSVpv ("Collectd::Plugin::FooBar", 24),
4073 [c_cv_have_broken_perl_load_module="no"],
4074 [c_cv_have_broken_perl_load_module="yes"]
4078 CFLAGS="$SAVE_CFLAGS"
4081 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4082 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4084 if test "x$with_libperl" = "xyes"
4086 SAVE_CFLAGS="$CFLAGS"
4088 CFLAGS="$CFLAGS $PERL_CFLAGS"
4089 LIBS="$LIBS $PERL_LIBS"
4092 [struct mgvtbl.svt_local],
4093 [have_struct_mgvtbl_svt_local="yes"],
4094 [have_struct_mgvtbl_svt_local="no"],
4101 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4103 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4104 [Define if Perl's struct mgvtbl has member svt_local.])
4107 CFLAGS="$SAVE_CFLAGS"
4113 with_pg_config="pg_config"
4114 with_libpq_includedir=""
4115 with_libpq_libdir=""
4116 with_libpq_cppflags=""
4117 with_libpq_ldflags=""
4118 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4121 if test "x$withval" = "xno"
4124 else if test "x$withval" = "xyes"
4128 if test -f "$withval" && test -x "$withval";
4130 with_pg_config="$withval"
4131 else if test -x "$withval/bin/pg_config"
4133 with_pg_config="$withval/bin/pg_config"
4141 if test "x$with_libpq" = "xyes"
4143 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4146 if test $pg_config_status -eq 0
4148 if test -n "$with_libpq_includedir"; then
4149 for dir in $with_libpq_includedir; do
4150 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4154 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4157 SAVE_CPPFLAGS="$CPPFLAGS"
4158 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4160 AC_CHECK_HEADERS(libpq-fe.h, [],
4161 [with_libpq="no (libpq-fe.h not found)"], [])
4163 CPPFLAGS="$SAVE_CPPFLAGS"
4165 if test "x$with_libpq" = "xyes"
4167 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4170 if test $pg_config_status -eq 0
4172 if test -n "$with_libpq_libdir"; then
4173 for dir in $with_libpq_libdir; do
4174 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4178 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4181 SAVE_LDFLAGS="$LDFLAGS"
4182 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4184 AC_CHECK_LIB(pq, PQconnectdb,
4186 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4188 AC_CHECK_LIB(pq, PQserverVersion,
4190 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4192 LDFLAGS="$SAVE_LDFLAGS"
4194 if test "x$with_libpq" = "xyes"
4196 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4197 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4198 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4199 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4201 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4204 # --with-libpqos {{{
4205 with_libpqos_cppflags=""
4206 with_libpqos_ldflags=""
4207 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4209 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4211 with_libpqos_cppflags="-I$withval/include"
4212 with_libpqos_ldflags="-L$withval/lib"
4215 with_libpqos="$withval"
4221 if test "x$with_libpqos" = "xyes"
4223 SAVE_CPPFLAGS="$CPPFLAGS"
4224 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4226 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4228 CPPFLAGS="$SAVE_CPPFLAGS"
4230 if test "x$with_libpqos" = "xyes"
4232 SAVE_CPPFLAGS="$CPPFLAGS"
4233 SAVE_LDFLAGS="$LDFLAGS"
4234 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4235 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4237 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4239 CPPFLAGS="$SAVE_CPPFLAGS"
4240 LDFLAGS="$SAVE_LDFLAGS"
4242 if test "x$with_libpqos" = "xyes"
4244 SAVE_CPPFLAGS="$CPPFLAGS"
4245 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4246 AC_RUN_IFELSE([AC_LANG_PROGRAM(
4247 [[#include <pqos.h>]],
4248 [[return !(PQOS_VERSION >= 106)]])],
4249 [with_libpqos="yes"], [with_libpqos="no (pqos library version 1.06 or higher is required)"])
4250 CPPFLAGS="$SAVE_CPPFLAGS"
4252 if test "x$with_libpqos" = "xyes"
4254 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4255 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4256 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4257 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4258 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4259 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4263 # --with-libprotobuf {{{
4264 with_libprotobuf_cppflags=""
4265 with_libprotobuf_ldflags=""
4266 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4268 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4270 with_libprotobuf_cppflags="-I$withval/include"
4271 with_libprotobuf_ldflags="-L$withval/lib"
4272 with_libprotobuf="yes"
4274 if test "x$withval" = "xno"
4276 with_libprotobuf="no (disabled on command line)"
4281 if test "x$withval" = "xyes"
4283 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4284 [with_libprotobuf="yes"],
4285 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4289 if test "x$withval" != "xno"
4291 SAVE_LDFLAGS="$LDFLAGS"
4293 LDFLAGS="$with_libprotobuf_ldflags"
4294 LIBS="$PROTOBUF_LIBS $LIBS"
4296 AC_CHECK_LIB([protobuf], [main],
4298 SAVE_CPPFLAGS="$CPPFLAGS"
4299 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4300 if test "x$PROTOBUF_LIBS" = "x"
4302 PROTOBUF_LIBS="-lprotobuf"
4304 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4305 [with_libprotobuf="yes"],
4306 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4308 CPPFLAGS="$SAVE_CPPFLAGS"
4310 [with_libprotobuf="no (libprotobuf not found)"]
4313 LDFLAGS="$SAVE_LDFLAGS"
4316 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4317 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4318 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4319 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4320 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4321 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4324 # --with-libprotobuf-c {{{
4325 with_libprotobuf_c_cppflags=""
4326 with_libprotobuf_c_ldflags=""
4327 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4329 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4331 with_libprotobuf_c_cppflags="-I$withval/include"
4332 with_libprotobuf_c_ldflags="-L$withval/lib"
4333 with_libprotobuf_c="yes"
4335 if test "x$withval" = "xno"
4337 with_libprotobuf_c="no (disabled on command line)"
4342 if test "x$withval" = "xyes"
4344 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4345 [with_libprotobuf_c="yes"],
4346 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4350 if test "x$withval" != "xno"
4352 SAVE_LDFLAGS="$LDFLAGS"
4354 LDFLAGS="$with_libprotobuf_c_ldflags"
4355 LIBS="$PROTOBUF_C_LIBS $LIBS"
4356 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4358 SAVE_CPPFLAGS="$CPPFLAGS"
4359 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4360 if test "x$PROTOBUF_C_LIBS" = "x"
4362 PROTOBUF_C_LIBS="-lprotobuf-c"
4364 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4366 with_libprotobuf_c="yes"
4369 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4371 CPPFLAGS="$SAVE_CPPFLAGS"
4373 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4375 LDFLAGS="$SAVE_LDFLAGS"
4378 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4379 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4380 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4381 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4382 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4383 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4386 # --with-libpython {{{
4387 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4388 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4389 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4391 AC_ARG_WITH([libpython],
4392 [AS_HELP_STRING([--with-libpython],
4393 [if we should build with libpython @<:@default=yes@:>@])
4395 [with_libpython="$withval"],
4396 [with_libpython="check"]
4398 if test "$with_libpython" != "no"; then
4399 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4400 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4401 AC_PATH_PROGS([PYTHON_CONFIG],
4402 [python3-config python2-config python-config]
4404 if test "$PYTHON_CONFIG" = ""; then
4405 if test "$with_libpython" = "yes"; then
4406 AC_MSG_ERROR([Unable to find python-config])
4413 if test "$PYTHON_CONFIG" != ""; then
4414 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4415 if test $? -ne 0; then
4418 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4419 if test $? -ne 0; then
4422 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4423 if test $? -ne 0; then
4428 if test "$with_libpython" != "xno"; then
4429 SAVE_CPPFLAGS="$CPPFLAGS"
4430 SAVE_LDFLAGS="$LDFLAGS"
4432 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4433 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4434 LIBS="$LIBPYTHON_LIBS $LIBS"
4435 AC_CHECK_HEADERS([Python.h],
4437 AC_MSG_CHECKING([for libpython])
4438 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4439 [[#include <Python.h>]],
4440 [[Py_Initialize();]])
4442 [with_libpython="yes"],
4443 [with_libpython="no"]
4445 AC_MSG_RESULT([$with_libpython])
4447 [with_libpython="no"]
4449 CPPFLAGS="$SAVE_CPPFLAGS"
4450 LDFLAGS="$SAVE_LDFLAGS"
4453 # }}} --with-libpython
4455 # --with-librabbitmq {{{
4456 with_librabbitmq_cppflags=""
4457 with_librabbitmq_ldflags=""
4458 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4460 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4462 with_librabbitmq_cppflags="-I$withval/include"
4463 with_librabbitmq_ldflags="-L$withval/lib"
4464 with_librabbitmq="yes"
4466 with_librabbitmq="$withval"
4470 with_librabbitmq="yes"
4472 SAVE_CPPFLAGS="$CPPFLAGS"
4473 SAVE_LDFLAGS="$LDFLAGS"
4474 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4475 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4476 if test "x$with_librabbitmq" = "xyes"
4478 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4480 if test "x$with_librabbitmq" = "xyes"
4482 # librabbitmq up to version 0.9.1 provides "library_errno", later
4483 # versions use "library_error". The library does not provide a version
4484 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4485 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4488 # include <stdlib.h>
4494 # include <stdint.h>
4497 # include <inttypes.h>
4502 if test "x$with_librabbitmq" = "xyes"
4504 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4506 if test "x$with_librabbitmq" = "xyes"
4508 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4509 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4510 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4511 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4512 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4513 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4514 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4516 CPPFLAGS="$SAVE_CPPFLAGS"
4517 LDFLAGS="$SAVE_LDFLAGS"
4518 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4520 with_amqp_tcp_socket="no"
4521 if test "x$with_librabbitmq" = "xyes"
4523 SAVE_CPPFLAGS="$CPPFLAGS"
4524 SAVE_LDFLAGS="$LDFLAGS"
4526 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4527 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4530 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4531 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4532 if test "x$with_amqp_tcp_socket" = "xyes"
4534 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4535 [Define if librabbitmq provides the new TCP socket interface.])
4538 AC_CHECK_DECLS(amqp_socket_close,
4539 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4542 #ifdef HAVE_AMQP_TCP_SOCKET_H
4543 # include <amqp_tcp_socket.h>
4545 #ifdef HAVE_AMQP_SOCKET_H
4546 # include <amqp_socket.h>
4550 CPPFLAGS="$SAVE_CPPFLAGS"
4551 LDFLAGS="$SAVE_LDFLAGS"
4556 # --with-librdkafka {{{
4557 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4559 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4561 with_librdkafka_cppflags="-I$withval/include"
4562 with_librdkafka_ldflags="-L$withval/lib"
4563 with_librdkafka_rpath="$withval/lib"
4564 with_librdkafka="yes"
4566 with_librdkafka="$withval"
4570 with_librdkafka="yes"
4572 SAVE_CPPFLAGS="$CPPFLAGS"
4573 SAVE_LDFLAGS="$LDFLAGS"
4575 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4576 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4578 if test "x$with_librdkafka" = "xyes"
4580 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4583 if test "x$with_librdkafka" = "xyes"
4585 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4586 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4587 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4589 if test "x$with_librdkafka" = "xyes"
4591 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4592 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4593 if test "x$with_librdkafka_rpath" != "x"
4595 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4597 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4599 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4600 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4601 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4602 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4603 if test "x$with_librdkafka_log_cb" = "xyes"
4605 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4606 else if test "x$with_librdkafka_logger" = "xyes"
4608 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4611 CPPFLAGS="$SAVE_CPPFLAGS"
4612 LDFLAGS="$SAVE_LDFLAGS"
4613 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4617 # --with-librouteros {{{
4618 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4620 if test "x$withval" = "xyes"
4622 with_librouteros="yes"
4623 else if test "x$withval" = "xno"
4625 with_librouteros="no"
4627 with_librouteros="yes"
4628 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4629 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4632 [with_librouteros="yes"])
4634 SAVE_CPPFLAGS="$CPPFLAGS"
4635 SAVE_LDFLAGS="$LDFLAGS"
4637 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4638 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4640 if test "x$with_librouteros" = "xyes"
4642 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4644 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4646 AC_CHECK_HEADERS(routeros_api.h,
4647 [with_librouteros="yes"],
4648 [with_librouteros="no (routeros_api.h not found)"])
4650 if test "x$with_librouteros" = "xyes"
4652 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4654 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4656 AC_CHECK_LIB(routeros, ros_interface,
4657 [with_librouteros="yes"],
4658 [with_librouteros="no (symbol 'ros_interface' not found)"])
4661 CPPFLAGS="$SAVE_CPPFLAGS"
4662 LDFLAGS="$SAVE_LDFLAGS"
4664 if test "x$with_librouteros" = "xyes"
4666 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4667 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4668 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4669 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4671 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4677 librrd_threadsafe="no"
4678 librrd_rrdc_update="no"
4680 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4682 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4684 librrd_cflags="-I$withval/include"
4685 librrd_ldflags="-L$withval/lib"
4688 with_librrd="$withval"
4694 if test "x$with_librrd" = "xyes"
4696 SAVE_LDFLAGS="$LDFLAGS"
4697 LDFLAGS="$LDFLAGS $librrd_ldflags"
4698 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4700 AC_CHECK_LIB([rrd], [rrd_update_r],
4701 [librrd_threadsafe="yes"],
4704 AC_CHECK_LIB([rrd], [rrdc_update],
4705 [librrd_rrdc_update="yes"],
4710 LDFLAGS="$SAVE_LDFLAGS"
4712 SAVE_CPPFLAGS="$CPPFLAGS"
4713 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4715 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4717 CPPFLAGS="$SAVE_CPPFLAGS"
4720 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4722 SAVE_LDFLAGS="$LDFLAGS"
4723 LDFLAGS="$LDFLAGS $librrd_ldflags"
4725 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4727 librrd_ldflags="$librrd_ldflags -lrrd_th"
4728 librrd_threadsafe="yes"
4729 AC_CHECK_LIB([rrd_th], [rrdc_update],
4730 [librrd_rrdc_update="yes"],
4736 LDFLAGS="$SAVE_LDFLAGS"
4739 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4741 SAVE_LDFLAGS="$LDFLAGS"
4742 LDFLAGS="$LDFLAGS $librrd_ldflags"
4744 AC_CHECK_LIB([rrd], [rrd_update],
4746 librrd_ldflags="$librrd_ldflags -lrrd"
4747 AC_CHECK_LIB([rrd], [rrdc_update],
4748 [librrd_rrdc_update="yes"],
4752 [with_librrd="no (symbol 'rrd_update' not found)"]
4754 LDFLAGS="$SAVE_LDFLAGS"
4757 if test "x$with_librrd" = "xyes"
4759 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4760 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4761 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4762 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4763 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4764 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4766 if test "x$librrd_threadsafe" = "xyes"
4768 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4769 [Define to 1 if the rrd library is thread-safe]
4774 # --with-libsensors {{{
4775 with_sensors_cflags=""
4776 with_sensors_ldflags=""
4777 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4779 if test "x$withval" = "xno"
4781 with_libsensors="no"
4783 with_libsensors="yes"
4784 if test "x$withval" != "xyes"
4786 with_sensors_cflags="-I$withval/include"
4787 with_sensors_ldflags="-L$withval/lib"
4788 with_libsensors="yes"
4793 if test "x$ac_system" = "xLinux"
4795 with_libsensors="yes"
4797 with_libsensors="no (Linux only library)"
4800 if test "x$with_libsensors" = "xyes"
4802 SAVE_CPPFLAGS="$CPPFLAGS"
4803 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4805 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4807 CPPFLAGS="$SAVE_CPPFLAGS"
4809 if test "x$with_libsensors" = "xyes"
4811 SAVE_CPPFLAGS="$CPPFLAGS"
4812 SAVE_LDFLAGS="$LDFLAGS"
4813 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4814 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4816 AC_CHECK_LIB(sensors, sensors_init,
4818 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4820 [with_libsensors="no (libsensors not found)"])
4822 CPPFLAGS="$SAVE_CPPFLAGS"
4823 LDFLAGS="$SAVE_LDFLAGS"
4825 if test "x$with_libsensors" = "xyes"
4827 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4828 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4829 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4830 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4832 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4836 AC_SUBST([LIBSIGROK_CFLAGS])
4837 AC_SUBST([LIBSIGROK_LIBS])
4838 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4839 [with_libsigrok="yes"],
4840 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4844 # --with-libstatgrab {{{
4845 with_libstatgrab_cflags=""
4846 with_libstatgrab_ldflags=""
4847 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4849 if test "x$withval" != "xno" \
4850 && test "x$withval" != "xyes"
4852 with_libstatgrab_cflags="-I$withval/include"
4853 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4854 with_libstatgrab="yes"
4855 with_libstatgrab_pkg_config="no"
4857 with_libstatgrab="$withval"
4858 with_libstatgrab_pkg_config="yes"
4862 with_libstatgrab="yes"
4863 with_libstatgrab_pkg_config="yes"
4866 if test "x$with_libstatgrab" = "xyes" \
4867 && test "x$with_libstatgrab_pkg_config" = "xyes"
4869 AC_MSG_CHECKING([pkg-config for libstatgrab])
4871 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4874 with_libstatgrab_pkg_config="no"
4875 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4876 temp_result="not found"
4878 AC_MSG_RESULT([$temp_result])
4881 if test "x$with_libstatgrab" = "xyes" \
4882 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4883 && test "x$with_libstatgrab_cflags" = "x"
4885 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4886 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4889 with_libstatgrab_cflags="$temp_result"
4891 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4892 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4894 AC_MSG_RESULT([$temp_result])
4897 if test "x$with_libstatgrab" = "xyes" \
4898 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4899 && test "x$with_libstatgrab_ldflags" = "x"
4901 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4902 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4905 with_libstatgrab_ldflags="$temp_result"
4907 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4908 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4910 AC_MSG_RESULT([$temp_result])
4913 if test "x$with_libstatgrab" = "xyes"
4915 SAVE_CPPFLAGS="$CPPFLAGS"
4916 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4918 AC_CHECK_HEADERS(statgrab.h,
4919 [with_libstatgrab="yes"],
4920 [with_libstatgrab="no (statgrab.h not found)"])
4922 CPPFLAGS="$SAVE_CPPFLAGS"
4925 if test "x$with_libstatgrab" = "xyes"
4927 SAVE_CFLAGS="$CFLAGS"
4928 SAVE_LDFLAGS="$LDFLAGS"
4930 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4931 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4933 AC_CHECK_LIB(statgrab, sg_init,
4934 [with_libstatgrab="yes"],
4935 [with_libstatgrab="no (symbol sg_init not found)"])
4937 CFLAGS="$SAVE_CFLAGS"
4938 LDFLAGS="$SAVE_LDFLAGS"
4941 if test "x$with_libstatgrab" = "xyes"
4943 SAVE_CFLAGS="$CFLAGS"
4944 SAVE_LDFLAGS="$LDFLAGS"
4947 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4948 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4949 LIBS="-lstatgrab $LIBS"
4951 AC_CACHE_CHECK([if libstatgrab >= 0.90],
4952 [c_cv_have_libstatgrab_0_90],
4953 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4956 #include <statgrab.h>
4959 if (sg_init()) return 0;
4962 [c_cv_have_libstatgrab_0_90="no"],
4963 [c_cv_have_libstatgrab_0_90="yes"]
4967 CFLAGS="$SAVE_CFLAGS"
4968 LDFLAGS="$SAVE_LDFLAGS"
4972 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4973 if test "x$with_libstatgrab" = "xyes"
4975 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4976 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4977 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4978 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4979 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4980 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
4982 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
4987 # --with-libtokyotyrant {{{
4988 with_libtokyotyrant_cppflags=""
4989 with_libtokyotyrant_ldflags=""
4990 with_libtokyotyrant_libs=""
4991 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4993 if test "x$withval" = "xno"
4995 with_libtokyotyrant="no"
4996 else if test "x$withval" = "xyes"
4998 with_libtokyotyrant="yes"
5000 with_libtokyotyrant_cppflags="-I$withval/include"
5001 with_libtokyotyrant_ldflags="-L$withval/include"
5002 with_libtokyotyrant_libs="-ltokyotyrant"
5003 with_libtokyotyrant="yes"
5007 with_libtokyotyrant="yes"
5010 if test "x$with_libtokyotyrant" = "xyes"
5012 if $PKG_CONFIG --exists tokyotyrant
5014 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5015 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5016 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5020 SAVE_CPPFLAGS="$CPPFLAGS"
5021 SAVE_LDFLAGS="$LDFLAGS"
5022 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5023 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5025 if test "x$with_libtokyotyrant" = "xyes"
5027 AC_CHECK_HEADERS(tcrdb.h,
5029 AC_DEFINE(HAVE_TCRDB_H, 1,
5030 [Define to 1 if you have the <tcrdb.h> header file.])
5031 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5034 if test "x$with_libtokyotyrant" = "xyes"
5036 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5038 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5039 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5041 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5042 [$with_libtokyotyrant_libs])
5045 CPPFLAGS="$SAVE_CPPFLAGS"
5046 LDFLAGS="$SAVE_LDFLAGS"
5048 if test "x$with_libtokyotyrant" = "xyes"
5050 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5051 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5052 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5053 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5054 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5055 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5057 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5060 # --with-libudev {{{
5061 with_libudev_cflags=""
5062 with_libudev_ldflags=""
5063 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5065 if test "x$withval" = "xno"
5070 if test "x$withval" != "xyes"
5072 with_libudev_cflags="-I$withval/include"
5073 with_libudev_ldflags="-L$withval/lib"
5079 if test "x$ac_system" = "xLinux"
5083 with_libudev="no (Linux only library)"
5086 if test "x$with_libudev" = "xyes"
5088 SAVE_CPPFLAGS="$CPPFLAGS"
5089 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5091 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5093 CPPFLAGS="$SAVE_CPPFLAGS"
5095 if test "x$with_libudev" = "xyes"
5097 SAVE_CPPFLAGS="$CPPFLAGS"
5098 SAVE_LDFLAGS="$LDFLAGS"
5099 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5100 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5102 AC_CHECK_LIB(udev, udev_new,
5104 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5106 [with_libudev="no (libudev not found)"])
5108 CPPFLAGS="$SAVE_CPPFLAGS"
5109 LDFLAGS="$SAVE_LDFLAGS"
5111 if test "x$with_libudev" = "xyes"
5113 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5114 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5115 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5116 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5117 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5118 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5120 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5123 # --with-libupsclient {{{
5124 with_libupsclient_config=""
5125 with_libupsclient_cflags=""
5126 with_libupsclient_libs=""
5127 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5129 if test "x$withval" = "xno"
5131 with_libupsclient="no"
5132 else if test "x$withval" = "xyes"
5134 with_libupsclient="use_pkgconfig"
5136 if test -x "$withval"
5138 with_libupsclient_config="$withval"
5139 with_libupsclient="use_libupsclient_config"
5140 else if test -x "$withval/bin/libupsclient-config"
5142 with_libupsclient_config="$withval/bin/libupsclient-config"
5143 with_libupsclient="use_libupsclient_config"
5145 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5146 with_libupsclient_cflags="-I$withval/include"
5147 with_libupsclient_libs="-L$withval/lib -lupsclient"
5148 with_libupsclient="yes"
5152 [with_libupsclient="use_pkgconfig"])
5154 # configure using libupsclient-config
5155 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5157 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5158 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5161 with_libupsclient="no ($with_libupsclient_config failed)"
5163 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5166 with_libupsclient="no ($with_libupsclient_config failed)"
5169 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5171 with_libupsclient="yes"
5174 # configure using pkg-config
5175 if test "x$with_libupsclient" = "xuse_pkgconfig"
5177 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5178 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5181 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5184 if test "x$with_libupsclient" = "xuse_pkgconfig"
5186 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5189 with_libupsclient="no ($PKG_CONFIG failed)"
5191 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5194 with_libupsclient="no ($PKG_CONFIG failed)"
5197 if test "x$with_libupsclient" = "xuse_pkgconfig"
5199 with_libupsclient="yes"
5202 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5203 # the actual checks.
5204 if test "x$with_libupsclient" = "xyes"
5206 SAVE_CPPFLAGS="$CPPFLAGS"
5207 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5209 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5211 CPPFLAGS="$SAVE_CPPFLAGS"
5213 if test "x$with_libupsclient" = "xyes"
5215 SAVE_CPPFLAGS="$CPPFLAGS"
5216 SAVE_LDFLAGS="$LDFLAGS"
5218 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5219 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5221 AC_CHECK_LIB(upsclient, upscli_connect,
5222 [with_libupsclient="yes"],
5223 [with_libupsclient="no (symbol upscli_connect not found)"])
5225 CPPFLAGS="$SAVE_CPPFLAGS"
5226 LDFLAGS="$SAVE_LDFLAGS"
5228 if test "x$with_libupsclient" = "xyes"
5230 SAVE_CPPFLAGS="$CPPFLAGS"
5231 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5233 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5234 [#include <stdlib.h>
5236 #include <upsclient.h>])
5238 CPPFLAGS="$SAVE_CPPFLAGS"
5240 if test "x$with_libupsclient" = "xyes"
5242 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5243 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5244 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5245 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5249 # --with-libxenctrl {{{
5250 with_libxenctrl_cppflags=""
5251 with_libxenctrl_ldflags=""
5252 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5254 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5256 with_libxenctrl_cppflags="-I$withval/include"
5257 with_libxenctrl_ldflags="-L$withval/lib"
5258 with_libxenctrl="yes"
5260 with_libxenctrl="$withval"
5264 with_libxenctrl="yes"
5266 if test "x$with_libxenctrl" = "xyes"
5268 SAVE_CPPFLAGS="$CPPFLAGS"
5269 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5271 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5273 CPPFLAGS="$SAVE_CPPFLAGS"
5275 if test "x$with_libxenctrl" = "xyes"
5277 SAVE_CPPFLAGS="$CPPFLAGS"
5278 SAVE_LDFLAGS="$LDFLAGS"
5279 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5280 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5282 #Xen versions older than 3.4 has no xc_getcpuinfo()
5283 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5285 CPPFLAGS="$SAVE_CPPFLAGS"
5286 LDFLAGS="$SAVE_LDFLAGS"
5287 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5288 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5289 AC_SUBST(LIBXENCTL_CPPFLAGS)
5290 AC_SUBST(LIBXENCTL_LDFLAGS)
5294 # --with-libxmms {{{
5295 with_xmms_config="xmms-config"
5298 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5300 if test "x$withval" != "xno" \
5301 && test "x$withval" != "xyes"
5303 if test -f "$withval" && test -x "$withval";
5305 with_xmms_config="$withval"
5306 else if test -x "$withval/bin/xmms-config"
5308 with_xmms_config="$withval/bin/xmms-config"
5311 else if test "x$withval" = "xno"
5321 if test "x$with_libxmms" = "xyes"
5323 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5324 xmms_config_status=$?
5326 if test $xmms_config_status -ne 0
5331 if test "x$with_libxmms" = "xyes"
5333 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5334 xmms_config_status=$?
5336 if test $xmms_config_status -ne 0
5341 if test "x$with_libxmms" = "xyes"
5343 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5345 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5346 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5347 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5348 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5355 with_libxmms_numeric=0
5356 if test "x$with_libxmms" = "xyes"
5358 with_libxmms_numeric=1
5360 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5361 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5364 # --with-libyajl {{{
5365 with_libyajl_cppflags=""
5366 with_libyajl_ldflags=""
5367 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5369 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5371 with_libyajl_cppflags="-I$withval/include"
5372 with_libyajl_ldflags="-L$withval/lib"
5375 with_libyajl="$withval"
5381 if test "x$with_libyajl" = "xyes"
5383 SAVE_CPPFLAGS="$CPPFLAGS"
5384 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5386 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5387 AC_CHECK_HEADERS(yajl/yajl_version.h)
5389 CPPFLAGS="$SAVE_CPPFLAGS"
5391 if test "x$with_libyajl" = "xyes"
5393 SAVE_CPPFLAGS="$CPPFLAGS"
5394 SAVE_LDFLAGS="$LDFLAGS"
5395 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5396 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5398 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5400 CPPFLAGS="$SAVE_CPPFLAGS"
5401 LDFLAGS="$SAVE_LDFLAGS"
5403 if test "x$with_libyajl" = "xyes"
5405 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5406 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5407 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5408 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5409 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5410 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5411 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5413 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5417 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5418 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5420 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5422 if test "x$withval" = "xno"
5425 else if test "x$withval" = "xyes"
5428 else if test -d "$with_mic/lib"
5430 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5431 with_mic_cflags="-I$withval/include"
5432 with_mic_ldpath="-L$withval/lib/Linux"
5433 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5438 if test "x$with_mic" = "xyes"
5440 SAVE_CPPFLAGS="$CPPFLAGS"
5441 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5442 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5443 CPPFLAGS="$SAVE_CPPFLAGS"
5445 if test "x$with_mic" = "xyes"
5447 SAVE_CPPFLAGS="$CPPFLAGS"
5448 SAVE_LDFLAGS="$LDFLAGS"
5450 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5451 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5453 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5454 [with_mic_ldpath="$with_mic_ldpath"
5455 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5456 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5458 CPPFLAGS="$SAVE_CPPFLAGS"
5459 LDFLAGS="$SAVE_LDFLAGS"
5462 if test "x$with_mic" = "xyes"
5464 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5465 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5466 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5467 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5468 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5469 AC_SUBST(BUILD_WITH_MIC_LDADD)
5473 # --with-libvarnish {{{
5474 with_libvarnish_cppflags=""
5475 with_libvarnish_cflags=""
5476 with_libvarnish_libs=""
5477 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5479 if test "x$withval" = "xno"
5481 with_libvarnish="no"
5482 else if test "x$withval" = "xyes"
5484 with_libvarnish="use_pkgconfig"
5485 else if test -d "$with_libvarnish/lib"
5487 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5488 with_libvarnish_cflags="-I$withval/include"
5489 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5490 with_libvarnish="yes"
5493 [with_libvarnish="use_pkgconfig"])
5495 # configure using pkg-config
5496 if test "x$with_libvarnish" = "xuse_pkgconfig"
5498 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5499 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5502 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5505 if test "x$with_libvarnish" = "xuse_pkgconfig"
5507 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5510 with_libvarnish="no ($PKG_CONFIG failed)"
5512 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5515 with_libvarnish="no ($PKG_CONFIG failed)"
5518 if test "x$with_libvarnish" = "xuse_pkgconfig"
5520 with_libvarnish="yes"
5523 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5524 # the actual checks.
5525 if test "x$with_libvarnish" = "xyes"
5527 SAVE_CPPFLAGS="$CPPFLAGS"
5529 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5531 AC_CHECK_HEADERS(vapi/vsc.h,
5532 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5533 [AC_CHECK_HEADERS(vsc.h,
5534 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5535 [AC_CHECK_HEADERS(varnishapi.h,
5536 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5537 [with_libvarnish="no (found none of the varnish header files)"])])])
5539 CPPFLAGS="$SAVE_CPPFLAGS"
5541 if test "x$with_libvarnish" = "xyes"
5543 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5544 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5545 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5546 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5550 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5551 with_libxml2="no (pkg-config isn't available)"
5552 with_libxml2_cflags=""
5553 with_libxml2_ldflags=""
5554 with_libvirt="no (pkg-config isn't available)"
5555 with_libvirt_cflags=""
5556 with_libvirt_ldflags=""
5557 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5562 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5565 $PKG_CONFIG --exists libvirt 2>/dev/null
5570 with_libvirt="no (pkg-config doesn't know libvirt)"
5572 if test "x$with_libxml2" = "xyes"
5574 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5579 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5585 if test "x$with_libxml2" = "xyes"
5587 SAVE_CPPFLAGS="$CPPFLAGS"
5588 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5590 AC_CHECK_HEADERS(libxml/parser.h, [],
5591 [with_libxml2="no (libxml/parser.h not found)"])
5593 CPPFLAGS="$SAVE_CPPFLAGS"
5595 if test "x$with_libxml2" = "xyes"
5597 SAVE_CFLAGS="$CFLAGS"
5598 SAVE_LDFLAGS="$LDFLAGS"
5600 CFLAGS="$CFLAGS $with_libxml2_cflags"
5601 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5603 AC_CHECK_LIB(xml2, xmlXPathEval,
5604 [with_libxml2="yes"],
5605 [with_libxml2="no (symbol xmlXPathEval not found)"])
5607 CFLAGS="$SAVE_CFLAGS"
5608 LDFLAGS="$SAVE_LDFLAGS"
5610 dnl Add the right compiler flags and libraries.
5611 if test "x$with_libxml2" = "xyes"; then
5612 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5613 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5614 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5615 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5617 if test "x$with_libvirt" = "xyes"
5619 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5624 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5630 if test "x$with_libvirt" = "xyes"
5632 SAVE_CPPFLAGS="$CPPFLAGS"
5633 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5635 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5636 [with_libvirt="no (libvirt/libvirt.h not found)"])
5638 CPPFLAGS="$SAVE_CPPFLAGS"
5640 if test "x$with_libvirt" = "xyes"
5642 SAVE_CFLAGS="$CFLAGS"
5643 SAVE_LDFLAGS="$LDFLAGS"
5645 CFLAGS="$CFLAGS $with_libvirt_cflags"
5646 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5648 AC_CHECK_LIB(virt, virDomainBlockStats,
5649 [with_libvirt="yes"],
5650 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5652 CFLAGS="$SAVE_CFLAGS"
5653 LDFLAGS="$SAVE_LDFLAGS"
5655 dnl Add the right compiler flags and libraries.
5656 if test "x$with_libvirt" = "xyes"; then
5657 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5658 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5659 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5660 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5664 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5665 with_libopenipmipthread="yes"
5666 with_libopenipmipthread_cflags=""
5667 with_libopenipmipthread_libs=""
5669 if test "x$with_libopenipmipthread" = "xyes"
5671 AC_MSG_CHECKING([for libOpenIPMIpthread])
5672 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5675 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5677 AC_MSG_RESULT([$with_libopenipmipthread])
5680 if test "x$with_libopenipmipthread" = "xyes"
5682 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5683 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5686 with_libopenipmipthread_cflags="$temp_result"
5688 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5689 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5691 AC_MSG_RESULT([$temp_result])
5694 if test "x$with_libopenipmipthread" = "xyes"
5696 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5697 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5700 with_libopenipmipthread_ldflags="$temp_result"
5702 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5703 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5705 AC_MSG_RESULT([$temp_result])
5708 if test "x$with_libopenipmipthread" = "xyes"
5710 SAVE_CPPFLAGS="$CPPFLAGS"
5711 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5713 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5714 [with_libopenipmipthread="yes"],
5715 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5716 [#include <OpenIPMI/ipmiif.h>
5717 #include <OpenIPMI/ipmi_err.h>
5718 #include <OpenIPMI/ipmi_posix.h>
5719 #include <OpenIPMI/ipmi_conn.h>
5722 CPPFLAGS="$SAVE_CPPFLAGS"
5725 if test "x$with_libopenipmipthread" = "xyes"
5727 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5728 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5729 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5730 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5734 # --with-libatasmart {{{
5735 with_libatasmart_cppflags=""
5736 with_libatasmart_ldflags=""
5737 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5739 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5741 with_libatasmart_cppflags="-I$withval/include"
5742 with_libatasmart_ldflags="-L$withval/lib"
5743 with_libatasmart="yes"
5745 with_libatasmart="$withval"
5749 if test "x$ac_system" = "xLinux"
5751 with_libatasmart="yes"
5753 with_libatasmart="no (Linux only library)"
5756 if test "x$with_libatasmart" = "xyes"
5758 SAVE_CPPFLAGS="$CPPFLAGS"
5759 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5761 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5763 CPPFLAGS="$SAVE_CPPFLAGS"
5765 if test "x$with_libatasmart" = "xyes"
5767 SAVE_CPPFLAGS="$CPPFLAGS"
5768 SAVE_LDFLAGS="$LDFLAGS"
5769 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5770 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5772 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5774 CPPFLAGS="$SAVE_CPPFLAGS"
5775 LDFLAGS="$SAVE_LDFLAGS"
5777 if test "x$with_libatasmart" = "xyes"
5779 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5780 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5781 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5782 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5783 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5784 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5785 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5787 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5790 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5791 [with_libnotify="yes"],
5792 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5795 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5796 [with_libriemann_client="yes"],
5797 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5799 # Check for enabled/disabled features
5802 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5803 # ------------------------------------------------------------
5805 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5810 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5815 m4_define([EnDis],[disabled])dnl
5816 m4_define([YesNo],[no])dnl
5822 m4_define([EnDis],[enabled])dnl
5823 m4_define([YesNo],[yes])dnl
5826 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5830 m4_if([$3], [feature], [],
5834 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5840 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5842 enable_$1='[YesNo]'dnl
5844 if test "x$enable_$1" = "xno"
5848 if test "x$enable_$1" = "xyes"
5852 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5857 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5858 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5860 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5862 # AC_PLUGIN(name, default, info)
5863 # ------------------------------------------------------------
5870 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5872 if test "x$enableval" = "xyes"
5875 else if test "x$enableval" = "xforce"
5880 enable_plugin="no (disabled on command line)"
5884 if test "x$enable_all_plugins" = "xauto"
5886 if test "x$2" = "xyes"
5893 enable_plugin="$enable_all_plugins"
5896 if test "x$enable_plugin" = "xyes"
5898 if test "x$2" = "xyes" || test "x$force" = "xyes"
5900 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
5901 if test "x$2" != "xyes"
5903 dependency_warning="yes"
5905 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
5906 dependency_error="yes"
5907 enable_plugin="$2 (dependency error)"
5910 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
5911 enable_$1="$enable_plugin"
5913 )# AC_PLUGIN(name, default, info)
5915 m4_divert_once([HELP_ENABLE], [
5916 collectd features:])
5917 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
5918 AC_COLLECTD([debug], [enable], [feature], [debugging])
5919 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
5920 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
5921 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
5923 dependency_warning="no"
5924 dependency_error="no"
5927 plugin_barometer="no"
5932 plugin_conntrack="no"
5933 plugin_contextswitch="no"
5936 plugin_cpusleep="no"
5937 plugin_curl_json="no"
5938 plugin_curl_xml="no"
5942 plugin_dpdkstat="no"
5949 plugin_hugepages="no"
5950 plugin_intel_rdt="no"
5951 plugin_interface="no"
5956 plugin_log_logstash="no"
5958 plugin_multimeter="no"
5963 plugin_processes="no"
5964 plugin_protocols="no"
5970 plugin_tcpconns="no"
5973 plugin_turbostat="no"
5979 plugin_wireless="no"
5980 plugin_write_prometheus="no"
5984 plugin_zookeeper="no"
5987 if test "x$ac_system" = "xLinux"
5989 plugin_battery="yes"
5990 plugin_cgroups="yes"
5991 plugin_conntrack="yes"
5992 plugin_contextswitch="yes"
5994 plugin_cpufreq="yes"
5997 plugin_entropy="yes"
5998 plugin_fhcount="yes"
5999 plugin_fscache="yes"
6000 plugin_hugepages="yes"
6001 plugin_interface="yes"
6009 plugin_processes="yes"
6010 plugin_protocols="yes"
6013 plugin_tcpconns="yes"
6014 plugin_thermal="yes"
6017 plugin_vserver="yes"
6018 plugin_wireless="yes"
6019 plugin_zfs_arc="yes"
6021 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
6025 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
6027 plugin_turbostat="yes"
6030 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6032 plugin_cpusleep="yes"
6036 if test "x$ac_system" = "xOpenBSD"
6038 plugin_tcpconns="yes"
6041 if test "x$ac_system" = "xNetBSD"
6044 plugin_entropy="yes"
6046 plugin_processes="yes"
6050 if test "x$with_libiokit" = "xyes"
6052 plugin_battery="yes"
6058 if test "x$ac_system" = "xAIX"
6061 plugin_tcpconns="yes"
6066 if test "x$ac_system" = "xFreeBSD"
6069 plugin_zfs_arc="yes"
6073 if test "x$with_perfstat" = "xyes"
6075 plugin_contextswitch="yes"
6078 plugin_interface="yes"
6085 if test "x$with_procinfo" = "xyes"
6087 plugin_processes="yes"
6091 if test "x$with_kstat" = "xyes"
6094 plugin_processes="yes"
6096 plugin_zfs_arc="yes"
6100 if test "x$with_devinfo$with_kstat" = "xyesyes"
6104 plugin_interface="yes"
6110 if test "x$ac_system" = "xLinux"
6112 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6113 [with_libi2c="yes"],
6114 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6115 [[#include <stdlib.h>
6116 #include <linux/i2c-dev.h>]])
6118 with_libi2c="no (Linux only)"
6121 if test "x$with_libi2c" = "xyes"
6123 plugin_barometer="yes"
6128 if test "x$with_libstatgrab" = "xyes"
6132 plugin_interface="yes"
6139 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6142 if test "x$have_strptime" = "xyes"
6148 if test "x$with_libopenipmipthread" = "xyes"
6153 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6155 plugin_curl_json="yes"
6158 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6160 plugin_curl_xml="yes"
6163 if test "x$with_libyajl" = "xyes"
6168 if test "x$have_processor_info" = "xyes"
6172 if test "x$have_sysctl" = "xyes"
6177 if test "x$ac_system" = "xDarwin"
6182 if test "x$have_sysctlbyname" = "xyes"
6184 plugin_contextswitch="yes"
6187 plugin_tcpconns="yes"
6190 # Df plugin: Check if we know how to determine mount points first.
6191 #if test "x$have_listmntent" = "xyes"; then
6194 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6198 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6202 #if test "x$have_getmntent" = "xseq"
6206 if test "x$c_cv_have_one_getmntent" = "xyes"
6211 if test "x$c_cv_have_getmntent_r" = "xyes"
6216 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6217 if test "x$plugin_df" = "xyes"
6220 if test "x$have_statfs" = "xyes"
6224 if test "x$have_statvfs" = "xyes"
6230 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6232 plugin_ethstat="yes"
6235 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6240 if test "x$have_getifaddrs" = "xyes"
6242 plugin_interface="yes"
6245 if test "x$with_libgps" = "xyes"
6250 if test "x$have_getloadavg" = "xyes"
6255 if test "x$with_libyajl" = "xyes"
6257 plugin_log_logstash="yes"
6260 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6265 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6268 if test "x$with_libmicrohttpd" = "xyes"
6270 plugin_write_prometheus="yes"
6274 # Mac OS X memory interface
6275 if test "x$have_host_statistics" = "xyes"
6280 if test "x$have_termios_h" = "xyes"
6282 if test "x$ac_system" != "xAIX"
6284 plugin_multimeter="yes"
6289 if test "x$have_thread_info" = "xyes"
6291 plugin_processes="yes"
6294 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6296 plugin_processes="yes"
6299 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6301 plugin_processes="yes"
6304 if test "x$with_libpython" != "xno"
6309 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6314 if test "x$with_kvm_getswapinfo" = "xyes"
6319 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6324 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6329 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6331 plugin_tcpconns="yes"
6334 if test "x$have_getutent" = "xyes"
6338 if test "x$have_getutxent" = "xyes"
6343 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6348 if test "x$with_libxenctrl" = "xyes"
6353 if test "x$with_libdpdk" = "xyes"
6355 plugin_dpdkstat="yes"
6358 m4_divert_once([HELP_ENABLE], [
6361 AC_ARG_ENABLE([all-plugins],
6362 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6364 if test "x$enableval" = "xyes"
6366 enable_all_plugins="yes"
6367 else if test "x$enableval" = "xauto"
6369 enable_all_plugins="auto"
6371 enable_all_plugins="no"
6374 [enable_all_plugins="auto"])
6376 m4_divert_once([HELP_ENABLE], [])
6378 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6379 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6380 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6381 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6382 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6383 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6384 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6385 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6386 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6387 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6388 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6389 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6390 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6391 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6392 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6393 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6394 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6395 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6396 AC_PLUGIN([csv], [yes], [CSV output plugin])
6397 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6398 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6399 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6400 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6401 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6402 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6403 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6404 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats & Status from DPDK])
6405 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6406 AC_PLUGIN([email], [yes], [EMail statistics])
6407 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6408 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6409 AC_PLUGIN([exec], [yes], [Execution of external programs])
6410 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6411 AC_PLUGIN([filecount], [yes], [Count files in directories])
6412 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6413 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6414 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6415 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6416 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6417 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6418 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6419 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6420 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6421 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6422 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6423 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6424 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6425 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6426 AC_PLUGIN([load], [$plugin_load], [System load])
6427 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6428 AC_PLUGIN([logfile], [yes], [File logging plugin])
6429 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6430 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6431 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6432 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6433 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6434 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6435 AC_PLUGIN([match_regex], [yes], [The regex match])
6436 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6437 AC_PLUGIN([match_value], [yes], [The value match])
6438 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6439 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6440 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6441 AC_PLUGIN([memcached], [yes], [memcached statistics])
6442 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6443 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6444 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6445 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6446 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6447 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6448 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6449 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6450 AC_PLUGIN([network], [yes], [Network communication plugin])
6451 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6452 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6453 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6454 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6455 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6456 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6457 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6458 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6459 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6460 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6461 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6462 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6463 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6464 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6465 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6466 # FIXME: Check for libevent, too.
6467 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6468 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6469 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6470 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6471 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6472 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6473 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6474 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6475 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6476 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6477 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6478 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6479 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6480 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6481 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6482 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6483 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6484 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6485 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6486 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6487 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6488 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6489 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6490 AC_PLUGIN([target_notification], [yes], [The notification target])
6491 AC_PLUGIN([target_replace], [yes], [The replace target])
6492 AC_PLUGIN([target_scale], [yes], [The scale target])
6493 AC_PLUGIN([target_set], [yes], [The set target])
6494 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6495 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6496 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6497 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6498 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6499 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6500 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6501 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6502 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6503 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6504 AC_PLUGIN([users], [$plugin_users], [User statistics])
6505 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6506 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6507 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6508 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6509 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6510 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6511 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6512 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6513 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6514 AC_PLUGIN([write_log], [yes], [Log output plugin])
6515 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6516 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6517 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6518 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6519 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6520 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6521 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6522 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6523 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6524 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6525 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6527 dnl Default configuration file
6528 # Load either syslog or logfile
6529 LOAD_PLUGIN_SYSLOG=""
6530 LOAD_PLUGIN_LOGFILE=""
6531 LOAD_PLUGIN_LOG_LOGSTASH=""
6533 AC_MSG_CHECKING([which default log plugin to load])
6534 default_log_plugin="none"
6535 if test "x$enable_syslog" = "xyes"
6537 default_log_plugin="syslog"
6539 LOAD_PLUGIN_SYSLOG="##"
6542 if test "x$enable_logfile" = "xyes"
6544 if test "x$default_log_plugin" = "xnone"
6546 default_log_plugin="logfile"
6548 LOAD_PLUGIN_LOGFILE="#"
6551 LOAD_PLUGIN_LOGFILE="##"
6554 if test "x$enable_log_logstash" = "xyes"
6556 LOAD_PLUGIN_LOG_LOGSTASH="#"
6558 LOAD_PLUGIN_LOG_LOGSTASH="##"
6562 AC_MSG_RESULT([$default_log_plugin])
6564 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6565 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6566 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6568 DEFAULT_LOG_LEVEL="info"
6569 if test "x$enable_debug" = "xyes"
6571 DEFAULT_LOG_LEVEL="debug"
6573 AC_SUBST(DEFAULT_LOG_LEVEL)
6575 # Load only one of rrdtool, network, csv in the default config.
6576 LOAD_PLUGIN_RRDTOOL=""
6577 LOAD_PLUGIN_NETWORK=""
6580 AC_MSG_CHECKING([which default write plugin to load])
6581 default_write_plugin="none"
6582 if test "x$enable_rrdtool" = "xyes"
6584 default_write_plugin="rrdtool"
6586 LOAD_PLUGIN_RRDTOOL="##"
6589 if test "x$enable_network" = "xyes"
6591 if test "x$default_write_plugin" = "xnone"
6593 default_write_plugin="network"
6595 LOAD_PLUGIN_NETWORK="#"
6598 LOAD_PLUGIN_NETWORK="##"
6601 if test "x$enable_csv" = "xyes"
6603 if test "x$default_write_plugin" = "xnone"
6605 default_write_plugin="csv"
6610 LOAD_PLUGIN_CSV="##"
6612 AC_MSG_RESULT([$default_write_plugin])
6614 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6615 AC_SUBST(LOAD_PLUGIN_NETWORK)
6616 AC_SUBST(LOAD_PLUGIN_CSV)
6619 if test "x$ac_system" = "xLinux" \
6620 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6622 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6625 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6627 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6631 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6632 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6634 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6636 PERL_BINDINGS_OPTIONS="$withval"
6637 with_perl_bindings="yes"
6639 with_perl_bindings="$withval"
6643 if test -n "$perl_interpreter"
6645 with_perl_bindings="yes"
6647 with_perl_bindings="no (no perl interpreter found)"
6651 if test "x$with_perl_bindings" = "xyes"
6653 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6654 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6655 AC_MSG_RESULT([yes])
6658 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6662 if test "x$with_perl_bindings" = "xyes"
6664 PERL_BINDINGS="perl"
6668 AC_SUBST(PERL_BINDINGS)
6669 AC_SUBST(PERL_BINDINGS_OPTIONS)
6671 dnl libcollectdclient
6672 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6673 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6674 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6676 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6678 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6680 AC_SUBST(LCC_VERSION_MAJOR)
6681 AC_SUBST(LCC_VERSION_MINOR)
6682 AC_SUBST(LCC_VERSION_PATCH)
6683 AC_SUBST(LCC_VERSION_EXTRA)
6684 AC_SUBST(LCC_VERSION_STRING)
6686 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6690 if test "x$enable_werror" != "xno"
6692 AM_CFLAGS="$AM_CFLAGS -Werror"
6693 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6695 AC_SUBST([AM_CFLAGS])
6696 AC_SUBST([AM_CXXFLAGS])
6698 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])
6701 if test "x$with_librrd" = "xyes" \
6702 && test "x$librrd_threadsafe" != "xyes"
6704 with_librrd="yes (warning: librrd is not thread-safe)"
6707 if test "x$with_libperl" = "xyes"
6709 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6711 enable_perl="no (needs libperl)"
6714 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6716 enable_perl="no (libperl doesn't support ithreads)"
6719 if test "x$with_perl_bindings" = "xyes" \
6720 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6722 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6726 AC_MSG_RESULT([Configuration:])
6727 AC_MSG_RESULT([ Build:])
6728 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6729 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6730 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6731 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6732 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6733 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6734 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6735 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6736 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6737 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6738 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6739 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6741 AC_MSG_RESULT([ Libraries:])
6742 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6743 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6744 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6745 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6746 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6747 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6748 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6749 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6750 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6751 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6752 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6753 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6754 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6755 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6756 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6757 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6758 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6759 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6760 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6761 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6762 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6763 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6764 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6765 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6766 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6767 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6768 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6769 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6770 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6771 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6772 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6773 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6774 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6775 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6776 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6777 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6778 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6779 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6780 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6781 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6782 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6783 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6784 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6785 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6786 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6787 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6788 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6789 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6790 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6791 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6792 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6793 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6794 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6795 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6796 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6797 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6798 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6799 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6800 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6801 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6802 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6803 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6804 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6805 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6807 AC_MSG_RESULT([ Features:])
6808 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6809 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6811 AC_MSG_RESULT([ Bindings:])
6812 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6814 AC_MSG_RESULT([ Modules:])
6815 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6816 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6817 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6818 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6819 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6820 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6821 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6822 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6823 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6824 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6825 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6826 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6827 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6828 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6829 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6830 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6831 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6832 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6833 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6834 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6835 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6836 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6837 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6838 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6839 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6840 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6841 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6842 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6843 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6844 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6845 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6846 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6847 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6848 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6849 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6850 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6851 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6852 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6853 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6854 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6855 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6856 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6857 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6858 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6859 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6860 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6861 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6862 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6863 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6864 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6865 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6866 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6867 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6868 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6869 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6870 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6871 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6872 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6873 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6874 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6875 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6876 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6877 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6878 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
6879 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
6880 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
6881 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
6882 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
6883 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
6884 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
6885 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
6886 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
6887 AC_MSG_RESULT([ network . . . . . . . $enable_network])
6888 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
6889 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
6890 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
6891 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
6892 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
6893 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
6894 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
6895 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
6896 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
6897 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
6898 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
6899 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
6900 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
6901 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
6902 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
6903 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
6904 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
6905 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
6906 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
6907 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
6908 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
6909 AC_MSG_RESULT([ python . . . . . . . $enable_python])
6910 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
6911 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
6912 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
6913 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
6914 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
6915 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
6916 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
6917 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
6918 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
6919 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
6920 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
6921 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
6922 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
6923 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
6924 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
6925 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
6926 AC_MSG_RESULT([ target_notification . $enable_target_notification])
6927 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
6928 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
6929 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
6930 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
6931 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
6932 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
6933 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
6934 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
6935 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
6936 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
6937 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
6938 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
6939 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
6940 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
6941 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
6942 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
6943 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
6944 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
6945 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
6946 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
6947 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
6948 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
6949 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
6950 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
6951 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
6952 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
6953 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
6954 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
6955 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
6956 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
6957 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
6958 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
6959 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
6960 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
6961 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
6964 if test "x$dependency_error" = "xyes"; then
6965 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
6968 if test "x$dependency_warning" = "xyes"; then
6969 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
6972 # vim: set fdm=marker :