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 AC_CHECK_HEADERS([cpuid.h],
809 [have_cpuid_h="yes"],
810 [have_cpuid_h="no (cpuid.h not found)"]
813 have_capability="yes"
814 AC_CHECK_HEADERS(sys/capability.h,
815 [have_capability="yes"],
816 [have_capability="no (<sys/capability.h> not found)"])
817 if test "x$have_capability" = "xyes"; then
818 AC_CHECK_LIB(cap, cap_get_proc,
819 [have_capability="yes"],
820 [have_capability="no (cap_get_proc() not found)"])
822 if test "x$have_capability" = "xyes"; then
823 AC_CHECK_DECL([CAP_IS_SUPPORTED],
824 [have_capability="yes"],
825 [have_capability="no (CAP_IS_SUPPORTED not found)"],
826 [[#include <sys/capability.h>]])
828 if test "x$have_capability" = "xyes"; then
829 AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_proc() (-lcap).])
831 AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes")
834 # Checks for typedefs, structures, and compiler characteristics.
843 # Checks for library functions.
845 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname setlocale asprintf)
852 AC_LANG_SOURCE([[int main(void){}]])
854 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
861 SAVE_CFLAGS="$CFLAGS"
862 # Emulate behavior of src/Makefile.am
863 if test "x$GCC" = "xyes"
865 CFLAGS="$CFLAGS -Wall -Werror"
868 AC_CACHE_CHECK([for strtok_r],
869 [c_cv_have_strtok_r_default],
878 char buffer[] = "foo,bar,baz";
885 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
888 printf ("token = %s;\n", token);
892 [c_cv_have_strtok_r_default="yes"],
893 [c_cv_have_strtok_r_default="no"]
897 if test "x$c_cv_have_strtok_r_default" = "xno"
899 CFLAGS="$CFLAGS -D_REENTRANT=1"
901 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
902 [c_cv_have_strtok_r_reentrant],
911 char buffer[] = "foo,bar,baz";
918 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
921 printf ("token = %s;\n", token);
925 [c_cv_have_strtok_r_reentrant="yes"],
926 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
931 CFLAGS="$SAVE_CFLAGS"
932 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
934 CFLAGS="$CFLAGS -D_REENTRANT=1"
937 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
939 socket_needs_socket="no"
940 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
941 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
943 clock_gettime_needs_rt="no"
944 clock_gettime_needs_posix4="no"
945 have_clock_gettime="no"
946 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
947 if test "x$have_clock_gettime" = "xno"
949 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
950 have_clock_gettime="yes"])
952 if test "x$have_clock_gettime" = "xno"
954 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
955 have_clock_gettime="yes"])
957 if test "x$have_clock_gettime" = "xyes"
959 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
962 nanosleep_needs_rt="no"
963 nanosleep_needs_posix4="no"
964 AC_CHECK_FUNCS(nanosleep,
966 AC_CHECK_LIB(rt, nanosleep,
967 [nanosleep_needs_rt="yes"],
968 AC_CHECK_LIB(posix4, nanosleep,
969 [nanosleep_needs_posix4="yes"],
970 AC_MSG_ERROR(cannot find nanosleep))))
972 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
973 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
975 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
976 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
977 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
978 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
979 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
980 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
981 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
982 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
983 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
984 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
985 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
986 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
988 # Check for strptime {{{
989 if test "x$GCC" = "xyes"
991 SAVE_CFLAGS="$CFLAGS"
992 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
995 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
996 if test "x$have_strptime" = "xyes"
998 AC_CACHE_CHECK([whether strptime is exported by default],
999 [c_cv_have_strptime_default],
1000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1006 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1009 [c_cv_have_strptime_default="yes"],
1010 [c_cv_have_strptime_default="no"]))
1012 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
1014 AC_CACHE_CHECK([whether strptime needs standards mode],
1015 [c_cv_have_strptime_standards],
1016 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1018 #ifndef _ISOC99_SOURCE
1019 # define _ISOC99_SOURCE 1
1021 #ifndef _POSIX_C_SOURCE
1022 # define _POSIX_C_SOURCE 200112L
1024 #ifndef _XOPEN_SOURCE
1025 # define _XOPEN_SOURCE 500
1031 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1034 [c_cv_have_strptime_standards="yes"],
1035 [c_cv_have_strptime_standards="no"]))
1037 if test "x$c_cv_have_strptime_standards" = "xyes"
1039 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
1045 if test "x$GCC" = "xyes"
1047 CFLAGS="$SAVE_CFLAGS"
1049 # }}} Check for strptime
1051 # Check for timegm {{{
1053 # These checks need -Werror because implicit function declarations are only a
1055 SAVE_CFLAGS="$CFLAGS"
1056 CFLAGS="$CFLAGS -Werror"
1058 AC_CACHE_CHECK([for timegm],
1063 #if STRPTIME_NEEDS_STANDARDS
1064 # ifndef _ISOC99_SOURCE
1065 # define _ISOC99_SOURCE 1
1067 # ifndef _POSIX_C_SOURCE
1068 # define _POSIX_C_SOURCE 200112L
1070 # ifndef _XOPEN_SOURCE
1071 # define _XOPEN_SOURCE 500
1077 time_t t = timegm(&(struct tm){0});
1078 if (t == ((time_t) -1)) {
1083 [c_cv_have_timegm="yes"],
1084 [c_cv_have_timegm="no"]
1088 if test "x$c_cv_have_timegm" != "xyes"
1090 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1091 [c_cv_have_timegm_bsd],
1095 #if STRPTIME_NEEDS_STANDARDS
1096 # ifndef _ISOC99_SOURCE
1097 # define _ISOC99_SOURCE 1
1099 # ifndef _POSIX_C_SOURCE
1100 # define _POSIX_C_SOURCE 200112L
1102 # ifndef _XOPEN_SOURCE
1103 # define _XOPEN_SOURCE 500
1107 # define _BSD_SOURCE 1
1112 time_t t = timegm(&(struct tm){0});
1113 if (t == ((time_t) -1)) {
1118 [c_cv_have_timegm_bsd="yes"
1119 c_cv_have_timegm="yes"],
1120 [c_cv_have_timegm_bsd="no"]
1125 if test "x$c_cv_have_timegm" = "xyes"
1127 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1128 if test "x$c_cv_have_timegm_bsd" = "xyes"
1130 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1134 CFLAGS="$SAVE_CFLAGS"
1135 # }}} Check for timegm
1137 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
1138 if test "x$have_swapctl" = "xyes"; then
1139 AC_CACHE_CHECK([whether swapctl takes two arguments],
1140 [c_cv_have_swapctl_two_args],
1141 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1143 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1144 # undef _FILE_OFFSET_BITS
1145 # undef _LARGEFILE64_SOURCE
1147 #include <sys/stat.h>
1148 #include <sys/param.h>
1149 #include <sys/swap.h>
1153 int num = swapctl(0, NULL);
1156 [c_cv_have_swapctl_two_args="yes"],
1157 [c_cv_have_swapctl_two_args="no"]
1160 AC_CACHE_CHECK([whether swapctl takes three arguments],
1161 [c_cv_have_swapctl_three_args],
1165 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1166 # undef _FILE_OFFSET_BITS
1167 # undef _LARGEFILE64_SOURCE
1169 #include <sys/stat.h>
1170 #include <sys/param.h>
1171 #include <sys/swap.h>
1175 int num = swapctl(0, NULL, 0);
1178 [c_cv_have_swapctl_three_args="yes"],
1179 [c_cv_have_swapctl_three_args="no"]
1183 # Check for different versions of `swapctl' here..
1184 if test "x$have_swapctl" = "xyes"; then
1185 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1186 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
1187 [Define if the function swapctl exists and takes two arguments.])
1189 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1190 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
1191 [Define if the function swapctl exists and takes three arguments.])
1196 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1198 if test "x$withval" = "xno"; then
1200 else if test "x$withval" = "xyes"; then
1207 if test "x$nan_type" = "xnone"; then
1208 AC_CACHE_CHECK([whether NAN is defined by default],
1209 [c_cv_have_nan_default],
1210 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1214 static double foo = NAN;
1223 [c_cv_have_nan_default="yes"],
1224 [c_cv_have_nan_default="no"]
1227 if test "x$c_cv_have_nan_default" = "xyes"
1232 if test "x$nan_type" = "xnone"; then
1233 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1234 [c_cv_have_nan_isoc],
1235 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1238 #define __USE_ISOC99 1
1240 static double foo = NAN;
1249 [c_cv_have_nan_isoc="yes"],
1250 [c_cv_have_nan_isoc="no"]
1253 if test "x$c_cv_have_nan_isoc" = "xyes"
1258 if test "x$nan_type" = "xnone"; then
1259 SAVE_LDFLAGS=$LDFLAGS
1260 LDFLAGS="$LDFLAGS -lm"
1261 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1262 [c_cv_have_nan_zero],
1263 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1270 #define NAN (0.0 / 0.0)
1272 # define isnan(f) ((f) != (f))
1274 static double foo = NAN;
1283 [c_cv_have_nan_zero="yes"],
1284 [c_cv_have_nan_zero="no"]
1287 LDFLAGS=$SAVE_LDFLAGS
1288 if test "x$c_cv_have_nan_zero" = "xyes"
1294 if test "x$nan_type" = "xdefault"; then
1295 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1296 [Define if NAN is defined by default and can initialize static variables.])
1297 else if test "x$nan_type" = "xisoc99"; then
1298 AC_DEFINE(NAN_STATIC_ISOC, 1,
1299 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1300 else if test "x$nan_type" = "xzero"; then
1301 AC_DEFINE(NAN_ZERO_ZERO, 1,
1302 [Define if NAN can be defined as (0.0 / 0.0)])
1304 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1307 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1309 if test "x$withval" = "xnothing"; then
1310 fp_layout_type="nothing"
1311 else if test "x$withval" = "xendianflip"; then
1312 fp_layout_type="endianflip"
1313 else if test "x$withval" = "xintswap"; then
1314 fp_layout_type="intswap"
1316 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1319 [fp_layout_type="unknown"])
1321 if test "x$fp_layout_type" = "xunknown"; then
1322 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1323 [c_cv_fp_layout_need_nothing],
1324 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1330 # include <stdint.h>
1333 # include <inttypes.h>
1336 # include <stdbool.h>
1346 memcpy ((void *) &i0, (void *) &d, 8);
1349 memcpy ((void *) c, (void *) &i1, 8);
1351 if ((c[0] == 0x2f) && (c[1] == 0x25)
1352 && (c[2] == 0xc0) && (c[3] == 0xc7)
1353 && (c[4] == 0x43) && (c[5] == 0x2b)
1354 && (c[6] == 0x1f) && (c[7] == 0x5b))
1360 [c_cv_fp_layout_need_nothing="yes"],
1361 [c_cv_fp_layout_need_nothing="no"]
1364 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1365 fp_layout_type="nothing"
1368 if test "x$fp_layout_type" = "xunknown"; then
1369 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1370 [c_cv_fp_layout_need_endianflip],
1371 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1377 # include <stdint.h>
1380 # include <inttypes.h>
1383 # include <stdbool.h>
1385 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1386 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1387 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1388 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1389 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1390 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1391 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1392 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1401 memcpy ((void *) &i0, (void *) &d, 8);
1403 i1 = endianflip (i0);
1404 memcpy ((void *) c, (void *) &i1, 8);
1406 if ((c[0] == 0x2f) && (c[1] == 0x25)
1407 && (c[2] == 0xc0) && (c[3] == 0xc7)
1408 && (c[4] == 0x43) && (c[5] == 0x2b)
1409 && (c[6] == 0x1f) && (c[7] == 0x5b))
1415 [c_cv_fp_layout_need_endianflip="yes"],
1416 [c_cv_fp_layout_need_endianflip="no"]
1419 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1420 fp_layout_type="endianflip"
1423 if test "x$fp_layout_type" = "xunknown"; then
1424 AC_CACHE_CHECK([if intswap converts to x86 representation],
1425 [c_cv_fp_layout_need_intswap],
1426 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1432 # include <stdint.h>
1435 # include <inttypes.h>
1438 # include <stdbool.h>
1440 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1441 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1450 memcpy ((void *) &i0, (void *) &d, 8);
1453 memcpy ((void *) c, (void *) &i1, 8);
1455 if ((c[0] == 0x2f) && (c[1] == 0x25)
1456 && (c[2] == 0xc0) && (c[3] == 0xc7)
1457 && (c[4] == 0x43) && (c[5] == 0x2b)
1458 && (c[6] == 0x1f) && (c[7] == 0x5b))
1464 [c_cv_fp_layout_need_intswap="yes"],
1465 [c_cv_fp_layout_need_intswap="no"]
1468 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1469 fp_layout_type="intswap"
1473 if test "x$fp_layout_type" = "xnothing"; then
1474 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1475 [Define if doubles are stored in x86 representation.])
1476 else if test "x$fp_layout_type" = "xendianflip"; then
1477 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1478 [Define if endianflip is needed to convert to x86 representation.])
1479 else if test "x$fp_layout_type" = "xintswap"; then
1480 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1481 [Define if intswap is needed to convert to x86 representation.])
1483 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1486 # --with-useragent {{{
1487 AC_ARG_WITH(useragent, [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1489 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1491 AC_DEFINE_UNQUOTED(COLLECTD_USERAGENT, ["$withval"], [User agent for http requests])
1497 # --with-data-max-name-len {{{
1498 AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1500 if test "x$withval" != "x" && test $withval -gt 0
1502 AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
1504 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1507 [ AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
1512 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1513 have_getvfsstat="no"
1514 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1515 have_listmntent="no"
1516 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1517 have_getmntent_r="no"
1518 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1521 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1522 if test "x$have_getmntent" = "xno"; then
1523 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1525 if test "x$have_getmntent" = "xno"; then
1526 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1528 if test "x$have_getmntent" = "xno"; then
1529 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1532 if test "x$have_getmntent" = "xc"; then
1533 AC_CACHE_CHECK([whether getmntent takes one argument],
1534 [c_cv_have_one_getmntent],
1538 #include "$srcdir/src/utils_mount.h"
1543 fh = setmntent ("/etc/mtab", "r");
1544 me = getmntent (fh);
1545 return(me->mnt_passno);
1548 [c_cv_have_one_getmntent="yes"],
1549 [c_cv_have_one_getmntent="no"]
1552 AC_CACHE_CHECK([whether getmntent takes two arguments],
1553 [c_cv_have_two_getmntent],
1557 #include "$srcdir/src/utils_mount.h"
1563 fh = fopen ("/etc/mnttab", "r");
1564 status = getmntent (fh, &mt);
1568 [c_cv_have_two_getmntent="yes"],
1569 [c_cv_have_two_getmntent="no"]
1574 # Check for different versions of `getmntent' here..
1576 if test "x$have_getmntent" = "xc"; then
1577 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1578 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1579 [Define if the function getmntent exists and takes one argument.])
1581 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1582 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1583 [Define if the function getmntent exists and takes two arguments.])
1586 if test "x$have_getmntent" = "xsun"; then
1587 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1588 [Define if the function getmntent exists. It is the version from libsun.])
1590 if test "x$have_getmntent" = "xseq"; then
1591 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1592 [Define if the function getmntent exists. It is the version from libseq.])
1594 if test "x$have_getmntent" = "xgen"; then
1595 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1596 [Define if the function getmntent exists. It is the version from libgen.])
1600 AC_CACHE_CHECK([if have htonll defined],
1602 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1604 #include <sys/types.h>
1605 #include <netinet/in.h>
1607 # include <inttypes.h>
1614 [c_cv_have_htonll="yes"],
1615 [c_cv_have_htonll="no"]
1618 if test "x$c_cv_have_htonll" = "xyes"
1620 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1623 # Check for structures
1624 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1625 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1628 #include <sys/types.h>
1629 #include <sys/socket.h>
1632 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1633 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1636 #include <sys/types.h>
1637 #include <sys/socket.h>
1638 #include <linux/if.h>
1639 #include <linux/netdevice.h>
1641 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1642 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1645 #include <linux/inet_diag.h>
1649 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1652 #include <netinet/in.h>
1656 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1658 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1659 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1660 have_struct_kinfo_proc_freebsd="yes"
1663 have_struct_kinfo_proc_freebsd="no"
1667 #include <sys/param.h>
1668 #include <sys/sysctl.h>
1669 #include <sys/user.h>
1672 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1674 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1675 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1676 have_struct_kinfo_proc_openbsd="yes"
1679 have_struct_kinfo_proc_openbsd="no"
1682 #include <sys/param.h>
1683 #include <sys/sysctl.h>
1688 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1690 AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
1691 [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1692 have_struct_kinfo_proc2_netbsd="yes"
1695 have_struct_kinfo_proc2_netbsd="no"
1698 #include <sys/param.h>
1699 #include <sys/sysctl.h>
1705 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1706 [#define _BSD_SOURCE
1707 #define _DEFAULT_SOURCE
1709 # include <stdint.h>
1711 #if HAVE_SYS_TYPES_H
1712 # include <sys/types.h>
1714 #if HAVE_NETINET_IN_SYSTM_H
1715 # include <netinet/in_systm.h>
1717 #if HAVE_NETINET_IN_H
1718 # include <netinet/in.h>
1720 #if HAVE_NETINET_IP_H
1721 # include <netinet/ip.h>
1723 #if HAVE_NETINET_UDP_H
1724 # include <netinet/udp.h>
1727 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1728 [#define _BSD_SOURCE
1729 #define _DEFAULT_SOURCE
1731 # include <stdint.h>
1733 #if HAVE_SYS_TYPES_H
1734 # include <sys/types.h>
1736 #if HAVE_NETINET_IN_SYSTM_H
1737 # include <netinet/in_systm.h>
1739 #if HAVE_NETINET_IN_H
1740 # include <netinet/in.h>
1742 #if HAVE_NETINET_IP_H
1743 # include <netinet/ip.h>
1745 #if HAVE_NETINET_UDP_H
1746 # include <netinet/udp.h>
1750 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1759 # check for pthread_setname_np
1760 SAVE_LDFLAGS="$LDFLAGS"
1761 LDFLAGS="$LDFLAGS -lpthread"
1763 AC_MSG_CHECKING([for pthread_setname_np])
1764 have_pthread_setname_np="no"
1765 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1768 #include <pthread.h>
1771 pthread_setname_np((pthread_t) {0}, "conftest");
1774 have_pthread_setname_np="yes"
1775 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1778 AC_MSG_RESULT([$have_pthread_setname_np])
1780 # check for pthread_set_name_np(3) (FreeBSD)
1781 AC_MSG_CHECKING([for pthread_set_name_np])
1782 have_pthread_set_name_np="no"
1783 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1785 #include <pthread_np.h>
1788 pthread_set_name_np((pthread_t) {0}, "conftest");
1791 have_pthread_set_name_np="yes"
1792 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1794 AC_MSG_RESULT([$have_pthread_set_name_np])
1796 LDFLAGS="$SAVE_LDFLAGS"
1799 # Checks for libraries begin here
1802 with_libresolv="yes"
1803 AC_CHECK_LIB(resolv, res_search,
1805 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1807 [with_libresolv="no"])
1808 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1810 dnl Check for HAL (hardware abstraction library)
1812 PKG_CHECK_MODULES([HAL], [hal],
1815 LIBS="$HAL_LIBS $LIBS"
1816 AC_CHECK_LIB([hal], [libhal_device_property_exists],
1818 SAVE_CPPFLAGS="$CPPFLAGS"
1819 CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
1820 AC_CHECK_HEADERS([libhal.h],
1823 BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
1824 BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
1826 CPPFLAGS="$SAVE_CPPFLAGS"
1834 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1835 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1839 AC_CHECK_LIB([pthread],
1842 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
1845 PTHREAD_LIBS="$LIBS"
1848 AC_CHECK_HEADERS([pthread.h],
1850 [AC_MSG_ERROR([pthread.h not found])]
1852 AC_SUBST([PTHREAD_LIBS])
1854 m4_divert_once([HELP_WITH], [
1855 collectd additional packages:])
1857 if test "x$ac_system" = "xAIX"
1862 with_perfstat="no (AIX only)"
1863 with_procinfo="no (AIX only)"
1866 if test "x$with_perfstat" = "xyes"
1868 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1869 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1871 if test "x$with_perfstat" = "xyes"
1873 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1874 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1875 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1876 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1878 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1881 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1883 # Processes plugin under AIX.
1884 if test "x$with_procinfo" = "xyes"
1886 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1888 if test "x$with_procinfo" = "xyes"
1890 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1893 if test "x$ac_system" = "xSolaris"
1898 with_kstat="no (Solaris only)"
1899 with_devinfo="no (Solaris only)"
1902 if test "x$with_kstat" = "xyes"
1904 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1906 if test "x$with_kstat" = "xyes"
1908 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1909 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1911 if test "x$with_kstat" = "xyes"
1913 AC_DEFINE(HAVE_LIBKSTAT, 1,
1914 [Define to 1 if you have the 'kstat' library (-lkstat)])
1916 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1917 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1920 if test "x$ac_system" = "xDarwin"
1926 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1929 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1930 if test "x$with_kvm_getprocs" = "xyes"
1932 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1933 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1936 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1938 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1939 if test "x$with_kvm_getswapinfo" = "xyes"
1941 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1942 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1945 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1947 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1948 if test "x$with_kvm_nlist" = "xyes"
1950 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1951 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1952 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1955 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1957 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1958 if test "x$with_kvm_openfiles" = "xyes"
1960 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1961 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1964 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1966 # --with-libaquaero5 {{{
1967 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1969 if test "x$withval" = "xyes"
1971 with_libaquaero5="yes"
1972 else if test "x$withval" = "xno"
1974 with_libaquaero5="no"
1976 with_libaquaero5="yes"
1977 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1978 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1981 [with_libaquaero5="yes"])
1983 SAVE_CPPFLAGS="$CPPFLAGS"
1984 SAVE_LDFLAGS="$LDFLAGS"
1986 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1987 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1989 if test "x$with_libaquaero5" = "xyes"
1991 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1993 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1995 AC_CHECK_HEADERS(libaquaero5.h,
1996 [with_libaquaero5="yes"],
1997 [with_libaquaero5="no (libaquaero5.h not found)"])
1999 if test "x$with_libaquaero5" = "xyes"
2001 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
2003 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
2005 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
2006 [with_libaquaero5="yes"],
2007 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
2010 CPPFLAGS="$SAVE_CPPFLAGS"
2011 LDFLAGS="$SAVE_LDFLAGS"
2013 if test "x$with_libaquaero5" = "xyes"
2015 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2016 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2017 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
2018 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
2020 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
2023 # --with-libhiredis {{{
2024 AC_ARG_WITH(libhiredis, [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@],
2025 [Path to libhiredis.])],
2027 if test "x$withval" = "xyes"
2029 with_libhiredis="yes"
2030 else if test "x$withval" = "xno"
2032 with_libhiredis="no"
2034 with_libhiredis="yes"
2035 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2036 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2039 [with_libhiredis="yes"])
2041 SAVE_CPPFLAGS="$CPPFLAGS"
2042 SAVE_LDFLAGS="$LDFLAGS"
2044 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2045 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2047 if test "x$with_libhiredis" = "xyes"
2049 if test "x$LIBHIREDIS_CPPFLAGS" != "x"
2051 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
2053 AC_CHECK_HEADERS(hiredis/hiredis.h,
2054 [with_libhiredis="yes"],
2055 [with_libhiredis="no (hiredis.h not found)"])
2057 if test "x$with_libhiredis" = "xyes"
2059 if test "x$LIBHIREDIS_LDFLAGS" != "x"
2061 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
2063 AC_CHECK_LIB(hiredis, redisCommand,
2064 [with_libhiredis="yes"],
2065 [with_libhiredis="no (symbol 'redisCommand' not found)"])
2069 CPPFLAGS="$SAVE_CPPFLAGS"
2070 LDFLAGS="$SAVE_LDFLAGS"
2072 if test "x$with_libhiredis" = "xyes"
2074 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2075 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2076 AC_SUBST(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
2077 AC_SUBST(BUILD_WITH_LIBHIREDIS_LDFLAGS)
2079 AM_CONDITIONAL(BUILD_WITH_LIBHIREDIS, test "x$with_libhiredis" = "xyes")
2082 # --with-libcurl {{{
2083 with_curl_config="curl-config"
2086 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2088 if test "x$withval" = "xno"
2091 else if test "x$withval" = "xyes"
2095 if test -f "$withval" && test -x "$withval"
2097 with_curl_config="$withval"
2099 else if test -x "$withval/bin/curl-config"
2101 with_curl_config="$withval/bin/curl-config"
2110 if test "x$with_libcurl" = "xyes"
2112 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2113 curl_config_status=$?
2115 if test $curl_config_status -ne 0
2117 with_libcurl="no ($with_curl_config failed)"
2119 SAVE_CPPFLAGS="$CPPFLAGS"
2120 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2122 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
2124 CPPFLAGS="$SAVE_CPPFLAGS"
2127 if test "x$with_libcurl" = "xyes"
2129 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2130 curl_config_status=$?
2132 if test $curl_config_status -ne 0
2134 with_libcurl="no ($with_curl_config failed)"
2136 AC_CHECK_LIB(curl, curl_easy_init,
2137 [with_libcurl="yes"],
2138 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2140 AC_CHECK_DECL(CURLOPT_USERNAME,
2141 [have_curlopt_username="yes"],
2142 [have_curlopt_username="no"],
2143 [[#include <curl/curl.h>]])
2144 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2145 [have_curlopt_timeout="yes"],
2146 [have_curlopt_timeout="no"],
2147 [[#include <curl/curl.h>]])
2150 if test "x$with_libcurl" = "xyes"
2152 SAVE_CPPFLAGS="$CPPFLAGS"
2153 SAVE_LDFLAGS="$LDFLAGS"
2154 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2155 LDFLAGS="$LDFLAGS $with_curl_libs"
2156 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2157 [c_cv_have_curlinfo_appconnect_time],
2158 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2160 #include <curl/curl.h>
2163 int val = CURLINFO_APPCONNECT_TIME;
2167 [c_cv_have_curlinfo_appconnect_time="yes"],
2168 [c_cv_have_curlinfo_appconnect_time="no"]
2171 CPPFLAGS="$SAVE_CPPFLAGS"
2172 LDFLAGS="$SAVE_LDFLAGS"
2174 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
2175 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
2177 AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
2180 if test "x$with_libcurl" = "xyes"
2182 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2183 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2184 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2185 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2187 if test "x$have_curlopt_username" = "xyes"
2189 AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
2192 if test "x$have_curlopt_timeout" = "xyes"
2194 AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
2200 with_libdbi_cppflags=""
2201 with_libdbi_ldflags=""
2202 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2204 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2206 with_libdbi_cppflags="-I$withval/include"
2207 with_libdbi_ldflags="-L$withval/lib"
2210 with_libdbi="$withval"
2216 if test "x$with_libdbi" = "xyes"
2218 SAVE_CPPFLAGS="$CPPFLAGS"
2219 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2221 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
2223 CPPFLAGS="$SAVE_CPPFLAGS"
2225 if test "x$with_libdbi" = "xyes"
2227 SAVE_CPPFLAGS="$CPPFLAGS"
2228 SAVE_LDFLAGS="$LDFLAGS"
2229 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2230 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2232 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
2234 CPPFLAGS="$SAVE_CPPFLAGS"
2235 LDFLAGS="$SAVE_LDFLAGS"
2237 if test "x$with_libdbi" = "xyes"
2239 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2240 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2241 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2242 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2243 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2244 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2246 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
2249 # --with-libesmtp {{{
2250 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2252 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2254 LDFLAGS="$LDFLAGS -L$withval/lib"
2255 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
2258 with_libesmtp="$withval"
2264 if test "x$with_libesmtp" = "xyes"
2266 AC_CHECK_LIB(esmtp, smtp_create_session,
2268 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
2269 ], [with_libesmtp="no (libesmtp not found)"])
2271 if test "x$with_libesmtp" = "xyes"
2273 AC_CHECK_HEADERS(libesmtp.h,
2275 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
2276 ], [with_libesmtp="no (libesmtp.h not found)"])
2278 if test "x$with_libesmtp" = "xyes"
2284 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
2285 [Wether or not to use the esmtp library])
2286 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
2289 # --with-libganglia {{{
2290 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2292 if test -f "$withval" && test -x "$withval"
2294 with_libganglia_config="$withval"
2295 with_libganglia="yes"
2296 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
2298 with_libganglia_config="$withval/bin/ganglia-config"
2299 with_libganglia="yes"
2300 else if test -d "$withval"
2302 GANGLIA_CPPFLAGS="-I$withval/include"
2303 GANGLIA_LDFLAGS="-L$withval/lib"
2304 with_libganglia="yes"
2306 with_libganglia="$withval"
2310 with_libganglia="yes"
2313 if test "x$with_libganglia" = "xyes"
2315 if test "x$with_libganglia_config" != "x"
2317 if test "x$GANGLIA_CPPFLAGS" = "x"
2319 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2322 if test "x$GANGLIA_LDFLAGS" = "x"
2324 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2327 if test "x$GANGLIA_LIBS" = "x"
2329 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2332 GANGLIA_LIBS="-lganglia"
2336 SAVE_CPPFLAGS="$CPPFLAGS"
2337 SAVE_LDFLAGS="$LDFLAGS"
2338 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2339 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2341 if test "x$with_libganglia" = "xyes"
2343 AC_CHECK_HEADERS(gm_protocol.h,
2345 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
2346 [Define to 1 if you have the <gm_protocol.h> header file.])
2347 ], [with_libganglia="no (gm_protocol.h not found)"])
2350 if test "x$with_libganglia" = "xyes"
2352 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
2354 AC_DEFINE(HAVE_LIBGANGLIA, 1,
2355 [Define to 1 if you have the ganglia library (-lganglia).])
2356 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
2359 CPPFLAGS="$SAVE_CPPFLAGS"
2360 LDFLAGS="$SAVE_LDFLAGS"
2362 AC_SUBST(GANGLIA_CPPFLAGS)
2363 AC_SUBST(GANGLIA_LDFLAGS)
2364 AC_SUBST(GANGLIA_LIBS)
2365 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
2368 # --with-libgcrypt {{{
2369 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2370 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2371 GCRYPT_LIBS="$GCRYPT_LIBS"
2372 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2374 if test -f "$withval" && test -x "$withval"
2376 with_libgcrypt_config="$withval"
2377 with_libgcrypt="yes"
2378 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
2380 with_libgcrypt_config="$withval/bin/gcrypt-config"
2381 with_libgcrypt="yes"
2382 else if test -d "$withval"
2384 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2385 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2386 with_libgcrypt="yes"
2388 with_libgcrypt_config="gcrypt-config"
2389 with_libgcrypt="$withval"
2393 with_libgcrypt_config="libgcrypt-config"
2394 with_libgcrypt="yes"
2397 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2399 if test "x$GCRYPT_CPPFLAGS" = "x"
2401 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2404 if test "x$GCRYPT_LIBS" = "x"
2406 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2410 SAVE_CPPFLAGS="$CPPFLAGS"
2411 SAVE_LDFLAGS="$LDFLAGS"
2413 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2414 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2415 LIBS="$LIBS $GCRYPT_LIBS"
2417 if test "x$with_libgcrypt" = "xyes"
2419 if test "x$GCRYPT_CPPFLAGS" != "x"
2421 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2423 AC_CHECK_HEADERS(gcrypt.h,
2424 [with_libgcrypt="yes"],
2425 [with_libgcrypt="no (gcrypt.h not found)"])
2428 if test "x$with_libgcrypt" = "xyes"
2430 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2431 [with_libgcrypt="yes"],
2432 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2435 CPPFLAGS="$SAVE_CPPFLAGS"
2436 LDFLAGS="$SAVE_LDFLAGS"
2439 if test "x$with_libgcrypt" = "xyes"
2441 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2444 AC_SUBST(GCRYPT_CPPFLAGS)
2445 AC_SUBST(GCRYPT_LDFLAGS)
2446 AC_SUBST(GCRYPT_LIBS)
2447 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2451 with_libgps_cflags=""
2452 with_libgps_ldflags=""
2453 AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2455 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2457 with_libgps_cflags="-I$withval/include"
2458 with_libgps_ldflags="-L$withval/lib"
2461 with_libgps="$withval"
2467 if test "x$with_libgps" = "xyes"
2469 SAVE_CFLAGS="$CFLAGS"
2470 CFLAGS="$CFLAGS $with_libgps_cflags"
2472 AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
2474 CFLAGS="$SAVE_CFLAGS"
2476 if test "x$with_libgps" = "xyes"
2478 SAVE_CFLAGS="$CFLAGS"
2479 SAVE_LDFLAGS="$LDFLAGS"
2480 CFLAGS="$CFLAGS $with_libgps_cflags"
2481 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2483 AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
2485 CFLAGS="$SAVE_CFLAGS"
2486 LDFLAGS="$SAVE_LDFLAGS"
2488 if test "x$with_libgps" = "xyes"
2490 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2491 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2492 BUILD_WITH_LIBGPS_LIBS="-lgps"
2493 AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
2494 AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
2495 AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
2497 AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
2500 # --with-libgrpc++ {{{
2501 with_libgrpcpp_cppflags=""
2502 with_libgrpcpp_ldflags=""
2503 AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2505 with_grpcpp="$withval"
2506 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2508 with_libgrpcpp_cppflags="-I$withval/include"
2509 with_libgrpcpp_ldflags="-L$withval/lib"
2510 with_libgrpcpp="yes"
2512 if test "x$withval" = "xno"
2514 with_libgrpcpp="no (disabled on command line)"
2519 if test "x$withval" = "xyes"
2521 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2522 [with_libgrpcpp="yes"],
2523 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2527 if test "x$withval" != "xno"
2529 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2530 if test_cxx_flags -std=c++11; then
2531 AC_MSG_RESULT([yes])
2534 with_libgrpcpp="no (requires C++11 support)"
2538 if test "x$with_libgrpcpp" = "xyes"
2541 SAVE_CPPFLAGS="$CPPFLAGS"
2542 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2543 AC_CHECK_HEADERS([grpc++/grpc++.h], [],
2544 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2546 CPPFLAGS="$SAVE_CPPFLAGS"
2549 if test "x$with_libgrpcpp" = "xyes"
2552 SAVE_CPPFLAGS="$CPPFLAGS"
2553 SAVE_LDFLAGS="$LDFLAGS"
2555 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2556 LDFLAGS="$with_libgrpcpp_ldflags"
2557 if test "x$GRPCPP_LIBS" = "x"
2565 [[#include <grpc++/grpc++.h>]],
2566 [[grpc::ServerBuilder sb;]]
2569 with_libgrpcpp="yes"
2570 if test "x$GRPCPP_LIBS" = "x"
2572 GRPCPP_LIBS="-lgrpc++"
2575 [with_libgrpcpp="no (libgrpc++ not found)"]
2577 CPPFLAGS="$SAVE_CPPFLAGS"
2578 LDFLAGS="$SAVE_LDFLAGS"
2582 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2583 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2584 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2585 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2586 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2587 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2590 # --with-libiptc {{{
2591 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2593 if test "x$withval" = "xyes"
2595 with_libiptc="pkgconfig"
2596 else if test "x$withval" = "xno"
2601 with_libiptc_cflags="-I$withval/include"
2602 with_libiptc_libs="-L$withval/lib"
2606 if test "x$ac_system" = "xLinux"
2608 with_libiptc="pkgconfig"
2610 with_libiptc="no (Linux only)"
2614 if test "x$with_libiptc" = "xpkgconfig"
2616 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2619 with_libiptc="no (pkg-config doesn't know libiptc)"
2622 if test "x$with_libiptc" = "xpkgconfig"
2624 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2627 with_libiptc="no ($PKG_CONFIG failed)"
2629 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2632 with_libiptc="no ($PKG_CONFIG failed)"
2636 SAVE_CPPFLAGS="$CPPFLAGS"
2637 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2639 # check whether the header file for libiptc is available.
2640 if test "x$with_libiptc" = "xpkgconfig"
2642 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2643 [with_libiptc="no (header file missing)"])
2645 # If the header file is available, check for the required type declaractions.
2646 # They may be missing in old versions of libiptc. In that case, they will be
2647 # declared in the iptables plugin.
2648 if test "x$with_libiptc" = "xpkgconfig"
2650 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2652 # Check for the iptc_init symbol in the library.
2653 # This could be in iptc or ip4tc
2654 if test "x$with_libiptc" = "xpkgconfig"
2657 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2658 [with_libiptc="pkgconfig"],
2659 [with_libiptc="no"],
2660 [$with_libiptc_libs])
2663 if test "x$with_libiptc" = "xpkgconfig"
2668 CPPFLAGS="$SAVE_CPPFLAGS"
2670 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2671 if test "x$with_libiptc" = "xyes"
2673 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2674 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2675 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2676 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2680 # --with-libdpdk {{{
2681 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2682 AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
2683 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2684 AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
2686 AC_ARG_WITH([libdpdk],
2687 [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
2688 [with_libdpdk="$withval"],
2689 [with_libdpdk="yes"]
2692 if test "x$with_libdpdk" != "xno"; then
2693 PKG_CHECK_MODULES([DPDK], [libdpdk], [],
2694 [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
2695 if test "x$LIBDPDK_CPPFLAGS" = "x"; then
2696 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2698 if test "x$LIBDPDK_CFLAGS" = "x"; then
2699 LIBDPDK_CFLAGS="$DPDK_CFLAGS"
2700 LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
2702 if test "x$LIBDPDK_LIBS" = "x"; then
2703 if test "x$DPDK_LIBS" != "x"; then
2704 LIBDPDK_LIBS="$DPDK_LIBS"
2706 LIBDPDK_LIBS="-ldpdk"
2709 SAVE_CPPFLAGS="$CPPFLAGS"
2710 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2711 SAVE_CFLAGS="$CFLAGS"
2712 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2713 AC_CHECK_HEADERS([rte_config.h],
2720 #include <rte_version.h>
2721 #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
2722 #error "required DPDK >= 16.07"
2727 [dpdk_keepalive="yes"],
2728 [dpdk_keepalive="no (DPDK version < 16.07)"]
2731 [with_libdpdk="no (rte_config.h not found)"]
2733 CPPFLAGS="$SAVE_CPPFLAGS"
2734 CFLAGS="$SAVE_CFLAGS"
2737 if test "x$with_libdpdk" = "xyes"; then
2738 SAVE_LDFLAGS="$LDFLAGS"
2739 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2740 AC_CHECK_LIB([dpdk], [rte_eal_init],
2741 [with_libdpdk="yes"],
2742 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2744 LDFLAGS="$SAVE_LDFLAGS"
2750 with_java_home="$JAVA_HOME"
2751 if test "x$with_java_home" = "x"
2753 with_java_home="/usr/lib/jvm"
2757 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2759 if test "x$withval" = "xno"
2762 else if test "x$withval" = "xyes"
2766 with_java_home="$withval"
2771 if test "x$with_java" = "xyes"
2773 if test -d "$with_java_home"
2775 AC_MSG_CHECKING([for jni.h])
2776 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2777 if test "x$TMPVAR" != "x"
2779 AC_MSG_RESULT([found in $TMPVAR])
2780 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2782 AC_MSG_RESULT([not found])
2785 AC_MSG_CHECKING([for jni_md.h])
2786 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2787 if test "x$TMPVAR" != "x"
2789 AC_MSG_RESULT([found in $TMPVAR])
2790 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2792 AC_MSG_RESULT([not found])
2795 AC_MSG_CHECKING([for libjvm.so])
2796 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`
2797 if test "x$TMPVAR" != "x"
2799 AC_MSG_RESULT([found in $TMPVAR])
2800 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2802 AC_MSG_RESULT([not found])
2805 if test "x$JAVAC" = "x"
2807 AC_MSG_CHECKING([for javac])
2808 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2809 if test "x$TMPVAR" != "x"
2812 AC_MSG_RESULT([$JAVAC])
2814 AC_MSG_RESULT([not found])
2817 if test "x$JAR" = "x"
2819 AC_MSG_CHECKING([for jar])
2820 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2821 if test "x$TMPVAR" != "x"
2824 AC_MSG_RESULT([$JAR])
2826 AC_MSG_RESULT([not found])
2829 else if test "x$with_java_home" != "x"
2831 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2835 if test "x$JAVA_CPPFLAGS" != "x"
2837 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2839 if test "x$JAVA_CFLAGS" != "x"
2841 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2843 if test "x$JAVA_LDFLAGS" != "x"
2845 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2847 if test "x$JAVA_LIBS" != "x"
2849 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2851 if test "x$JAVAC" = "x"
2853 with_javac_path="$PATH"
2854 if test "x$with_java_home" != "x"
2856 with_javac_path="$with_java_home:with_javac_path"
2857 if test -d "$with_java_home/bin"
2859 with_javac_path="$with_java_home/bin:with_javac_path"
2863 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2865 if test "x$JAVAC" = "x"
2867 with_java="no (javac not found)"
2869 if test "x$JAR" = "x"
2871 with_jar_path="$PATH"
2872 if test "x$with_java_home" != "x"
2874 with_jar_path="$with_java_home:$with_jar_path"
2875 if test -d "$with_java_home/bin"
2877 with_jar_path="$with_java_home/bin:$with_jar_path"
2881 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2883 if test "x$JAR" = "x"
2885 with_java="no (jar not found)"
2888 SAVE_CPPFLAGS="$CPPFLAGS"
2889 SAVE_CFLAGS="$CFLAGS"
2890 SAVE_LDFLAGS="$LDFLAGS"
2892 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2893 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2894 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2895 LIBS="$LIBS $JAVA_LIBS"
2897 if test "x$with_java" = "xyes"
2899 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2901 if test "x$with_java" = "xyes"
2903 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2905 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2906 [$JAVA_LIBS $PTHREAD_LIBS])
2908 if test "x$with_java" = "xyes"
2910 JAVA_LIBS="$JAVA_LIBS -ljvm"
2911 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2914 CPPFLAGS="$SAVE_CPPFLAGS"
2915 CFLAGS="$SAVE_CFLAGS"
2916 LDFLAGS="$SAVE_LDFLAGS"
2919 AC_SUBST(JAVA_CPPFLAGS)
2920 AC_SUBST(JAVA_CFLAGS)
2921 AC_SUBST(JAVA_LDFLAGS)
2923 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2926 # --with-libldap {{{
2927 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2929 if test "x$withval" = "xyes"
2932 else if test "x$withval" = "xno"
2937 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2938 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2941 [with_libldap="yes"])
2943 SAVE_CPPFLAGS="$CPPFLAGS"
2944 SAVE_LDFLAGS="$LDFLAGS"
2946 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2947 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2949 if test "x$with_libldap" = "xyes"
2951 if test "x$LIBLDAP_CPPFLAGS" != "x"
2953 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2955 AC_CHECK_HEADERS(ldap.h,
2956 [with_libldap="yes"],
2957 [with_libldap="no ('ldap.h' not found)"])
2959 if test "x$with_libldap" = "xyes"
2961 if test "x$LIBLDAP_LDFLAGS" != "x"
2963 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2965 AC_CHECK_LIB(ldap, ldap_initialize,
2966 [with_libldap="yes"],
2967 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2971 CPPFLAGS="$SAVE_CPPFLAGS"
2972 LDFLAGS="$SAVE_LDFLAGS"
2974 if test "x$with_libldap" = "xyes"
2976 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2977 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2978 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2979 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
2981 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
2985 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
2986 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
2988 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
2989 [with_liblua="yes"],
2993 PKG_CHECK_MODULES([LUA], [lua],
2994 [with_liblua="yes"],
2996 PKG_CHECK_MODULES([LUA], [lua-5.3],
2997 [with_liblua="yes"],
2999 PKG_CHECK_MODULES([LUA], [lua5.3],
3000 [with_liblua="yes"],
3002 PKG_CHECK_MODULES([LUA], [lua-5.2],
3003 [with_liblua="yes"],
3005 PKG_CHECK_MODULES([LUA], [lua5.2],
3006 [with_liblua="yes"],
3008 PKG_CHECK_MODULES([LUA], [lua-5.1],
3009 [with_liblua="yes"],
3011 PKG_CHECK_MODULES([LUA], [lua5.1],
3012 [with_liblua="yes"],
3013 [with_liblua="no (pkg-config cannot find liblua)"]
3029 if test "x$with_liblua" = "xyes"
3031 SAVE_CPPFLAGS="$CPPFLAGS"
3032 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
3034 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
3035 [with_liblua="yes"],
3036 [with_liblua="no (header not found)"]
3039 CPPFLAGS="$SAVE_CPPFLAGS"
3042 if test "x$with_liblua" = "xyes"
3045 LIBS="$LIBS $LUA_LIBS"
3047 AC_CHECK_FUNC([lua_settop],
3048 [with_liblua="yes"],
3049 [with_liblua="no (symbol 'lua_settop' not found)"]
3055 if test "x$with_liblua" = "xyes"
3057 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
3058 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
3060 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
3061 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
3064 # --with-liblvm2app {{{
3065 with_liblvm2app_cppflags=""
3066 with_liblvm2app_ldflags=""
3067 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
3069 if test "x$withval" = "xno"
3071 with_liblvm2app="no"
3073 with_liblvm2app="yes"
3074 if test "x$withval" != "xyes"
3076 with_liblvm2app_cppflags="-I$withval/include"
3077 with_liblvm2app_ldflags="-L$withval/lib"
3082 if test "x$ac_system" = "xLinux"
3084 with_liblvm2app="yes"
3086 with_liblvm2app="no (Linux only library)"
3089 if test "x$with_liblvm2app" = "xyes"
3091 SAVE_CPPFLAGS="$CPPFLAGS"
3092 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3094 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
3096 CPPFLAGS="$SAVE_CPPFLAGS"
3099 if test "x$with_liblvm2app" = "xyes"
3101 SAVE_CPPFLAGS="$CPPFLAGS"
3102 SAVE_LDFLAGS="$LDFLAGS"
3103 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3104 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
3106 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
3108 CPPFLAGS="$SAVE_CPPFLAGS"
3109 LDFLAGS="$SAVE_LDFLAGS"
3111 if test "x$with_liblvm2app" = "xyes"
3113 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
3114 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
3115 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
3116 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
3117 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
3118 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
3119 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
3121 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3124 # --with-libmemcached {{{
3125 with_libmemcached_cppflags=""
3126 with_libmemcached_ldflags=""
3127 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3129 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3131 with_libmemcached_cppflags="-I$withval/include"
3132 with_libmemcached_ldflags="-L$withval/lib"
3133 with_libmemcached="yes"
3135 with_libmemcached="$withval"
3139 with_libmemcached="yes"
3141 if test "x$with_libmemcached" = "xyes"
3143 SAVE_CPPFLAGS="$CPPFLAGS"
3144 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3146 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3148 CPPFLAGS="$SAVE_CPPFLAGS"
3150 if test "x$with_libmemcached" = "xyes"
3152 SAVE_CPPFLAGS="$CPPFLAGS"
3153 SAVE_LDFLAGS="$LDFLAGS"
3154 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3155 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3157 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3159 CPPFLAGS="$SAVE_CPPFLAGS"
3160 LDFLAGS="$SAVE_LDFLAGS"
3162 if test "x$with_libmemcached" = "xyes"
3164 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3165 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3166 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3167 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3168 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3169 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3170 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3172 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3175 # --with-libmicrohttpd {{{
3176 with_libmicrohttpd_cppflags=""
3177 with_libmicrohttpd_ldflags=""
3178 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3180 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3182 with_libmicrohttpd_cppflags="-I$withval/include"
3183 with_libmicrohttpd_ldflags="-L$withval/lib"
3184 with_libmicrohttpd="yes"
3186 if test "x$withval" = "xno"
3188 with_libmicrohttpd="no (disabled on command line)"
3193 if test "x$withval" = "xyes"
3195 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3196 [with_libmicrohttpd="yes"],
3197 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3201 if test "x$MICROHTTPD_LIBS" = "x"
3203 MICROHTTPD_LIBS="-lmicrohttpd"
3206 SAVE_CPPFLAGS="$CPPFLAGS"
3207 SAVE_LDFLAGS="$LDFLAGS"
3209 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3210 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3211 LIBS="$LIBS $MICROHTTPD_LIBS"
3213 if test "x$with_libmicrohttpd" = "xyes"
3215 AC_CHECK_HEADERS([microhttpd.h],
3216 [with_libmicrohttpd="yes"],
3217 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3220 if test "x$with_libmicrohttpd" = "xyes"
3222 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3223 [with_libmicrohttpd="yes"],
3224 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3227 CPPFLAGS="$SAVE_CPPFLAGS"
3228 LDFLAGS="$SAVE_LDFLAGS"
3231 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3232 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3233 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3234 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3235 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3236 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3239 # --with-libmodbus {{{
3240 with_libmodbus_config=""
3241 with_libmodbus_cflags=""
3242 with_libmodbus_libs=""
3243 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3245 if test "x$withval" = "xno"
3248 else if test "x$withval" = "xyes"
3250 with_libmodbus="use_pkgconfig"
3251 else if test -d "$with_libmodbus/lib"
3253 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3254 with_libmodbus_cflags="-I$withval/include"
3255 with_libmodbus_libs="-L$withval/lib -lmodbus"
3256 with_libmodbus="yes"
3259 [with_libmodbus="use_pkgconfig"])
3261 # configure using pkg-config
3262 if test "x$with_libmodbus" = "xuse_pkgconfig"
3264 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3265 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3268 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3271 if test "x$with_libmodbus" = "xuse_pkgconfig"
3273 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3276 with_libmodbus="no ($PKG_CONFIG failed)"
3278 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3281 with_libmodbus="no ($PKG_CONFIG failed)"
3284 if test "x$with_libmodbus" = "xuse_pkgconfig"
3286 with_libmodbus="yes"
3289 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3290 # the actual checks.
3291 if test "x$with_libmodbus" = "xyes"
3293 SAVE_CPPFLAGS="$CPPFLAGS"
3294 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3296 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3298 CPPFLAGS="$SAVE_CPPFLAGS"
3300 if test "x$with_libmodbus" = "xyes"
3302 SAVE_CPPFLAGS="$CPPFLAGS"
3303 SAVE_LDFLAGS="$LDFLAGS"
3305 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3306 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3308 AC_CHECK_LIB(modbus, modbus_connect,
3309 [with_libmodbus="yes"],
3310 [with_libmodbus="no (symbol modbus_connect not found)"])
3312 CPPFLAGS="$SAVE_CPPFLAGS"
3313 LDFLAGS="$SAVE_LDFLAGS"
3315 if test "x$with_libmodbus" = "xyes"
3317 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3318 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3319 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3320 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3324 # --with-libmongoc {{{
3325 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3327 if test "x$withval" = "xyes"
3329 with_libmongoc="yes"
3330 else if test "x$withval" = "xno"
3334 with_libmongoc="yes"
3335 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3336 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3339 [with_libmongoc="yes"])
3341 SAVE_CPPFLAGS="$CPPFLAGS"
3342 SAVE_LDFLAGS="$LDFLAGS"
3344 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3345 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3347 if test "x$with_libmongoc" = "xyes"
3349 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3351 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3353 AC_CHECK_HEADERS(mongo.h,
3354 [with_libmongoc="yes"],
3355 [with_libmongoc="no ('mongo.h' not found)"],
3357 # define MONGO_HAVE_STDINT 1
3359 # define MONGO_USE_LONG_LONG_INT 1
3363 if test "x$with_libmongoc" = "xyes"
3365 if test "x$LIBMONGOC_LDFLAGS" != "x"
3367 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3369 AC_CHECK_LIB(mongoc, mongo_run_command,
3370 [with_libmongoc="yes"],
3371 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3374 CPPFLAGS="$SAVE_CPPFLAGS"
3375 LDFLAGS="$SAVE_LDFLAGS"
3377 if test "x$with_libmongoc" = "xyes"
3379 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3380 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3381 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3382 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3384 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3387 # --with-libmosquitto {{{
3388 with_libmosquitto_cppflags=""
3389 with_libmosquitto_ldflags=""
3390 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3392 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3394 with_libmosquitto_cppflags="-I$withval/include"
3395 with_libmosquitto_ldflags="-L$withval/lib"
3396 with_libmosquitto="yes"
3398 with_libmosquitto="$withval"
3402 with_libmosquitto="yes"
3404 if test "x$with_libmosquitto" = "xyes"
3406 SAVE_CPPFLAGS="$CPPFLAGS"
3407 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3409 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3411 CPPFLAGS="$SAVE_CPPFLAGS"
3413 if test "x$with_libmosquitto" = "xyes"
3415 SAVE_LDFLAGS="$LDFLAGS"
3416 SAVE_CPPFLAGS="$CPPFLAGS"
3417 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3418 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3420 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3422 LDFLAGS="$SAVE_LDFLAGS"
3423 CPPFLAGS="$SAVE_CPPFLAGS"
3425 if test "x$with_libmosquitto" = "xyes"
3427 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3428 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3429 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3430 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3431 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3432 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3436 # --with-libmysql {{{
3437 with_mysql_config="mysql_config"
3438 with_mysql_cflags=""
3440 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3442 if test "x$withval" = "xno"
3445 else if test "x$withval" = "xyes"
3449 if test -f "$withval" && test -x "$withval";
3451 with_mysql_config="$withval"
3452 else if test -x "$withval/bin/mysql_config"
3454 with_mysql_config="$withval/bin/mysql_config"
3462 if test "x$with_libmysql" = "xyes"
3464 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3465 mysql_config_status=$?
3467 if test $mysql_config_status -ne 0
3469 with_libmysql="no ($with_mysql_config failed)"
3471 SAVE_CPPFLAGS="$CPPFLAGS"
3472 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3475 have_mysql_mysql_h="no"
3476 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3478 if test "x$have_mysql_h" = "xno"
3480 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3483 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3485 with_libmysql="no (mysql.h not found)"
3488 CPPFLAGS="$SAVE_CPPFLAGS"
3491 if test "x$with_libmysql" = "xyes"
3493 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3494 mysql_config_status=$?
3496 if test $mysql_config_status -ne 0
3498 with_libmysql="no ($with_mysql_config failed)"
3500 SAVE_CPPFLAGS="$CPPFLAGS"
3501 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3503 LIBS="$with_mysql_libs"
3504 AC_SEARCH_LIBS([mysql_get_server_version],
3506 [with_libmysql="yes"],
3507 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3509 CPPFLAGS="$SAVE_CPPFLAGS"
3513 if test "x$with_libmysql" = "xyes"
3515 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3516 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3517 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3518 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3520 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3524 with_libmnl_cflags=""
3526 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3528 echo "libmnl: withval = $withval"
3529 if test "x$withval" = "xyes"
3532 else if test "x$withval" = "xno"
3536 if test -d "$withval/include"
3538 with_libmnl_cflags="-I$withval/include"
3539 with_libmnl_libs="-L$withval/lib -lmnl"
3542 AC_MSG_ERROR("no such directory: $withval/include")
3547 if test "x$ac_system" = "xLinux"
3551 with_libmnl="no (Linux only library)"
3554 if test "x$with_libmnl" = "xyes"
3556 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3557 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3558 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3561 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3567 #include <sys/types.h>
3568 #include <asm/types.h>
3569 #include <sys/socket.h>
3570 #include <linux/netlink.h>
3571 #include <linux/rtnetlink.h>])
3572 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3574 #include <sys/types.h>
3575 #include <asm/types.h>
3576 #include <sys/socket.h>])
3578 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3581 #include <sys/types.h>
3582 #include <asm/types.h>
3583 #include <sys/socket.h>
3584 #include <linux/netlink.h>
3585 #include <linux/rtnetlink.h>
3588 int retval = TCA_STATS2;
3592 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3594 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3597 #include <sys/types.h>
3598 #include <asm/types.h>
3599 #include <sys/socket.h>
3600 #include <linux/netlink.h>
3601 #include <linux/rtnetlink.h>
3604 int retval = TCA_STATS;
3608 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3610 if test "x$with_libmnl" = "xyes"
3612 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3613 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3616 #include <linux/if_link.h>
3619 if test "x$with_libmnl" = "xyes"
3621 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3622 [with_libmnl="yes"],
3623 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3624 [$with_libmnl_libs])
3626 if test "x$with_libmnl" = "xyes"
3628 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3629 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3630 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3631 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3632 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3634 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3637 # --with-libnetapp {{{
3638 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3639 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3640 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3641 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3642 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3643 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3644 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3646 if test -d "$withval"
3648 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3649 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3650 with_libnetapp="yes"
3652 with_libnetapp="$withval"
3656 with_libnetapp="yes"
3659 SAVE_CPPFLAGS="$CPPFLAGS"
3660 SAVE_LDFLAGS="$LDFLAGS"
3661 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3662 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3664 if test "x$with_libnetapp" = "xyes"
3666 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3668 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3670 AC_CHECK_HEADERS(netapp_api.h,
3671 [with_libnetapp="yes"],
3672 [with_libnetapp="no (netapp_api.h not found)"])
3675 if test "x$with_libnetapp" = "xyes"
3677 if test "x$LIBNETAPP_LDFLAGS" != "x"
3679 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3682 if test "x$LIBNETAPP_LIBS" = "x"
3684 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3686 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3688 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3689 [with_libnetapp="yes"],
3690 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3692 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3695 CPPFLAGS="$SAVE_CPPFLAGS"
3696 LDFLAGS="$SAVE_LDFLAGS"
3698 if test "x$with_libnetapp" = "xyes"
3700 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3703 AC_SUBST(LIBNETAPP_CPPFLAGS)
3704 AC_SUBST(LIBNETAPP_LDFLAGS)
3705 AC_SUBST(LIBNETAPP_LIBS)
3706 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3709 # --with-libnetsnmp {{{
3710 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3712 if test "x$withval" = "xno"
3714 with_libnetsnmp="no"
3715 else if test "x$withval" = "xyes"
3717 with_libnetsnmp="yes"
3719 with_libnetsnmp_cppflags="-I$withval/include"
3720 with_libnetsnmp_ldflags="-I$withval/lib"
3721 with_libnetsnmp="yes"
3724 [with_libnetsnmp="yes"])
3725 if test "x$with_libnetsnmp" = "xyes"
3727 SAVE_CPPFLAGS="$CPPFLAGS"
3728 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3730 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3732 CPPFLAGS="$SAVE_CPPFLAGS"
3734 if test "x$with_libnetsnmp" = "xyes"
3736 SAVE_LDFLAGS="$LDFLAGS"
3737 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3739 AC_CHECK_LIB(netsnmp, init_snmp,
3740 [with_libnetsnmp="yes"],
3741 [with_libnetsnmp="no (libnetsnmp not found)"],
3744 LDFLAGS="$SAVE_LDFLAGS"
3746 if test "x$with_libnetsnmp" = "xyes"
3748 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3749 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3750 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3752 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3753 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3754 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3757 # --with-liboconfig {{{
3758 with_own_liboconfig="no"
3759 liboconfig_LDFLAGS="$LDFLAGS"
3760 liboconfig_CPPFLAGS="$CPPFLAGS"
3761 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3763 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3765 if test -d "$withval/lib"
3767 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3769 if test -d "$withval/include"
3771 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3774 if test "x$withval" = "xno"
3776 AC_MSG_ERROR("liboconfig is required")
3780 with_liboconfig="yes"
3783 save_LDFLAGS="$LDFLAGS"
3784 save_CPPFLAGS="$CPPFLAGS"
3785 LDFLAGS="$liboconfig_LDFLAGS"
3786 CPPFLAGS="$liboconfig_CPPFLAGS"
3787 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3789 with_liboconfig="yes"
3790 with_own_liboconfig="no"
3793 with_liboconfig="yes"
3794 with_own_liboconfig="yes"
3795 LDFLAGS="$save_LDFLAGS"
3796 CPPFLAGS="$save_CPPFLAGS"
3799 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3800 if test "x$with_own_liboconfig" = "xyes"
3802 with_liboconfig="yes (shipped version)"
3806 # --with-liboping {{{
3807 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3809 if test "x$withval" = "xyes"
3812 else if test "x$withval" = "xno"
3817 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3818 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3821 [with_liboping="yes"])
3823 SAVE_CPPFLAGS="$CPPFLAGS"
3824 SAVE_LDFLAGS="$LDFLAGS"
3826 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3827 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3829 if test "x$with_liboping" = "xyes"
3831 if test "x$LIBOPING_CPPFLAGS" != "x"
3833 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3835 AC_CHECK_HEADERS(oping.h,
3836 [with_liboping="yes"],
3837 [with_liboping="no (oping.h not found)"])
3839 if test "x$with_liboping" = "xyes"
3841 if test "x$LIBOPING_LDFLAGS" != "x"
3843 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3845 AC_CHECK_LIB(oping, ping_construct,
3846 [with_liboping="yes"],
3847 [with_liboping="no (symbol 'ping_construct' not found)"])
3850 CPPFLAGS="$SAVE_CPPFLAGS"
3851 LDFLAGS="$SAVE_LDFLAGS"
3853 if test "x$with_liboping" = "xyes"
3855 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3856 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3857 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3858 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3860 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3864 with_oracle_cppflags=""
3866 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3868 if test "x$withval" = "xyes"
3870 if test "x$ORACLE_HOME" = "x"
3872 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3875 else if test "x$withval" = "xno"
3880 ORACLE_HOME="$withval"
3884 if test "x$ORACLE_HOME" = "x"
3886 with_oracle="no (ORACLE_HOME is not set)"
3891 if test "x$ORACLE_HOME" != "x"
3893 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3895 if test -e "$ORACLE_HOME/lib/ldflags"
3897 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3899 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3900 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3902 if test "x$with_oracle" = "xyes"
3904 SAVE_CPPFLAGS="$CPPFLAGS"
3905 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3907 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3909 CPPFLAGS="$SAVE_CPPFLAGS"
3911 if test "x$with_oracle" = "xyes"
3913 SAVE_CPPFLAGS="$CPPFLAGS"
3915 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3916 LIBS="$LIBS $with_oracle_libs"
3918 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3920 CPPFLAGS="$SAVE_CPPFLAGS"
3923 if test "x$with_oracle" = "xyes"
3925 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3926 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3927 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3928 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3932 # --with-libowcapi {{{
3933 with_libowcapi_cppflags=""
3934 with_libowcapi_ldflags=""
3935 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3937 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3939 with_libowcapi_cppflags="-I$withval/include"
3940 with_libowcapi_ldflags="-L$withval/lib"
3941 with_libowcapi="yes"
3943 with_libowcapi="$withval"
3947 with_libowcapi="yes"
3949 if test "x$with_libowcapi" = "xyes"
3951 SAVE_CPPFLAGS="$CPPFLAGS"
3952 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3954 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3956 CPPFLAGS="$SAVE_CPPFLAGS"
3958 if test "x$with_libowcapi" = "xyes"
3960 SAVE_LDFLAGS="$LDFLAGS"
3961 SAVE_CPPFLAGS="$CPPFLAGS"
3962 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3963 CPPFLAGS="$with_libowcapi_cppflags"
3965 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3967 LDFLAGS="$SAVE_LDFLAGS"
3968 CPPFLAGS="$SAVE_CPPFLAGS"
3970 if test "x$with_libowcapi" = "xyes"
3972 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3973 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3974 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3975 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3976 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3977 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3981 # --with-libpcap {{{
3982 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3984 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3986 LDFLAGS="$LDFLAGS -L$withval/lib"
3987 CPPFLAGS="$CPPFLAGS -I$withval/include"
3990 with_libpcap="$withval"
3996 if test "x$with_libpcap" = "xyes"
3998 AC_CHECK_LIB(pcap, pcap_open_live,
4000 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
4001 ], [with_libpcap="no (libpcap not found)"])
4003 if test "x$with_libpcap" = "xyes"
4005 AC_CHECK_HEADERS(pcap.h,,
4006 [with_libpcap="no (pcap.h not found)"])
4008 if test "x$with_libpcap" = "xyes"
4010 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
4011 [c_cv_libpcap_have_pcap_error_iface_not_up],
4012 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
4017 int val = PCAP_ERROR_IFACE_NOT_UP;
4021 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
4022 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
4024 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
4026 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
4028 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
4031 # --with-libperl {{{
4032 perl_interpreter="perl"
4033 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
4035 if test -f "$withval" && test -x "$withval"
4037 perl_interpreter="$withval"
4039 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
4041 LDFLAGS="$LDFLAGS -L$withval/lib"
4042 CPPFLAGS="$CPPFLAGS -I$withval/include"
4043 perl_interpreter="$withval/bin/perl"
4046 with_libperl="$withval"
4053 AC_MSG_CHECKING([for perl])
4054 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
4055 if test -x "$perl_interpreter"
4057 AC_MSG_RESULT([yes ($perl_interpreter)])
4063 AC_SUBST(PERL, "$perl_interpreter")
4065 if test "x$with_libperl" = "xyes" \
4066 && test -n "$perl_interpreter"
4068 SAVE_CFLAGS="$CFLAGS"
4070 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4071 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
4072 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
4073 CFLAGS="$CFLAGS $PERL_CFLAGS"
4074 LIBS="$LIBS $PERL_LIBS"
4076 AC_CACHE_CHECK([for libperl],
4077 [c_cv_have_libperl],
4078 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4080 #define PERL_NO_GET_CONTEXT
4087 load_module (PERL_LOADMOD_NOIMPORT,
4088 newSVpv ("Collectd::Plugin::FooBar", 24),
4092 [c_cv_have_libperl="yes"],
4093 [c_cv_have_libperl="no"]
4097 if test "x$c_cv_have_libperl" = "xyes"
4099 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
4100 AC_SUBST(PERL_CFLAGS)
4106 CFLAGS="$SAVE_CFLAGS"
4108 else if test -z "$perl_interpreter"; then
4109 with_libperl="no (no perl interpreter found)"
4110 c_cv_have_libperl="no"
4112 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
4114 if test "x$with_libperl" = "xyes"
4116 SAVE_CFLAGS="$CFLAGS"
4118 CFLAGS="$CFLAGS $PERL_CFLAGS"
4119 LIBS="$LIBS $PERL_LIBS"
4121 AC_CACHE_CHECK([if perl supports ithreads],
4122 [c_cv_have_perl_ithreads],
4123 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4129 #if !defined(USE_ITHREADS)
4130 # error "Perl does not support ithreads!"
4131 #endif /* !defined(USE_ITHREADS) */
4135 [c_cv_have_perl_ithreads="yes"],
4136 [c_cv_have_perl_ithreads="no"]
4140 if test "x$c_cv_have_perl_ithreads" = "xyes"
4142 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4145 CFLAGS="$SAVE_CFLAGS"
4149 if test "x$with_libperl" = "xyes"
4151 SAVE_CFLAGS="$CFLAGS"
4153 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4154 # (see issues #41 and #42)
4155 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4156 LIBS="$LIBS $PERL_LIBS"
4158 AC_CACHE_CHECK([for broken Perl_load_module()],
4159 [c_cv_have_broken_perl_load_module],
4160 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4162 #define PERL_NO_GET_CONTEXT
4169 load_module (PERL_LOADMOD_NOIMPORT,
4170 newSVpv ("Collectd::Plugin::FooBar", 24),
4174 [c_cv_have_broken_perl_load_module="no"],
4175 [c_cv_have_broken_perl_load_module="yes"]
4179 CFLAGS="$SAVE_CFLAGS"
4182 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4183 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4185 if test "x$with_libperl" = "xyes"
4187 SAVE_CFLAGS="$CFLAGS"
4189 CFLAGS="$CFLAGS $PERL_CFLAGS"
4190 LIBS="$LIBS $PERL_LIBS"
4193 [struct mgvtbl.svt_local],
4194 [have_struct_mgvtbl_svt_local="yes"],
4195 [have_struct_mgvtbl_svt_local="no"],
4202 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4204 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4205 [Define if Perl's struct mgvtbl has member svt_local.])
4208 CFLAGS="$SAVE_CFLAGS"
4214 with_pg_config="pg_config"
4215 with_libpq_includedir=""
4216 with_libpq_libdir=""
4217 with_libpq_cppflags=""
4218 with_libpq_ldflags=""
4219 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4222 if test "x$withval" = "xno"
4225 else if test "x$withval" = "xyes"
4229 if test -f "$withval" && test -x "$withval";
4231 with_pg_config="$withval"
4232 else if test -x "$withval/bin/pg_config"
4234 with_pg_config="$withval/bin/pg_config"
4242 if test "x$with_libpq" = "xyes"
4244 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4247 if test $pg_config_status -eq 0
4249 if test -n "$with_libpq_includedir"; then
4250 for dir in $with_libpq_includedir; do
4251 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4255 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4258 SAVE_CPPFLAGS="$CPPFLAGS"
4259 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4261 AC_CHECK_HEADERS(libpq-fe.h, [],
4262 [with_libpq="no (libpq-fe.h not found)"], [])
4264 CPPFLAGS="$SAVE_CPPFLAGS"
4266 if test "x$with_libpq" = "xyes"
4268 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4271 if test $pg_config_status -eq 0
4273 if test -n "$with_libpq_libdir"; then
4274 for dir in $with_libpq_libdir; do
4275 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4279 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4282 SAVE_LDFLAGS="$LDFLAGS"
4283 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4285 AC_CHECK_LIB(pq, PQconnectdb,
4287 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4289 AC_CHECK_LIB(pq, PQserverVersion,
4291 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4293 LDFLAGS="$SAVE_LDFLAGS"
4295 if test "x$with_libpq" = "xyes"
4297 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4298 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4299 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4300 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4302 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4305 # --with-libpqos {{{
4306 with_libpqos_cppflags=""
4307 with_libpqos_ldflags=""
4308 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4310 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4312 with_libpqos_cppflags="-I$withval/include"
4313 with_libpqos_ldflags="-L$withval/lib"
4316 with_libpqos="$withval"
4322 if test "x$with_libpqos" = "xyes"
4324 SAVE_CPPFLAGS="$CPPFLAGS"
4325 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4327 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4329 CPPFLAGS="$SAVE_CPPFLAGS"
4331 if test "x$with_libpqos" = "xyes"
4333 SAVE_CPPFLAGS="$CPPFLAGS"
4334 SAVE_LDFLAGS="$LDFLAGS"
4335 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4336 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4338 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4340 CPPFLAGS="$SAVE_CPPFLAGS"
4341 LDFLAGS="$SAVE_LDFLAGS"
4343 if test "x$with_libpqos" = "xyes"
4345 SAVE_CPPFLAGS="$CPPFLAGS"
4346 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4347 AC_RUN_IFELSE([AC_LANG_PROGRAM(
4348 [[#include <pqos.h>]],
4349 [[return !(PQOS_VERSION >= 106)]])],
4350 [with_libpqos="yes"], [with_libpqos="no (pqos library version 1.06 or higher is required)"])
4351 CPPFLAGS="$SAVE_CPPFLAGS"
4353 if test "x$with_libpqos" = "xyes"
4355 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4356 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4357 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4358 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4359 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4360 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4364 # --with-libprotobuf {{{
4365 with_libprotobuf_cppflags=""
4366 with_libprotobuf_ldflags=""
4367 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4369 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4371 with_libprotobuf_cppflags="-I$withval/include"
4372 with_libprotobuf_ldflags="-L$withval/lib"
4373 with_libprotobuf="yes"
4375 if test "x$withval" = "xno"
4377 with_libprotobuf="no (disabled on command line)"
4382 if test "x$withval" = "xyes"
4384 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4385 [with_libprotobuf="yes"],
4386 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4390 if test "x$withval" != "xno"
4392 SAVE_LDFLAGS="$LDFLAGS"
4394 LDFLAGS="$with_libprotobuf_ldflags"
4395 LIBS="$PROTOBUF_LIBS $LIBS"
4397 AC_CHECK_LIB([protobuf], [main],
4399 SAVE_CPPFLAGS="$CPPFLAGS"
4400 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4401 if test "x$PROTOBUF_LIBS" = "x"
4403 PROTOBUF_LIBS="-lprotobuf"
4405 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4406 [with_libprotobuf="yes"],
4407 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4409 CPPFLAGS="$SAVE_CPPFLAGS"
4411 [with_libprotobuf="no (libprotobuf not found)"]
4414 LDFLAGS="$SAVE_LDFLAGS"
4417 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4418 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4419 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4420 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4421 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4422 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4425 # --with-libprotobuf-c {{{
4426 with_libprotobuf_c_cppflags=""
4427 with_libprotobuf_c_ldflags=""
4428 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4430 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4432 with_libprotobuf_c_cppflags="-I$withval/include"
4433 with_libprotobuf_c_ldflags="-L$withval/lib"
4434 with_libprotobuf_c="yes"
4436 if test "x$withval" = "xno"
4438 with_libprotobuf_c="no (disabled on command line)"
4443 if test "x$withval" = "xyes"
4445 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4446 [with_libprotobuf_c="yes"],
4447 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4451 if test "x$withval" != "xno"
4453 SAVE_LDFLAGS="$LDFLAGS"
4455 LDFLAGS="$with_libprotobuf_c_ldflags"
4456 LIBS="$PROTOBUF_C_LIBS $LIBS"
4457 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4459 SAVE_CPPFLAGS="$CPPFLAGS"
4460 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4461 if test "x$PROTOBUF_C_LIBS" = "x"
4463 PROTOBUF_C_LIBS="-lprotobuf-c"
4465 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4467 with_libprotobuf_c="yes"
4470 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4472 CPPFLAGS="$SAVE_CPPFLAGS"
4474 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4476 LDFLAGS="$SAVE_LDFLAGS"
4479 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4480 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4481 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4482 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4483 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4484 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4487 # --with-libpython {{{
4488 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4489 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4490 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4492 AC_ARG_WITH([libpython],
4493 [AS_HELP_STRING([--with-libpython],
4494 [if we should build with libpython @<:@default=yes@:>@])
4496 [with_libpython="$withval"],
4497 [with_libpython="check"]
4499 if test "$with_libpython" != "no"; then
4500 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4501 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4502 AC_PATH_PROGS([PYTHON_CONFIG],
4503 [python3-config python2-config python-config]
4505 if test "$PYTHON_CONFIG" = ""; then
4506 if test "$with_libpython" = "yes"; then
4507 AC_MSG_ERROR([Unable to find python-config])
4514 if test "$PYTHON_CONFIG" != ""; then
4515 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4516 if test $? -ne 0; then
4519 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4520 if test $? -ne 0; then
4523 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4524 if test $? -ne 0; then
4529 if test "$with_libpython" != "xno"; then
4530 SAVE_CPPFLAGS="$CPPFLAGS"
4531 SAVE_LDFLAGS="$LDFLAGS"
4533 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4534 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4535 LIBS="$LIBPYTHON_LIBS $LIBS"
4536 AC_CHECK_HEADERS([Python.h],
4538 AC_MSG_CHECKING([for libpython])
4539 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4540 [[#include <Python.h>]],
4541 [[Py_Initialize();]])
4543 [with_libpython="yes"],
4544 [with_libpython="no"]
4546 AC_MSG_RESULT([$with_libpython])
4548 [with_libpython="no"]
4550 CPPFLAGS="$SAVE_CPPFLAGS"
4551 LDFLAGS="$SAVE_LDFLAGS"
4554 # }}} --with-libpython
4556 # --with-librabbitmq {{{
4557 with_librabbitmq_cppflags=""
4558 with_librabbitmq_ldflags=""
4559 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4561 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4563 with_librabbitmq_cppflags="-I$withval/include"
4564 with_librabbitmq_ldflags="-L$withval/lib"
4565 with_librabbitmq="yes"
4567 with_librabbitmq="$withval"
4571 with_librabbitmq="yes"
4573 SAVE_CPPFLAGS="$CPPFLAGS"
4574 SAVE_LDFLAGS="$LDFLAGS"
4575 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4576 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4577 if test "x$with_librabbitmq" = "xyes"
4579 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4581 if test "x$with_librabbitmq" = "xyes"
4583 # librabbitmq up to version 0.9.1 provides "library_errno", later
4584 # versions use "library_error". The library does not provide a version
4585 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4586 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4589 # include <stdlib.h>
4595 # include <stdint.h>
4598 # include <inttypes.h>
4603 if test "x$with_librabbitmq" = "xyes"
4605 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4607 if test "x$with_librabbitmq" = "xyes"
4609 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4610 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4611 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4612 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4613 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4614 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4615 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4617 CPPFLAGS="$SAVE_CPPFLAGS"
4618 LDFLAGS="$SAVE_LDFLAGS"
4619 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4621 with_amqp_tcp_socket="no"
4622 if test "x$with_librabbitmq" = "xyes"
4624 SAVE_CPPFLAGS="$CPPFLAGS"
4625 SAVE_LDFLAGS="$LDFLAGS"
4627 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4628 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4631 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4632 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4633 if test "x$with_amqp_tcp_socket" = "xyes"
4635 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4636 [Define if librabbitmq provides the new TCP socket interface.])
4639 AC_CHECK_DECLS(amqp_socket_close,
4640 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4643 #ifdef HAVE_AMQP_TCP_SOCKET_H
4644 # include <amqp_tcp_socket.h>
4646 #ifdef HAVE_AMQP_SOCKET_H
4647 # include <amqp_socket.h>
4651 CPPFLAGS="$SAVE_CPPFLAGS"
4652 LDFLAGS="$SAVE_LDFLAGS"
4657 # --with-librdkafka {{{
4658 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4660 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4662 with_librdkafka_cppflags="-I$withval/include"
4663 with_librdkafka_ldflags="-L$withval/lib"
4664 with_librdkafka_rpath="$withval/lib"
4665 with_librdkafka="yes"
4667 with_librdkafka="$withval"
4671 with_librdkafka="yes"
4673 SAVE_CPPFLAGS="$CPPFLAGS"
4674 SAVE_LDFLAGS="$LDFLAGS"
4676 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4677 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4679 if test "x$with_librdkafka" = "xyes"
4681 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4684 if test "x$with_librdkafka" = "xyes"
4686 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4687 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4688 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4690 if test "x$with_librdkafka" = "xyes"
4692 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4693 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4694 if test "x$with_librdkafka_rpath" != "x"
4696 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4698 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4700 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4701 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4702 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4703 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4704 if test "x$with_librdkafka_log_cb" = "xyes"
4706 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4707 else if test "x$with_librdkafka_logger" = "xyes"
4709 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4712 CPPFLAGS="$SAVE_CPPFLAGS"
4713 LDFLAGS="$SAVE_LDFLAGS"
4714 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4718 # --with-librouteros {{{
4719 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4721 if test "x$withval" = "xyes"
4723 with_librouteros="yes"
4724 else if test "x$withval" = "xno"
4726 with_librouteros="no"
4728 with_librouteros="yes"
4729 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4730 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4733 [with_librouteros="yes"])
4735 SAVE_CPPFLAGS="$CPPFLAGS"
4736 SAVE_LDFLAGS="$LDFLAGS"
4738 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4739 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4741 if test "x$with_librouteros" = "xyes"
4743 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4745 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4747 AC_CHECK_HEADERS(routeros_api.h,
4748 [with_librouteros="yes"],
4749 [with_librouteros="no (routeros_api.h not found)"])
4751 if test "x$with_librouteros" = "xyes"
4753 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4755 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4757 AC_CHECK_LIB(routeros, ros_interface,
4758 [with_librouteros="yes"],
4759 [with_librouteros="no (symbol 'ros_interface' not found)"])
4762 CPPFLAGS="$SAVE_CPPFLAGS"
4763 LDFLAGS="$SAVE_LDFLAGS"
4765 if test "x$with_librouteros" = "xyes"
4767 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4768 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4769 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4770 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4772 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4778 librrd_threadsafe="no"
4779 librrd_rrdc_update="no"
4781 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4783 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4785 librrd_cflags="-I$withval/include"
4786 librrd_ldflags="-L$withval/lib"
4789 with_librrd="$withval"
4795 if test "x$with_librrd" = "xyes"
4797 SAVE_LDFLAGS="$LDFLAGS"
4798 LDFLAGS="$LDFLAGS $librrd_ldflags"
4799 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4801 AC_CHECK_LIB([rrd], [rrd_update_r],
4802 [librrd_threadsafe="yes"],
4805 AC_CHECK_LIB([rrd], [rrdc_update],
4806 [librrd_rrdc_update="yes"],
4811 LDFLAGS="$SAVE_LDFLAGS"
4813 SAVE_CPPFLAGS="$CPPFLAGS"
4814 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4816 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4818 CPPFLAGS="$SAVE_CPPFLAGS"
4821 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4823 SAVE_LDFLAGS="$LDFLAGS"
4824 LDFLAGS="$LDFLAGS $librrd_ldflags"
4826 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4828 librrd_ldflags="$librrd_ldflags -lrrd_th"
4829 librrd_threadsafe="yes"
4830 AC_CHECK_LIB([rrd_th], [rrdc_update],
4831 [librrd_rrdc_update="yes"],
4837 LDFLAGS="$SAVE_LDFLAGS"
4840 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4842 SAVE_LDFLAGS="$LDFLAGS"
4843 LDFLAGS="$LDFLAGS $librrd_ldflags"
4845 AC_CHECK_LIB([rrd], [rrd_update],
4847 librrd_ldflags="$librrd_ldflags -lrrd"
4848 AC_CHECK_LIB([rrd], [rrdc_update],
4849 [librrd_rrdc_update="yes"],
4853 [with_librrd="no (symbol 'rrd_update' not found)"]
4855 LDFLAGS="$SAVE_LDFLAGS"
4858 if test "x$with_librrd" = "xyes"
4860 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4861 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4862 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4863 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4864 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4865 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4867 if test "x$librrd_threadsafe" = "xyes"
4869 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4870 [Define to 1 if the rrd library is thread-safe]
4875 # --with-libsensors {{{
4876 with_sensors_cflags=""
4877 with_sensors_ldflags=""
4878 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4880 if test "x$withval" = "xno"
4882 with_libsensors="no"
4884 with_libsensors="yes"
4885 if test "x$withval" != "xyes"
4887 with_sensors_cflags="-I$withval/include"
4888 with_sensors_ldflags="-L$withval/lib"
4889 with_libsensors="yes"
4894 if test "x$ac_system" = "xLinux"
4896 with_libsensors="yes"
4898 with_libsensors="no (Linux only library)"
4901 if test "x$with_libsensors" = "xyes"
4903 SAVE_CPPFLAGS="$CPPFLAGS"
4904 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4906 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4908 CPPFLAGS="$SAVE_CPPFLAGS"
4910 if test "x$with_libsensors" = "xyes"
4912 SAVE_CPPFLAGS="$CPPFLAGS"
4913 SAVE_LDFLAGS="$LDFLAGS"
4914 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4915 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4917 AC_CHECK_LIB(sensors, sensors_init,
4919 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4921 [with_libsensors="no (libsensors not found)"])
4923 CPPFLAGS="$SAVE_CPPFLAGS"
4924 LDFLAGS="$SAVE_LDFLAGS"
4926 if test "x$with_libsensors" = "xyes"
4928 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4929 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4930 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4931 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4933 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4937 AC_SUBST([LIBSIGROK_CFLAGS])
4938 AC_SUBST([LIBSIGROK_LIBS])
4939 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4940 [with_libsigrok="yes"],
4941 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4945 # --with-libstatgrab {{{
4946 with_libstatgrab_cflags=""
4947 with_libstatgrab_ldflags=""
4948 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4950 if test "x$withval" != "xno" \
4951 && test "x$withval" != "xyes"
4953 with_libstatgrab_cflags="-I$withval/include"
4954 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4955 with_libstatgrab="yes"
4956 with_libstatgrab_pkg_config="no"
4958 with_libstatgrab="$withval"
4959 with_libstatgrab_pkg_config="yes"
4963 with_libstatgrab="yes"
4964 with_libstatgrab_pkg_config="yes"
4967 if test "x$with_libstatgrab" = "xyes" \
4968 && test "x$with_libstatgrab_pkg_config" = "xyes"
4970 AC_MSG_CHECKING([pkg-config for libstatgrab])
4972 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4975 with_libstatgrab_pkg_config="no"
4976 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4977 temp_result="not found"
4979 AC_MSG_RESULT([$temp_result])
4982 if test "x$with_libstatgrab" = "xyes" \
4983 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4984 && test "x$with_libstatgrab_cflags" = "x"
4986 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4987 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4990 with_libstatgrab_cflags="$temp_result"
4992 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4993 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4995 AC_MSG_RESULT([$temp_result])
4998 if test "x$with_libstatgrab" = "xyes" \
4999 && test "x$with_libstatgrab_pkg_config" = "xyes" \
5000 && test "x$with_libstatgrab_ldflags" = "x"
5002 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
5003 temp_result="`$PKG_CONFIG --libs libstatgrab`"
5006 with_libstatgrab_ldflags="$temp_result"
5008 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
5009 temp_result="$PKG_CONFIG --libs libstatgrab failed"
5011 AC_MSG_RESULT([$temp_result])
5014 if test "x$with_libstatgrab" = "xyes"
5016 SAVE_CPPFLAGS="$CPPFLAGS"
5017 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
5019 AC_CHECK_HEADERS(statgrab.h,
5020 [with_libstatgrab="yes"],
5021 [with_libstatgrab="no (statgrab.h not found)"])
5023 CPPFLAGS="$SAVE_CPPFLAGS"
5026 if test "x$with_libstatgrab" = "xyes"
5028 SAVE_CFLAGS="$CFLAGS"
5029 SAVE_LDFLAGS="$LDFLAGS"
5031 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5032 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5034 AC_CHECK_LIB(statgrab, sg_init,
5035 [with_libstatgrab="yes"],
5036 [with_libstatgrab="no (symbol sg_init not found)"])
5038 CFLAGS="$SAVE_CFLAGS"
5039 LDFLAGS="$SAVE_LDFLAGS"
5042 if test "x$with_libstatgrab" = "xyes"
5044 SAVE_CFLAGS="$CFLAGS"
5045 SAVE_LDFLAGS="$LDFLAGS"
5048 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5049 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5050 LIBS="-lstatgrab $LIBS"
5052 AC_CACHE_CHECK([if libstatgrab >= 0.90],
5053 [c_cv_have_libstatgrab_0_90],
5054 AC_LINK_IFELSE([AC_LANG_PROGRAM(
5057 #include <statgrab.h>
5060 if (sg_init()) return 0;
5063 [c_cv_have_libstatgrab_0_90="no"],
5064 [c_cv_have_libstatgrab_0_90="yes"]
5068 CFLAGS="$SAVE_CFLAGS"
5069 LDFLAGS="$SAVE_LDFLAGS"
5073 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
5074 if test "x$with_libstatgrab" = "xyes"
5076 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
5077 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5078 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5079 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
5080 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
5081 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
5083 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
5088 # --with-libtokyotyrant {{{
5089 with_libtokyotyrant_cppflags=""
5090 with_libtokyotyrant_ldflags=""
5091 with_libtokyotyrant_libs=""
5092 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5094 if test "x$withval" = "xno"
5096 with_libtokyotyrant="no"
5097 else if test "x$withval" = "xyes"
5099 with_libtokyotyrant="yes"
5101 with_libtokyotyrant_cppflags="-I$withval/include"
5102 with_libtokyotyrant_ldflags="-L$withval/include"
5103 with_libtokyotyrant_libs="-ltokyotyrant"
5104 with_libtokyotyrant="yes"
5108 with_libtokyotyrant="yes"
5111 if test "x$with_libtokyotyrant" = "xyes"
5113 if $PKG_CONFIG --exists tokyotyrant
5115 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5116 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5117 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5121 SAVE_CPPFLAGS="$CPPFLAGS"
5122 SAVE_LDFLAGS="$LDFLAGS"
5123 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5124 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5126 if test "x$with_libtokyotyrant" = "xyes"
5128 AC_CHECK_HEADERS(tcrdb.h,
5130 AC_DEFINE(HAVE_TCRDB_H, 1,
5131 [Define to 1 if you have the <tcrdb.h> header file.])
5132 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5135 if test "x$with_libtokyotyrant" = "xyes"
5137 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5139 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5140 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5142 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5143 [$with_libtokyotyrant_libs])
5146 CPPFLAGS="$SAVE_CPPFLAGS"
5147 LDFLAGS="$SAVE_LDFLAGS"
5149 if test "x$with_libtokyotyrant" = "xyes"
5151 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5152 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5153 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5154 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5155 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5156 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5158 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5161 # --with-libudev {{{
5162 with_libudev_cflags=""
5163 with_libudev_ldflags=""
5164 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5166 if test "x$withval" = "xno"
5171 if test "x$withval" != "xyes"
5173 with_libudev_cflags="-I$withval/include"
5174 with_libudev_ldflags="-L$withval/lib"
5180 if test "x$ac_system" = "xLinux"
5184 with_libudev="no (Linux only library)"
5187 if test "x$with_libudev" = "xyes"
5189 SAVE_CPPFLAGS="$CPPFLAGS"
5190 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5192 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5194 CPPFLAGS="$SAVE_CPPFLAGS"
5196 if test "x$with_libudev" = "xyes"
5198 SAVE_CPPFLAGS="$CPPFLAGS"
5199 SAVE_LDFLAGS="$LDFLAGS"
5200 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5201 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5203 AC_CHECK_LIB(udev, udev_new,
5205 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5207 [with_libudev="no (libudev not found)"])
5209 CPPFLAGS="$SAVE_CPPFLAGS"
5210 LDFLAGS="$SAVE_LDFLAGS"
5212 if test "x$with_libudev" = "xyes"
5214 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5215 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5216 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5217 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5218 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5219 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5221 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5224 # --with-libupsclient {{{
5225 with_libupsclient_config=""
5226 with_libupsclient_cflags=""
5227 with_libupsclient_libs=""
5228 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5230 if test "x$withval" = "xno"
5232 with_libupsclient="no"
5233 else if test "x$withval" = "xyes"
5235 with_libupsclient="use_pkgconfig"
5237 if test -x "$withval"
5239 with_libupsclient_config="$withval"
5240 with_libupsclient="use_libupsclient_config"
5241 else if test -x "$withval/bin/libupsclient-config"
5243 with_libupsclient_config="$withval/bin/libupsclient-config"
5244 with_libupsclient="use_libupsclient_config"
5246 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5247 with_libupsclient_cflags="-I$withval/include"
5248 with_libupsclient_libs="-L$withval/lib -lupsclient"
5249 with_libupsclient="yes"
5253 [with_libupsclient="use_pkgconfig"])
5255 # configure using libupsclient-config
5256 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5258 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5259 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5262 with_libupsclient="no ($with_libupsclient_config failed)"
5264 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5267 with_libupsclient="no ($with_libupsclient_config failed)"
5270 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5272 with_libupsclient="yes"
5275 # configure using pkg-config
5276 if test "x$with_libupsclient" = "xuse_pkgconfig"
5278 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5279 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5282 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5285 if test "x$with_libupsclient" = "xuse_pkgconfig"
5287 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5290 with_libupsclient="no ($PKG_CONFIG failed)"
5292 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5295 with_libupsclient="no ($PKG_CONFIG failed)"
5298 if test "x$with_libupsclient" = "xuse_pkgconfig"
5300 with_libupsclient="yes"
5303 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5304 # the actual checks.
5305 if test "x$with_libupsclient" = "xyes"
5307 SAVE_CPPFLAGS="$CPPFLAGS"
5308 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5310 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5312 CPPFLAGS="$SAVE_CPPFLAGS"
5314 if test "x$with_libupsclient" = "xyes"
5316 SAVE_CPPFLAGS="$CPPFLAGS"
5317 SAVE_LDFLAGS="$LDFLAGS"
5319 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5320 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5322 AC_CHECK_LIB(upsclient, upscli_connect,
5323 [with_libupsclient="yes"],
5324 [with_libupsclient="no (symbol upscli_connect not found)"])
5326 CPPFLAGS="$SAVE_CPPFLAGS"
5327 LDFLAGS="$SAVE_LDFLAGS"
5329 if test "x$with_libupsclient" = "xyes"
5331 SAVE_CPPFLAGS="$CPPFLAGS"
5332 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5334 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5335 [#include <stdlib.h>
5337 #include <upsclient.h>])
5339 CPPFLAGS="$SAVE_CPPFLAGS"
5341 if test "x$with_libupsclient" = "xyes"
5343 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5344 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5345 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5346 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5350 # --with-libxenctrl {{{
5351 with_libxenctrl_cppflags=""
5352 with_libxenctrl_ldflags=""
5353 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5355 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5357 with_libxenctrl_cppflags="-I$withval/include"
5358 with_libxenctrl_ldflags="-L$withval/lib"
5359 with_libxenctrl="yes"
5361 with_libxenctrl="$withval"
5365 with_libxenctrl="yes"
5367 if test "x$with_libxenctrl" = "xyes"
5369 SAVE_CPPFLAGS="$CPPFLAGS"
5370 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5372 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5374 CPPFLAGS="$SAVE_CPPFLAGS"
5376 if test "x$with_libxenctrl" = "xyes"
5378 SAVE_CPPFLAGS="$CPPFLAGS"
5379 SAVE_LDFLAGS="$LDFLAGS"
5380 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5381 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5383 #Xen versions older than 3.4 has no xc_getcpuinfo()
5384 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5386 CPPFLAGS="$SAVE_CPPFLAGS"
5387 LDFLAGS="$SAVE_LDFLAGS"
5388 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5389 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5390 AC_SUBST(LIBXENCTL_CPPFLAGS)
5391 AC_SUBST(LIBXENCTL_LDFLAGS)
5395 # --with-libxmms {{{
5396 with_xmms_config="xmms-config"
5399 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5401 if test "x$withval" != "xno" \
5402 && test "x$withval" != "xyes"
5404 if test -f "$withval" && test -x "$withval";
5406 with_xmms_config="$withval"
5407 else if test -x "$withval/bin/xmms-config"
5409 with_xmms_config="$withval/bin/xmms-config"
5412 else if test "x$withval" = "xno"
5422 if test "x$with_libxmms" = "xyes"
5424 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5425 xmms_config_status=$?
5427 if test $xmms_config_status -ne 0
5432 if test "x$with_libxmms" = "xyes"
5434 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5435 xmms_config_status=$?
5437 if test $xmms_config_status -ne 0
5442 if test "x$with_libxmms" = "xyes"
5444 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5446 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5447 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5448 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5449 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5456 with_libxmms_numeric=0
5457 if test "x$with_libxmms" = "xyes"
5459 with_libxmms_numeric=1
5461 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5462 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5465 # --with-libyajl {{{
5466 with_libyajl_cppflags=""
5467 with_libyajl_ldflags=""
5468 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5470 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5472 with_libyajl_cppflags="-I$withval/include"
5473 with_libyajl_ldflags="-L$withval/lib"
5476 with_libyajl="$withval"
5482 if test "x$with_libyajl" = "xyes"
5484 SAVE_CPPFLAGS="$CPPFLAGS"
5485 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5487 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5488 AC_CHECK_HEADERS(yajl/yajl_version.h)
5490 CPPFLAGS="$SAVE_CPPFLAGS"
5492 if test "x$with_libyajl" = "xyes"
5494 SAVE_CPPFLAGS="$CPPFLAGS"
5495 SAVE_LDFLAGS="$LDFLAGS"
5496 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5497 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5499 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5501 CPPFLAGS="$SAVE_CPPFLAGS"
5502 LDFLAGS="$SAVE_LDFLAGS"
5504 if test "x$with_libyajl" = "xyes"
5506 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5507 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5508 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5509 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5510 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5511 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5512 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5514 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5518 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5519 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5521 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5523 if test "x$withval" = "xno"
5526 else if test "x$withval" = "xyes"
5529 else if test -d "$with_mic/lib"
5531 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5532 with_mic_cflags="-I$withval/include"
5533 with_mic_ldpath="-L$withval/lib/Linux"
5534 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5539 if test "x$with_mic" = "xyes"
5541 SAVE_CPPFLAGS="$CPPFLAGS"
5542 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5543 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5544 CPPFLAGS="$SAVE_CPPFLAGS"
5546 if test "x$with_mic" = "xyes"
5548 SAVE_CPPFLAGS="$CPPFLAGS"
5549 SAVE_LDFLAGS="$LDFLAGS"
5551 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5552 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5554 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5555 [with_mic_ldpath="$with_mic_ldpath"
5556 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5557 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5559 CPPFLAGS="$SAVE_CPPFLAGS"
5560 LDFLAGS="$SAVE_LDFLAGS"
5563 if test "x$with_mic" = "xyes"
5565 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5566 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5567 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5568 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5569 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5570 AC_SUBST(BUILD_WITH_MIC_LDADD)
5574 # --with-libvarnish {{{
5575 with_libvarnish_cppflags=""
5576 with_libvarnish_cflags=""
5577 with_libvarnish_libs=""
5578 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5580 if test "x$withval" = "xno"
5582 with_libvarnish="no"
5583 else if test "x$withval" = "xyes"
5585 with_libvarnish="use_pkgconfig"
5586 else if test -d "$with_libvarnish/lib"
5588 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5589 with_libvarnish_cflags="-I$withval/include"
5590 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5591 with_libvarnish="yes"
5594 [with_libvarnish="use_pkgconfig"])
5596 # configure using pkg-config
5597 if test "x$with_libvarnish" = "xuse_pkgconfig"
5599 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5600 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5603 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5606 if test "x$with_libvarnish" = "xuse_pkgconfig"
5608 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5611 with_libvarnish="no ($PKG_CONFIG failed)"
5613 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5616 with_libvarnish="no ($PKG_CONFIG failed)"
5619 if test "x$with_libvarnish" = "xuse_pkgconfig"
5621 with_libvarnish="yes"
5624 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5625 # the actual checks.
5626 if test "x$with_libvarnish" = "xyes"
5628 SAVE_CPPFLAGS="$CPPFLAGS"
5630 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5632 AC_CHECK_HEADERS(vapi/vsc.h,
5633 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5634 [AC_CHECK_HEADERS(vsc.h,
5635 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5636 [AC_CHECK_HEADERS(varnishapi.h,
5637 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5638 [with_libvarnish="no (found none of the varnish header files)"])])])
5640 CPPFLAGS="$SAVE_CPPFLAGS"
5642 if test "x$with_libvarnish" = "xyes"
5644 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5645 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5646 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5647 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5651 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5652 with_libxml2="no (pkg-config isn't available)"
5653 with_libxml2_cflags=""
5654 with_libxml2_ldflags=""
5655 with_libvirt="no (pkg-config isn't available)"
5656 with_libvirt_cflags=""
5657 with_libvirt_ldflags=""
5658 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5663 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5666 $PKG_CONFIG --exists libvirt 2>/dev/null
5671 with_libvirt="no (pkg-config doesn't know libvirt)"
5673 if test "x$with_libxml2" = "xyes"
5675 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5680 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5686 if test "x$with_libxml2" = "xyes"
5688 SAVE_CPPFLAGS="$CPPFLAGS"
5689 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5691 AC_CHECK_HEADERS(libxml/parser.h, [],
5692 [with_libxml2="no (libxml/parser.h not found)"])
5694 CPPFLAGS="$SAVE_CPPFLAGS"
5696 if test "x$with_libxml2" = "xyes"
5698 SAVE_CFLAGS="$CFLAGS"
5699 SAVE_LDFLAGS="$LDFLAGS"
5701 CFLAGS="$CFLAGS $with_libxml2_cflags"
5702 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5704 AC_CHECK_LIB(xml2, xmlXPathEval,
5705 [with_libxml2="yes"],
5706 [with_libxml2="no (symbol xmlXPathEval not found)"])
5708 CFLAGS="$SAVE_CFLAGS"
5709 LDFLAGS="$SAVE_LDFLAGS"
5711 dnl Add the right compiler flags and libraries.
5712 if test "x$with_libxml2" = "xyes"; then
5713 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5714 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5715 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5716 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5718 if test "x$with_libvirt" = "xyes"
5720 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5725 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5731 if test "x$with_libvirt" = "xyes"
5733 SAVE_CPPFLAGS="$CPPFLAGS"
5734 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5736 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5737 [with_libvirt="no (libvirt/libvirt.h not found)"])
5739 CPPFLAGS="$SAVE_CPPFLAGS"
5741 if test "x$with_libvirt" = "xyes"
5743 SAVE_CFLAGS="$CFLAGS"
5744 SAVE_LDFLAGS="$LDFLAGS"
5746 CFLAGS="$CFLAGS $with_libvirt_cflags"
5747 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5749 AC_CHECK_LIB(virt, virDomainBlockStats,
5750 [with_libvirt="yes"],
5751 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5753 CFLAGS="$SAVE_CFLAGS"
5754 LDFLAGS="$SAVE_LDFLAGS"
5756 dnl Add the right compiler flags and libraries.
5757 if test "x$with_libvirt" = "xyes"; then
5758 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5759 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5760 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5761 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5765 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5766 with_libopenipmipthread="yes"
5767 with_libopenipmipthread_cflags=""
5768 with_libopenipmipthread_libs=""
5770 if test "x$with_libopenipmipthread" = "xyes"
5772 AC_MSG_CHECKING([for libOpenIPMIpthread])
5773 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5776 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5778 AC_MSG_RESULT([$with_libopenipmipthread])
5781 if test "x$with_libopenipmipthread" = "xyes"
5783 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5784 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5787 with_libopenipmipthread_cflags="$temp_result"
5789 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5790 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5792 AC_MSG_RESULT([$temp_result])
5795 if test "x$with_libopenipmipthread" = "xyes"
5797 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5798 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5801 with_libopenipmipthread_ldflags="$temp_result"
5803 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5804 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5806 AC_MSG_RESULT([$temp_result])
5809 if test "x$with_libopenipmipthread" = "xyes"
5811 SAVE_CPPFLAGS="$CPPFLAGS"
5812 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5814 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5815 [with_libopenipmipthread="yes"],
5816 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5817 [#include <OpenIPMI/ipmiif.h>
5818 #include <OpenIPMI/ipmi_err.h>
5819 #include <OpenIPMI/ipmi_posix.h>
5820 #include <OpenIPMI/ipmi_conn.h>
5823 CPPFLAGS="$SAVE_CPPFLAGS"
5826 if test "x$with_libopenipmipthread" = "xyes"
5828 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5829 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5830 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5831 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5835 # --with-libatasmart {{{
5836 with_libatasmart_cppflags=""
5837 with_libatasmart_ldflags=""
5838 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5840 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5842 with_libatasmart_cppflags="-I$withval/include"
5843 with_libatasmart_ldflags="-L$withval/lib"
5844 with_libatasmart="yes"
5846 with_libatasmart="$withval"
5850 if test "x$ac_system" = "xLinux"
5852 with_libatasmart="yes"
5854 with_libatasmart="no (Linux only library)"
5857 if test "x$with_libatasmart" = "xyes"
5859 SAVE_CPPFLAGS="$CPPFLAGS"
5860 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5862 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5864 CPPFLAGS="$SAVE_CPPFLAGS"
5866 if test "x$with_libatasmart" = "xyes"
5868 SAVE_CPPFLAGS="$CPPFLAGS"
5869 SAVE_LDFLAGS="$LDFLAGS"
5870 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5871 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5873 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5875 CPPFLAGS="$SAVE_CPPFLAGS"
5876 LDFLAGS="$SAVE_LDFLAGS"
5878 if test "x$with_libatasmart" = "xyes"
5880 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5881 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5882 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5883 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5884 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5885 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5886 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5888 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5891 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5892 [with_libnotify="yes"],
5893 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5896 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5897 [with_libriemann_client="yes"],
5898 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5900 # Check for enabled/disabled features
5903 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5904 # ------------------------------------------------------------
5906 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5911 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5916 m4_define([EnDis],[disabled])dnl
5917 m4_define([YesNo],[no])dnl
5923 m4_define([EnDis],[enabled])dnl
5924 m4_define([YesNo],[yes])dnl
5927 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5931 m4_if([$3], [feature], [],
5935 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5941 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5943 enable_$1='[YesNo]'dnl
5945 if test "x$enable_$1" = "xno"
5949 if test "x$enable_$1" = "xyes"
5953 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5958 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5959 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5961 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5963 # AC_PLUGIN(name, default, info)
5964 # ------------------------------------------------------------
5971 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5973 if test "x$enableval" = "xyes"
5976 else if test "x$enableval" = "xforce"
5981 enable_plugin="no (disabled on command line)"
5985 if test "x$enable_all_plugins" = "xauto"
5987 if test "x$2" = "xyes"
5994 enable_plugin="$enable_all_plugins"
5997 if test "x$enable_plugin" = "xyes"
5999 if test "x$2" = "xyes" || test "x$force" = "xyes"
6001 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
6002 if test "x$2" != "xyes"
6004 dependency_warning="yes"
6006 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
6007 dependency_error="yes"
6008 enable_plugin="$2 (dependency error)"
6011 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
6012 enable_$1="$enable_plugin"
6014 )# AC_PLUGIN(name, default, info)
6016 m4_divert_once([HELP_ENABLE], [
6017 collectd features:])
6018 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
6019 AC_COLLECTD([debug], [enable], [feature], [debugging])
6020 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
6021 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
6022 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
6024 dependency_warning="no"
6025 dependency_error="no"
6028 plugin_barometer="no"
6033 plugin_conntrack="no"
6034 plugin_contextswitch="no"
6037 plugin_cpusleep="no"
6038 plugin_curl_json="no"
6039 plugin_curl_xml="no"
6043 plugin_dpdkstat="no"
6050 plugin_hugepages="no"
6051 plugin_intel_rdt="no"
6052 plugin_interface="no"
6057 plugin_log_logstash="no"
6059 plugin_multimeter="no"
6064 plugin_processes="no"
6065 plugin_protocols="no"
6071 plugin_tcpconns="no"
6074 plugin_turbostat="no"
6080 plugin_wireless="no"
6081 plugin_write_prometheus="no"
6085 plugin_zookeeper="no"
6088 if test "x$ac_system" = "xLinux"
6090 plugin_battery="yes"
6091 plugin_cgroups="yes"
6092 plugin_conntrack="yes"
6093 plugin_contextswitch="yes"
6095 plugin_cpufreq="yes"
6098 plugin_entropy="yes"
6099 plugin_fhcount="yes"
6100 plugin_fscache="yes"
6101 plugin_hugepages="yes"
6102 plugin_interface="yes"
6110 plugin_processes="yes"
6111 plugin_protocols="yes"
6114 plugin_tcpconns="yes"
6115 plugin_thermal="yes"
6118 plugin_vserver="yes"
6119 plugin_wireless="yes"
6120 plugin_zfs_arc="yes"
6122 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
6126 if test "x$have_cpuid_h" = "xyes"; then
6127 plugin_turbostat="yes"
6130 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6132 plugin_cpusleep="yes"
6136 if test "x$ac_system" = "xOpenBSD"
6138 plugin_tcpconns="yes"
6141 if test "x$ac_system" = "xNetBSD"
6144 plugin_entropy="yes"
6146 plugin_processes="yes"
6150 if test "x$with_libiokit" = "xyes"
6152 plugin_battery="yes"
6158 if test "x$ac_system" = "xAIX"
6161 plugin_tcpconns="yes"
6166 if test "x$ac_system" = "xFreeBSD"
6169 plugin_zfs_arc="yes"
6173 if test "x$with_perfstat" = "xyes"
6175 plugin_contextswitch="yes"
6178 plugin_interface="yes"
6185 if test "x$with_procinfo" = "xyes"
6187 plugin_processes="yes"
6191 if test "x$with_kstat" = "xyes"
6194 plugin_processes="yes"
6196 plugin_zfs_arc="yes"
6200 if test "x$with_devinfo$with_kstat" = "xyesyes"
6204 plugin_interface="yes"
6210 if test "x$ac_system" = "xLinux"
6212 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6213 [with_libi2c="yes"],
6214 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6215 [[#include <stdlib.h>
6216 #include <linux/i2c-dev.h>]])
6218 with_libi2c="no (Linux only)"
6221 if test "x$with_libi2c" = "xyes"
6223 plugin_barometer="yes"
6228 if test "x$with_libstatgrab" = "xyes"
6232 plugin_interface="yes"
6239 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6242 if test "x$have_strptime" = "xyes"
6248 if test "x$with_libopenipmipthread" = "xyes"
6253 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6255 plugin_curl_json="yes"
6258 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6260 plugin_curl_xml="yes"
6263 if test "x$with_libyajl" = "xyes"
6268 if test "x$have_processor_info" = "xyes"
6272 if test "x$have_sysctl" = "xyes"
6277 if test "x$ac_system" = "xDarwin"
6282 if test "x$have_sysctlbyname" = "xyes"
6284 plugin_contextswitch="yes"
6287 plugin_tcpconns="yes"
6290 # Df plugin: Check if we know how to determine mount points first.
6291 #if test "x$have_listmntent" = "xyes"; then
6294 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6298 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6302 #if test "x$have_getmntent" = "xseq"
6306 if test "x$c_cv_have_one_getmntent" = "xyes"
6311 if test "x$c_cv_have_getmntent_r" = "xyes"
6316 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6317 if test "x$plugin_df" = "xyes"
6320 if test "x$have_statfs" = "xyes"
6324 if test "x$have_statvfs" = "xyes"
6330 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6332 plugin_ethstat="yes"
6335 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6340 if test "x$have_getifaddrs" = "xyes"
6342 plugin_interface="yes"
6345 if test "x$with_libgps" = "xyes"
6350 if test "x$have_getloadavg" = "xyes"
6355 if test "x$with_libyajl" = "xyes"
6357 plugin_log_logstash="yes"
6360 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6365 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6368 if test "x$with_libmicrohttpd" = "xyes"
6370 plugin_write_prometheus="yes"
6374 # Mac OS X memory interface
6375 if test "x$have_host_statistics" = "xyes"
6380 if test "x$have_termios_h" = "xyes"
6382 if test "x$ac_system" != "xAIX"
6384 plugin_multimeter="yes"
6389 if test "x$have_thread_info" = "xyes"
6391 plugin_processes="yes"
6394 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6396 plugin_processes="yes"
6399 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6401 plugin_processes="yes"
6404 if test "x$with_libpython" != "xno"
6409 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6414 if test "x$with_kvm_getswapinfo" = "xyes"
6419 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6424 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6429 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6431 plugin_tcpconns="yes"
6434 if test "x$have_getutent" = "xyes"
6438 if test "x$have_getutxent" = "xyes"
6443 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6448 if test "x$with_libxenctrl" = "xyes"
6453 if test "x$with_libdpdk" = "xyes"
6455 plugin_dpdkstat="yes"
6458 m4_divert_once([HELP_ENABLE], [
6461 AC_ARG_ENABLE([all-plugins],
6462 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6464 if test "x$enableval" = "xyes"
6466 enable_all_plugins="yes"
6467 else if test "x$enableval" = "xauto"
6469 enable_all_plugins="auto"
6471 enable_all_plugins="no"
6474 [enable_all_plugins="auto"])
6476 m4_divert_once([HELP_ENABLE], [])
6478 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6479 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6480 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6481 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6482 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6483 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6484 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6485 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6486 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6487 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6488 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6489 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6490 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6491 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6492 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6493 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6494 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6495 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6496 AC_PLUGIN([csv], [yes], [CSV output plugin])
6497 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6498 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6499 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6500 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6501 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6502 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6503 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6504 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats & Status from DPDK])
6505 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6506 AC_PLUGIN([email], [yes], [EMail statistics])
6507 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6508 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6509 AC_PLUGIN([exec], [yes], [Execution of external programs])
6510 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6511 AC_PLUGIN([filecount], [yes], [Count files in directories])
6512 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6513 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6514 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6515 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6516 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6517 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6518 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6519 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6520 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6521 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6522 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6523 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6524 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6525 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6526 AC_PLUGIN([load], [$plugin_load], [System load])
6527 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6528 AC_PLUGIN([logfile], [yes], [File logging plugin])
6529 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6530 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6531 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6532 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6533 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6534 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6535 AC_PLUGIN([match_regex], [yes], [The regex match])
6536 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6537 AC_PLUGIN([match_value], [yes], [The value match])
6538 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6539 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6540 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6541 AC_PLUGIN([memcached], [yes], [memcached statistics])
6542 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6543 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6544 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6545 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6546 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6547 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6548 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6549 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6550 AC_PLUGIN([network], [yes], [Network communication plugin])
6551 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6552 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6553 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6554 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6555 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6556 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6557 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6558 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6559 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6560 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6561 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6562 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6563 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6564 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6565 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6566 # FIXME: Check for libevent, too.
6567 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6568 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6569 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6570 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6571 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6572 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6573 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6574 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6575 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6576 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6577 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6578 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6579 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6580 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6581 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6582 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6583 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6584 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6585 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6586 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6587 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6588 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6589 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6590 AC_PLUGIN([target_notification], [yes], [The notification target])
6591 AC_PLUGIN([target_replace], [yes], [The replace target])
6592 AC_PLUGIN([target_scale], [yes], [The scale target])
6593 AC_PLUGIN([target_set], [yes], [The set target])
6594 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6595 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6596 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6597 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6598 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6599 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6600 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6601 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6602 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6603 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6604 AC_PLUGIN([users], [$plugin_users], [User statistics])
6605 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6606 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6607 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6608 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6609 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6610 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6611 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6612 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6613 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6614 AC_PLUGIN([write_log], [yes], [Log output plugin])
6615 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6616 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6617 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6618 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6619 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6620 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6621 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6622 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6623 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6624 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6625 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6627 dnl Default configuration file
6628 # Load either syslog or logfile
6629 LOAD_PLUGIN_SYSLOG=""
6630 LOAD_PLUGIN_LOGFILE=""
6631 LOAD_PLUGIN_LOG_LOGSTASH=""
6633 AC_MSG_CHECKING([which default log plugin to load])
6634 default_log_plugin="none"
6635 if test "x$enable_syslog" = "xyes"
6637 default_log_plugin="syslog"
6639 LOAD_PLUGIN_SYSLOG="##"
6642 if test "x$enable_logfile" = "xyes"
6644 if test "x$default_log_plugin" = "xnone"
6646 default_log_plugin="logfile"
6648 LOAD_PLUGIN_LOGFILE="#"
6651 LOAD_PLUGIN_LOGFILE="##"
6654 if test "x$enable_log_logstash" = "xyes"
6656 LOAD_PLUGIN_LOG_LOGSTASH="#"
6658 LOAD_PLUGIN_LOG_LOGSTASH="##"
6662 AC_MSG_RESULT([$default_log_plugin])
6664 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6665 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6666 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6668 DEFAULT_LOG_LEVEL="info"
6669 if test "x$enable_debug" = "xyes"
6671 DEFAULT_LOG_LEVEL="debug"
6673 AC_SUBST(DEFAULT_LOG_LEVEL)
6675 # Load only one of rrdtool, network, csv in the default config.
6676 LOAD_PLUGIN_RRDTOOL=""
6677 LOAD_PLUGIN_NETWORK=""
6680 AC_MSG_CHECKING([which default write plugin to load])
6681 default_write_plugin="none"
6682 if test "x$enable_rrdtool" = "xyes"
6684 default_write_plugin="rrdtool"
6686 LOAD_PLUGIN_RRDTOOL="##"
6689 if test "x$enable_network" = "xyes"
6691 if test "x$default_write_plugin" = "xnone"
6693 default_write_plugin="network"
6695 LOAD_PLUGIN_NETWORK="#"
6698 LOAD_PLUGIN_NETWORK="##"
6701 if test "x$enable_csv" = "xyes"
6703 if test "x$default_write_plugin" = "xnone"
6705 default_write_plugin="csv"
6710 LOAD_PLUGIN_CSV="##"
6712 AC_MSG_RESULT([$default_write_plugin])
6714 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6715 AC_SUBST(LOAD_PLUGIN_NETWORK)
6716 AC_SUBST(LOAD_PLUGIN_CSV)
6719 if test "x$ac_system" = "xLinux" \
6720 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6722 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6725 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6727 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6731 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6732 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6734 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6736 PERL_BINDINGS_OPTIONS="$withval"
6737 with_perl_bindings="yes"
6739 with_perl_bindings="$withval"
6743 if test -n "$perl_interpreter"
6745 with_perl_bindings="yes"
6747 with_perl_bindings="no (no perl interpreter found)"
6751 if test "x$with_perl_bindings" = "xyes"
6753 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6754 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6755 AC_MSG_RESULT([yes])
6758 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6762 if test "x$with_perl_bindings" = "xyes"
6764 PERL_BINDINGS="perl"
6768 AC_SUBST(PERL_BINDINGS)
6769 AC_SUBST(PERL_BINDINGS_OPTIONS)
6771 dnl libcollectdclient
6772 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6773 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6774 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6776 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6778 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6780 AC_SUBST(LCC_VERSION_MAJOR)
6781 AC_SUBST(LCC_VERSION_MINOR)
6782 AC_SUBST(LCC_VERSION_PATCH)
6783 AC_SUBST(LCC_VERSION_EXTRA)
6784 AC_SUBST(LCC_VERSION_STRING)
6786 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6790 if test "x$enable_werror" != "xno"
6792 AM_CFLAGS="$AM_CFLAGS -Werror"
6793 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6795 AC_SUBST([AM_CFLAGS])
6796 AC_SUBST([AM_CXXFLAGS])
6798 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])
6801 if test "x$with_librrd" = "xyes" \
6802 && test "x$librrd_threadsafe" != "xyes"
6804 with_librrd="yes (warning: librrd is not thread-safe)"
6807 if test "x$with_libperl" = "xyes"
6809 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6811 enable_perl="no (needs libperl)"
6814 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6816 enable_perl="no (libperl doesn't support ithreads)"
6819 if test "x$with_perl_bindings" = "xyes" \
6820 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6822 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6826 AC_MSG_RESULT([Configuration:])
6827 AC_MSG_RESULT([ Build:])
6828 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6829 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6830 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6831 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6832 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6833 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6834 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6835 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6836 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6837 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6838 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6839 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6841 AC_MSG_RESULT([ Libraries:])
6842 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6843 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6844 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6845 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6846 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6847 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6848 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6849 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6850 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6851 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6852 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6853 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6854 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6855 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6856 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6857 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6858 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6859 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6860 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6861 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6862 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6863 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6864 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6865 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6866 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6867 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6868 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6869 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6870 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6871 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6872 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6873 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6874 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6875 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6876 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6877 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6878 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6879 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6880 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6881 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6882 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6883 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6884 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6885 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6886 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6887 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6888 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6889 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6890 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6891 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6892 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6893 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6894 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6895 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6896 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6897 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6898 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6899 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6900 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6901 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6902 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6903 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6904 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6905 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6907 AC_MSG_RESULT([ Features:])
6908 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6909 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6911 AC_MSG_RESULT([ Bindings:])
6912 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6914 AC_MSG_RESULT([ Modules:])
6915 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6916 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6917 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6918 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6919 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6920 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6921 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6922 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6923 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6924 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6925 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6926 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6927 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6928 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6929 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6930 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6931 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6932 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6933 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6934 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6935 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6936 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6937 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6938 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6939 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6940 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6941 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6942 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6943 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6944 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6945 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6946 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6947 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6948 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6949 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6950 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6951 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6952 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6953 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6954 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6955 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6956 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6957 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6958 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6959 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6960 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6961 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6962 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6963 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6964 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6965 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6966 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6967 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6968 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6969 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6970 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6971 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6972 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6973 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6974 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6975 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6976 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6977 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6978 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
6979 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
6980 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
6981 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
6982 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
6983 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
6984 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
6985 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
6986 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
6987 AC_MSG_RESULT([ network . . . . . . . $enable_network])
6988 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
6989 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
6990 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
6991 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
6992 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
6993 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
6994 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
6995 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
6996 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
6997 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
6998 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
6999 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
7000 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
7001 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
7002 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
7003 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
7004 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
7005 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
7006 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
7007 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
7008 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
7009 AC_MSG_RESULT([ python . . . . . . . $enable_python])
7010 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
7011 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
7012 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
7013 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
7014 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
7015 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
7016 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
7017 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
7018 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
7019 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
7020 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
7021 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
7022 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
7023 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
7024 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
7025 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
7026 AC_MSG_RESULT([ target_notification . $enable_target_notification])
7027 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
7028 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
7029 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
7030 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
7031 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
7032 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
7033 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
7034 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
7035 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
7036 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
7037 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
7038 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
7039 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
7040 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
7041 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
7042 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
7043 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
7044 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
7045 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
7046 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
7047 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
7048 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
7049 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
7050 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
7051 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
7052 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
7053 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
7054 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
7055 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
7056 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
7057 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
7058 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
7059 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
7060 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
7061 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
7064 if test "x$dependency_error" = "xyes"; then
7065 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
7068 if test "x$dependency_warning" = "xyes"; then
7069 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
7072 # vim: set fdm=marker :