1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
4 AC_CONFIG_SRCDIR(src/target_set.c)
5 AC_CONFIG_HEADERS(src/config.h)
6 AC_CONFIG_AUX_DIR([libltdl/config])
8 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
9 dnl we don't really need the 'u' even in older toolchains. Then there is
10 dnl older libtool, which spelled it AR_FLAGS
11 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
13 m4_ifdef([LT_PACKAGE_VERSION],
16 LT_CONFIG_LTDL_DIR([libltdl])
18 LTDL_INIT([convenience])
19 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
24 AC_LIBLTDL_CONVENIENCE
28 AC_CONFIG_SUBDIRS(libltdl)
29 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
33 AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
35 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 AC_PREFIX_DEFAULT("/opt/collectd")
44 # Checks for programs.
47 [AC_MSG_ERROR([No compiler found that supports C99])]
56 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
63 AC_PATH_PROG([VALGRIND], [valgrind])
65 # Warn when pkg.m4 is missing
66 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
70 AC_CACHE_CHECK([if bison is the parser generator],
71 [collectd_cv_prog_bison],
72 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
73 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
77 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
79 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
82 AC_ARG_VAR([PROTOC], [path to the protoc binary])
83 AC_PATH_PROG([PROTOC], [protoc])
85 if test "x$PROTOC" != "x"; then
86 AC_MSG_CHECKING([for protoc 3.0.0+])
87 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
88 protoc3="yes (`$PROTOC --version`)"
91 protoc3="no (`$PROTOC --version`)"
93 AC_MSG_RESULT([$protoc3])
95 AM_CONDITIONAL(HAVE_PROTOC3, test "x$have_protoc3" = "xyes")
97 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
98 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
99 AM_CONDITIONAL(HAVE_GRPC_CPP, test "x$GRPC_CPP_PLUGIN" != "x")
101 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
102 AC_PATH_PROG([PROTOC_C], [protoc-c])
103 if test "x$PROTOC_C" = "x"
105 have_protoc_c="no (protoc-c compiler not found)"
110 AC_MSG_CHECKING([for kernel type ($host_os)])
113 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
117 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
121 AC_DEFINE([KERNEL_DARWIN], 1, [True if program is to be compiled for a Darwin kernel])
125 AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel])
129 AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel])
133 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
137 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
143 AC_MSG_RESULT([$ac_system])
145 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
146 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
147 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
148 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
149 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
150 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
152 if test "x$ac_system" = "xLinux"
154 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
155 if test -z "$KERNEL_DIR"
157 KERNEL_DIR="/lib/modules/`uname -r`/source"
160 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
161 AC_SUBST(KERNEL_CFLAGS)
164 if test "x$ac_system" = "xSolaris"
166 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
167 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
169 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
170 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
172 # error "Compiler not in 64bit mode."
175 [AC_MSG_RESULT([yes])],
178 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
182 if test "x$ac_system" = "xAIX"
184 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
187 # Where to install .pc files.
188 pkgconfigdir="${libdir}/pkgconfig"
189 AC_SUBST(pkgconfigdir)
191 # Check for standards compliance mode
192 AC_ARG_ENABLE(standards,
193 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
194 [enable_standards="$enableval"],
195 [enable_standards="no"])
196 if test "x$enable_standards" = "xyes"
198 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
199 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
200 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
201 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
202 if test "x$GCC" = "xyes"
204 CFLAGS="$CFLAGS -std=c99"
207 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
210 # Checks for header files.
266 # For entropy plugin on newer NetBSD
267 AC_CHECK_HEADERS(sys/rndio.h, [], [],
268 [#if HAVE_SYS_TYPES_H
269 # include <sys/types.h>
272 # include <sys/ioctl.h>
275 # include <sys/param.h>
280 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
285 # include <sys/types.h>
288 AC_CHECK_HEADERS(netinet/in.h, [], [],
293 # include <sys/types.h>
295 #if HAVE_NETINET_IN_SYSTM_H
296 # include <netinet/in_systm.h>
299 AC_CHECK_HEADERS(netinet/ip.h, [], [],
304 # include <sys/types.h>
306 #if HAVE_NETINET_IN_SYSTM_H
307 # include <netinet/in_systm.h>
309 #if HAVE_NETINET_IN_H
310 # include <netinet/in.h>
313 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
318 # include <sys/types.h>
320 #if HAVE_NETINET_IN_SYSTM_H
321 # include <netinet/in_systm.h>
323 #if HAVE_NETINET_IN_H
324 # include <netinet/in.h>
326 #if HAVE_NETINET_IP_H
327 # include <netinet/ip.h>
330 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
335 # include <sys/types.h>
337 #if HAVE_NETINET_IN_SYSTM_H
338 # include <netinet/in_systm.h>
340 #if HAVE_NETINET_IN_H
341 # include <netinet/in.h>
343 #if HAVE_NETINET_IP_H
344 # include <netinet/ip.h>
347 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
352 # include <sys/types.h>
354 #if HAVE_NETINET_IN_SYSTM_H
355 # include <netinet/in_systm.h>
357 #if HAVE_NETINET_IN_H
358 # include <netinet/in.h>
361 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
366 # include <sys/types.h>
368 #if HAVE_NETINET_IN_SYSTM_H
369 # include <netinet/in_systm.h>
371 #if HAVE_NETINET_IN_H
372 # include <netinet/in.h>
374 #if HAVE_NETINET_IP6_H
375 # include <netinet/ip6.h>
378 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
383 # include <sys/types.h>
385 #if HAVE_NETINET_IN_SYSTM_H
386 # include <netinet/in_systm.h>
388 #if HAVE_NETINET_IN_H
389 # include <netinet/in.h>
391 #if HAVE_NETINET_IP_H
392 # include <netinet/ip.h>
395 AC_CHECK_HEADERS(netinet/udp.h, [], [],
400 # include <sys/types.h>
402 #if HAVE_NETINET_IN_SYSTM_H
403 # include <netinet/in_systm.h>
405 #if HAVE_NETINET_IN_H
406 # include <netinet/in.h>
408 #if HAVE_NETINET_IP_H
409 # include <netinet/ip.h>
414 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
419 # include <sys/types.h>
421 #if HAVE_NETINET_IN_SYSTM_H
422 # include <netinet/in_systm.h>
424 #if HAVE_NETINET_IN_H
425 # include <netinet/in.h>
427 #if HAVE_NETINET_IP6_H
428 # include <netinet/ip6.h>
432 if test "x$have_ip6_ext" = "xno"; then
433 SAVE_CFLAGS="$CFLAGS"
434 CFLAGS="$CFLAGS -DSOLARIS2=8"
436 AC_CHECK_TYPES([struct ip6_ext],
437 [have_ip6_ext="yes, with -DSOLARIS2=8"],
443 # include <sys/types.h>
445 #if HAVE_NETINET_IN_SYSTM_H
446 # include <netinet/in_systm.h>
448 #if HAVE_NETINET_IN_H
449 # include <netinet/in.h>
451 #if HAVE_NETINET_IP6_H
452 # include <netinet/ip6.h>
456 if test "x$have_ip6_ext" = "xno"; then
457 CFLAGS="$SAVE_CFLAGS"
462 AC_CHECK_HEADERS(sys/dkstat.h)
463 if test "x$ac_system" = "xDarwin"
465 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
466 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
467 # For the battery plugin
468 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
470 #if HAVE_IOKIT_IOKITLIB_H
471 # include <IOKit/IOKitLib.h>
473 #if HAVE_IOKIT_IOTYPES_H
474 # include <IOKit/IOTypes.h>
480 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
483 # include <sys/types.h>
486 # include <sys/param.h>
490 AC_MSG_CHECKING([for sysctl kern.cp_times])
491 if test -x /sbin/sysctl
493 /sbin/sysctl kern.cp_times >/dev/null 2>&1
497 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
498 [Define if sysctl supports kern.cp_times])
506 AC_MSG_CHECKING([for sysctl kern.cp_time])
507 if test -x /sbin/sysctl
509 /sbin/sysctl kern.cp_time >/dev/null 2>&1
513 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1,
514 [Define if sysctl supports kern.cp_time])
523 AC_CHECK_HEADERS(linux/major.h)
525 # For md module (Linux only)
526 if test "x$ac_system" = "xLinux"
528 AC_CHECK_HEADERS(linux/raid/md_u.h,
529 [have_linux_raid_md_u_h="yes"],
530 [have_linux_raid_md_u_h="no"],
532 #include <sys/ioctl.h>
533 #include <linux/major.h>
534 #include <linux/types.h>
536 AC_CHECK_HEADERS([sys/sysmacros.h])
538 have_linux_raid_md_u_h="no"
541 # For the wireless module
542 have_linux_wireless_h="no"
543 if test "x$ac_system" = "xLinux"
545 AC_CHECK_HEADERS(linux/wireless.h,
546 [have_linux_wireless_h="yes"],
547 [have_linux_wireless_h="no"],
550 #include <sys/ioctl.h>
551 #include <sys/socket.h>
555 # For the swap module
556 have_sys_swap_h="yes"
557 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
559 #undef _FILE_OFFSET_BITS
560 #undef _LARGEFILE64_SOURCE
562 # include <sys/types.h>
565 # include <sys/param.h>
570 # For the processes plugin
572 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
574 # For interface plugin
575 AC_CHECK_HEADERS(ifaddrs.h)
576 AC_CHECK_HEADERS(net/if.h, [], [],
579 # include <sys/types.h>
581 #if HAVE_SYS_SOCKET_H
582 # include <sys/socket.h>
585 AC_CHECK_HEADERS(linux/if.h, [], [],
588 # include <sys/types.h>
590 #if HAVE_SYS_SOCKET_H
591 # include <sys/socket.h>
594 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
597 # include <sys/types.h>
599 #if HAVE_SYS_SOCKET_H
600 # include <sys/socket.h>
602 #if HAVE_LINUX_INET_DIAG_H
603 # include <linux/inet_diag.h>
606 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
609 # include <sys/types.h>
611 #if HAVE_SYS_SOCKET_H
612 # include <sys/socket.h>
615 # include <linux/if.h>
620 AC_CHECK_HEADERS(linux/sockios.h,
621 [have_linux_sockios_h="yes"],
622 [have_linux_sockios_h="no"],
625 # include <sys/ioctl.h>
631 AC_CHECK_HEADERS(linux/ethtool.h,
632 [have_linux_ethtool_h="yes"],
633 [have_linux_ethtool_h="no"],
636 # include <sys/ioctl.h>
641 #if HAVE_LINUX_SOCKIOS_H
642 # include <linux/sockios.h>
647 have_linux_ip_vs_h="no"
648 have_net_ip_vs_h="no"
650 ip_vs_h_needs_kernel_cflags="no"
651 if test "x$ac_system" = "xLinux"
653 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
654 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
655 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
657 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
659 SAVE_CFLAGS="$CFLAGS"
660 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
662 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
664 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
665 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
666 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
668 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
670 ip_vs_h_needs_kernel_cflags="yes"
673 CFLAGS="$SAVE_CFLAGS"
676 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
679 AC_CHECK_HEADERS(sys/ucred.h, [], [],
682 # include <sys/types.h>
685 # include <sys/param.h>
689 # For mount interface
690 AC_CHECK_HEADERS(sys/mount.h, [], [],
693 # include <sys/types.h>
696 # include <sys/param.h>
700 # For the email plugin
701 AC_CHECK_HEADERS(linux/un.h, [], [],
703 #if HAVE_SYS_SOCKET_H
704 # include <sys/socket.h>
710 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
715 if test "x$enable_xfs" != "xno"; then
716 AC_CHECK_HEADERS([xfs/xqm.h],
719 if test "x$enable_xfs" = "xyes"; then
720 AC_MSG_ERROR([xfs/xqm.h not found])
723 [[#define _GNU_SOURCE]]
730 AC_CHECK_HEADERS(arpa/nameser.h)
731 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
733 #if HAVE_ARPA_NAMESER_H
734 # include <arpa/nameser.h>
738 AC_CHECK_HEADERS(net/if_arp.h, [], [],
739 [#if HAVE_SYS_SOCKET_H
740 # include <sys/socket.h>
743 AC_CHECK_HEADERS(net/ppp_defs.h)
744 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
745 [#if HAVE_NET_PPP_DEFS_H
746 # include <net/ppp_defs.h>
749 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
754 # include <sys/types.h>
756 #if HAVE_SYS_SOCKET_H
757 # include <sys/socket.h>
762 #if HAVE_NETINET_IN_H
763 # include <netinet/in.h>
767 have_net_pfvar_h="no"
768 AC_CHECK_HEADERS(net/pfvar.h,
769 [have_net_pfvar_h="yes"],
770 [have_net_pfvar_h="no"],
773 # include <sys/ioctl.h>
775 #if HAVE_SYS_SOCKET_H
776 # include <sys/socket.h>
781 #if HAVE_NETINET_IN_H
782 # include <netinet/in.h>
786 # For the multimeter plugin
788 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
790 # For cpusleep plugin
791 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
792 [c_cv_have_clock_boottime_monotonic],
793 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
798 struct timespec b, m;
799 clock_gettime(CLOCK_BOOTTIME, &b );
800 clock_gettime(CLOCK_MONOTONIC, &m );
803 [c_cv_have_clock_boottime_monotonic="yes"],
804 [c_cv_have_clock_boottime_monotonic="no"]))
807 # For the turbostat plugin
808 have_asm_msrindex_h="no"
809 AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
811 if test "x$have_asm_msrindex_h" = "xyes"
813 AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
814 [c_cv_have_usable_asm_msrindex_h],
815 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
817 #include<asm/msr-index.h>
820 int y = MSR_PKG_C10_RESIDENCY;
824 [c_cv_have_usable_asm_msrindex_h="yes"],
825 [c_cv_have_usable_asm_msrindex_h="no"],
831 AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
833 have_capability="yes"
834 AC_CHECK_HEADERS(sys/capability.h,
835 [have_capability="yes"],
836 [have_capability="no (<sys/capability.h> not found)"])
837 if test "x$have_capability" = "xyes"; then
838 AC_CHECK_LIB(cap, cap_get_proc,
839 [have_capability="yes"],
840 [have_capability="no (cap_get_proc() not found)"])
842 if test "x$have_capability" = "xyes"; then
843 AC_CHECK_DECL([CAP_IS_SUPPORTED],
844 [have_capability="yes"],
845 [have_capability="no (CAP_IS_SUPPORTED not found)"],
846 [[#include <sys/capability.h>]])
848 if test "x$have_capability" = "xyes"; then
849 AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_proc() (-lcap).])
851 AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes")
854 # Checks for typedefs, structures, and compiler characteristics.
863 # Checks for library functions.
865 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname setlocale asprintf)
872 AC_LANG_SOURCE([[int main(void){}]])
874 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
881 SAVE_CFLAGS="$CFLAGS"
882 # Emulate behavior of src/Makefile.am
883 if test "x$GCC" = "xyes"
885 CFLAGS="$CFLAGS -Wall -Werror"
888 AC_CACHE_CHECK([for strtok_r],
889 [c_cv_have_strtok_r_default],
898 char buffer[] = "foo,bar,baz";
905 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
908 printf ("token = %s;\n", token);
912 [c_cv_have_strtok_r_default="yes"],
913 [c_cv_have_strtok_r_default="no"]
917 if test "x$c_cv_have_strtok_r_default" = "xno"
919 CFLAGS="$CFLAGS -D_REENTRANT=1"
921 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
922 [c_cv_have_strtok_r_reentrant],
931 char buffer[] = "foo,bar,baz";
938 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
941 printf ("token = %s;\n", token);
945 [c_cv_have_strtok_r_reentrant="yes"],
946 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
951 CFLAGS="$SAVE_CFLAGS"
952 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
954 CFLAGS="$CFLAGS -D_REENTRANT=1"
957 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
959 socket_needs_socket="no"
960 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
961 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
963 clock_gettime_needs_rt="no"
964 clock_gettime_needs_posix4="no"
965 have_clock_gettime="no"
966 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
967 if test "x$have_clock_gettime" = "xno"
969 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
970 have_clock_gettime="yes"])
972 if test "x$have_clock_gettime" = "xno"
974 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
975 have_clock_gettime="yes"])
977 if test "x$have_clock_gettime" = "xyes"
979 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
982 nanosleep_needs_rt="no"
983 nanosleep_needs_posix4="no"
984 AC_CHECK_FUNCS(nanosleep,
986 AC_CHECK_LIB(rt, nanosleep,
987 [nanosleep_needs_rt="yes"],
988 AC_CHECK_LIB(posix4, nanosleep,
989 [nanosleep_needs_posix4="yes"],
990 AC_MSG_ERROR(cannot find nanosleep))))
992 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
993 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
995 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
996 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
997 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
998 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
999 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
1000 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
1001 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
1002 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
1003 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
1004 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
1005 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
1006 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
1008 # Check for strptime {{{
1009 if test "x$GCC" = "xyes"
1011 SAVE_CFLAGS="$CFLAGS"
1012 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
1015 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
1016 if test "x$have_strptime" = "xyes"
1018 AC_CACHE_CHECK([whether strptime is exported by default],
1019 [c_cv_have_strptime_default],
1020 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1026 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1029 [c_cv_have_strptime_default="yes"],
1030 [c_cv_have_strptime_default="no"]))
1032 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
1034 AC_CACHE_CHECK([whether strptime needs standards mode],
1035 [c_cv_have_strptime_standards],
1036 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1038 #ifndef _ISOC99_SOURCE
1039 # define _ISOC99_SOURCE 1
1041 #ifndef _POSIX_C_SOURCE
1042 # define _POSIX_C_SOURCE 200112L
1044 #ifndef _XOPEN_SOURCE
1045 # define _XOPEN_SOURCE 500
1051 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1054 [c_cv_have_strptime_standards="yes"],
1055 [c_cv_have_strptime_standards="no"]))
1057 if test "x$c_cv_have_strptime_standards" = "xyes"
1059 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
1065 if test "x$GCC" = "xyes"
1067 CFLAGS="$SAVE_CFLAGS"
1069 # }}} Check for strptime
1071 # Check for timegm {{{
1073 # These checks need -Werror because implicit function declarations are only a
1075 SAVE_CFLAGS="$CFLAGS"
1076 CFLAGS="$CFLAGS -Werror"
1078 AC_CACHE_CHECK([for timegm],
1083 #if STRPTIME_NEEDS_STANDARDS
1084 # ifndef _ISOC99_SOURCE
1085 # define _ISOC99_SOURCE 1
1087 # ifndef _POSIX_C_SOURCE
1088 # define _POSIX_C_SOURCE 200112L
1090 # ifndef _XOPEN_SOURCE
1091 # define _XOPEN_SOURCE 500
1097 time_t t = timegm(&(struct tm){0});
1098 if (t == ((time_t) -1)) {
1103 [c_cv_have_timegm="yes"],
1104 [c_cv_have_timegm="no"]
1108 if test "x$c_cv_have_timegm" != "xyes"
1110 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1111 [c_cv_have_timegm_bsd],
1115 #if STRPTIME_NEEDS_STANDARDS
1116 # ifndef _ISOC99_SOURCE
1117 # define _ISOC99_SOURCE 1
1119 # ifndef _POSIX_C_SOURCE
1120 # define _POSIX_C_SOURCE 200112L
1122 # ifndef _XOPEN_SOURCE
1123 # define _XOPEN_SOURCE 500
1127 # define _BSD_SOURCE 1
1132 time_t t = timegm(&(struct tm){0});
1133 if (t == ((time_t) -1)) {
1138 [c_cv_have_timegm_bsd="yes"
1139 c_cv_have_timegm="yes"],
1140 [c_cv_have_timegm_bsd="no"]
1145 if test "x$c_cv_have_timegm" = "xyes"
1147 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1148 if test "x$c_cv_have_timegm_bsd" = "xyes"
1150 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1154 CFLAGS="$SAVE_CFLAGS"
1155 # }}} Check for timegm
1157 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
1158 if test "x$have_swapctl" = "xyes"; then
1159 AC_CACHE_CHECK([whether swapctl takes two arguments],
1160 [c_cv_have_swapctl_two_args],
1161 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1163 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1164 # undef _FILE_OFFSET_BITS
1165 # undef _LARGEFILE64_SOURCE
1167 #include <sys/stat.h>
1168 #include <sys/param.h>
1169 #include <sys/swap.h>
1173 int num = swapctl(0, NULL);
1176 [c_cv_have_swapctl_two_args="yes"],
1177 [c_cv_have_swapctl_two_args="no"]
1180 AC_CACHE_CHECK([whether swapctl takes three arguments],
1181 [c_cv_have_swapctl_three_args],
1185 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1186 # undef _FILE_OFFSET_BITS
1187 # undef _LARGEFILE64_SOURCE
1189 #include <sys/stat.h>
1190 #include <sys/param.h>
1191 #include <sys/swap.h>
1195 int num = swapctl(0, NULL, 0);
1198 [c_cv_have_swapctl_three_args="yes"],
1199 [c_cv_have_swapctl_three_args="no"]
1203 # Check for different versions of `swapctl' here..
1204 if test "x$have_swapctl" = "xyes"; then
1205 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1206 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
1207 [Define if the function swapctl exists and takes two arguments.])
1209 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1210 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
1211 [Define if the function swapctl exists and takes three arguments.])
1216 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1218 if test "x$withval" = "xno"; then
1220 else if test "x$withval" = "xyes"; then
1227 if test "x$nan_type" = "xnone"; then
1228 AC_CACHE_CHECK([whether NAN is defined by default],
1229 [c_cv_have_nan_default],
1230 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1234 static double foo = NAN;
1243 [c_cv_have_nan_default="yes"],
1244 [c_cv_have_nan_default="no"]
1247 if test "x$c_cv_have_nan_default" = "xyes"
1252 if test "x$nan_type" = "xnone"; then
1253 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1254 [c_cv_have_nan_isoc],
1255 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1258 #define __USE_ISOC99 1
1260 static double foo = NAN;
1269 [c_cv_have_nan_isoc="yes"],
1270 [c_cv_have_nan_isoc="no"]
1273 if test "x$c_cv_have_nan_isoc" = "xyes"
1278 if test "x$nan_type" = "xnone"; then
1279 SAVE_LDFLAGS=$LDFLAGS
1280 LDFLAGS="$LDFLAGS -lm"
1281 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1282 [c_cv_have_nan_zero],
1283 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1290 #define NAN (0.0 / 0.0)
1292 # define isnan(f) ((f) != (f))
1294 static double foo = NAN;
1303 [c_cv_have_nan_zero="yes"],
1304 [c_cv_have_nan_zero="no"]
1307 LDFLAGS=$SAVE_LDFLAGS
1308 if test "x$c_cv_have_nan_zero" = "xyes"
1314 if test "x$nan_type" = "xdefault"; then
1315 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1316 [Define if NAN is defined by default and can initialize static variables.])
1317 else if test "x$nan_type" = "xisoc99"; then
1318 AC_DEFINE(NAN_STATIC_ISOC, 1,
1319 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1320 else if test "x$nan_type" = "xzero"; then
1321 AC_DEFINE(NAN_ZERO_ZERO, 1,
1322 [Define if NAN can be defined as (0.0 / 0.0)])
1324 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1327 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1329 if test "x$withval" = "xnothing"; then
1330 fp_layout_type="nothing"
1331 else if test "x$withval" = "xendianflip"; then
1332 fp_layout_type="endianflip"
1333 else if test "x$withval" = "xintswap"; then
1334 fp_layout_type="intswap"
1336 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1339 [fp_layout_type="unknown"])
1341 if test "x$fp_layout_type" = "xunknown"; then
1342 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1343 [c_cv_fp_layout_need_nothing],
1344 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1350 # include <stdint.h>
1353 # include <inttypes.h>
1356 # include <stdbool.h>
1366 memcpy ((void *) &i0, (void *) &d, 8);
1369 memcpy ((void *) c, (void *) &i1, 8);
1371 if ((c[0] == 0x2f) && (c[1] == 0x25)
1372 && (c[2] == 0xc0) && (c[3] == 0xc7)
1373 && (c[4] == 0x43) && (c[5] == 0x2b)
1374 && (c[6] == 0x1f) && (c[7] == 0x5b))
1380 [c_cv_fp_layout_need_nothing="yes"],
1381 [c_cv_fp_layout_need_nothing="no"]
1384 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1385 fp_layout_type="nothing"
1388 if test "x$fp_layout_type" = "xunknown"; then
1389 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1390 [c_cv_fp_layout_need_endianflip],
1391 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1397 # include <stdint.h>
1400 # include <inttypes.h>
1403 # include <stdbool.h>
1405 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1406 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1407 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1408 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1409 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1410 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1411 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1412 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1421 memcpy ((void *) &i0, (void *) &d, 8);
1423 i1 = endianflip (i0);
1424 memcpy ((void *) c, (void *) &i1, 8);
1426 if ((c[0] == 0x2f) && (c[1] == 0x25)
1427 && (c[2] == 0xc0) && (c[3] == 0xc7)
1428 && (c[4] == 0x43) && (c[5] == 0x2b)
1429 && (c[6] == 0x1f) && (c[7] == 0x5b))
1435 [c_cv_fp_layout_need_endianflip="yes"],
1436 [c_cv_fp_layout_need_endianflip="no"]
1439 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1440 fp_layout_type="endianflip"
1443 if test "x$fp_layout_type" = "xunknown"; then
1444 AC_CACHE_CHECK([if intswap converts to x86 representation],
1445 [c_cv_fp_layout_need_intswap],
1446 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1452 # include <stdint.h>
1455 # include <inttypes.h>
1458 # include <stdbool.h>
1460 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1461 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1470 memcpy ((void *) &i0, (void *) &d, 8);
1473 memcpy ((void *) c, (void *) &i1, 8);
1475 if ((c[0] == 0x2f) && (c[1] == 0x25)
1476 && (c[2] == 0xc0) && (c[3] == 0xc7)
1477 && (c[4] == 0x43) && (c[5] == 0x2b)
1478 && (c[6] == 0x1f) && (c[7] == 0x5b))
1484 [c_cv_fp_layout_need_intswap="yes"],
1485 [c_cv_fp_layout_need_intswap="no"]
1488 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1489 fp_layout_type="intswap"
1493 if test "x$fp_layout_type" = "xnothing"; then
1494 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1495 [Define if doubles are stored in x86 representation.])
1496 else if test "x$fp_layout_type" = "xendianflip"; then
1497 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1498 [Define if endianflip is needed to convert to x86 representation.])
1499 else if test "x$fp_layout_type" = "xintswap"; then
1500 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1501 [Define if intswap is needed to convert to x86 representation.])
1503 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1506 # --with-useragent {{{
1507 AC_ARG_WITH(useragent, [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1509 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1511 AC_DEFINE_UNQUOTED(COLLECTD_USERAGENT, ["$withval"], [User agent for http requests])
1517 # --with-data-max-name-len {{{
1518 AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1520 if test "x$withval" != "x" && test $withval -gt 0
1522 AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
1524 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1527 [ AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
1532 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1533 have_getvfsstat="no"
1534 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1535 have_listmntent="no"
1536 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1537 have_getmntent_r="no"
1538 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1541 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1542 if test "x$have_getmntent" = "xno"; then
1543 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1545 if test "x$have_getmntent" = "xno"; then
1546 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1548 if test "x$have_getmntent" = "xno"; then
1549 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1552 if test "x$have_getmntent" = "xc"; then
1553 AC_CACHE_CHECK([whether getmntent takes one argument],
1554 [c_cv_have_one_getmntent],
1558 #include "$srcdir/src/utils_mount.h"
1563 fh = setmntent ("/etc/mtab", "r");
1564 me = getmntent (fh);
1565 return(me->mnt_passno);
1568 [c_cv_have_one_getmntent="yes"],
1569 [c_cv_have_one_getmntent="no"]
1572 AC_CACHE_CHECK([whether getmntent takes two arguments],
1573 [c_cv_have_two_getmntent],
1577 #include "$srcdir/src/utils_mount.h"
1583 fh = fopen ("/etc/mnttab", "r");
1584 status = getmntent (fh, &mt);
1588 [c_cv_have_two_getmntent="yes"],
1589 [c_cv_have_two_getmntent="no"]
1594 # Check for different versions of `getmntent' here..
1596 if test "x$have_getmntent" = "xc"; then
1597 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1598 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1599 [Define if the function getmntent exists and takes one argument.])
1601 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1602 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1603 [Define if the function getmntent exists and takes two arguments.])
1606 if test "x$have_getmntent" = "xsun"; then
1607 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1608 [Define if the function getmntent exists. It is the version from libsun.])
1610 if test "x$have_getmntent" = "xseq"; then
1611 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1612 [Define if the function getmntent exists. It is the version from libseq.])
1614 if test "x$have_getmntent" = "xgen"; then
1615 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1616 [Define if the function getmntent exists. It is the version from libgen.])
1620 AC_CACHE_CHECK([if have htonll defined],
1622 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1624 #include <sys/types.h>
1625 #include <netinet/in.h>
1627 # include <inttypes.h>
1634 [c_cv_have_htonll="yes"],
1635 [c_cv_have_htonll="no"]
1638 if test "x$c_cv_have_htonll" = "xyes"
1640 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1643 # Check for structures
1644 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1645 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1648 #include <sys/types.h>
1649 #include <sys/socket.h>
1652 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1653 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1656 #include <sys/types.h>
1657 #include <sys/socket.h>
1658 #include <linux/if.h>
1659 #include <linux/netdevice.h>
1661 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1662 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1665 #include <linux/inet_diag.h>
1669 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1672 #include <netinet/in.h>
1676 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1678 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1679 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1680 have_struct_kinfo_proc_freebsd="yes"
1683 have_struct_kinfo_proc_freebsd="no"
1687 #include <sys/param.h>
1688 #include <sys/sysctl.h>
1689 #include <sys/user.h>
1692 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1694 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1695 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1696 have_struct_kinfo_proc_openbsd="yes"
1699 have_struct_kinfo_proc_openbsd="no"
1702 #include <sys/param.h>
1703 #include <sys/sysctl.h>
1708 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1710 AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
1711 [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1712 have_struct_kinfo_proc2_netbsd="yes"
1715 have_struct_kinfo_proc2_netbsd="no"
1718 #include <sys/param.h>
1719 #include <sys/sysctl.h>
1725 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1726 [#define _BSD_SOURCE
1727 #define _DEFAULT_SOURCE
1729 # include <stdint.h>
1731 #if HAVE_SYS_TYPES_H
1732 # include <sys/types.h>
1734 #if HAVE_NETINET_IN_SYSTM_H
1735 # include <netinet/in_systm.h>
1737 #if HAVE_NETINET_IN_H
1738 # include <netinet/in.h>
1740 #if HAVE_NETINET_IP_H
1741 # include <netinet/ip.h>
1743 #if HAVE_NETINET_UDP_H
1744 # include <netinet/udp.h>
1747 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1748 [#define _BSD_SOURCE
1749 #define _DEFAULT_SOURCE
1751 # include <stdint.h>
1753 #if HAVE_SYS_TYPES_H
1754 # include <sys/types.h>
1756 #if HAVE_NETINET_IN_SYSTM_H
1757 # include <netinet/in_systm.h>
1759 #if HAVE_NETINET_IN_H
1760 # include <netinet/in.h>
1762 #if HAVE_NETINET_IP_H
1763 # include <netinet/ip.h>
1765 #if HAVE_NETINET_UDP_H
1766 # include <netinet/udp.h>
1770 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1779 # check for pthread_setname_np
1780 SAVE_LDFLAGS="$LDFLAGS"
1781 LDFLAGS="$LDFLAGS -lpthread"
1783 AC_MSG_CHECKING([for pthread_setname_np])
1784 have_pthread_setname_np="no"
1785 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1788 #include <pthread.h>
1791 pthread_setname_np((pthread_t) {0}, "conftest");
1794 have_pthread_setname_np="yes"
1795 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1798 AC_MSG_RESULT([$have_pthread_setname_np])
1800 # check for pthread_set_name_np(3) (FreeBSD)
1801 AC_MSG_CHECKING([for pthread_set_name_np])
1802 have_pthread_set_name_np="no"
1803 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1805 #include <pthread_np.h>
1808 pthread_set_name_np((pthread_t) {0}, "conftest");
1811 have_pthread_set_name_np="yes"
1812 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1814 AC_MSG_RESULT([$have_pthread_set_name_np])
1816 LDFLAGS="$SAVE_LDFLAGS"
1819 # Checks for libraries begin here
1822 with_libresolv="yes"
1823 AC_CHECK_LIB(resolv, res_search,
1825 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1827 [with_libresolv="no"])
1828 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1830 dnl Check for HAL (hardware abstraction library)
1832 PKG_CHECK_MODULES([HAL], [hal],
1835 LIBS="$HAL_LIBS $LIBS"
1836 AC_CHECK_LIB([hal], [libhal_device_property_exists],
1838 SAVE_CPPFLAGS="$CPPFLAGS"
1839 CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
1840 AC_CHECK_HEADERS([libhal.h],
1843 BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
1844 BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
1846 CPPFLAGS="$SAVE_CPPFLAGS"
1854 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1855 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1859 AC_CHECK_LIB([pthread],
1862 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
1865 PTHREAD_LIBS="$LIBS"
1868 AC_CHECK_HEADERS([pthread.h],
1870 [AC_MSG_ERROR([pthread.h not found])]
1872 AC_SUBST([PTHREAD_LIBS])
1874 m4_divert_once([HELP_WITH], [
1875 collectd additional packages:])
1877 if test "x$ac_system" = "xAIX"
1882 with_perfstat="no (AIX only)"
1883 with_procinfo="no (AIX only)"
1886 if test "x$with_perfstat" = "xyes"
1888 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1889 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1891 if test "x$with_perfstat" = "xyes"
1893 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1894 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1895 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1896 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1898 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1901 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1903 # Processes plugin under AIX.
1904 if test "x$with_procinfo" = "xyes"
1906 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1908 if test "x$with_procinfo" = "xyes"
1910 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1913 if test "x$ac_system" = "xSolaris"
1918 with_kstat="no (Solaris only)"
1919 with_devinfo="no (Solaris only)"
1922 if test "x$with_kstat" = "xyes"
1924 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1926 if test "x$with_kstat" = "xyes"
1928 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1929 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1931 if test "x$with_kstat" = "xyes"
1933 AC_DEFINE(HAVE_LIBKSTAT, 1,
1934 [Define to 1 if you have the 'kstat' library (-lkstat)])
1936 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1937 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1940 if test "x$ac_system" = "xDarwin"
1946 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1949 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1950 if test "x$with_kvm_getprocs" = "xyes"
1952 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1953 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1956 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1958 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1959 if test "x$with_kvm_getswapinfo" = "xyes"
1961 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1962 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1965 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1967 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1968 if test "x$with_kvm_nlist" = "xyes"
1970 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1971 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1972 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1975 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1977 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1978 if test "x$with_kvm_openfiles" = "xyes"
1980 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1981 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1984 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1986 # --with-libaquaero5 {{{
1987 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1989 if test "x$withval" = "xyes"
1991 with_libaquaero5="yes"
1992 else if test "x$withval" = "xno"
1994 with_libaquaero5="no"
1996 with_libaquaero5="yes"
1997 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1998 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
2001 [with_libaquaero5="yes"])
2003 SAVE_CPPFLAGS="$CPPFLAGS"
2004 SAVE_LDFLAGS="$LDFLAGS"
2006 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
2007 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
2009 if test "x$with_libaquaero5" = "xyes"
2011 if test "x$LIBAQUAERO5_CFLAGS" != "x"
2013 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
2015 AC_CHECK_HEADERS(libaquaero5.h,
2016 [with_libaquaero5="yes"],
2017 [with_libaquaero5="no (libaquaero5.h not found)"])
2019 if test "x$with_libaquaero5" = "xyes"
2021 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
2023 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
2025 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
2026 [with_libaquaero5="yes"],
2027 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
2030 CPPFLAGS="$SAVE_CPPFLAGS"
2031 LDFLAGS="$SAVE_LDFLAGS"
2033 if test "x$with_libaquaero5" = "xyes"
2035 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2036 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2037 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
2038 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
2040 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
2043 # --with-libhiredis {{{
2044 AC_ARG_WITH(libhiredis, [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@],
2045 [Path to libhiredis.])],
2047 if test "x$withval" = "xyes"
2049 with_libhiredis="yes"
2050 else if test "x$withval" = "xno"
2052 with_libhiredis="no"
2054 with_libhiredis="yes"
2055 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2056 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2059 [with_libhiredis="yes"])
2061 SAVE_CPPFLAGS="$CPPFLAGS"
2062 SAVE_LDFLAGS="$LDFLAGS"
2064 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2065 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2067 if test "x$with_libhiredis" = "xyes"
2069 if test "x$LIBHIREDIS_CPPFLAGS" != "x"
2071 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
2073 AC_CHECK_HEADERS(hiredis/hiredis.h,
2074 [with_libhiredis="yes"],
2075 [with_libhiredis="no (hiredis.h not found)"])
2077 if test "x$with_libhiredis" = "xyes"
2079 if test "x$LIBHIREDIS_LDFLAGS" != "x"
2081 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
2083 AC_CHECK_LIB(hiredis, redisCommand,
2084 [with_libhiredis="yes"],
2085 [with_libhiredis="no (symbol 'redisCommand' not found)"])
2089 CPPFLAGS="$SAVE_CPPFLAGS"
2090 LDFLAGS="$SAVE_LDFLAGS"
2092 if test "x$with_libhiredis" = "xyes"
2094 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2095 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2096 AC_SUBST(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
2097 AC_SUBST(BUILD_WITH_LIBHIREDIS_LDFLAGS)
2099 AM_CONDITIONAL(BUILD_WITH_LIBHIREDIS, test "x$with_libhiredis" = "xyes")
2102 # --with-libcurl {{{
2103 with_curl_config="curl-config"
2106 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2108 if test "x$withval" = "xno"
2111 else if test "x$withval" = "xyes"
2115 if test -f "$withval" && test -x "$withval"
2117 with_curl_config="$withval"
2119 else if test -x "$withval/bin/curl-config"
2121 with_curl_config="$withval/bin/curl-config"
2130 if test "x$with_libcurl" = "xyes"
2132 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2133 curl_config_status=$?
2135 if test $curl_config_status -ne 0
2137 with_libcurl="no ($with_curl_config failed)"
2139 SAVE_CPPFLAGS="$CPPFLAGS"
2140 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2142 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
2144 CPPFLAGS="$SAVE_CPPFLAGS"
2147 if test "x$with_libcurl" = "xyes"
2149 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2150 curl_config_status=$?
2152 if test $curl_config_status -ne 0
2154 with_libcurl="no ($with_curl_config failed)"
2156 AC_CHECK_LIB(curl, curl_easy_init,
2157 [with_libcurl="yes"],
2158 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2160 AC_CHECK_DECL(CURLOPT_USERNAME,
2161 [have_curlopt_username="yes"],
2162 [have_curlopt_username="no"],
2163 [[#include <curl/curl.h>]])
2164 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2165 [have_curlopt_timeout="yes"],
2166 [have_curlopt_timeout="no"],
2167 [[#include <curl/curl.h>]])
2170 if test "x$with_libcurl" = "xyes"
2172 SAVE_CPPFLAGS="$CPPFLAGS"
2173 SAVE_LDFLAGS="$LDFLAGS"
2174 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2175 LDFLAGS="$LDFLAGS $with_curl_libs"
2176 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2177 [c_cv_have_curlinfo_appconnect_time],
2178 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2180 #include <curl/curl.h>
2183 int val = CURLINFO_APPCONNECT_TIME;
2187 [c_cv_have_curlinfo_appconnect_time="yes"],
2188 [c_cv_have_curlinfo_appconnect_time="no"]
2191 CPPFLAGS="$SAVE_CPPFLAGS"
2192 LDFLAGS="$SAVE_LDFLAGS"
2194 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
2195 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
2197 AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
2200 if test "x$with_libcurl" = "xyes"
2202 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2203 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2204 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2205 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2207 if test "x$have_curlopt_username" = "xyes"
2209 AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
2212 if test "x$have_curlopt_timeout" = "xyes"
2214 AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
2220 with_libdbi_cppflags=""
2221 with_libdbi_ldflags=""
2222 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2224 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2226 with_libdbi_cppflags="-I$withval/include"
2227 with_libdbi_ldflags="-L$withval/lib"
2230 with_libdbi="$withval"
2236 if test "x$with_libdbi" = "xyes"
2238 SAVE_CPPFLAGS="$CPPFLAGS"
2239 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2241 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
2243 CPPFLAGS="$SAVE_CPPFLAGS"
2245 if test "x$with_libdbi" = "xyes"
2247 SAVE_CPPFLAGS="$CPPFLAGS"
2248 SAVE_LDFLAGS="$LDFLAGS"
2249 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2250 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2252 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
2254 CPPFLAGS="$SAVE_CPPFLAGS"
2255 LDFLAGS="$SAVE_LDFLAGS"
2257 if test "x$with_libdbi" = "xyes"
2259 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2260 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2261 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2262 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2263 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2264 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2266 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
2269 # --with-libesmtp {{{
2270 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2272 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2274 LDFLAGS="$LDFLAGS -L$withval/lib"
2275 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
2278 with_libesmtp="$withval"
2284 if test "x$with_libesmtp" = "xyes"
2286 AC_CHECK_LIB(esmtp, smtp_create_session,
2288 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
2289 ], [with_libesmtp="no (libesmtp not found)"])
2291 if test "x$with_libesmtp" = "xyes"
2293 AC_CHECK_HEADERS(libesmtp.h,
2295 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
2296 ], [with_libesmtp="no (libesmtp.h not found)"])
2298 if test "x$with_libesmtp" = "xyes"
2304 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
2305 [Wether or not to use the esmtp library])
2306 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
2309 # --with-libganglia {{{
2310 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2312 if test -f "$withval" && test -x "$withval"
2314 with_libganglia_config="$withval"
2315 with_libganglia="yes"
2316 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
2318 with_libganglia_config="$withval/bin/ganglia-config"
2319 with_libganglia="yes"
2320 else if test -d "$withval"
2322 GANGLIA_CPPFLAGS="-I$withval/include"
2323 GANGLIA_LDFLAGS="-L$withval/lib"
2324 with_libganglia="yes"
2326 with_libganglia="$withval"
2330 with_libganglia="yes"
2333 if test "x$with_libganglia" = "xyes"
2335 if test "x$with_libganglia_config" != "x"
2337 if test "x$GANGLIA_CPPFLAGS" = "x"
2339 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2342 if test "x$GANGLIA_LDFLAGS" = "x"
2344 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2347 if test "x$GANGLIA_LIBS" = "x"
2349 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2352 GANGLIA_LIBS="-lganglia"
2356 SAVE_CPPFLAGS="$CPPFLAGS"
2357 SAVE_LDFLAGS="$LDFLAGS"
2358 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2359 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2361 if test "x$with_libganglia" = "xyes"
2363 AC_CHECK_HEADERS(gm_protocol.h,
2365 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
2366 [Define to 1 if you have the <gm_protocol.h> header file.])
2367 ], [with_libganglia="no (gm_protocol.h not found)"])
2370 if test "x$with_libganglia" = "xyes"
2372 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
2374 AC_DEFINE(HAVE_LIBGANGLIA, 1,
2375 [Define to 1 if you have the ganglia library (-lganglia).])
2376 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
2379 CPPFLAGS="$SAVE_CPPFLAGS"
2380 LDFLAGS="$SAVE_LDFLAGS"
2382 AC_SUBST(GANGLIA_CPPFLAGS)
2383 AC_SUBST(GANGLIA_LDFLAGS)
2384 AC_SUBST(GANGLIA_LIBS)
2385 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
2388 # --with-libgcrypt {{{
2389 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2390 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2391 GCRYPT_LIBS="$GCRYPT_LIBS"
2392 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2394 if test -f "$withval" && test -x "$withval"
2396 with_libgcrypt_config="$withval"
2397 with_libgcrypt="yes"
2398 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
2400 with_libgcrypt_config="$withval/bin/gcrypt-config"
2401 with_libgcrypt="yes"
2402 else if test -d "$withval"
2404 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2405 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2406 with_libgcrypt="yes"
2408 with_libgcrypt_config="gcrypt-config"
2409 with_libgcrypt="$withval"
2413 with_libgcrypt_config="libgcrypt-config"
2414 with_libgcrypt="yes"
2417 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2419 if test "x$GCRYPT_CPPFLAGS" = "x"
2421 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2424 if test "x$GCRYPT_LIBS" = "x"
2426 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2430 SAVE_CPPFLAGS="$CPPFLAGS"
2431 SAVE_LDFLAGS="$LDFLAGS"
2433 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2434 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2435 LIBS="$LIBS $GCRYPT_LIBS"
2437 if test "x$with_libgcrypt" = "xyes"
2439 if test "x$GCRYPT_CPPFLAGS" != "x"
2441 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2443 AC_CHECK_HEADERS(gcrypt.h,
2444 [with_libgcrypt="yes"],
2445 [with_libgcrypt="no (gcrypt.h not found)"])
2448 if test "x$with_libgcrypt" = "xyes"
2450 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2451 [with_libgcrypt="yes"],
2452 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2455 CPPFLAGS="$SAVE_CPPFLAGS"
2456 LDFLAGS="$SAVE_LDFLAGS"
2459 if test "x$with_libgcrypt" = "xyes"
2461 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2464 AC_SUBST(GCRYPT_CPPFLAGS)
2465 AC_SUBST(GCRYPT_LDFLAGS)
2466 AC_SUBST(GCRYPT_LIBS)
2467 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2471 with_libgps_cflags=""
2472 with_libgps_ldflags=""
2473 AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2475 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2477 with_libgps_cflags="-I$withval/include"
2478 with_libgps_ldflags="-L$withval/lib"
2481 with_libgps="$withval"
2487 if test "x$with_libgps" = "xyes"
2489 SAVE_CFLAGS="$CFLAGS"
2490 CFLAGS="$CFLAGS $with_libgps_cflags"
2492 AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
2494 CFLAGS="$SAVE_CFLAGS"
2496 if test "x$with_libgps" = "xyes"
2498 SAVE_CFLAGS="$CFLAGS"
2499 SAVE_LDFLAGS="$LDFLAGS"
2500 CFLAGS="$CFLAGS $with_libgps_cflags"
2501 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2503 AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
2505 CFLAGS="$SAVE_CFLAGS"
2506 LDFLAGS="$SAVE_LDFLAGS"
2508 if test "x$with_libgps" = "xyes"
2510 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2511 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2512 BUILD_WITH_LIBGPS_LIBS="-lgps"
2513 AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
2514 AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
2515 AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
2517 AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
2520 # --with-libgrpc++ {{{
2521 with_libgrpcpp_cppflags=""
2522 with_libgrpcpp_ldflags=""
2523 AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2525 with_grpcpp="$withval"
2526 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2528 with_libgrpcpp_cppflags="-I$withval/include"
2529 with_libgrpcpp_ldflags="-L$withval/lib"
2530 with_libgrpcpp="yes"
2532 if test "x$withval" = "xno"
2534 with_libgrpcpp="no (disabled on command line)"
2539 if test "x$withval" = "xyes"
2541 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2542 [with_libgrpcpp="yes"],
2543 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2547 if test "x$withval" != "xno"
2549 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2550 if test_cxx_flags -std=c++11; then
2551 AC_MSG_RESULT([yes])
2554 with_libgrpcpp="no (requires C++11 support)"
2558 if test "x$with_libgrpcpp" = "xyes"
2561 SAVE_CPPFLAGS="$CPPFLAGS"
2562 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2563 AC_CHECK_HEADERS([grpc++/grpc++.h], [],
2564 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2566 CPPFLAGS="$SAVE_CPPFLAGS"
2569 if test "x$with_libgrpcpp" = "xyes"
2572 SAVE_CPPFLAGS="$CPPFLAGS"
2573 SAVE_LDFLAGS="$LDFLAGS"
2575 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2576 LDFLAGS="$with_libgrpcpp_ldflags"
2577 if test "x$GRPCPP_LIBS" = "x"
2585 [[#include <grpc++/grpc++.h>]],
2586 [[grpc::ServerBuilder sb;]]
2589 with_libgrpcpp="yes"
2590 if test "x$GRPCPP_LIBS" = "x"
2592 GRPCPP_LIBS="-lgrpc++"
2595 [with_libgrpcpp="no (libgrpc++ not found)"]
2597 CPPFLAGS="$SAVE_CPPFLAGS"
2598 LDFLAGS="$SAVE_LDFLAGS"
2602 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2603 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2604 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2605 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2606 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2607 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2610 # --with-libiptc {{{
2611 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2613 if test "x$withval" = "xyes"
2615 with_libiptc="pkgconfig"
2616 else if test "x$withval" = "xno"
2621 with_libiptc_cflags="-I$withval/include"
2622 with_libiptc_libs="-L$withval/lib"
2626 if test "x$ac_system" = "xLinux"
2628 with_libiptc="pkgconfig"
2630 with_libiptc="no (Linux only)"
2634 if test "x$with_libiptc" = "xpkgconfig"
2636 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2639 with_libiptc="no (pkg-config doesn't know libiptc)"
2642 if test "x$with_libiptc" = "xpkgconfig"
2644 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2647 with_libiptc="no ($PKG_CONFIG failed)"
2649 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2652 with_libiptc="no ($PKG_CONFIG failed)"
2656 SAVE_CPPFLAGS="$CPPFLAGS"
2657 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2659 # check whether the header file for libiptc is available.
2660 if test "x$with_libiptc" = "xpkgconfig"
2662 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2663 [with_libiptc="no (header file missing)"])
2665 # If the header file is available, check for the required type declaractions.
2666 # They may be missing in old versions of libiptc. In that case, they will be
2667 # declared in the iptables plugin.
2668 if test "x$with_libiptc" = "xpkgconfig"
2670 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2672 # Check for the iptc_init symbol in the library.
2673 # This could be in iptc or ip4tc
2674 if test "x$with_libiptc" = "xpkgconfig"
2677 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2678 [with_libiptc="pkgconfig"],
2679 [with_libiptc="no"],
2680 [$with_libiptc_libs])
2683 if test "x$with_libiptc" = "xpkgconfig"
2688 CPPFLAGS="$SAVE_CPPFLAGS"
2690 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2691 if test "x$with_libiptc" = "xyes"
2693 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2694 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2695 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2696 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2700 # --with-libdpdk {{{
2701 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2702 AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
2703 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2704 AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
2706 AC_ARG_WITH([libdpdk],
2707 [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
2708 [with_libdpdk="$withval"],
2709 [with_libdpdk="yes"]
2712 if test "x$with_libdpdk" != "xno"; then
2713 PKG_CHECK_MODULES([DPDK], [libdpdk], [],
2714 [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
2715 if test "x$LIBDPDK_CPPFLAGS" = "x"; then
2716 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2718 if test "x$LIBDPDK_CFLAGS" = "x"; then
2719 LIBDPDK_CFLAGS="$DPDK_CFLAGS"
2720 LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
2722 if test "x$LIBDPDK_LIBS" = "x"; then
2723 if test "x$DPDK_LIBS" != "x"; then
2724 LIBDPDK_LIBS="$DPDK_LIBS"
2726 LIBDPDK_LIBS="-ldpdk"
2729 SAVE_CPPFLAGS="$CPPFLAGS"
2730 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2731 SAVE_CFLAGS="$CFLAGS"
2732 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2733 AC_CHECK_HEADERS([rte_config.h],
2740 #include <rte_version.h>
2741 #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
2742 #error "required DPDK >= 16.07"
2747 [dpdk_keepalive="yes"],
2748 [dpdk_keepalive="no (DPDK version < 16.07)"]
2751 [with_libdpdk="no (rte_config.h not found)"]
2753 CPPFLAGS="$SAVE_CPPFLAGS"
2754 CFLAGS="$SAVE_CFLAGS"
2757 if test "x$with_libdpdk" = "xyes"; then
2758 SAVE_LDFLAGS="$LDFLAGS"
2759 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2760 AC_CHECK_LIB([dpdk], [rte_eal_init],
2761 [with_libdpdk="yes"],
2762 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2764 LDFLAGS="$SAVE_LDFLAGS"
2770 with_java_home="$JAVA_HOME"
2771 if test "x$with_java_home" = "x"
2773 with_java_home="/usr/lib/jvm"
2777 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2779 if test "x$withval" = "xno"
2782 else if test "x$withval" = "xyes"
2786 with_java_home="$withval"
2791 if test "x$with_java" = "xyes"
2793 if test -d "$with_java_home"
2795 AC_MSG_CHECKING([for jni.h])
2796 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -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_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2802 AC_MSG_RESULT([not found])
2805 AC_MSG_CHECKING([for jni_md.h])
2806 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2807 if test "x$TMPVAR" != "x"
2809 AC_MSG_RESULT([found in $TMPVAR])
2810 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2812 AC_MSG_RESULT([not found])
2815 AC_MSG_CHECKING([for libjvm.so])
2816 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`
2817 if test "x$TMPVAR" != "x"
2819 AC_MSG_RESULT([found in $TMPVAR])
2820 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2822 AC_MSG_RESULT([not found])
2825 if test "x$JAVAC" = "x"
2827 AC_MSG_CHECKING([for javac])
2828 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2829 if test "x$TMPVAR" != "x"
2832 AC_MSG_RESULT([$JAVAC])
2834 AC_MSG_RESULT([not found])
2837 if test "x$JAR" = "x"
2839 AC_MSG_CHECKING([for jar])
2840 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2841 if test "x$TMPVAR" != "x"
2844 AC_MSG_RESULT([$JAR])
2846 AC_MSG_RESULT([not found])
2849 else if test "x$with_java_home" != "x"
2851 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2855 if test "x$JAVA_CPPFLAGS" != "x"
2857 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2859 if test "x$JAVA_CFLAGS" != "x"
2861 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2863 if test "x$JAVA_LDFLAGS" != "x"
2865 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2867 if test "x$JAVA_LIBS" != "x"
2869 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2871 if test "x$JAVAC" = "x"
2873 with_javac_path="$PATH"
2874 if test "x$with_java_home" != "x"
2876 with_javac_path="$with_java_home:with_javac_path"
2877 if test -d "$with_java_home/bin"
2879 with_javac_path="$with_java_home/bin:with_javac_path"
2883 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2885 if test "x$JAVAC" = "x"
2887 with_java="no (javac not found)"
2889 if test "x$JAR" = "x"
2891 with_jar_path="$PATH"
2892 if test "x$with_java_home" != "x"
2894 with_jar_path="$with_java_home:$with_jar_path"
2895 if test -d "$with_java_home/bin"
2897 with_jar_path="$with_java_home/bin:$with_jar_path"
2901 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2903 if test "x$JAR" = "x"
2905 with_java="no (jar not found)"
2908 SAVE_CPPFLAGS="$CPPFLAGS"
2909 SAVE_CFLAGS="$CFLAGS"
2910 SAVE_LDFLAGS="$LDFLAGS"
2912 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2913 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2914 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2915 LIBS="$LIBS $JAVA_LIBS"
2917 if test "x$with_java" = "xyes"
2919 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2921 if test "x$with_java" = "xyes"
2923 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2925 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2926 [$JAVA_LIBS $PTHREAD_LIBS])
2928 if test "x$with_java" = "xyes"
2930 JAVA_LIBS="$JAVA_LIBS -ljvm"
2931 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2934 CPPFLAGS="$SAVE_CPPFLAGS"
2935 CFLAGS="$SAVE_CFLAGS"
2936 LDFLAGS="$SAVE_LDFLAGS"
2939 AC_SUBST(JAVA_CPPFLAGS)
2940 AC_SUBST(JAVA_CFLAGS)
2941 AC_SUBST(JAVA_LDFLAGS)
2943 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2946 # --with-libldap {{{
2947 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2949 if test "x$withval" = "xyes"
2952 else if test "x$withval" = "xno"
2957 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2958 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2961 [with_libldap="yes"])
2963 SAVE_CPPFLAGS="$CPPFLAGS"
2964 SAVE_LDFLAGS="$LDFLAGS"
2966 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2967 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2969 if test "x$with_libldap" = "xyes"
2971 if test "x$LIBLDAP_CPPFLAGS" != "x"
2973 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2975 AC_CHECK_HEADERS(ldap.h,
2976 [with_libldap="yes"],
2977 [with_libldap="no ('ldap.h' not found)"])
2979 if test "x$with_libldap" = "xyes"
2981 if test "x$LIBLDAP_LDFLAGS" != "x"
2983 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2985 AC_CHECK_LIB(ldap, ldap_initialize,
2986 [with_libldap="yes"],
2987 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2991 CPPFLAGS="$SAVE_CPPFLAGS"
2992 LDFLAGS="$SAVE_LDFLAGS"
2994 if test "x$with_libldap" = "xyes"
2996 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2997 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2998 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2999 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
3001 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
3005 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
3006 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
3008 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
3009 [with_liblua="yes"],
3013 PKG_CHECK_MODULES([LUA], [lua],
3014 [with_liblua="yes"],
3016 PKG_CHECK_MODULES([LUA], [lua-5.3],
3017 [with_liblua="yes"],
3019 PKG_CHECK_MODULES([LUA], [lua5.3],
3020 [with_liblua="yes"],
3022 PKG_CHECK_MODULES([LUA], [lua-5.2],
3023 [with_liblua="yes"],
3025 PKG_CHECK_MODULES([LUA], [lua5.2],
3026 [with_liblua="yes"],
3028 PKG_CHECK_MODULES([LUA], [lua-5.1],
3029 [with_liblua="yes"],
3031 PKG_CHECK_MODULES([LUA], [lua5.1],
3032 [with_liblua="yes"],
3033 [with_liblua="no (pkg-config cannot find liblua)"]
3049 if test "x$with_liblua" = "xyes"
3051 SAVE_CPPFLAGS="$CPPFLAGS"
3052 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
3054 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
3055 [with_liblua="yes"],
3056 [with_liblua="no (header not found)"]
3059 CPPFLAGS="$SAVE_CPPFLAGS"
3062 if test "x$with_liblua" = "xyes"
3065 LIBS="$LIBS $LUA_LIBS"
3067 AC_CHECK_FUNC([lua_settop],
3068 [with_liblua="yes"],
3069 [with_liblua="no (symbol 'lua_settop' not found)"]
3075 if test "x$with_liblua" = "xyes"
3077 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
3078 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
3080 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
3081 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
3084 # --with-liblvm2app {{{
3085 with_liblvm2app_cppflags=""
3086 with_liblvm2app_ldflags=""
3087 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
3089 if test "x$withval" = "xno"
3091 with_liblvm2app="no"
3093 with_liblvm2app="yes"
3094 if test "x$withval" != "xyes"
3096 with_liblvm2app_cppflags="-I$withval/include"
3097 with_liblvm2app_ldflags="-L$withval/lib"
3102 if test "x$ac_system" = "xLinux"
3104 with_liblvm2app="yes"
3106 with_liblvm2app="no (Linux only library)"
3109 if test "x$with_liblvm2app" = "xyes"
3111 SAVE_CPPFLAGS="$CPPFLAGS"
3112 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3114 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
3116 CPPFLAGS="$SAVE_CPPFLAGS"
3119 if test "x$with_liblvm2app" = "xyes"
3121 SAVE_CPPFLAGS="$CPPFLAGS"
3122 SAVE_LDFLAGS="$LDFLAGS"
3123 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3124 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
3126 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
3128 CPPFLAGS="$SAVE_CPPFLAGS"
3129 LDFLAGS="$SAVE_LDFLAGS"
3131 if test "x$with_liblvm2app" = "xyes"
3133 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
3134 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
3135 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
3136 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
3137 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
3138 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
3139 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
3141 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3144 # --with-libmemcached {{{
3145 with_libmemcached_cppflags=""
3146 with_libmemcached_ldflags=""
3147 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3149 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3151 with_libmemcached_cppflags="-I$withval/include"
3152 with_libmemcached_ldflags="-L$withval/lib"
3153 with_libmemcached="yes"
3155 with_libmemcached="$withval"
3159 with_libmemcached="yes"
3161 if test "x$with_libmemcached" = "xyes"
3163 SAVE_CPPFLAGS="$CPPFLAGS"
3164 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3166 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3168 CPPFLAGS="$SAVE_CPPFLAGS"
3170 if test "x$with_libmemcached" = "xyes"
3172 SAVE_CPPFLAGS="$CPPFLAGS"
3173 SAVE_LDFLAGS="$LDFLAGS"
3174 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3175 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3177 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3179 CPPFLAGS="$SAVE_CPPFLAGS"
3180 LDFLAGS="$SAVE_LDFLAGS"
3182 if test "x$with_libmemcached" = "xyes"
3184 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3185 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3186 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3187 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3188 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3189 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3190 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3192 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3195 # --with-libmicrohttpd {{{
3196 with_libmicrohttpd_cppflags=""
3197 with_libmicrohttpd_ldflags=""
3198 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3200 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3202 with_libmicrohttpd_cppflags="-I$withval/include"
3203 with_libmicrohttpd_ldflags="-L$withval/lib"
3204 with_libmicrohttpd="yes"
3206 if test "x$withval" = "xno"
3208 with_libmicrohttpd="no (disabled on command line)"
3213 if test "x$withval" = "xyes"
3215 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3216 [with_libmicrohttpd="yes"],
3217 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3221 if test "x$MICROHTTPD_LIBS" = "x"
3223 MICROHTTPD_LIBS="-lmicrohttpd"
3226 SAVE_CPPFLAGS="$CPPFLAGS"
3227 SAVE_LDFLAGS="$LDFLAGS"
3229 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3230 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3231 LIBS="$LIBS $MICROHTTPD_LIBS"
3233 if test "x$with_libmicrohttpd" = "xyes"
3235 AC_CHECK_HEADERS([microhttpd.h],
3236 [with_libmicrohttpd="yes"],
3237 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3240 if test "x$with_libmicrohttpd" = "xyes"
3242 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3243 [with_libmicrohttpd="yes"],
3244 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3247 CPPFLAGS="$SAVE_CPPFLAGS"
3248 LDFLAGS="$SAVE_LDFLAGS"
3251 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3252 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3253 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3254 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3255 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3256 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3259 # --with-libmodbus {{{
3260 with_libmodbus_config=""
3261 with_libmodbus_cflags=""
3262 with_libmodbus_libs=""
3263 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3265 if test "x$withval" = "xno"
3268 else if test "x$withval" = "xyes"
3270 with_libmodbus="use_pkgconfig"
3271 else if test -d "$with_libmodbus/lib"
3273 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3274 with_libmodbus_cflags="-I$withval/include"
3275 with_libmodbus_libs="-L$withval/lib -lmodbus"
3276 with_libmodbus="yes"
3279 [with_libmodbus="use_pkgconfig"])
3281 # configure using pkg-config
3282 if test "x$with_libmodbus" = "xuse_pkgconfig"
3284 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3285 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3288 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3291 if test "x$with_libmodbus" = "xuse_pkgconfig"
3293 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3296 with_libmodbus="no ($PKG_CONFIG failed)"
3298 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3301 with_libmodbus="no ($PKG_CONFIG failed)"
3304 if test "x$with_libmodbus" = "xuse_pkgconfig"
3306 with_libmodbus="yes"
3309 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3310 # the actual checks.
3311 if test "x$with_libmodbus" = "xyes"
3313 SAVE_CPPFLAGS="$CPPFLAGS"
3314 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3316 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3318 CPPFLAGS="$SAVE_CPPFLAGS"
3320 if test "x$with_libmodbus" = "xyes"
3322 SAVE_CPPFLAGS="$CPPFLAGS"
3323 SAVE_LDFLAGS="$LDFLAGS"
3325 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3326 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3328 AC_CHECK_LIB(modbus, modbus_connect,
3329 [with_libmodbus="yes"],
3330 [with_libmodbus="no (symbol modbus_connect not found)"])
3332 CPPFLAGS="$SAVE_CPPFLAGS"
3333 LDFLAGS="$SAVE_LDFLAGS"
3335 if test "x$with_libmodbus" = "xyes"
3337 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3338 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3339 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3340 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3344 # --with-libmongoc {{{
3345 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3347 if test "x$withval" = "xyes"
3349 with_libmongoc="yes"
3350 else if test "x$withval" = "xno"
3354 with_libmongoc="yes"
3355 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3356 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3359 [with_libmongoc="yes"])
3361 SAVE_CPPFLAGS="$CPPFLAGS"
3362 SAVE_LDFLAGS="$LDFLAGS"
3364 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3365 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3367 if test "x$with_libmongoc" = "xyes"
3369 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3371 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3373 AC_CHECK_HEADERS(mongo.h,
3374 [with_libmongoc="yes"],
3375 [with_libmongoc="no ('mongo.h' not found)"],
3377 # define MONGO_HAVE_STDINT 1
3379 # define MONGO_USE_LONG_LONG_INT 1
3383 if test "x$with_libmongoc" = "xyes"
3385 if test "x$LIBMONGOC_LDFLAGS" != "x"
3387 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3389 AC_CHECK_LIB(mongoc, mongo_run_command,
3390 [with_libmongoc="yes"],
3391 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3394 CPPFLAGS="$SAVE_CPPFLAGS"
3395 LDFLAGS="$SAVE_LDFLAGS"
3397 if test "x$with_libmongoc" = "xyes"
3399 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3400 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3401 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3402 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3404 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3407 # --with-libmosquitto {{{
3408 with_libmosquitto_cppflags=""
3409 with_libmosquitto_ldflags=""
3410 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3412 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3414 with_libmosquitto_cppflags="-I$withval/include"
3415 with_libmosquitto_ldflags="-L$withval/lib"
3416 with_libmosquitto="yes"
3418 with_libmosquitto="$withval"
3422 with_libmosquitto="yes"
3424 if test "x$with_libmosquitto" = "xyes"
3426 SAVE_CPPFLAGS="$CPPFLAGS"
3427 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3429 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3431 CPPFLAGS="$SAVE_CPPFLAGS"
3433 if test "x$with_libmosquitto" = "xyes"
3435 SAVE_LDFLAGS="$LDFLAGS"
3436 SAVE_CPPFLAGS="$CPPFLAGS"
3437 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3438 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3440 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3442 LDFLAGS="$SAVE_LDFLAGS"
3443 CPPFLAGS="$SAVE_CPPFLAGS"
3445 if test "x$with_libmosquitto" = "xyes"
3447 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3448 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3449 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3450 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3451 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3452 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3456 # --with-libmysql {{{
3457 with_mysql_config="mysql_config"
3458 with_mysql_cflags=""
3460 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3462 if test "x$withval" = "xno"
3465 else if test "x$withval" = "xyes"
3469 if test -f "$withval" && test -x "$withval";
3471 with_mysql_config="$withval"
3472 else if test -x "$withval/bin/mysql_config"
3474 with_mysql_config="$withval/bin/mysql_config"
3482 if test "x$with_libmysql" = "xyes"
3484 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3485 mysql_config_status=$?
3487 if test $mysql_config_status -ne 0
3489 with_libmysql="no ($with_mysql_config failed)"
3491 SAVE_CPPFLAGS="$CPPFLAGS"
3492 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3495 have_mysql_mysql_h="no"
3496 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3498 if test "x$have_mysql_h" = "xno"
3500 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3503 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3505 with_libmysql="no (mysql.h not found)"
3508 CPPFLAGS="$SAVE_CPPFLAGS"
3511 if test "x$with_libmysql" = "xyes"
3513 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3514 mysql_config_status=$?
3516 if test $mysql_config_status -ne 0
3518 with_libmysql="no ($with_mysql_config failed)"
3520 SAVE_CPPFLAGS="$CPPFLAGS"
3521 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3523 LIBS="$with_mysql_libs"
3524 AC_SEARCH_LIBS([mysql_get_server_version],
3526 [with_libmysql="yes"],
3527 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3529 CPPFLAGS="$SAVE_CPPFLAGS"
3533 if test "x$with_libmysql" = "xyes"
3535 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3536 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3537 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3538 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3540 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3544 with_libmnl_cflags=""
3546 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3548 echo "libmnl: withval = $withval"
3549 if test "x$withval" = "xyes"
3552 else if test "x$withval" = "xno"
3556 if test -d "$withval/include"
3558 with_libmnl_cflags="-I$withval/include"
3559 with_libmnl_libs="-L$withval/lib -lmnl"
3562 AC_MSG_ERROR("no such directory: $withval/include")
3567 if test "x$ac_system" = "xLinux"
3571 with_libmnl="no (Linux only library)"
3574 if test "x$with_libmnl" = "xyes"
3576 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3577 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3578 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3581 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3587 #include <sys/types.h>
3588 #include <asm/types.h>
3589 #include <sys/socket.h>
3590 #include <linux/netlink.h>
3591 #include <linux/rtnetlink.h>])
3592 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3594 #include <sys/types.h>
3595 #include <asm/types.h>
3596 #include <sys/socket.h>])
3598 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3601 #include <sys/types.h>
3602 #include <asm/types.h>
3603 #include <sys/socket.h>
3604 #include <linux/netlink.h>
3605 #include <linux/rtnetlink.h>
3608 int retval = TCA_STATS2;
3612 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3614 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3617 #include <sys/types.h>
3618 #include <asm/types.h>
3619 #include <sys/socket.h>
3620 #include <linux/netlink.h>
3621 #include <linux/rtnetlink.h>
3624 int retval = TCA_STATS;
3628 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3630 if test "x$with_libmnl" = "xyes"
3632 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3633 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3636 #include <linux/if_link.h>
3639 if test "x$with_libmnl" = "xyes"
3641 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3642 [with_libmnl="yes"],
3643 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3644 [$with_libmnl_libs])
3646 if test "x$with_libmnl" = "xyes"
3648 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3649 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3650 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3651 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3652 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3654 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3657 # --with-libnetapp {{{
3658 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3659 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3660 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3661 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3662 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3663 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3664 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3666 if test -d "$withval"
3668 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3669 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3670 with_libnetapp="yes"
3672 with_libnetapp="$withval"
3676 with_libnetapp="yes"
3679 SAVE_CPPFLAGS="$CPPFLAGS"
3680 SAVE_LDFLAGS="$LDFLAGS"
3681 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3682 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3684 if test "x$with_libnetapp" = "xyes"
3686 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3688 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3690 AC_CHECK_HEADERS(netapp_api.h,
3691 [with_libnetapp="yes"],
3692 [with_libnetapp="no (netapp_api.h not found)"])
3695 if test "x$with_libnetapp" = "xyes"
3697 if test "x$LIBNETAPP_LDFLAGS" != "x"
3699 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3702 if test "x$LIBNETAPP_LIBS" = "x"
3704 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3706 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3708 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3709 [with_libnetapp="yes"],
3710 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3712 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3715 CPPFLAGS="$SAVE_CPPFLAGS"
3716 LDFLAGS="$SAVE_LDFLAGS"
3718 if test "x$with_libnetapp" = "xyes"
3720 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3723 AC_SUBST(LIBNETAPP_CPPFLAGS)
3724 AC_SUBST(LIBNETAPP_LDFLAGS)
3725 AC_SUBST(LIBNETAPP_LIBS)
3726 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3729 # --with-libnetsnmp {{{
3730 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3732 if test "x$withval" = "xno"
3734 with_libnetsnmp="no"
3735 else if test "x$withval" = "xyes"
3737 with_libnetsnmp="yes"
3739 with_libnetsnmp_cppflags="-I$withval/include"
3740 with_libnetsnmp_ldflags="-I$withval/lib"
3741 with_libnetsnmp="yes"
3744 [with_libnetsnmp="yes"])
3745 if test "x$with_libnetsnmp" = "xyes"
3747 SAVE_CPPFLAGS="$CPPFLAGS"
3748 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3750 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3752 CPPFLAGS="$SAVE_CPPFLAGS"
3754 if test "x$with_libnetsnmp" = "xyes"
3756 SAVE_LDFLAGS="$LDFLAGS"
3757 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3759 AC_CHECK_LIB(netsnmp, init_snmp,
3760 [with_libnetsnmp="yes"],
3761 [with_libnetsnmp="no (libnetsnmp not found)"],
3764 LDFLAGS="$SAVE_LDFLAGS"
3766 if test "x$with_libnetsnmp" = "xyes"
3768 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3769 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3770 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3772 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3773 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3774 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3777 # --with-liboconfig {{{
3778 with_own_liboconfig="no"
3779 liboconfig_LDFLAGS="$LDFLAGS"
3780 liboconfig_CPPFLAGS="$CPPFLAGS"
3781 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3783 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3785 if test -d "$withval/lib"
3787 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3789 if test -d "$withval/include"
3791 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3794 if test "x$withval" = "xno"
3796 AC_MSG_ERROR("liboconfig is required")
3800 with_liboconfig="yes"
3803 save_LDFLAGS="$LDFLAGS"
3804 save_CPPFLAGS="$CPPFLAGS"
3805 LDFLAGS="$liboconfig_LDFLAGS"
3806 CPPFLAGS="$liboconfig_CPPFLAGS"
3807 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3809 with_liboconfig="yes"
3810 with_own_liboconfig="no"
3813 with_liboconfig="yes"
3814 with_own_liboconfig="yes"
3815 LDFLAGS="$save_LDFLAGS"
3816 CPPFLAGS="$save_CPPFLAGS"
3819 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3820 if test "x$with_own_liboconfig" = "xyes"
3822 with_liboconfig="yes (shipped version)"
3826 # --with-liboping {{{
3827 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3829 if test "x$withval" = "xyes"
3832 else if test "x$withval" = "xno"
3837 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3838 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3841 [with_liboping="yes"])
3843 SAVE_CPPFLAGS="$CPPFLAGS"
3844 SAVE_LDFLAGS="$LDFLAGS"
3846 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3847 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3849 if test "x$with_liboping" = "xyes"
3851 if test "x$LIBOPING_CPPFLAGS" != "x"
3853 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3855 AC_CHECK_HEADERS(oping.h,
3856 [with_liboping="yes"],
3857 [with_liboping="no (oping.h not found)"])
3859 if test "x$with_liboping" = "xyes"
3861 if test "x$LIBOPING_LDFLAGS" != "x"
3863 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3865 AC_CHECK_LIB(oping, ping_construct,
3866 [with_liboping="yes"],
3867 [with_liboping="no (symbol 'ping_construct' not found)"])
3870 CPPFLAGS="$SAVE_CPPFLAGS"
3871 LDFLAGS="$SAVE_LDFLAGS"
3873 if test "x$with_liboping" = "xyes"
3875 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3876 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3877 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3878 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3880 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3884 with_oracle_cppflags=""
3886 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3888 if test "x$withval" = "xyes"
3890 if test "x$ORACLE_HOME" = "x"
3892 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3895 else if test "x$withval" = "xno"
3900 ORACLE_HOME="$withval"
3904 if test "x$ORACLE_HOME" = "x"
3906 with_oracle="no (ORACLE_HOME is not set)"
3911 if test "x$ORACLE_HOME" != "x"
3913 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3915 if test -e "$ORACLE_HOME/lib/ldflags"
3917 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3919 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3920 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3922 if test "x$with_oracle" = "xyes"
3924 SAVE_CPPFLAGS="$CPPFLAGS"
3925 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3927 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3929 CPPFLAGS="$SAVE_CPPFLAGS"
3931 if test "x$with_oracle" = "xyes"
3933 SAVE_CPPFLAGS="$CPPFLAGS"
3935 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3936 LIBS="$LIBS $with_oracle_libs"
3938 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3940 CPPFLAGS="$SAVE_CPPFLAGS"
3943 if test "x$with_oracle" = "xyes"
3945 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3946 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3947 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3948 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3952 # --with-libowcapi {{{
3953 with_libowcapi_cppflags=""
3954 with_libowcapi_ldflags=""
3955 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3957 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3959 with_libowcapi_cppflags="-I$withval/include"
3960 with_libowcapi_ldflags="-L$withval/lib"
3961 with_libowcapi="yes"
3963 with_libowcapi="$withval"
3967 with_libowcapi="yes"
3969 if test "x$with_libowcapi" = "xyes"
3971 SAVE_CPPFLAGS="$CPPFLAGS"
3972 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3974 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3976 CPPFLAGS="$SAVE_CPPFLAGS"
3978 if test "x$with_libowcapi" = "xyes"
3980 SAVE_LDFLAGS="$LDFLAGS"
3981 SAVE_CPPFLAGS="$CPPFLAGS"
3982 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3983 CPPFLAGS="$with_libowcapi_cppflags"
3985 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3987 LDFLAGS="$SAVE_LDFLAGS"
3988 CPPFLAGS="$SAVE_CPPFLAGS"
3990 if test "x$with_libowcapi" = "xyes"
3992 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3993 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3994 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3995 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3996 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3997 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
4001 # --with-libpcap {{{
4002 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
4004 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4006 LDFLAGS="$LDFLAGS -L$withval/lib"
4007 CPPFLAGS="$CPPFLAGS -I$withval/include"
4010 with_libpcap="$withval"
4016 if test "x$with_libpcap" = "xyes"
4018 AC_CHECK_LIB(pcap, pcap_open_live,
4020 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
4021 ], [with_libpcap="no (libpcap not found)"])
4023 if test "x$with_libpcap" = "xyes"
4025 AC_CHECK_HEADERS(pcap.h,,
4026 [with_libpcap="no (pcap.h not found)"])
4028 if test "x$with_libpcap" = "xyes"
4030 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
4031 [c_cv_libpcap_have_pcap_error_iface_not_up],
4032 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
4037 int val = PCAP_ERROR_IFACE_NOT_UP;
4041 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
4042 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
4044 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
4046 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
4048 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
4051 # --with-libperl {{{
4052 perl_interpreter="perl"
4053 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
4055 if test -f "$withval" && test -x "$withval"
4057 perl_interpreter="$withval"
4059 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
4061 LDFLAGS="$LDFLAGS -L$withval/lib"
4062 CPPFLAGS="$CPPFLAGS -I$withval/include"
4063 perl_interpreter="$withval/bin/perl"
4066 with_libperl="$withval"
4073 AC_MSG_CHECKING([for perl])
4074 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
4075 if test -x "$perl_interpreter"
4077 AC_MSG_RESULT([yes ($perl_interpreter)])
4083 AC_SUBST(PERL, "$perl_interpreter")
4085 if test "x$with_libperl" = "xyes" \
4086 && test -n "$perl_interpreter"
4088 SAVE_CFLAGS="$CFLAGS"
4090 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4091 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
4092 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
4093 CFLAGS="$CFLAGS $PERL_CFLAGS"
4094 LIBS="$LIBS $PERL_LIBS"
4096 AC_CACHE_CHECK([for libperl],
4097 [c_cv_have_libperl],
4098 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4100 #define PERL_NO_GET_CONTEXT
4107 load_module (PERL_LOADMOD_NOIMPORT,
4108 newSVpv ("Collectd::Plugin::FooBar", 24),
4112 [c_cv_have_libperl="yes"],
4113 [c_cv_have_libperl="no"]
4117 if test "x$c_cv_have_libperl" = "xyes"
4119 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
4120 AC_SUBST(PERL_CFLAGS)
4126 CFLAGS="$SAVE_CFLAGS"
4128 else if test -z "$perl_interpreter"; then
4129 with_libperl="no (no perl interpreter found)"
4130 c_cv_have_libperl="no"
4132 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
4134 if test "x$with_libperl" = "xyes"
4136 SAVE_CFLAGS="$CFLAGS"
4138 CFLAGS="$CFLAGS $PERL_CFLAGS"
4139 LIBS="$LIBS $PERL_LIBS"
4141 AC_CACHE_CHECK([if perl supports ithreads],
4142 [c_cv_have_perl_ithreads],
4143 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4149 #if !defined(USE_ITHREADS)
4150 # error "Perl does not support ithreads!"
4151 #endif /* !defined(USE_ITHREADS) */
4155 [c_cv_have_perl_ithreads="yes"],
4156 [c_cv_have_perl_ithreads="no"]
4160 if test "x$c_cv_have_perl_ithreads" = "xyes"
4162 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4165 CFLAGS="$SAVE_CFLAGS"
4169 if test "x$with_libperl" = "xyes"
4171 SAVE_CFLAGS="$CFLAGS"
4173 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4174 # (see issues #41 and #42)
4175 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4176 LIBS="$LIBS $PERL_LIBS"
4178 AC_CACHE_CHECK([for broken Perl_load_module()],
4179 [c_cv_have_broken_perl_load_module],
4180 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4182 #define PERL_NO_GET_CONTEXT
4189 load_module (PERL_LOADMOD_NOIMPORT,
4190 newSVpv ("Collectd::Plugin::FooBar", 24),
4194 [c_cv_have_broken_perl_load_module="no"],
4195 [c_cv_have_broken_perl_load_module="yes"]
4199 CFLAGS="$SAVE_CFLAGS"
4202 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4203 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4205 if test "x$with_libperl" = "xyes"
4207 SAVE_CFLAGS="$CFLAGS"
4209 CFLAGS="$CFLAGS $PERL_CFLAGS"
4210 LIBS="$LIBS $PERL_LIBS"
4213 [struct mgvtbl.svt_local],
4214 [have_struct_mgvtbl_svt_local="yes"],
4215 [have_struct_mgvtbl_svt_local="no"],
4222 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4224 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4225 [Define if Perl's struct mgvtbl has member svt_local.])
4228 CFLAGS="$SAVE_CFLAGS"
4234 with_pg_config="pg_config"
4235 with_libpq_includedir=""
4236 with_libpq_libdir=""
4237 with_libpq_cppflags=""
4238 with_libpq_ldflags=""
4239 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4242 if test "x$withval" = "xno"
4245 else if test "x$withval" = "xyes"
4249 if test -f "$withval" && test -x "$withval";
4251 with_pg_config="$withval"
4252 else if test -x "$withval/bin/pg_config"
4254 with_pg_config="$withval/bin/pg_config"
4262 if test "x$with_libpq" = "xyes"
4264 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4267 if test $pg_config_status -eq 0
4269 if test -n "$with_libpq_includedir"; then
4270 for dir in $with_libpq_includedir; do
4271 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4275 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4278 SAVE_CPPFLAGS="$CPPFLAGS"
4279 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4281 AC_CHECK_HEADERS(libpq-fe.h, [],
4282 [with_libpq="no (libpq-fe.h not found)"], [])
4284 CPPFLAGS="$SAVE_CPPFLAGS"
4286 if test "x$with_libpq" = "xyes"
4288 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4291 if test $pg_config_status -eq 0
4293 if test -n "$with_libpq_libdir"; then
4294 for dir in $with_libpq_libdir; do
4295 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4299 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4302 SAVE_LDFLAGS="$LDFLAGS"
4303 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4305 AC_CHECK_LIB(pq, PQconnectdb,
4307 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4309 AC_CHECK_LIB(pq, PQserverVersion,
4311 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4313 LDFLAGS="$SAVE_LDFLAGS"
4315 if test "x$with_libpq" = "xyes"
4317 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4318 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4319 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4320 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4322 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4325 # --with-libpqos {{{
4326 with_libpqos_cppflags=""
4327 with_libpqos_ldflags=""
4328 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4330 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4332 with_libpqos_cppflags="-I$withval/include"
4333 with_libpqos_ldflags="-L$withval/lib"
4336 with_libpqos="$withval"
4342 if test "x$with_libpqos" = "xyes"
4344 SAVE_CPPFLAGS="$CPPFLAGS"
4345 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4347 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4349 CPPFLAGS="$SAVE_CPPFLAGS"
4351 if test "x$with_libpqos" = "xyes"
4353 SAVE_CPPFLAGS="$CPPFLAGS"
4354 SAVE_LDFLAGS="$LDFLAGS"
4355 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4356 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4358 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4360 CPPFLAGS="$SAVE_CPPFLAGS"
4361 LDFLAGS="$SAVE_LDFLAGS"
4363 if test "x$with_libpqos" = "xyes"
4365 SAVE_CPPFLAGS="$CPPFLAGS"
4366 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4367 AC_RUN_IFELSE([AC_LANG_PROGRAM(
4368 [[#include <pqos.h>]],
4369 [[return !(PQOS_VERSION >= 106)]])],
4370 [with_libpqos="yes"], [with_libpqos="no (pqos library version 1.06 or higher is required)"])
4371 CPPFLAGS="$SAVE_CPPFLAGS"
4373 if test "x$with_libpqos" = "xyes"
4375 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4376 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4377 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4378 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4379 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4380 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4384 # --with-libprotobuf {{{
4385 with_libprotobuf_cppflags=""
4386 with_libprotobuf_ldflags=""
4387 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4389 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4391 with_libprotobuf_cppflags="-I$withval/include"
4392 with_libprotobuf_ldflags="-L$withval/lib"
4393 with_libprotobuf="yes"
4395 if test "x$withval" = "xno"
4397 with_libprotobuf="no (disabled on command line)"
4402 if test "x$withval" = "xyes"
4404 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4405 [with_libprotobuf="yes"],
4406 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4410 if test "x$withval" != "xno"
4412 SAVE_LDFLAGS="$LDFLAGS"
4414 LDFLAGS="$with_libprotobuf_ldflags"
4415 LIBS="$PROTOBUF_LIBS $LIBS"
4417 AC_CHECK_LIB([protobuf], [main],
4419 SAVE_CPPFLAGS="$CPPFLAGS"
4420 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4421 if test "x$PROTOBUF_LIBS" = "x"
4423 PROTOBUF_LIBS="-lprotobuf"
4425 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4426 [with_libprotobuf="yes"],
4427 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4429 CPPFLAGS="$SAVE_CPPFLAGS"
4431 [with_libprotobuf="no (libprotobuf not found)"]
4434 LDFLAGS="$SAVE_LDFLAGS"
4437 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4438 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4439 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4440 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4441 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4442 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4445 # --with-libprotobuf-c {{{
4446 with_libprotobuf_c_cppflags=""
4447 with_libprotobuf_c_ldflags=""
4448 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4450 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4452 with_libprotobuf_c_cppflags="-I$withval/include"
4453 with_libprotobuf_c_ldflags="-L$withval/lib"
4454 with_libprotobuf_c="yes"
4456 if test "x$withval" = "xno"
4458 with_libprotobuf_c="no (disabled on command line)"
4463 if test "x$withval" = "xyes"
4465 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4466 [with_libprotobuf_c="yes"],
4467 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4471 if test "x$withval" != "xno"
4473 SAVE_LDFLAGS="$LDFLAGS"
4475 LDFLAGS="$with_libprotobuf_c_ldflags"
4476 LIBS="$PROTOBUF_C_LIBS $LIBS"
4477 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4479 SAVE_CPPFLAGS="$CPPFLAGS"
4480 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4481 if test "x$PROTOBUF_C_LIBS" = "x"
4483 PROTOBUF_C_LIBS="-lprotobuf-c"
4485 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4487 with_libprotobuf_c="yes"
4490 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4492 CPPFLAGS="$SAVE_CPPFLAGS"
4494 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4496 LDFLAGS="$SAVE_LDFLAGS"
4499 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4500 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4501 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4502 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4503 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4504 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4507 # --with-libpython {{{
4508 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4509 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4510 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4512 AC_ARG_WITH([libpython],
4513 [AS_HELP_STRING([--with-libpython],
4514 [if we should build with libpython @<:@default=yes@:>@])
4516 [with_libpython="$withval"],
4517 [with_libpython="check"]
4519 if test "$with_libpython" != "no"; then
4520 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4521 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4522 AC_PATH_PROGS([PYTHON_CONFIG],
4523 [python3-config python2-config python-config]
4525 if test "$PYTHON_CONFIG" = ""; then
4526 if test "$with_libpython" = "yes"; then
4527 AC_MSG_ERROR([Unable to find python-config])
4534 if test "$PYTHON_CONFIG" != ""; then
4535 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4536 if test $? -ne 0; then
4539 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4540 if test $? -ne 0; then
4543 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4544 if test $? -ne 0; then
4549 if test "$with_libpython" != "xno"; then
4550 SAVE_CPPFLAGS="$CPPFLAGS"
4551 SAVE_LDFLAGS="$LDFLAGS"
4553 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4554 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4555 LIBS="$LIBPYTHON_LIBS $LIBS"
4556 AC_CHECK_HEADERS([Python.h],
4558 AC_MSG_CHECKING([for libpython])
4559 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4560 [[#include <Python.h>]],
4561 [[Py_Initialize();]])
4563 [with_libpython="yes"],
4564 [with_libpython="no"]
4566 AC_MSG_RESULT([$with_libpython])
4568 [with_libpython="no"]
4570 CPPFLAGS="$SAVE_CPPFLAGS"
4571 LDFLAGS="$SAVE_LDFLAGS"
4574 # }}} --with-libpython
4576 # --with-librabbitmq {{{
4577 with_librabbitmq_cppflags=""
4578 with_librabbitmq_ldflags=""
4579 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4581 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4583 with_librabbitmq_cppflags="-I$withval/include"
4584 with_librabbitmq_ldflags="-L$withval/lib"
4585 with_librabbitmq="yes"
4587 with_librabbitmq="$withval"
4591 with_librabbitmq="yes"
4593 SAVE_CPPFLAGS="$CPPFLAGS"
4594 SAVE_LDFLAGS="$LDFLAGS"
4595 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4596 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4597 if test "x$with_librabbitmq" = "xyes"
4599 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4601 if test "x$with_librabbitmq" = "xyes"
4603 # librabbitmq up to version 0.9.1 provides "library_errno", later
4604 # versions use "library_error". The library does not provide a version
4605 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4606 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4609 # include <stdlib.h>
4615 # include <stdint.h>
4618 # include <inttypes.h>
4623 if test "x$with_librabbitmq" = "xyes"
4625 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4627 if test "x$with_librabbitmq" = "xyes"
4629 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4630 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4631 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4632 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4633 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4634 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4635 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4637 CPPFLAGS="$SAVE_CPPFLAGS"
4638 LDFLAGS="$SAVE_LDFLAGS"
4639 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4641 with_amqp_tcp_socket="no"
4642 if test "x$with_librabbitmq" = "xyes"
4644 SAVE_CPPFLAGS="$CPPFLAGS"
4645 SAVE_LDFLAGS="$LDFLAGS"
4647 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4648 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4651 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4652 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4653 if test "x$with_amqp_tcp_socket" = "xyes"
4655 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4656 [Define if librabbitmq provides the new TCP socket interface.])
4659 AC_CHECK_DECLS(amqp_socket_close,
4660 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4663 #ifdef HAVE_AMQP_TCP_SOCKET_H
4664 # include <amqp_tcp_socket.h>
4666 #ifdef HAVE_AMQP_SOCKET_H
4667 # include <amqp_socket.h>
4671 CPPFLAGS="$SAVE_CPPFLAGS"
4672 LDFLAGS="$SAVE_LDFLAGS"
4677 # --with-librdkafka {{{
4678 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4680 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4682 with_librdkafka_cppflags="-I$withval/include"
4683 with_librdkafka_ldflags="-L$withval/lib"
4684 with_librdkafka_rpath="$withval/lib"
4685 with_librdkafka="yes"
4687 with_librdkafka="$withval"
4691 with_librdkafka="yes"
4693 SAVE_CPPFLAGS="$CPPFLAGS"
4694 SAVE_LDFLAGS="$LDFLAGS"
4696 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4697 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4699 if test "x$with_librdkafka" = "xyes"
4701 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4704 if test "x$with_librdkafka" = "xyes"
4706 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4707 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4708 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4710 if test "x$with_librdkafka" = "xyes"
4712 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4713 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4714 if test "x$with_librdkafka_rpath" != "x"
4716 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4718 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4720 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4721 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4722 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4723 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4724 if test "x$with_librdkafka_log_cb" = "xyes"
4726 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4727 else if test "x$with_librdkafka_logger" = "xyes"
4729 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4732 CPPFLAGS="$SAVE_CPPFLAGS"
4733 LDFLAGS="$SAVE_LDFLAGS"
4734 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4738 # --with-librouteros {{{
4739 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4741 if test "x$withval" = "xyes"
4743 with_librouteros="yes"
4744 else if test "x$withval" = "xno"
4746 with_librouteros="no"
4748 with_librouteros="yes"
4749 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4750 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4753 [with_librouteros="yes"])
4755 SAVE_CPPFLAGS="$CPPFLAGS"
4756 SAVE_LDFLAGS="$LDFLAGS"
4758 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4759 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4761 if test "x$with_librouteros" = "xyes"
4763 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4765 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4767 AC_CHECK_HEADERS(routeros_api.h,
4768 [with_librouteros="yes"],
4769 [with_librouteros="no (routeros_api.h not found)"])
4771 if test "x$with_librouteros" = "xyes"
4773 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4775 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4777 AC_CHECK_LIB(routeros, ros_interface,
4778 [with_librouteros="yes"],
4779 [with_librouteros="no (symbol 'ros_interface' not found)"])
4782 CPPFLAGS="$SAVE_CPPFLAGS"
4783 LDFLAGS="$SAVE_LDFLAGS"
4785 if test "x$with_librouteros" = "xyes"
4787 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4788 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4789 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4790 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4792 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4798 librrd_threadsafe="no"
4799 librrd_rrdc_update="no"
4801 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4803 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4805 librrd_cflags="-I$withval/include"
4806 librrd_ldflags="-L$withval/lib"
4809 with_librrd="$withval"
4815 if test "x$with_librrd" = "xyes"
4817 SAVE_LDFLAGS="$LDFLAGS"
4818 LDFLAGS="$LDFLAGS $librrd_ldflags"
4819 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4821 AC_CHECK_LIB([rrd], [rrd_update_r],
4822 [librrd_threadsafe="yes"],
4825 AC_CHECK_LIB([rrd], [rrdc_update],
4826 [librrd_rrdc_update="yes"],
4831 LDFLAGS="$SAVE_LDFLAGS"
4833 SAVE_CPPFLAGS="$CPPFLAGS"
4834 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4836 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4838 CPPFLAGS="$SAVE_CPPFLAGS"
4841 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4843 SAVE_LDFLAGS="$LDFLAGS"
4844 LDFLAGS="$LDFLAGS $librrd_ldflags"
4846 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4848 librrd_ldflags="$librrd_ldflags -lrrd_th"
4849 librrd_threadsafe="yes"
4850 AC_CHECK_LIB([rrd_th], [rrdc_update],
4851 [librrd_rrdc_update="yes"],
4857 LDFLAGS="$SAVE_LDFLAGS"
4860 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4862 SAVE_LDFLAGS="$LDFLAGS"
4863 LDFLAGS="$LDFLAGS $librrd_ldflags"
4865 AC_CHECK_LIB([rrd], [rrd_update],
4867 librrd_ldflags="$librrd_ldflags -lrrd"
4868 AC_CHECK_LIB([rrd], [rrdc_update],
4869 [librrd_rrdc_update="yes"],
4873 [with_librrd="no (symbol 'rrd_update' not found)"]
4875 LDFLAGS="$SAVE_LDFLAGS"
4878 if test "x$with_librrd" = "xyes"
4880 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4881 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4882 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4883 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4884 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4885 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4887 if test "x$librrd_threadsafe" = "xyes"
4889 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4890 [Define to 1 if the rrd library is thread-safe]
4895 # --with-libsensors {{{
4896 with_sensors_cflags=""
4897 with_sensors_ldflags=""
4898 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4900 if test "x$withval" = "xno"
4902 with_libsensors="no"
4904 with_libsensors="yes"
4905 if test "x$withval" != "xyes"
4907 with_sensors_cflags="-I$withval/include"
4908 with_sensors_ldflags="-L$withval/lib"
4909 with_libsensors="yes"
4914 if test "x$ac_system" = "xLinux"
4916 with_libsensors="yes"
4918 with_libsensors="no (Linux only library)"
4921 if test "x$with_libsensors" = "xyes"
4923 SAVE_CPPFLAGS="$CPPFLAGS"
4924 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4926 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4928 CPPFLAGS="$SAVE_CPPFLAGS"
4930 if test "x$with_libsensors" = "xyes"
4932 SAVE_CPPFLAGS="$CPPFLAGS"
4933 SAVE_LDFLAGS="$LDFLAGS"
4934 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4935 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4937 AC_CHECK_LIB(sensors, sensors_init,
4939 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4941 [with_libsensors="no (libsensors not found)"])
4943 CPPFLAGS="$SAVE_CPPFLAGS"
4944 LDFLAGS="$SAVE_LDFLAGS"
4946 if test "x$with_libsensors" = "xyes"
4948 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4949 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4950 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4951 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4953 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4957 AC_SUBST([LIBSIGROK_CFLAGS])
4958 AC_SUBST([LIBSIGROK_LIBS])
4959 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4960 [with_libsigrok="yes"],
4961 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4965 # --with-libstatgrab {{{
4966 with_libstatgrab_cflags=""
4967 with_libstatgrab_ldflags=""
4968 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4970 if test "x$withval" != "xno" \
4971 && test "x$withval" != "xyes"
4973 with_libstatgrab_cflags="-I$withval/include"
4974 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4975 with_libstatgrab="yes"
4976 with_libstatgrab_pkg_config="no"
4978 with_libstatgrab="$withval"
4979 with_libstatgrab_pkg_config="yes"
4983 with_libstatgrab="yes"
4984 with_libstatgrab_pkg_config="yes"
4987 if test "x$with_libstatgrab" = "xyes" \
4988 && test "x$with_libstatgrab_pkg_config" = "xyes"
4990 AC_MSG_CHECKING([pkg-config for libstatgrab])
4992 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4995 with_libstatgrab_pkg_config="no"
4996 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4997 temp_result="not found"
4999 AC_MSG_RESULT([$temp_result])
5002 if test "x$with_libstatgrab" = "xyes" \
5003 && test "x$with_libstatgrab_pkg_config" = "xyes" \
5004 && test "x$with_libstatgrab_cflags" = "x"
5006 AC_MSG_CHECKING([for libstatgrab CFLAGS])
5007 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
5010 with_libstatgrab_cflags="$temp_result"
5012 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
5013 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
5015 AC_MSG_RESULT([$temp_result])
5018 if test "x$with_libstatgrab" = "xyes" \
5019 && test "x$with_libstatgrab_pkg_config" = "xyes" \
5020 && test "x$with_libstatgrab_ldflags" = "x"
5022 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
5023 temp_result="`$PKG_CONFIG --libs libstatgrab`"
5026 with_libstatgrab_ldflags="$temp_result"
5028 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
5029 temp_result="$PKG_CONFIG --libs libstatgrab failed"
5031 AC_MSG_RESULT([$temp_result])
5034 if test "x$with_libstatgrab" = "xyes"
5036 SAVE_CPPFLAGS="$CPPFLAGS"
5037 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
5039 AC_CHECK_HEADERS(statgrab.h,
5040 [with_libstatgrab="yes"],
5041 [with_libstatgrab="no (statgrab.h not found)"])
5043 CPPFLAGS="$SAVE_CPPFLAGS"
5046 if test "x$with_libstatgrab" = "xyes"
5048 SAVE_CFLAGS="$CFLAGS"
5049 SAVE_LDFLAGS="$LDFLAGS"
5051 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5052 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5054 AC_CHECK_LIB(statgrab, sg_init,
5055 [with_libstatgrab="yes"],
5056 [with_libstatgrab="no (symbol sg_init not found)"])
5058 CFLAGS="$SAVE_CFLAGS"
5059 LDFLAGS="$SAVE_LDFLAGS"
5062 if test "x$with_libstatgrab" = "xyes"
5064 SAVE_CFLAGS="$CFLAGS"
5065 SAVE_LDFLAGS="$LDFLAGS"
5068 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5069 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5070 LIBS="-lstatgrab $LIBS"
5072 AC_CACHE_CHECK([if libstatgrab >= 0.90],
5073 [c_cv_have_libstatgrab_0_90],
5074 AC_LINK_IFELSE([AC_LANG_PROGRAM(
5077 #include <statgrab.h>
5080 if (sg_init()) return 0;
5083 [c_cv_have_libstatgrab_0_90="no"],
5084 [c_cv_have_libstatgrab_0_90="yes"]
5088 CFLAGS="$SAVE_CFLAGS"
5089 LDFLAGS="$SAVE_LDFLAGS"
5093 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
5094 if test "x$with_libstatgrab" = "xyes"
5096 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
5097 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5098 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5099 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
5100 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
5101 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
5103 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
5108 # --with-libtokyotyrant {{{
5109 with_libtokyotyrant_cppflags=""
5110 with_libtokyotyrant_ldflags=""
5111 with_libtokyotyrant_libs=""
5112 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5114 if test "x$withval" = "xno"
5116 with_libtokyotyrant="no"
5117 else if test "x$withval" = "xyes"
5119 with_libtokyotyrant="yes"
5121 with_libtokyotyrant_cppflags="-I$withval/include"
5122 with_libtokyotyrant_ldflags="-L$withval/include"
5123 with_libtokyotyrant_libs="-ltokyotyrant"
5124 with_libtokyotyrant="yes"
5128 with_libtokyotyrant="yes"
5131 if test "x$with_libtokyotyrant" = "xyes"
5133 if $PKG_CONFIG --exists tokyotyrant
5135 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5136 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5137 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5141 SAVE_CPPFLAGS="$CPPFLAGS"
5142 SAVE_LDFLAGS="$LDFLAGS"
5143 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5144 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5146 if test "x$with_libtokyotyrant" = "xyes"
5148 AC_CHECK_HEADERS(tcrdb.h,
5150 AC_DEFINE(HAVE_TCRDB_H, 1,
5151 [Define to 1 if you have the <tcrdb.h> header file.])
5152 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5155 if test "x$with_libtokyotyrant" = "xyes"
5157 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5159 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5160 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5162 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5163 [$with_libtokyotyrant_libs])
5166 CPPFLAGS="$SAVE_CPPFLAGS"
5167 LDFLAGS="$SAVE_LDFLAGS"
5169 if test "x$with_libtokyotyrant" = "xyes"
5171 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5172 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5173 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5174 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5175 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5176 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5178 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5181 # --with-libudev {{{
5182 with_libudev_cflags=""
5183 with_libudev_ldflags=""
5184 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5186 if test "x$withval" = "xno"
5191 if test "x$withval" != "xyes"
5193 with_libudev_cflags="-I$withval/include"
5194 with_libudev_ldflags="-L$withval/lib"
5200 if test "x$ac_system" = "xLinux"
5204 with_libudev="no (Linux only library)"
5207 if test "x$with_libudev" = "xyes"
5209 SAVE_CPPFLAGS="$CPPFLAGS"
5210 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5212 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5214 CPPFLAGS="$SAVE_CPPFLAGS"
5216 if test "x$with_libudev" = "xyes"
5218 SAVE_CPPFLAGS="$CPPFLAGS"
5219 SAVE_LDFLAGS="$LDFLAGS"
5220 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5221 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5223 AC_CHECK_LIB(udev, udev_new,
5225 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5227 [with_libudev="no (libudev not found)"])
5229 CPPFLAGS="$SAVE_CPPFLAGS"
5230 LDFLAGS="$SAVE_LDFLAGS"
5232 if test "x$with_libudev" = "xyes"
5234 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5235 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5236 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5237 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5238 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5239 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5241 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5244 # --with-libupsclient {{{
5245 with_libupsclient_config=""
5246 with_libupsclient_cflags=""
5247 with_libupsclient_libs=""
5248 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5250 if test "x$withval" = "xno"
5252 with_libupsclient="no"
5253 else if test "x$withval" = "xyes"
5255 with_libupsclient="use_pkgconfig"
5257 if test -x "$withval"
5259 with_libupsclient_config="$withval"
5260 with_libupsclient="use_libupsclient_config"
5261 else if test -x "$withval/bin/libupsclient-config"
5263 with_libupsclient_config="$withval/bin/libupsclient-config"
5264 with_libupsclient="use_libupsclient_config"
5266 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5267 with_libupsclient_cflags="-I$withval/include"
5268 with_libupsclient_libs="-L$withval/lib -lupsclient"
5269 with_libupsclient="yes"
5273 [with_libupsclient="use_pkgconfig"])
5275 # configure using libupsclient-config
5276 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5278 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5279 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5282 with_libupsclient="no ($with_libupsclient_config failed)"
5284 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5287 with_libupsclient="no ($with_libupsclient_config failed)"
5290 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5292 with_libupsclient="yes"
5295 # configure using pkg-config
5296 if test "x$with_libupsclient" = "xuse_pkgconfig"
5298 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5299 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5302 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5305 if test "x$with_libupsclient" = "xuse_pkgconfig"
5307 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5310 with_libupsclient="no ($PKG_CONFIG failed)"
5312 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5315 with_libupsclient="no ($PKG_CONFIG failed)"
5318 if test "x$with_libupsclient" = "xuse_pkgconfig"
5320 with_libupsclient="yes"
5323 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5324 # the actual checks.
5325 if test "x$with_libupsclient" = "xyes"
5327 SAVE_CPPFLAGS="$CPPFLAGS"
5328 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5330 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5332 CPPFLAGS="$SAVE_CPPFLAGS"
5334 if test "x$with_libupsclient" = "xyes"
5336 SAVE_CPPFLAGS="$CPPFLAGS"
5337 SAVE_LDFLAGS="$LDFLAGS"
5339 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5340 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5342 AC_CHECK_LIB(upsclient, upscli_connect,
5343 [with_libupsclient="yes"],
5344 [with_libupsclient="no (symbol upscli_connect not found)"])
5346 CPPFLAGS="$SAVE_CPPFLAGS"
5347 LDFLAGS="$SAVE_LDFLAGS"
5349 if test "x$with_libupsclient" = "xyes"
5351 SAVE_CPPFLAGS="$CPPFLAGS"
5352 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5354 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5355 [#include <stdlib.h>
5357 #include <upsclient.h>])
5359 CPPFLAGS="$SAVE_CPPFLAGS"
5361 if test "x$with_libupsclient" = "xyes"
5363 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5364 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5365 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5366 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5370 # --with-libxenctrl {{{
5371 with_libxenctrl_cppflags=""
5372 with_libxenctrl_ldflags=""
5373 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5375 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5377 with_libxenctrl_cppflags="-I$withval/include"
5378 with_libxenctrl_ldflags="-L$withval/lib"
5379 with_libxenctrl="yes"
5381 with_libxenctrl="$withval"
5385 with_libxenctrl="yes"
5387 if test "x$with_libxenctrl" = "xyes"
5389 SAVE_CPPFLAGS="$CPPFLAGS"
5390 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5392 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5394 CPPFLAGS="$SAVE_CPPFLAGS"
5396 if test "x$with_libxenctrl" = "xyes"
5398 SAVE_CPPFLAGS="$CPPFLAGS"
5399 SAVE_LDFLAGS="$LDFLAGS"
5400 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5401 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5403 #Xen versions older than 3.4 has no xc_getcpuinfo()
5404 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5406 CPPFLAGS="$SAVE_CPPFLAGS"
5407 LDFLAGS="$SAVE_LDFLAGS"
5408 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5409 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5410 AC_SUBST(LIBXENCTL_CPPFLAGS)
5411 AC_SUBST(LIBXENCTL_LDFLAGS)
5415 # --with-libxmms {{{
5416 with_xmms_config="xmms-config"
5419 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5421 if test "x$withval" != "xno" \
5422 && test "x$withval" != "xyes"
5424 if test -f "$withval" && test -x "$withval";
5426 with_xmms_config="$withval"
5427 else if test -x "$withval/bin/xmms-config"
5429 with_xmms_config="$withval/bin/xmms-config"
5432 else if test "x$withval" = "xno"
5442 if test "x$with_libxmms" = "xyes"
5444 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5445 xmms_config_status=$?
5447 if test $xmms_config_status -ne 0
5452 if test "x$with_libxmms" = "xyes"
5454 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5455 xmms_config_status=$?
5457 if test $xmms_config_status -ne 0
5462 if test "x$with_libxmms" = "xyes"
5464 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5466 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5467 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5468 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5469 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5476 with_libxmms_numeric=0
5477 if test "x$with_libxmms" = "xyes"
5479 with_libxmms_numeric=1
5481 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5482 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5485 # --with-libyajl {{{
5486 with_libyajl_cppflags=""
5487 with_libyajl_ldflags=""
5488 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5490 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5492 with_libyajl_cppflags="-I$withval/include"
5493 with_libyajl_ldflags="-L$withval/lib"
5496 with_libyajl="$withval"
5502 if test "x$with_libyajl" = "xyes"
5504 SAVE_CPPFLAGS="$CPPFLAGS"
5505 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5507 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5508 AC_CHECK_HEADERS(yajl/yajl_version.h)
5510 CPPFLAGS="$SAVE_CPPFLAGS"
5512 if test "x$with_libyajl" = "xyes"
5514 SAVE_CPPFLAGS="$CPPFLAGS"
5515 SAVE_LDFLAGS="$LDFLAGS"
5516 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5517 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5519 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5521 CPPFLAGS="$SAVE_CPPFLAGS"
5522 LDFLAGS="$SAVE_LDFLAGS"
5524 if test "x$with_libyajl" = "xyes"
5526 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5527 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5528 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5529 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5530 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5531 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5532 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5534 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5538 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5539 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5541 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5543 if test "x$withval" = "xno"
5546 else if test "x$withval" = "xyes"
5549 else if test -d "$with_mic/lib"
5551 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5552 with_mic_cflags="-I$withval/include"
5553 with_mic_ldpath="-L$withval/lib/Linux"
5554 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5559 if test "x$with_mic" = "xyes"
5561 SAVE_CPPFLAGS="$CPPFLAGS"
5562 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5563 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5564 CPPFLAGS="$SAVE_CPPFLAGS"
5566 if test "x$with_mic" = "xyes"
5568 SAVE_CPPFLAGS="$CPPFLAGS"
5569 SAVE_LDFLAGS="$LDFLAGS"
5571 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5572 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5574 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5575 [with_mic_ldpath="$with_mic_ldpath"
5576 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5577 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5579 CPPFLAGS="$SAVE_CPPFLAGS"
5580 LDFLAGS="$SAVE_LDFLAGS"
5583 if test "x$with_mic" = "xyes"
5585 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5586 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5587 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5588 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5589 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5590 AC_SUBST(BUILD_WITH_MIC_LDADD)
5594 # --with-libvarnish {{{
5595 with_libvarnish_cppflags=""
5596 with_libvarnish_cflags=""
5597 with_libvarnish_libs=""
5598 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5600 if test "x$withval" = "xno"
5602 with_libvarnish="no"
5603 else if test "x$withval" = "xyes"
5605 with_libvarnish="use_pkgconfig"
5606 else if test -d "$with_libvarnish/lib"
5608 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5609 with_libvarnish_cflags="-I$withval/include"
5610 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5611 with_libvarnish="yes"
5614 [with_libvarnish="use_pkgconfig"])
5616 # configure using pkg-config
5617 if test "x$with_libvarnish" = "xuse_pkgconfig"
5619 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5620 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5623 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5626 if test "x$with_libvarnish" = "xuse_pkgconfig"
5628 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5631 with_libvarnish="no ($PKG_CONFIG failed)"
5633 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5636 with_libvarnish="no ($PKG_CONFIG failed)"
5639 if test "x$with_libvarnish" = "xuse_pkgconfig"
5641 with_libvarnish="yes"
5644 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5645 # the actual checks.
5646 if test "x$with_libvarnish" = "xyes"
5648 SAVE_CPPFLAGS="$CPPFLAGS"
5650 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5652 AC_CHECK_HEADERS(vapi/vsc.h,
5653 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5654 [AC_CHECK_HEADERS(vsc.h,
5655 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5656 [AC_CHECK_HEADERS(varnishapi.h,
5657 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5658 [with_libvarnish="no (found none of the varnish header files)"])])])
5660 CPPFLAGS="$SAVE_CPPFLAGS"
5662 if test "x$with_libvarnish" = "xyes"
5664 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5665 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5666 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5667 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5671 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5672 with_libxml2="no (pkg-config isn't available)"
5673 with_libxml2_cflags=""
5674 with_libxml2_ldflags=""
5675 with_libvirt="no (pkg-config isn't available)"
5676 with_libvirt_cflags=""
5677 with_libvirt_ldflags=""
5678 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5683 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5686 $PKG_CONFIG --exists libvirt 2>/dev/null
5691 with_libvirt="no (pkg-config doesn't know libvirt)"
5693 if test "x$with_libxml2" = "xyes"
5695 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5700 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5706 if test "x$with_libxml2" = "xyes"
5708 SAVE_CPPFLAGS="$CPPFLAGS"
5709 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5711 AC_CHECK_HEADERS(libxml/parser.h, [],
5712 [with_libxml2="no (libxml/parser.h not found)"])
5714 CPPFLAGS="$SAVE_CPPFLAGS"
5716 if test "x$with_libxml2" = "xyes"
5718 SAVE_CFLAGS="$CFLAGS"
5719 SAVE_LDFLAGS="$LDFLAGS"
5721 CFLAGS="$CFLAGS $with_libxml2_cflags"
5722 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5724 AC_CHECK_LIB(xml2, xmlXPathEval,
5725 [with_libxml2="yes"],
5726 [with_libxml2="no (symbol xmlXPathEval not found)"])
5728 CFLAGS="$SAVE_CFLAGS"
5729 LDFLAGS="$SAVE_LDFLAGS"
5731 dnl Add the right compiler flags and libraries.
5732 if test "x$with_libxml2" = "xyes"; then
5733 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5734 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5735 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5736 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5738 if test "x$with_libvirt" = "xyes"
5740 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5745 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5751 if test "x$with_libvirt" = "xyes"
5753 SAVE_CPPFLAGS="$CPPFLAGS"
5754 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5756 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5757 [with_libvirt="no (libvirt/libvirt.h not found)"])
5759 CPPFLAGS="$SAVE_CPPFLAGS"
5761 if test "x$with_libvirt" = "xyes"
5763 SAVE_CFLAGS="$CFLAGS"
5764 SAVE_LDFLAGS="$LDFLAGS"
5766 CFLAGS="$CFLAGS $with_libvirt_cflags"
5767 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5769 AC_CHECK_LIB(virt, virDomainBlockStats,
5770 [with_libvirt="yes"],
5771 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5773 CFLAGS="$SAVE_CFLAGS"
5774 LDFLAGS="$SAVE_LDFLAGS"
5776 dnl Add the right compiler flags and libraries.
5777 if test "x$with_libvirt" = "xyes"; then
5778 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5779 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5780 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5781 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5785 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5786 with_libopenipmipthread="yes"
5787 with_libopenipmipthread_cflags=""
5788 with_libopenipmipthread_libs=""
5790 if test "x$with_libopenipmipthread" = "xyes"
5792 AC_MSG_CHECKING([for libOpenIPMIpthread])
5793 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5796 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5798 AC_MSG_RESULT([$with_libopenipmipthread])
5801 if test "x$with_libopenipmipthread" = "xyes"
5803 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5804 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5807 with_libopenipmipthread_cflags="$temp_result"
5809 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5810 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5812 AC_MSG_RESULT([$temp_result])
5815 if test "x$with_libopenipmipthread" = "xyes"
5817 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5818 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5821 with_libopenipmipthread_ldflags="$temp_result"
5823 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5824 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5826 AC_MSG_RESULT([$temp_result])
5829 if test "x$with_libopenipmipthread" = "xyes"
5831 SAVE_CPPFLAGS="$CPPFLAGS"
5832 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5834 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5835 [with_libopenipmipthread="yes"],
5836 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5837 [#include <OpenIPMI/ipmiif.h>
5838 #include <OpenIPMI/ipmi_err.h>
5839 #include <OpenIPMI/ipmi_posix.h>
5840 #include <OpenIPMI/ipmi_conn.h>
5843 CPPFLAGS="$SAVE_CPPFLAGS"
5846 if test "x$with_libopenipmipthread" = "xyes"
5848 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5849 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5850 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5851 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5855 # --with-libatasmart {{{
5856 with_libatasmart_cppflags=""
5857 with_libatasmart_ldflags=""
5858 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5860 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5862 with_libatasmart_cppflags="-I$withval/include"
5863 with_libatasmart_ldflags="-L$withval/lib"
5864 with_libatasmart="yes"
5866 with_libatasmart="$withval"
5870 if test "x$ac_system" = "xLinux"
5872 with_libatasmart="yes"
5874 with_libatasmart="no (Linux only library)"
5877 if test "x$with_libatasmart" = "xyes"
5879 SAVE_CPPFLAGS="$CPPFLAGS"
5880 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5882 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5884 CPPFLAGS="$SAVE_CPPFLAGS"
5886 if test "x$with_libatasmart" = "xyes"
5888 SAVE_CPPFLAGS="$CPPFLAGS"
5889 SAVE_LDFLAGS="$LDFLAGS"
5890 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5891 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5893 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5895 CPPFLAGS="$SAVE_CPPFLAGS"
5896 LDFLAGS="$SAVE_LDFLAGS"
5898 if test "x$with_libatasmart" = "xyes"
5900 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5901 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5902 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5903 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5904 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5905 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5906 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5908 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5911 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5912 [with_libnotify="yes"],
5913 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5916 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5917 [with_libriemann_client="yes"],
5918 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5920 # Check for enabled/disabled features
5923 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5924 # ------------------------------------------------------------
5926 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5931 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5936 m4_define([EnDis],[disabled])dnl
5937 m4_define([YesNo],[no])dnl
5943 m4_define([EnDis],[enabled])dnl
5944 m4_define([YesNo],[yes])dnl
5947 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5951 m4_if([$3], [feature], [],
5955 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5961 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5963 enable_$1='[YesNo]'dnl
5965 if test "x$enable_$1" = "xno"
5969 if test "x$enable_$1" = "xyes"
5973 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5978 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5979 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5981 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5983 # AC_PLUGIN(name, default, info)
5984 # ------------------------------------------------------------
5991 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5993 if test "x$enableval" = "xyes"
5996 else if test "x$enableval" = "xforce"
6001 enable_plugin="no (disabled on command line)"
6005 if test "x$enable_all_plugins" = "xauto"
6007 if test "x$2" = "xyes"
6014 enable_plugin="$enable_all_plugins"
6017 if test "x$enable_plugin" = "xyes"
6019 if test "x$2" = "xyes" || test "x$force" = "xyes"
6021 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
6022 if test "x$2" != "xyes"
6024 dependency_warning="yes"
6026 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
6027 dependency_error="yes"
6028 enable_plugin="$2 (dependency error)"
6031 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
6032 enable_$1="$enable_plugin"
6034 )# AC_PLUGIN(name, default, info)
6036 m4_divert_once([HELP_ENABLE], [
6037 collectd features:])
6038 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
6039 AC_COLLECTD([debug], [enable], [feature], [debugging])
6040 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
6041 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
6042 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
6044 dependency_warning="no"
6045 dependency_error="no"
6048 plugin_barometer="no"
6053 plugin_conntrack="no"
6054 plugin_contextswitch="no"
6057 plugin_cpusleep="no"
6058 plugin_curl_json="no"
6059 plugin_curl_xml="no"
6063 plugin_dpdkstat="no"
6070 plugin_hugepages="no"
6071 plugin_intel_rdt="no"
6072 plugin_interface="no"
6077 plugin_log_logstash="no"
6079 plugin_multimeter="no"
6084 plugin_processes="no"
6085 plugin_protocols="no"
6091 plugin_tcpconns="no"
6094 plugin_turbostat="no"
6100 plugin_wireless="no"
6101 plugin_write_prometheus="no"
6105 plugin_zookeeper="no"
6108 if test "x$ac_system" = "xLinux"
6110 plugin_battery="yes"
6111 plugin_cgroups="yes"
6112 plugin_conntrack="yes"
6113 plugin_contextswitch="yes"
6115 plugin_cpufreq="yes"
6118 plugin_entropy="yes"
6119 plugin_fhcount="yes"
6120 plugin_fscache="yes"
6121 plugin_hugepages="yes"
6122 plugin_interface="yes"
6130 plugin_processes="yes"
6131 plugin_protocols="yes"
6134 plugin_tcpconns="yes"
6135 plugin_thermal="yes"
6138 plugin_vserver="yes"
6139 plugin_wireless="yes"
6140 plugin_zfs_arc="yes"
6142 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
6146 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
6148 plugin_turbostat="yes"
6151 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6153 plugin_cpusleep="yes"
6157 if test "x$ac_system" = "xOpenBSD"
6159 plugin_tcpconns="yes"
6162 if test "x$ac_system" = "xNetBSD"
6165 plugin_entropy="yes"
6167 plugin_processes="yes"
6171 if test "x$with_libiokit" = "xyes"
6173 plugin_battery="yes"
6179 if test "x$ac_system" = "xAIX"
6182 plugin_tcpconns="yes"
6187 if test "x$ac_system" = "xFreeBSD"
6190 plugin_zfs_arc="yes"
6194 if test "x$with_perfstat" = "xyes"
6196 plugin_contextswitch="yes"
6199 plugin_interface="yes"
6206 if test "x$with_procinfo" = "xyes"
6208 plugin_processes="yes"
6212 if test "x$with_kstat" = "xyes"
6215 plugin_processes="yes"
6217 plugin_zfs_arc="yes"
6221 if test "x$with_devinfo$with_kstat" = "xyesyes"
6225 plugin_interface="yes"
6231 if test "x$ac_system" = "xLinux"
6233 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6234 [with_libi2c="yes"],
6235 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6236 [[#include <stdlib.h>
6237 #include <linux/i2c-dev.h>]])
6239 with_libi2c="no (Linux only)"
6242 if test "x$with_libi2c" = "xyes"
6244 plugin_barometer="yes"
6249 if test "x$with_libstatgrab" = "xyes"
6253 plugin_interface="yes"
6260 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6263 if test "x$have_strptime" = "xyes"
6269 if test "x$with_libopenipmipthread" = "xyes"
6274 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6276 plugin_curl_json="yes"
6279 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6281 plugin_curl_xml="yes"
6284 if test "x$with_libyajl" = "xyes"
6289 if test "x$have_processor_info" = "xyes"
6293 if test "x$have_sysctl" = "xyes"
6298 if test "x$ac_system" = "xDarwin"
6303 if test "x$have_sysctlbyname" = "xyes"
6305 plugin_contextswitch="yes"
6308 plugin_tcpconns="yes"
6311 # Df plugin: Check if we know how to determine mount points first.
6312 #if test "x$have_listmntent" = "xyes"; then
6315 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6319 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6323 #if test "x$have_getmntent" = "xseq"
6327 if test "x$c_cv_have_one_getmntent" = "xyes"
6332 if test "x$c_cv_have_getmntent_r" = "xyes"
6337 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6338 if test "x$plugin_df" = "xyes"
6341 if test "x$have_statfs" = "xyes"
6345 if test "x$have_statvfs" = "xyes"
6351 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6353 plugin_ethstat="yes"
6356 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6361 if test "x$have_getifaddrs" = "xyes"
6363 plugin_interface="yes"
6366 if test "x$with_libgps" = "xyes"
6371 if test "x$have_getloadavg" = "xyes"
6376 if test "x$with_libyajl" = "xyes"
6378 plugin_log_logstash="yes"
6381 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6386 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6389 if test "x$with_libmicrohttpd" = "xyes"
6391 plugin_write_prometheus="yes"
6395 # Mac OS X memory interface
6396 if test "x$have_host_statistics" = "xyes"
6401 if test "x$have_termios_h" = "xyes"
6403 if test "x$ac_system" != "xAIX"
6405 plugin_multimeter="yes"
6410 if test "x$have_thread_info" = "xyes"
6412 plugin_processes="yes"
6415 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6417 plugin_processes="yes"
6420 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6422 plugin_processes="yes"
6425 if test "x$with_libpython" != "xno"
6430 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6435 if test "x$with_kvm_getswapinfo" = "xyes"
6440 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6445 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6450 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6452 plugin_tcpconns="yes"
6455 if test "x$have_getutent" = "xyes"
6459 if test "x$have_getutxent" = "xyes"
6464 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6469 if test "x$with_libxenctrl" = "xyes"
6474 if test "x$with_libdpdk" = "xyes"
6476 plugin_dpdkstat="yes"
6479 m4_divert_once([HELP_ENABLE], [
6482 AC_ARG_ENABLE([all-plugins],
6483 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6485 if test "x$enableval" = "xyes"
6487 enable_all_plugins="yes"
6488 else if test "x$enableval" = "xauto"
6490 enable_all_plugins="auto"
6492 enable_all_plugins="no"
6495 [enable_all_plugins="auto"])
6497 m4_divert_once([HELP_ENABLE], [])
6499 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6500 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6501 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6502 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6503 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6504 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6505 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6506 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6507 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6508 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6509 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6510 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6511 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6512 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6513 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6514 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6515 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6516 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6517 AC_PLUGIN([csv], [yes], [CSV output plugin])
6518 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6519 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6520 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6521 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6522 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6523 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6524 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6525 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats & Status from DPDK])
6526 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6527 AC_PLUGIN([email], [yes], [EMail statistics])
6528 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6529 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6530 AC_PLUGIN([exec], [yes], [Execution of external programs])
6531 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6532 AC_PLUGIN([filecount], [yes], [Count files in directories])
6533 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6534 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6535 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6536 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6537 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6538 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6539 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6540 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6541 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6542 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6543 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6544 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6545 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6546 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6547 AC_PLUGIN([load], [$plugin_load], [System load])
6548 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6549 AC_PLUGIN([logfile], [yes], [File logging plugin])
6550 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6551 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6552 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6553 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6554 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6555 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6556 AC_PLUGIN([match_regex], [yes], [The regex match])
6557 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6558 AC_PLUGIN([match_value], [yes], [The value match])
6559 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6560 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6561 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6562 AC_PLUGIN([memcached], [yes], [memcached statistics])
6563 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6564 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6565 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6566 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6567 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6568 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6569 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6570 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6571 AC_PLUGIN([network], [yes], [Network communication plugin])
6572 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6573 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6574 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6575 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6576 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6577 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6578 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6579 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6580 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6581 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6582 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6583 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6584 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6585 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6586 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6587 # FIXME: Check for libevent, too.
6588 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6589 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6590 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6591 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6592 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6593 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6594 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6595 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6596 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6597 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6598 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6599 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6600 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6601 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6602 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6603 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6604 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6605 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6606 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6607 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6608 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6609 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6610 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6611 AC_PLUGIN([target_notification], [yes], [The notification target])
6612 AC_PLUGIN([target_replace], [yes], [The replace target])
6613 AC_PLUGIN([target_scale], [yes], [The scale target])
6614 AC_PLUGIN([target_set], [yes], [The set target])
6615 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6616 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6617 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6618 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6619 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6620 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6621 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6622 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6623 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6624 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6625 AC_PLUGIN([users], [$plugin_users], [User statistics])
6626 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6627 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6628 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6629 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6630 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6631 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6632 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6633 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6634 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6635 AC_PLUGIN([write_log], [yes], [Log output plugin])
6636 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6637 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6638 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6639 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6640 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6641 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6642 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6643 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6644 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6645 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6646 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6648 dnl Default configuration file
6649 # Load either syslog or logfile
6650 LOAD_PLUGIN_SYSLOG=""
6651 LOAD_PLUGIN_LOGFILE=""
6652 LOAD_PLUGIN_LOG_LOGSTASH=""
6654 AC_MSG_CHECKING([which default log plugin to load])
6655 default_log_plugin="none"
6656 if test "x$enable_syslog" = "xyes"
6658 default_log_plugin="syslog"
6660 LOAD_PLUGIN_SYSLOG="##"
6663 if test "x$enable_logfile" = "xyes"
6665 if test "x$default_log_plugin" = "xnone"
6667 default_log_plugin="logfile"
6669 LOAD_PLUGIN_LOGFILE="#"
6672 LOAD_PLUGIN_LOGFILE="##"
6675 if test "x$enable_log_logstash" = "xyes"
6677 LOAD_PLUGIN_LOG_LOGSTASH="#"
6679 LOAD_PLUGIN_LOG_LOGSTASH="##"
6683 AC_MSG_RESULT([$default_log_plugin])
6685 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6686 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6687 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6689 DEFAULT_LOG_LEVEL="info"
6690 if test "x$enable_debug" = "xyes"
6692 DEFAULT_LOG_LEVEL="debug"
6694 AC_SUBST(DEFAULT_LOG_LEVEL)
6696 # Load only one of rrdtool, network, csv in the default config.
6697 LOAD_PLUGIN_RRDTOOL=""
6698 LOAD_PLUGIN_NETWORK=""
6701 AC_MSG_CHECKING([which default write plugin to load])
6702 default_write_plugin="none"
6703 if test "x$enable_rrdtool" = "xyes"
6705 default_write_plugin="rrdtool"
6707 LOAD_PLUGIN_RRDTOOL="##"
6710 if test "x$enable_network" = "xyes"
6712 if test "x$default_write_plugin" = "xnone"
6714 default_write_plugin="network"
6716 LOAD_PLUGIN_NETWORK="#"
6719 LOAD_PLUGIN_NETWORK="##"
6722 if test "x$enable_csv" = "xyes"
6724 if test "x$default_write_plugin" = "xnone"
6726 default_write_plugin="csv"
6731 LOAD_PLUGIN_CSV="##"
6733 AC_MSG_RESULT([$default_write_plugin])
6735 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6736 AC_SUBST(LOAD_PLUGIN_NETWORK)
6737 AC_SUBST(LOAD_PLUGIN_CSV)
6740 if test "x$ac_system" = "xLinux" \
6741 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6743 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6746 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6748 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6752 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6753 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6755 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6757 PERL_BINDINGS_OPTIONS="$withval"
6758 with_perl_bindings="yes"
6760 with_perl_bindings="$withval"
6764 if test -n "$perl_interpreter"
6766 with_perl_bindings="yes"
6768 with_perl_bindings="no (no perl interpreter found)"
6772 if test "x$with_perl_bindings" = "xyes"
6774 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6775 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6776 AC_MSG_RESULT([yes])
6779 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6783 if test "x$with_perl_bindings" = "xyes"
6785 PERL_BINDINGS="perl"
6789 AC_SUBST(PERL_BINDINGS)
6790 AC_SUBST(PERL_BINDINGS_OPTIONS)
6792 dnl libcollectdclient
6793 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6794 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6795 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6797 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6799 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6801 AC_SUBST(LCC_VERSION_MAJOR)
6802 AC_SUBST(LCC_VERSION_MINOR)
6803 AC_SUBST(LCC_VERSION_PATCH)
6804 AC_SUBST(LCC_VERSION_EXTRA)
6805 AC_SUBST(LCC_VERSION_STRING)
6807 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6811 if test "x$enable_werror" != "xno"
6813 AM_CFLAGS="$AM_CFLAGS -Werror"
6814 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6816 AC_SUBST([AM_CFLAGS])
6817 AC_SUBST([AM_CXXFLAGS])
6819 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])
6822 if test "x$with_librrd" = "xyes" \
6823 && test "x$librrd_threadsafe" != "xyes"
6825 with_librrd="yes (warning: librrd is not thread-safe)"
6828 if test "x$with_libperl" = "xyes"
6830 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6832 enable_perl="no (needs libperl)"
6835 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6837 enable_perl="no (libperl doesn't support ithreads)"
6840 if test "x$with_perl_bindings" = "xyes" \
6841 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6843 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6847 AC_MSG_RESULT([Configuration:])
6848 AC_MSG_RESULT([ Build:])
6849 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6850 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6851 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6852 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6853 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6854 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6855 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6856 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6857 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6858 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6859 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6860 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6862 AC_MSG_RESULT([ Libraries:])
6863 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6864 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6865 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6866 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6867 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6868 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6869 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6870 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6871 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6872 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6873 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6874 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6875 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6876 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6877 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6878 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6879 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6880 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6881 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6882 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6883 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6884 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6885 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6886 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6887 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6888 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6889 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6890 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6891 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6892 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6893 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6894 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6895 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6896 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6897 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6898 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6899 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6900 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6901 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6902 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6903 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6904 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6905 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6906 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6907 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6908 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6909 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6910 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6911 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6912 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6913 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6914 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6915 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6916 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6917 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6918 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6919 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6920 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6921 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6922 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6923 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6924 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6925 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6926 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6928 AC_MSG_RESULT([ Features:])
6929 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6930 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6932 AC_MSG_RESULT([ Bindings:])
6933 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6935 AC_MSG_RESULT([ Modules:])
6936 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6937 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6938 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6939 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6940 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6941 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6942 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6943 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6944 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6945 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6946 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6947 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6948 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6949 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6950 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6951 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6952 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6953 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6954 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6955 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6956 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6957 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6958 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6959 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6960 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6961 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6962 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6963 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6964 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6965 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6966 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6967 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6968 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6969 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6970 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6971 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6972 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6973 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6974 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6975 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6976 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6977 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6978 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6979 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6980 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6981 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6982 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6983 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6984 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6985 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6986 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6987 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6988 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6989 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6990 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6991 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6992 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6993 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6994 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6995 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6996 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6997 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6998 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6999 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
7000 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
7001 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
7002 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
7003 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
7004 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
7005 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
7006 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
7007 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
7008 AC_MSG_RESULT([ network . . . . . . . $enable_network])
7009 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
7010 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
7011 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
7012 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
7013 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
7014 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
7015 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
7016 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
7017 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
7018 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
7019 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
7020 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
7021 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
7022 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
7023 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
7024 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
7025 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
7026 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
7027 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
7028 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
7029 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
7030 AC_MSG_RESULT([ python . . . . . . . $enable_python])
7031 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
7032 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
7033 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
7034 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
7035 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
7036 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
7037 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
7038 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
7039 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
7040 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
7041 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
7042 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
7043 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
7044 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
7045 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
7046 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
7047 AC_MSG_RESULT([ target_notification . $enable_target_notification])
7048 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
7049 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
7050 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
7051 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
7052 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
7053 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
7054 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
7055 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
7056 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
7057 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
7058 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
7059 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
7060 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
7061 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
7062 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
7063 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
7064 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
7065 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
7066 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
7067 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
7068 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
7069 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
7070 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
7071 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
7072 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
7073 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
7074 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
7075 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
7076 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
7077 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
7078 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
7079 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
7080 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
7081 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
7082 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
7085 if test "x$dependency_error" = "xyes"; then
7086 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
7089 if test "x$dependency_warning" = "xyes"; then
7090 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
7093 # vim: set fdm=marker :