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_bound,
839 [have_capability="yes"],
840 [have_capability="no (cap_get_bound() not found)"])
842 if test "x$have_capability" = "xyes"; then
843 AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_bound() (-lcap).])
845 AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes")
848 # Checks for typedefs, structures, and compiler characteristics.
857 # Checks for library functions.
859 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)
866 AC_LANG_SOURCE([[int main(void){}]])
868 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
875 SAVE_CFLAGS="$CFLAGS"
876 # Emulate behavior of src/Makefile.am
877 if test "x$GCC" = "xyes"
879 CFLAGS="$CFLAGS -Wall -Werror"
882 AC_CACHE_CHECK([for strtok_r],
883 [c_cv_have_strtok_r_default],
892 char buffer[] = "foo,bar,baz";
899 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
902 printf ("token = %s;\n", token);
906 [c_cv_have_strtok_r_default="yes"],
907 [c_cv_have_strtok_r_default="no"]
911 if test "x$c_cv_have_strtok_r_default" = "xno"
913 CFLAGS="$CFLAGS -D_REENTRANT=1"
915 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
916 [c_cv_have_strtok_r_reentrant],
925 char buffer[] = "foo,bar,baz";
932 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
935 printf ("token = %s;\n", token);
939 [c_cv_have_strtok_r_reentrant="yes"],
940 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
945 CFLAGS="$SAVE_CFLAGS"
946 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
948 CFLAGS="$CFLAGS -D_REENTRANT=1"
951 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
953 socket_needs_socket="no"
954 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
955 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
957 clock_gettime_needs_rt="no"
958 clock_gettime_needs_posix4="no"
959 have_clock_gettime="no"
960 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
961 if test "x$have_clock_gettime" = "xno"
963 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
964 have_clock_gettime="yes"])
966 if test "x$have_clock_gettime" = "xno"
968 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
969 have_clock_gettime="yes"])
971 if test "x$have_clock_gettime" = "xyes"
973 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
976 nanosleep_needs_rt="no"
977 nanosleep_needs_posix4="no"
978 AC_CHECK_FUNCS(nanosleep,
980 AC_CHECK_LIB(rt, nanosleep,
981 [nanosleep_needs_rt="yes"],
982 AC_CHECK_LIB(posix4, nanosleep,
983 [nanosleep_needs_posix4="yes"],
984 AC_MSG_ERROR(cannot find nanosleep))))
986 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
987 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
989 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
990 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
991 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
992 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
993 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
994 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
995 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
996 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
997 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
998 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
999 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
1000 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
1002 # Check for strptime {{{
1003 if test "x$GCC" = "xyes"
1005 SAVE_CFLAGS="$CFLAGS"
1006 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
1009 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
1010 if test "x$have_strptime" = "xyes"
1012 AC_CACHE_CHECK([whether strptime is exported by default],
1013 [c_cv_have_strptime_default],
1014 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1020 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1023 [c_cv_have_strptime_default="yes"],
1024 [c_cv_have_strptime_default="no"]))
1026 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
1028 AC_CACHE_CHECK([whether strptime needs standards mode],
1029 [c_cv_have_strptime_standards],
1030 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1032 #ifndef _ISOC99_SOURCE
1033 # define _ISOC99_SOURCE 1
1035 #ifndef _POSIX_C_SOURCE
1036 # define _POSIX_C_SOURCE 200112L
1038 #ifndef _XOPEN_SOURCE
1039 # define _XOPEN_SOURCE 500
1045 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1048 [c_cv_have_strptime_standards="yes"],
1049 [c_cv_have_strptime_standards="no"]))
1051 if test "x$c_cv_have_strptime_standards" = "xyes"
1053 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
1059 if test "x$GCC" = "xyes"
1061 CFLAGS="$SAVE_CFLAGS"
1063 # }}} Check for strptime
1065 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
1066 if test "x$have_swapctl" = "xyes"; then
1067 AC_CACHE_CHECK([whether swapctl takes two arguments],
1068 [c_cv_have_swapctl_two_args],
1069 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1071 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1072 # undef _FILE_OFFSET_BITS
1073 # undef _LARGEFILE64_SOURCE
1075 #include <sys/stat.h>
1076 #include <sys/param.h>
1077 #include <sys/swap.h>
1081 int num = swapctl(0, NULL);
1084 [c_cv_have_swapctl_two_args="yes"],
1085 [c_cv_have_swapctl_two_args="no"]
1088 AC_CACHE_CHECK([whether swapctl takes three arguments],
1089 [c_cv_have_swapctl_three_args],
1093 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1094 # undef _FILE_OFFSET_BITS
1095 # undef _LARGEFILE64_SOURCE
1097 #include <sys/stat.h>
1098 #include <sys/param.h>
1099 #include <sys/swap.h>
1103 int num = swapctl(0, NULL, 0);
1106 [c_cv_have_swapctl_three_args="yes"],
1107 [c_cv_have_swapctl_three_args="no"]
1111 # Check for different versions of `swapctl' here..
1112 if test "x$have_swapctl" = "xyes"; then
1113 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1114 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
1115 [Define if the function swapctl exists and takes two arguments.])
1117 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1118 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
1119 [Define if the function swapctl exists and takes three arguments.])
1124 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1126 if test "x$withval" = "xno"; then
1128 else if test "x$withval" = "xyes"; then
1135 if test "x$nan_type" = "xnone"; then
1136 AC_CACHE_CHECK([whether NAN is defined by default],
1137 [c_cv_have_nan_default],
1138 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1142 static double foo = NAN;
1151 [c_cv_have_nan_default="yes"],
1152 [c_cv_have_nan_default="no"]
1155 if test "x$c_cv_have_nan_default" = "xyes"
1160 if test "x$nan_type" = "xnone"; then
1161 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1162 [c_cv_have_nan_isoc],
1163 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1166 #define __USE_ISOC99 1
1168 static double foo = NAN;
1177 [c_cv_have_nan_isoc="yes"],
1178 [c_cv_have_nan_isoc="no"]
1181 if test "x$c_cv_have_nan_isoc" = "xyes"
1186 if test "x$nan_type" = "xnone"; then
1187 SAVE_LDFLAGS=$LDFLAGS
1188 LDFLAGS="$LDFLAGS -lm"
1189 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1190 [c_cv_have_nan_zero],
1191 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1198 #define NAN (0.0 / 0.0)
1200 # define isnan(f) ((f) != (f))
1202 static double foo = NAN;
1211 [c_cv_have_nan_zero="yes"],
1212 [c_cv_have_nan_zero="no"]
1215 LDFLAGS=$SAVE_LDFLAGS
1216 if test "x$c_cv_have_nan_zero" = "xyes"
1222 if test "x$nan_type" = "xdefault"; then
1223 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1224 [Define if NAN is defined by default and can initialize static variables.])
1225 else if test "x$nan_type" = "xisoc99"; then
1226 AC_DEFINE(NAN_STATIC_ISOC, 1,
1227 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1228 else if test "x$nan_type" = "xzero"; then
1229 AC_DEFINE(NAN_ZERO_ZERO, 1,
1230 [Define if NAN can be defined as (0.0 / 0.0)])
1232 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1235 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1237 if test "x$withval" = "xnothing"; then
1238 fp_layout_type="nothing"
1239 else if test "x$withval" = "xendianflip"; then
1240 fp_layout_type="endianflip"
1241 else if test "x$withval" = "xintswap"; then
1242 fp_layout_type="intswap"
1244 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1247 [fp_layout_type="unknown"])
1249 if test "x$fp_layout_type" = "xunknown"; then
1250 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1251 [c_cv_fp_layout_need_nothing],
1252 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1258 # include <stdint.h>
1261 # include <inttypes.h>
1264 # include <stdbool.h>
1274 memcpy ((void *) &i0, (void *) &d, 8);
1277 memcpy ((void *) c, (void *) &i1, 8);
1279 if ((c[0] == 0x2f) && (c[1] == 0x25)
1280 && (c[2] == 0xc0) && (c[3] == 0xc7)
1281 && (c[4] == 0x43) && (c[5] == 0x2b)
1282 && (c[6] == 0x1f) && (c[7] == 0x5b))
1288 [c_cv_fp_layout_need_nothing="yes"],
1289 [c_cv_fp_layout_need_nothing="no"]
1292 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1293 fp_layout_type="nothing"
1296 if test "x$fp_layout_type" = "xunknown"; then
1297 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1298 [c_cv_fp_layout_need_endianflip],
1299 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1305 # include <stdint.h>
1308 # include <inttypes.h>
1311 # include <stdbool.h>
1313 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1314 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1315 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1316 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1317 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1318 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1319 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1320 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1329 memcpy ((void *) &i0, (void *) &d, 8);
1331 i1 = endianflip (i0);
1332 memcpy ((void *) c, (void *) &i1, 8);
1334 if ((c[0] == 0x2f) && (c[1] == 0x25)
1335 && (c[2] == 0xc0) && (c[3] == 0xc7)
1336 && (c[4] == 0x43) && (c[5] == 0x2b)
1337 && (c[6] == 0x1f) && (c[7] == 0x5b))
1343 [c_cv_fp_layout_need_endianflip="yes"],
1344 [c_cv_fp_layout_need_endianflip="no"]
1347 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1348 fp_layout_type="endianflip"
1351 if test "x$fp_layout_type" = "xunknown"; then
1352 AC_CACHE_CHECK([if intswap converts to x86 representation],
1353 [c_cv_fp_layout_need_intswap],
1354 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1360 # include <stdint.h>
1363 # include <inttypes.h>
1366 # include <stdbool.h>
1368 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1369 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1378 memcpy ((void *) &i0, (void *) &d, 8);
1381 memcpy ((void *) c, (void *) &i1, 8);
1383 if ((c[0] == 0x2f) && (c[1] == 0x25)
1384 && (c[2] == 0xc0) && (c[3] == 0xc7)
1385 && (c[4] == 0x43) && (c[5] == 0x2b)
1386 && (c[6] == 0x1f) && (c[7] == 0x5b))
1392 [c_cv_fp_layout_need_intswap="yes"],
1393 [c_cv_fp_layout_need_intswap="no"]
1396 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1397 fp_layout_type="intswap"
1401 if test "x$fp_layout_type" = "xnothing"; then
1402 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1403 [Define if doubles are stored in x86 representation.])
1404 else if test "x$fp_layout_type" = "xendianflip"; then
1405 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1406 [Define if endianflip is needed to convert to x86 representation.])
1407 else if test "x$fp_layout_type" = "xintswap"; then
1408 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1409 [Define if intswap is needed to convert to x86 representation.])
1411 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1414 # --with-useragent {{{
1415 AC_ARG_WITH(useragent, [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1417 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1419 AC_DEFINE_UNQUOTED(COLLECTD_USERAGENT, ["$withval"], [User agent for http requests])
1425 # --with-data-max-name-len {{{
1426 AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1428 if test "x$withval" != "x" && test $withval -gt 0
1430 AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
1432 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1435 [ AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
1440 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1441 have_getvfsstat="no"
1442 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1443 have_listmntent="no"
1444 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1445 have_getmntent_r="no"
1446 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1449 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1450 if test "x$have_getmntent" = "xno"; then
1451 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1453 if test "x$have_getmntent" = "xno"; then
1454 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1456 if test "x$have_getmntent" = "xno"; then
1457 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1460 if test "x$have_getmntent" = "xc"; then
1461 AC_CACHE_CHECK([whether getmntent takes one argument],
1462 [c_cv_have_one_getmntent],
1466 #include "$srcdir/src/utils_mount.h"
1471 fh = setmntent ("/etc/mtab", "r");
1472 me = getmntent (fh);
1473 return(me->mnt_passno);
1476 [c_cv_have_one_getmntent="yes"],
1477 [c_cv_have_one_getmntent="no"]
1480 AC_CACHE_CHECK([whether getmntent takes two arguments],
1481 [c_cv_have_two_getmntent],
1485 #include "$srcdir/src/utils_mount.h"
1491 fh = fopen ("/etc/mnttab", "r");
1492 status = getmntent (fh, &mt);
1496 [c_cv_have_two_getmntent="yes"],
1497 [c_cv_have_two_getmntent="no"]
1502 # Check for different versions of `getmntent' here..
1504 if test "x$have_getmntent" = "xc"; then
1505 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1506 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1507 [Define if the function getmntent exists and takes one argument.])
1509 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1510 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1511 [Define if the function getmntent exists and takes two arguments.])
1514 if test "x$have_getmntent" = "xsun"; then
1515 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1516 [Define if the function getmntent exists. It is the version from libsun.])
1518 if test "x$have_getmntent" = "xseq"; then
1519 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1520 [Define if the function getmntent exists. It is the version from libseq.])
1522 if test "x$have_getmntent" = "xgen"; then
1523 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1524 [Define if the function getmntent exists. It is the version from libgen.])
1528 AC_CACHE_CHECK([if have htonll defined],
1530 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1532 #include <sys/types.h>
1533 #include <netinet/in.h>
1535 # include <inttypes.h>
1542 [c_cv_have_htonll="yes"],
1543 [c_cv_have_htonll="no"]
1546 if test "x$c_cv_have_htonll" = "xyes"
1548 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1551 # Check for structures
1552 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1553 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1556 #include <sys/types.h>
1557 #include <sys/socket.h>
1560 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1561 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1564 #include <sys/types.h>
1565 #include <sys/socket.h>
1566 #include <linux/if.h>
1567 #include <linux/netdevice.h>
1569 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1570 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1573 #include <linux/inet_diag.h>
1577 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1580 #include <netinet/in.h>
1584 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1586 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1587 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1588 have_struct_kinfo_proc_freebsd="yes"
1591 have_struct_kinfo_proc_freebsd="no"
1595 #include <sys/param.h>
1596 #include <sys/sysctl.h>
1597 #include <sys/user.h>
1600 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1602 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1603 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1604 have_struct_kinfo_proc_openbsd="yes"
1607 have_struct_kinfo_proc_openbsd="no"
1610 #include <sys/param.h>
1611 #include <sys/sysctl.h>
1616 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1618 AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
1619 [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1620 have_struct_kinfo_proc2_netbsd="yes"
1623 have_struct_kinfo_proc2_netbsd="no"
1626 #include <sys/param.h>
1627 #include <sys/sysctl.h>
1633 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1634 [#define _BSD_SOURCE
1635 #define _DEFAULT_SOURCE
1637 # include <stdint.h>
1639 #if HAVE_SYS_TYPES_H
1640 # include <sys/types.h>
1642 #if HAVE_NETINET_IN_SYSTM_H
1643 # include <netinet/in_systm.h>
1645 #if HAVE_NETINET_IN_H
1646 # include <netinet/in.h>
1648 #if HAVE_NETINET_IP_H
1649 # include <netinet/ip.h>
1651 #if HAVE_NETINET_UDP_H
1652 # include <netinet/udp.h>
1655 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1656 [#define _BSD_SOURCE
1657 #define _DEFAULT_SOURCE
1659 # include <stdint.h>
1661 #if HAVE_SYS_TYPES_H
1662 # include <sys/types.h>
1664 #if HAVE_NETINET_IN_SYSTM_H
1665 # include <netinet/in_systm.h>
1667 #if HAVE_NETINET_IN_H
1668 # include <netinet/in.h>
1670 #if HAVE_NETINET_IP_H
1671 # include <netinet/ip.h>
1673 #if HAVE_NETINET_UDP_H
1674 # include <netinet/udp.h>
1678 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1687 # check for pthread_setname_np
1688 SAVE_LDFLAGS="$LDFLAGS"
1689 LDFLAGS="$LDFLAGS -lpthread"
1691 AC_MSG_CHECKING([for pthread_setname_np])
1692 have_pthread_setname_np="no"
1693 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1696 #include <pthread.h>
1699 pthread_setname_np((pthread_t) {0}, "conftest");
1702 have_pthread_setname_np="yes"
1703 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1706 AC_MSG_RESULT([$have_pthread_setname_np])
1708 # check for pthread_set_name_np(3) (FreeBSD)
1709 AC_MSG_CHECKING([for pthread_set_name_np])
1710 have_pthread_set_name_np="no"
1711 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1713 #include <pthread_np.h>
1716 pthread_set_name_np((pthread_t) {0}, "conftest");
1719 have_pthread_set_name_np="yes"
1720 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1722 AC_MSG_RESULT([$have_pthread_set_name_np])
1724 LDFLAGS="$SAVE_LDFLAGS"
1727 # Checks for libraries begin here
1730 with_libresolv="yes"
1731 AC_CHECK_LIB(resolv, res_search,
1733 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1735 [with_libresolv="no"])
1736 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1738 dnl Check for HAL (hardware abstraction library)
1740 PKG_CHECK_MODULES([HAL], [hal],
1743 LIBS="$HAL_LIBS $LIBS"
1744 AC_CHECK_LIB([hal], [libhal_device_property_exists],
1746 SAVE_CPPFLAGS="$CPPFLAGS"
1747 CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
1748 AC_CHECK_HEADERS([libhal.h],
1751 BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
1752 BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
1754 CPPFLAGS="$SAVE_CPPFLAGS"
1762 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1763 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1767 AC_CHECK_LIB([pthread],
1770 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
1773 PTHREAD_LIBS="$LIBS"
1776 AC_CHECK_HEADERS([pthread.h],
1778 [AC_MSG_ERROR([pthread.h not found])]
1780 AC_SUBST([PTHREAD_LIBS])
1782 m4_divert_once([HELP_WITH], [
1783 collectd additional packages:])
1785 if test "x$ac_system" = "xAIX"
1790 with_perfstat="no (AIX only)"
1791 with_procinfo="no (AIX only)"
1794 if test "x$with_perfstat" = "xyes"
1796 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1797 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1799 if test "x$with_perfstat" = "xyes"
1801 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1802 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1803 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1804 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1806 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1809 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1811 # Processes plugin under AIX.
1812 if test "x$with_procinfo" = "xyes"
1814 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1816 if test "x$with_procinfo" = "xyes"
1818 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1821 if test "x$ac_system" = "xSolaris"
1826 with_kstat="no (Solaris only)"
1827 with_devinfo="no (Solaris only)"
1830 if test "x$with_kstat" = "xyes"
1832 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1834 if test "x$with_kstat" = "xyes"
1836 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1837 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1839 if test "x$with_kstat" = "xyes"
1841 AC_DEFINE(HAVE_LIBKSTAT, 1,
1842 [Define to 1 if you have the 'kstat' library (-lkstat)])
1844 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1845 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1848 if test "x$ac_system" = "xDarwin"
1854 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1857 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1858 if test "x$with_kvm_getprocs" = "xyes"
1860 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1861 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1864 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1866 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1867 if test "x$with_kvm_getswapinfo" = "xyes"
1869 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1870 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1873 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1875 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1876 if test "x$with_kvm_nlist" = "xyes"
1878 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1879 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1880 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1883 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1885 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1886 if test "x$with_kvm_openfiles" = "xyes"
1888 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1889 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1892 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1894 # --with-libaquaero5 {{{
1895 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1897 if test "x$withval" = "xyes"
1899 with_libaquaero5="yes"
1900 else if test "x$withval" = "xno"
1902 with_libaquaero5="no"
1904 with_libaquaero5="yes"
1905 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1906 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1909 [with_libaquaero5="yes"])
1911 SAVE_CPPFLAGS="$CPPFLAGS"
1912 SAVE_LDFLAGS="$LDFLAGS"
1914 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1915 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1917 if test "x$with_libaquaero5" = "xyes"
1919 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1921 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1923 AC_CHECK_HEADERS(libaquaero5.h,
1924 [with_libaquaero5="yes"],
1925 [with_libaquaero5="no (libaquaero5.h not found)"])
1927 if test "x$with_libaquaero5" = "xyes"
1929 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1931 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1933 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1934 [with_libaquaero5="yes"],
1935 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1938 CPPFLAGS="$SAVE_CPPFLAGS"
1939 LDFLAGS="$SAVE_LDFLAGS"
1941 if test "x$with_libaquaero5" = "xyes"
1943 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1944 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1945 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1946 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1948 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1951 # --with-libhiredis {{{
1952 AC_ARG_WITH(libhiredis, [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@],
1953 [Path to libhiredis.])],
1955 if test "x$withval" = "xyes"
1957 with_libhiredis="yes"
1958 else if test "x$withval" = "xno"
1960 with_libhiredis="no"
1962 with_libhiredis="yes"
1963 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
1964 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
1967 [with_libhiredis="yes"])
1969 SAVE_CPPFLAGS="$CPPFLAGS"
1970 SAVE_LDFLAGS="$LDFLAGS"
1972 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
1973 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
1975 if test "x$with_libhiredis" = "xyes"
1977 if test "x$LIBHIREDIS_CPPFLAGS" != "x"
1979 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
1981 AC_CHECK_HEADERS(hiredis/hiredis.h,
1982 [with_libhiredis="yes"],
1983 [with_libhiredis="no (hiredis.h not found)"])
1985 if test "x$with_libhiredis" = "xyes"
1987 if test "x$LIBHIREDIS_LDFLAGS" != "x"
1989 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
1991 AC_CHECK_LIB(hiredis, redisCommand,
1992 [with_libhiredis="yes"],
1993 [with_libhiredis="no (symbol 'redisCommand' not found)"])
1997 CPPFLAGS="$SAVE_CPPFLAGS"
1998 LDFLAGS="$SAVE_LDFLAGS"
2000 if test "x$with_libhiredis" = "xyes"
2002 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2003 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2004 AC_SUBST(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
2005 AC_SUBST(BUILD_WITH_LIBHIREDIS_LDFLAGS)
2007 AM_CONDITIONAL(BUILD_WITH_LIBHIREDIS, test "x$with_libhiredis" = "xyes")
2010 # --with-libcurl {{{
2011 with_curl_config="curl-config"
2014 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2016 if test "x$withval" = "xno"
2019 else if test "x$withval" = "xyes"
2023 if test -f "$withval" && test -x "$withval"
2025 with_curl_config="$withval"
2027 else if test -x "$withval/bin/curl-config"
2029 with_curl_config="$withval/bin/curl-config"
2038 if test "x$with_libcurl" = "xyes"
2040 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2041 curl_config_status=$?
2043 if test $curl_config_status -ne 0
2045 with_libcurl="no ($with_curl_config failed)"
2047 SAVE_CPPFLAGS="$CPPFLAGS"
2048 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2050 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
2052 CPPFLAGS="$SAVE_CPPFLAGS"
2055 if test "x$with_libcurl" = "xyes"
2057 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2058 curl_config_status=$?
2060 if test $curl_config_status -ne 0
2062 with_libcurl="no ($with_curl_config failed)"
2064 AC_CHECK_LIB(curl, curl_easy_init,
2065 [with_libcurl="yes"],
2066 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2068 AC_CHECK_DECL(CURLOPT_USERNAME,
2069 [have_curlopt_username="yes"],
2070 [have_curlopt_username="no"],
2071 [[#include <curl/curl.h>]])
2072 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2073 [have_curlopt_timeout="yes"],
2074 [have_curlopt_timeout="no"],
2075 [[#include <curl/curl.h>]])
2078 if test "x$with_libcurl" = "xyes"
2080 SAVE_CPPFLAGS="$CPPFLAGS"
2081 SAVE_LDFLAGS="$LDFLAGS"
2082 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2083 LDFLAGS="$LDFLAGS $with_curl_libs"
2084 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2085 [c_cv_have_curlinfo_appconnect_time],
2086 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2088 #include <curl/curl.h>
2091 int val = CURLINFO_APPCONNECT_TIME;
2095 [c_cv_have_curlinfo_appconnect_time="yes"],
2096 [c_cv_have_curlinfo_appconnect_time="no"]
2099 CPPFLAGS="$SAVE_CPPFLAGS"
2100 LDFLAGS="$SAVE_LDFLAGS"
2102 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
2103 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
2105 AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
2108 if test "x$with_libcurl" = "xyes"
2110 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2111 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2112 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2113 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2115 if test "x$have_curlopt_username" = "xyes"
2117 AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
2120 if test "x$have_curlopt_timeout" = "xyes"
2122 AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
2128 with_libdbi_cppflags=""
2129 with_libdbi_ldflags=""
2130 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2132 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2134 with_libdbi_cppflags="-I$withval/include"
2135 with_libdbi_ldflags="-L$withval/lib"
2138 with_libdbi="$withval"
2144 if test "x$with_libdbi" = "xyes"
2146 SAVE_CPPFLAGS="$CPPFLAGS"
2147 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2149 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
2151 CPPFLAGS="$SAVE_CPPFLAGS"
2153 if test "x$with_libdbi" = "xyes"
2155 SAVE_CPPFLAGS="$CPPFLAGS"
2156 SAVE_LDFLAGS="$LDFLAGS"
2157 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2158 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2160 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
2162 CPPFLAGS="$SAVE_CPPFLAGS"
2163 LDFLAGS="$SAVE_LDFLAGS"
2165 if test "x$with_libdbi" = "xyes"
2167 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2168 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2169 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2170 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2171 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2172 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2174 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
2177 # --with-libesmtp {{{
2178 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2180 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2182 LDFLAGS="$LDFLAGS -L$withval/lib"
2183 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
2186 with_libesmtp="$withval"
2192 if test "x$with_libesmtp" = "xyes"
2194 AC_CHECK_LIB(esmtp, smtp_create_session,
2196 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
2197 ], [with_libesmtp="no (libesmtp not found)"])
2199 if test "x$with_libesmtp" = "xyes"
2201 AC_CHECK_HEADERS(libesmtp.h,
2203 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
2204 ], [with_libesmtp="no (libesmtp.h not found)"])
2206 if test "x$with_libesmtp" = "xyes"
2212 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
2213 [Wether or not to use the esmtp library])
2214 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
2217 # --with-libganglia {{{
2218 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2220 if test -f "$withval" && test -x "$withval"
2222 with_libganglia_config="$withval"
2223 with_libganglia="yes"
2224 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
2226 with_libganglia_config="$withval/bin/ganglia-config"
2227 with_libganglia="yes"
2228 else if test -d "$withval"
2230 GANGLIA_CPPFLAGS="-I$withval/include"
2231 GANGLIA_LDFLAGS="-L$withval/lib"
2232 with_libganglia="yes"
2234 with_libganglia="$withval"
2238 with_libganglia="yes"
2241 if test "x$with_libganglia" = "xyes"
2243 if test "x$with_libganglia_config" != "x"
2245 if test "x$GANGLIA_CPPFLAGS" = "x"
2247 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2250 if test "x$GANGLIA_LDFLAGS" = "x"
2252 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2255 if test "x$GANGLIA_LIBS" = "x"
2257 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2260 GANGLIA_LIBS="-lganglia"
2264 SAVE_CPPFLAGS="$CPPFLAGS"
2265 SAVE_LDFLAGS="$LDFLAGS"
2266 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2267 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2269 if test "x$with_libganglia" = "xyes"
2271 AC_CHECK_HEADERS(gm_protocol.h,
2273 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
2274 [Define to 1 if you have the <gm_protocol.h> header file.])
2275 ], [with_libganglia="no (gm_protocol.h not found)"])
2278 if test "x$with_libganglia" = "xyes"
2280 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
2282 AC_DEFINE(HAVE_LIBGANGLIA, 1,
2283 [Define to 1 if you have the ganglia library (-lganglia).])
2284 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
2287 CPPFLAGS="$SAVE_CPPFLAGS"
2288 LDFLAGS="$SAVE_LDFLAGS"
2290 AC_SUBST(GANGLIA_CPPFLAGS)
2291 AC_SUBST(GANGLIA_LDFLAGS)
2292 AC_SUBST(GANGLIA_LIBS)
2293 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
2296 # --with-libgcrypt {{{
2297 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2298 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2299 GCRYPT_LIBS="$GCRYPT_LIBS"
2300 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2302 if test -f "$withval" && test -x "$withval"
2304 with_libgcrypt_config="$withval"
2305 with_libgcrypt="yes"
2306 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
2308 with_libgcrypt_config="$withval/bin/gcrypt-config"
2309 with_libgcrypt="yes"
2310 else if test -d "$withval"
2312 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2313 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2314 with_libgcrypt="yes"
2316 with_libgcrypt_config="gcrypt-config"
2317 with_libgcrypt="$withval"
2321 with_libgcrypt_config="libgcrypt-config"
2322 with_libgcrypt="yes"
2325 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2327 if test "x$GCRYPT_CPPFLAGS" = "x"
2329 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2332 if test "x$GCRYPT_LIBS" = "x"
2334 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2338 SAVE_CPPFLAGS="$CPPFLAGS"
2339 SAVE_LDFLAGS="$LDFLAGS"
2341 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2342 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2343 LIBS="$LIBS $GCRYPT_LIBS"
2345 if test "x$with_libgcrypt" = "xyes"
2347 if test "x$GCRYPT_CPPFLAGS" != "x"
2349 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2351 AC_CHECK_HEADERS(gcrypt.h,
2352 [with_libgcrypt="yes"],
2353 [with_libgcrypt="no (gcrypt.h not found)"])
2356 if test "x$with_libgcrypt" = "xyes"
2358 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2359 [with_libgcrypt="yes"],
2360 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2363 CPPFLAGS="$SAVE_CPPFLAGS"
2364 LDFLAGS="$SAVE_LDFLAGS"
2367 if test "x$with_libgcrypt" = "xyes"
2369 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2372 AC_SUBST(GCRYPT_CPPFLAGS)
2373 AC_SUBST(GCRYPT_LDFLAGS)
2374 AC_SUBST(GCRYPT_LIBS)
2375 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2379 with_libgps_cflags=""
2380 with_libgps_ldflags=""
2381 AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2383 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2385 with_libgps_cflags="-I$withval/include"
2386 with_libgps_ldflags="-L$withval/lib"
2389 with_libgps="$withval"
2395 if test "x$with_libgps" = "xyes"
2397 SAVE_CFLAGS="$CFLAGS"
2398 CFLAGS="$CFLAGS $with_libgps_cflags"
2400 AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
2402 CFLAGS="$SAVE_CFLAGS"
2404 if test "x$with_libgps" = "xyes"
2406 SAVE_CFLAGS="$CFLAGS"
2407 SAVE_LDFLAGS="$LDFLAGS"
2408 CFLAGS="$CFLAGS $with_libgps_cflags"
2409 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2411 AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
2413 CFLAGS="$SAVE_CFLAGS"
2414 LDFLAGS="$SAVE_LDFLAGS"
2416 if test "x$with_libgps" = "xyes"
2418 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2419 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2420 BUILD_WITH_LIBGPS_LIBS="-lgps"
2421 AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
2422 AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
2423 AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
2425 AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
2428 # --with-libgrpc++ {{{
2429 with_libgrpcpp_cppflags=""
2430 with_libgrpcpp_ldflags=""
2431 AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2433 with_grpcpp="$withval"
2434 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2436 with_libgrpcpp_cppflags="-I$withval/include"
2437 with_libgrpcpp_ldflags="-L$withval/lib"
2438 with_libgrpcpp="yes"
2440 if test "x$withval" = "xno"
2442 with_libgrpcpp="no (disabled on command line)"
2447 if test "x$withval" = "xyes"
2449 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2450 [with_libgrpcpp="yes"],
2451 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2455 if test "x$withval" != "xno"
2457 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2458 if test_cxx_flags -std=c++11; then
2459 AC_MSG_RESULT([yes])
2462 with_libgrpcpp="no (requires C++11 support)"
2466 if test "x$with_libgrpcpp" = "xyes"
2469 SAVE_CPPFLAGS="$CPPFLAGS"
2470 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2471 AC_CHECK_HEADERS([grpc++/grpc++.h], [],
2472 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2474 CPPFLAGS="$SAVE_CPPFLAGS"
2477 if test "x$with_libgrpcpp" = "xyes"
2480 SAVE_CPPFLAGS="$CPPFLAGS"
2481 SAVE_LDFLAGS="$LDFLAGS"
2483 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2484 LDFLAGS="$with_libgrpcpp_ldflags"
2485 if test "x$GRPCPP_LIBS" = "x"
2493 [[#include <grpc++/grpc++.h>]],
2494 [[grpc::ServerBuilder sb;]]
2497 with_libgrpcpp="yes"
2498 if test "x$GRPCPP_LIBS" = "x"
2500 GRPCPP_LIBS="-lgrpc++"
2503 [with_libgrpcpp="no (libgrpc++ not found)"]
2505 CPPFLAGS="$SAVE_CPPFLAGS"
2506 LDFLAGS="$SAVE_LDFLAGS"
2510 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2511 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2512 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2513 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2514 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2515 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2518 # --with-libiptc {{{
2519 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2521 if test "x$withval" = "xyes"
2523 with_libiptc="pkgconfig"
2524 else if test "x$withval" = "xno"
2529 with_libiptc_cflags="-I$withval/include"
2530 with_libiptc_libs="-L$withval/lib"
2534 if test "x$ac_system" = "xLinux"
2536 with_libiptc="pkgconfig"
2538 with_libiptc="no (Linux only)"
2542 if test "x$with_libiptc" = "xpkgconfig"
2544 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2547 with_libiptc="no (pkg-config doesn't know libiptc)"
2550 if test "x$with_libiptc" = "xpkgconfig"
2552 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2555 with_libiptc="no ($PKG_CONFIG failed)"
2557 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2560 with_libiptc="no ($PKG_CONFIG failed)"
2564 SAVE_CPPFLAGS="$CPPFLAGS"
2565 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2567 # check whether the header file for libiptc is available.
2568 if test "x$with_libiptc" = "xpkgconfig"
2570 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2571 [with_libiptc="no (header file missing)"])
2573 # If the header file is available, check for the required type declaractions.
2574 # They may be missing in old versions of libiptc. In that case, they will be
2575 # declared in the iptables plugin.
2576 if test "x$with_libiptc" = "xpkgconfig"
2578 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2580 # Check for the iptc_init symbol in the library.
2581 # This could be in iptc or ip4tc
2582 if test "x$with_libiptc" = "xpkgconfig"
2585 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2586 [with_libiptc="pkgconfig"],
2587 [with_libiptc="no"],
2588 [$with_libiptc_libs])
2591 if test "x$with_libiptc" = "xpkgconfig"
2596 CPPFLAGS="$SAVE_CPPFLAGS"
2598 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2599 if test "x$with_libiptc" = "xyes"
2601 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2602 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2603 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2604 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2608 # --with-libdpdk {{{
2609 AC_ARG_WITH(libdpdk, [AS_HELP_STRING([--with-libdpdk@<:@=PREFIX@:>@], [Path to the DPDK build directory.])],
2611 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2613 RTE_BUILD="$withval"
2617 with_libdpdk="$withval"
2619 DPDK_INCLUDE="$RTE_BUILD/include"
2620 DPDK_LIB_DIR="$RTE_BUILD/lib"
2622 ], [with_libdpdk="no"])
2624 if test "x$with_libdpdk" = "xyes"
2626 LOCAL_DPDK_INSTALL="no"
2627 AC_CHECK_HEADER([$DPDK_INCLUDE/rte_config.h], [LOCAL_DPDK_INSTALL=yes],
2628 [AC_CHECK_HEADER([$DPDK_INCLUDE/dpdk/rte_config.h],
2630 [FOUND_DPDK=no], [])], [])
2632 if test "x$LOCAL_DPDK_INSTALL" = "xno"
2634 DPDK_INCLUDE=$DPDK_INCLUDE/dpdk
2637 if test "x$FOUND_DPDK" = "xno"
2639 AC_MSG_ERROR([libdpdk error: rte_config.h not found])
2643 if test "x$with_libdpdk" = "xyes"
2645 SAVE_LDFLAGS="$LDFLAGS"
2647 if test "x$LOCAL_DPDK_INSTALL" != "xyes"
2649 LDFLAGS="$LDFLAGS -L$DPDK_LIB_DIR"
2652 AC_CHECK_LIB(dpdk, rte_eal_init,
2653 [BUILD_WITH_DPDK_LIBS="-Wl,-ldpdk"],
2656 LDFLAGS="$SAVE_LDFLAGS"
2657 if test "x$FOUND_DPDK" = "xno"
2659 AC_MSG_ERROR([libdpdk error: cannot link with dpdk in $DPDK_LIB_DIR])
2664 # Note: An issue on Ubuntu 14.04 necessitates the use of -Wl,--no-as-needed:
2665 # If you try compile with the older linker, the dpdk symbols will be undefined.
2666 # This workaround should be removed when no longer necessary.
2668 if test "x$with_libdpdk" = "xyes"
2670 BUILD_WITH_DPDK_CFLAGS+="-I$DPDK_INCLUDE"
2671 if test "x$LOCAL_DPDK_INSTALL" != "xyes"
2673 BUILD_WITH_DPDK_LDFLAGS="-Wl,--no-as-needed"
2675 BUILD_WITH_DPDK_LDFLAGS="-L$DPDK_LIB_DIR -Wl,--no-as-needed"
2677 AC_SUBST(BUILD_WITH_DPDK_CFLAGS)
2678 AC_SUBST(BUILD_WITH_DPDK_LDFLAGS)
2679 AC_SUBST(BUILD_WITH_DPDK_LIBS)
2684 with_java_home="$JAVA_HOME"
2685 if test "x$with_java_home" = "x"
2687 with_java_home="/usr/lib/jvm"
2691 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2693 if test "x$withval" = "xno"
2696 else if test "x$withval" = "xyes"
2700 with_java_home="$withval"
2705 if test "x$with_java" = "xyes"
2707 if test -d "$with_java_home"
2709 AC_MSG_CHECKING([for jni.h])
2710 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2711 if test "x$TMPVAR" != "x"
2713 AC_MSG_RESULT([found in $TMPVAR])
2714 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2716 AC_MSG_RESULT([not found])
2719 AC_MSG_CHECKING([for jni_md.h])
2720 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2721 if test "x$TMPVAR" != "x"
2723 AC_MSG_RESULT([found in $TMPVAR])
2724 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2726 AC_MSG_RESULT([not found])
2729 AC_MSG_CHECKING([for libjvm.so])
2730 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`
2731 if test "x$TMPVAR" != "x"
2733 AC_MSG_RESULT([found in $TMPVAR])
2734 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2736 AC_MSG_RESULT([not found])
2739 if test "x$JAVAC" = "x"
2741 AC_MSG_CHECKING([for javac])
2742 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2743 if test "x$TMPVAR" != "x"
2746 AC_MSG_RESULT([$JAVAC])
2748 AC_MSG_RESULT([not found])
2751 if test "x$JAR" = "x"
2753 AC_MSG_CHECKING([for jar])
2754 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2755 if test "x$TMPVAR" != "x"
2758 AC_MSG_RESULT([$JAR])
2760 AC_MSG_RESULT([not found])
2763 else if test "x$with_java_home" != "x"
2765 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2769 if test "x$JAVA_CPPFLAGS" != "x"
2771 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2773 if test "x$JAVA_CFLAGS" != "x"
2775 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2777 if test "x$JAVA_LDFLAGS" != "x"
2779 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2781 if test "x$JAVA_LIBS" != "x"
2783 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2785 if test "x$JAVAC" = "x"
2787 with_javac_path="$PATH"
2788 if test "x$with_java_home" != "x"
2790 with_javac_path="$with_java_home:with_javac_path"
2791 if test -d "$with_java_home/bin"
2793 with_javac_path="$with_java_home/bin:with_javac_path"
2797 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2799 if test "x$JAVAC" = "x"
2801 with_java="no (javac not found)"
2803 if test "x$JAR" = "x"
2805 with_jar_path="$PATH"
2806 if test "x$with_java_home" != "x"
2808 with_jar_path="$with_java_home:$with_jar_path"
2809 if test -d "$with_java_home/bin"
2811 with_jar_path="$with_java_home/bin:$with_jar_path"
2815 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2817 if test "x$JAR" = "x"
2819 with_java="no (jar not found)"
2822 SAVE_CPPFLAGS="$CPPFLAGS"
2823 SAVE_CFLAGS="$CFLAGS"
2824 SAVE_LDFLAGS="$LDFLAGS"
2826 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2827 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2828 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2829 LIBS="$LIBS $JAVA_LIBS"
2831 if test "x$with_java" = "xyes"
2833 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2835 if test "x$with_java" = "xyes"
2837 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2839 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2840 [$JAVA_LIBS $PTHREAD_LIBS])
2842 if test "x$with_java" = "xyes"
2844 JAVA_LIBS="$JAVA_LIBS -ljvm"
2845 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2848 CPPFLAGS="$SAVE_CPPFLAGS"
2849 CFLAGS="$SAVE_CFLAGS"
2850 LDFLAGS="$SAVE_LDFLAGS"
2853 AC_SUBST(JAVA_CPPFLAGS)
2854 AC_SUBST(JAVA_CFLAGS)
2855 AC_SUBST(JAVA_LDFLAGS)
2857 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2860 # --with-libldap {{{
2861 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2863 if test "x$withval" = "xyes"
2866 else if test "x$withval" = "xno"
2871 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2872 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2875 [with_libldap="yes"])
2877 SAVE_CPPFLAGS="$CPPFLAGS"
2878 SAVE_LDFLAGS="$LDFLAGS"
2880 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2881 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2883 if test "x$with_libldap" = "xyes"
2885 if test "x$LIBLDAP_CPPFLAGS" != "x"
2887 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2889 AC_CHECK_HEADERS(ldap.h,
2890 [with_libldap="yes"],
2891 [with_libldap="no ('ldap.h' not found)"])
2893 if test "x$with_libldap" = "xyes"
2895 if test "x$LIBLDAP_LDFLAGS" != "x"
2897 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2899 AC_CHECK_LIB(ldap, ldap_initialize,
2900 [with_libldap="yes"],
2901 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2905 CPPFLAGS="$SAVE_CPPFLAGS"
2906 LDFLAGS="$SAVE_LDFLAGS"
2908 if test "x$with_libldap" = "xyes"
2910 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2911 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2912 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2913 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
2915 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
2919 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
2920 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
2922 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
2923 [with_liblua="yes"],
2927 PKG_CHECK_MODULES([LUA], [lua],
2928 [with_liblua="yes"],
2930 PKG_CHECK_MODULES([LUA], [lua-5.3],
2931 [with_liblua="yes"],
2933 PKG_CHECK_MODULES([LUA], [lua5.3],
2934 [with_liblua="yes"],
2936 PKG_CHECK_MODULES([LUA], [lua-5.2],
2937 [with_liblua="yes"],
2939 PKG_CHECK_MODULES([LUA], [lua5.2],
2940 [with_liblua="yes"],
2942 PKG_CHECK_MODULES([LUA], [lua-5.1],
2943 [with_liblua="yes"],
2945 PKG_CHECK_MODULES([LUA], [lua5.1],
2946 [with_liblua="yes"],
2947 [with_liblua="no (pkg-config cannot find liblua)"]
2963 if test "x$with_liblua" = "xyes"
2965 SAVE_CFLAGS="$CFLAGS"
2966 CFLAGS="$CFLAGS $LUA_CFLAGS"
2968 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
2969 [with_liblua="yes"],
2970 [with_liblua="no (header not found)"]
2973 CFLAGS="$SAVE_CFLAGS"
2976 if test "x$with_liblua" = "xyes"
2979 LIBS="$LIBS $LUA_LIBS"
2981 AC_CHECK_FUNC([lua_settop],
2982 [with_liblua="yes"],
2983 [with_liblua="no (symbol 'lua_settop' not found)"]
2989 if test "x$with_liblua" = "xyes"
2991 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
2992 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
2994 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
2995 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
2998 # --with-liblvm2app {{{
2999 with_liblvm2app_cppflags=""
3000 with_liblvm2app_ldflags=""
3001 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
3003 if test "x$withval" = "xno"
3005 with_liblvm2app="no"
3007 with_liblvm2app="yes"
3008 if test "x$withval" != "xyes"
3010 with_liblvm2app_cppflags="-I$withval/include"
3011 with_liblvm2app_ldflags="-L$withval/lib"
3016 if test "x$ac_system" = "xLinux"
3018 with_liblvm2app="yes"
3020 with_liblvm2app="no (Linux only library)"
3023 if test "x$with_liblvm2app" = "xyes"
3025 SAVE_CPPFLAGS="$CPPFLAGS"
3026 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3028 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
3030 CPPFLAGS="$SAVE_CPPFLAGS"
3033 if test "x$with_liblvm2app" = "xyes"
3035 SAVE_CPPFLAGS="$CPPFLAGS"
3036 SAVE_LDFLAGS="$LDFLAGS"
3037 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3038 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
3040 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
3042 CPPFLAGS="$SAVE_CPPFLAGS"
3043 LDFLAGS="$SAVE_LDFLAGS"
3045 if test "x$with_liblvm2app" = "xyes"
3047 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
3048 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
3049 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
3050 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
3051 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
3052 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
3053 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
3055 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3058 # --with-libmemcached {{{
3059 with_libmemcached_cppflags=""
3060 with_libmemcached_ldflags=""
3061 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3063 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3065 with_libmemcached_cppflags="-I$withval/include"
3066 with_libmemcached_ldflags="-L$withval/lib"
3067 with_libmemcached="yes"
3069 with_libmemcached="$withval"
3073 with_libmemcached="yes"
3075 if test "x$with_libmemcached" = "xyes"
3077 SAVE_CPPFLAGS="$CPPFLAGS"
3078 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3080 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3082 CPPFLAGS="$SAVE_CPPFLAGS"
3084 if test "x$with_libmemcached" = "xyes"
3086 SAVE_CPPFLAGS="$CPPFLAGS"
3087 SAVE_LDFLAGS="$LDFLAGS"
3088 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3089 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3091 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3093 CPPFLAGS="$SAVE_CPPFLAGS"
3094 LDFLAGS="$SAVE_LDFLAGS"
3096 if test "x$with_libmemcached" = "xyes"
3098 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3099 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3100 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3101 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3102 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3103 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3104 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3106 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3109 # --with-libmicrohttpd {{{
3110 with_libmicrohttpd_cppflags=""
3111 with_libmicrohttpd_ldflags=""
3112 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3114 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3116 with_libmicrohttpd_cppflags="-I$withval/include"
3117 with_libmicrohttpd_ldflags="-L$withval/lib"
3118 with_libmicrohttpd="yes"
3120 if test "x$withval" = "xno"
3122 with_libmicrohttpd="no (disabled on command line)"
3127 if test "x$withval" = "xyes"
3129 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3130 [with_libmicrohttpd="yes"],
3131 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3135 if test "x$MICROHTTPD_LIBS" = "x"
3137 MICROHTTPD_LIBS="-lmicrohttpd"
3140 SAVE_CPPFLAGS="$CPPFLAGS"
3141 SAVE_LDFLAGS="$LDFLAGS"
3143 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3144 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3145 LIBS="$LIBS $MICROHTTPD_LIBS"
3147 if test "x$with_libmicrohttpd" = "xyes"
3149 AC_CHECK_HEADERS([microhttpd.h],
3150 [with_libmicrohttpd="yes"],
3151 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3154 if test "x$with_libmicrohttpd" = "xyes"
3156 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3157 [with_libmicrohttpd="yes"],
3158 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3161 CPPFLAGS="$SAVE_CPPFLAGS"
3162 LDFLAGS="$SAVE_LDFLAGS"
3165 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3166 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3167 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3168 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3169 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3170 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3173 # --with-libmodbus {{{
3174 with_libmodbus_config=""
3175 with_libmodbus_cflags=""
3176 with_libmodbus_libs=""
3177 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3179 if test "x$withval" = "xno"
3182 else if test "x$withval" = "xyes"
3184 with_libmodbus="use_pkgconfig"
3185 else if test -d "$with_libmodbus/lib"
3187 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3188 with_libmodbus_cflags="-I$withval/include"
3189 with_libmodbus_libs="-L$withval/lib -lmodbus"
3190 with_libmodbus="yes"
3193 [with_libmodbus="use_pkgconfig"])
3195 # configure using pkg-config
3196 if test "x$with_libmodbus" = "xuse_pkgconfig"
3198 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3199 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3202 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3205 if test "x$with_libmodbus" = "xuse_pkgconfig"
3207 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3210 with_libmodbus="no ($PKG_CONFIG failed)"
3212 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3215 with_libmodbus="no ($PKG_CONFIG failed)"
3218 if test "x$with_libmodbus" = "xuse_pkgconfig"
3220 with_libmodbus="yes"
3223 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3224 # the actual checks.
3225 if test "x$with_libmodbus" = "xyes"
3227 SAVE_CPPFLAGS="$CPPFLAGS"
3228 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3230 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3232 CPPFLAGS="$SAVE_CPPFLAGS"
3234 if test "x$with_libmodbus" = "xyes"
3236 SAVE_CPPFLAGS="$CPPFLAGS"
3237 SAVE_LDFLAGS="$LDFLAGS"
3239 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3240 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3242 AC_CHECK_LIB(modbus, modbus_connect,
3243 [with_libmodbus="yes"],
3244 [with_libmodbus="no (symbol modbus_connect not found)"])
3246 CPPFLAGS="$SAVE_CPPFLAGS"
3247 LDFLAGS="$SAVE_LDFLAGS"
3249 if test "x$with_libmodbus" = "xyes"
3251 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3252 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3253 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3254 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3258 # --with-libmongoc {{{
3259 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3261 if test "x$withval" = "xyes"
3263 with_libmongoc="yes"
3264 else if test "x$withval" = "xno"
3268 with_libmongoc="yes"
3269 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3270 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3273 [with_libmongoc="yes"])
3275 SAVE_CPPFLAGS="$CPPFLAGS"
3276 SAVE_LDFLAGS="$LDFLAGS"
3278 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3279 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3281 if test "x$with_libmongoc" = "xyes"
3283 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3285 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3287 AC_CHECK_HEADERS(mongo.h,
3288 [with_libmongoc="yes"],
3289 [with_libmongoc="no ('mongo.h' not found)"],
3291 # define MONGO_HAVE_STDINT 1
3293 # define MONGO_USE_LONG_LONG_INT 1
3297 if test "x$with_libmongoc" = "xyes"
3299 if test "x$LIBMONGOC_LDFLAGS" != "x"
3301 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3303 AC_CHECK_LIB(mongoc, mongo_run_command,
3304 [with_libmongoc="yes"],
3305 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3308 CPPFLAGS="$SAVE_CPPFLAGS"
3309 LDFLAGS="$SAVE_LDFLAGS"
3311 if test "x$with_libmongoc" = "xyes"
3313 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3314 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3315 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3316 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3318 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3321 # --with-libmosquitto {{{
3322 with_libmosquitto_cppflags=""
3323 with_libmosquitto_ldflags=""
3324 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3326 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3328 with_libmosquitto_cppflags="-I$withval/include"
3329 with_libmosquitto_ldflags="-L$withval/lib"
3330 with_libmosquitto="yes"
3332 with_libmosquitto="$withval"
3336 with_libmosquitto="yes"
3338 if test "x$with_libmosquitto" = "xyes"
3340 SAVE_CPPFLAGS="$CPPFLAGS"
3341 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3343 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3345 CPPFLAGS="$SAVE_CPPFLAGS"
3347 if test "x$with_libmosquitto" = "xyes"
3349 SAVE_LDFLAGS="$LDFLAGS"
3350 SAVE_CPPFLAGS="$CPPFLAGS"
3351 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3352 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3354 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3356 LDFLAGS="$SAVE_LDFLAGS"
3357 CPPFLAGS="$SAVE_CPPFLAGS"
3359 if test "x$with_libmosquitto" = "xyes"
3361 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3362 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3363 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3364 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3365 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3366 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3370 # --with-libmysql {{{
3371 with_mysql_config="mysql_config"
3372 with_mysql_cflags=""
3374 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3376 if test "x$withval" = "xno"
3379 else if test "x$withval" = "xyes"
3383 if test -f "$withval" && test -x "$withval";
3385 with_mysql_config="$withval"
3386 else if test -x "$withval/bin/mysql_config"
3388 with_mysql_config="$withval/bin/mysql_config"
3396 if test "x$with_libmysql" = "xyes"
3398 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3399 mysql_config_status=$?
3401 if test $mysql_config_status -ne 0
3403 with_libmysql="no ($with_mysql_config failed)"
3405 SAVE_CPPFLAGS="$CPPFLAGS"
3406 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3409 have_mysql_mysql_h="no"
3410 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3412 if test "x$have_mysql_h" = "xno"
3414 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3417 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3419 with_libmysql="no (mysql.h not found)"
3422 CPPFLAGS="$SAVE_CPPFLAGS"
3425 if test "x$with_libmysql" = "xyes"
3427 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3428 mysql_config_status=$?
3430 if test $mysql_config_status -ne 0
3432 with_libmysql="no ($with_mysql_config failed)"
3434 SAVE_CPPFLAGS="$CPPFLAGS"
3435 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3437 LIBS="$with_mysql_libs"
3438 AC_SEARCH_LIBS([mysql_get_server_version],
3440 [with_libmysql="yes"],
3441 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3443 CPPFLAGS="$SAVE_CPPFLAGS"
3447 if test "x$with_libmysql" = "xyes"
3449 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3450 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3451 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3452 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3454 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3458 with_libmnl_cflags=""
3460 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3462 echo "libmnl: withval = $withval"
3463 if test "x$withval" = "xyes"
3466 else if test "x$withval" = "xno"
3470 if test -d "$withval/include"
3472 with_libmnl_cflags="-I$withval/include"
3473 with_libmnl_libs="-L$withval/lib -lmnl"
3476 AC_MSG_ERROR("no such directory: $withval/include")
3481 if test "x$ac_system" = "xLinux"
3485 with_libmnl="no (Linux only library)"
3488 if test "x$with_libmnl" = "xyes"
3490 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3491 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3492 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3495 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3501 #include <sys/types.h>
3502 #include <asm/types.h>
3503 #include <sys/socket.h>
3504 #include <linux/netlink.h>
3505 #include <linux/rtnetlink.h>])
3506 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3508 #include <sys/types.h>
3509 #include <asm/types.h>
3510 #include <sys/socket.h>])
3512 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3515 #include <sys/types.h>
3516 #include <asm/types.h>
3517 #include <sys/socket.h>
3518 #include <linux/netlink.h>
3519 #include <linux/rtnetlink.h>
3522 int retval = TCA_STATS2;
3526 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3528 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3531 #include <sys/types.h>
3532 #include <asm/types.h>
3533 #include <sys/socket.h>
3534 #include <linux/netlink.h>
3535 #include <linux/rtnetlink.h>
3538 int retval = TCA_STATS;
3542 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3544 if test "x$with_libmnl" = "xyes"
3546 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3547 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3550 #include <linux/if_link.h>
3553 if test "x$with_libmnl" = "xyes"
3555 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3556 [with_libmnl="yes"],
3557 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3558 [$with_libmnl_libs])
3560 if test "x$with_libmnl" = "xyes"
3562 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3563 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3564 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3565 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3566 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3568 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3571 # --with-libnetapp {{{
3572 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3573 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3574 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3575 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3576 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3577 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3578 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3580 if test -d "$withval"
3582 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3583 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3584 with_libnetapp="yes"
3586 with_libnetapp="$withval"
3590 with_libnetapp="yes"
3593 SAVE_CPPFLAGS="$CPPFLAGS"
3594 SAVE_LDFLAGS="$LDFLAGS"
3595 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3596 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3598 if test "x$with_libnetapp" = "xyes"
3600 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3602 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3604 AC_CHECK_HEADERS(netapp_api.h,
3605 [with_libnetapp="yes"],
3606 [with_libnetapp="no (netapp_api.h not found)"])
3609 if test "x$with_libnetapp" = "xyes"
3611 if test "x$LIBNETAPP_LDFLAGS" != "x"
3613 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3616 if test "x$LIBNETAPP_LIBS" = "x"
3618 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3620 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3622 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3623 [with_libnetapp="yes"],
3624 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3626 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3629 CPPFLAGS="$SAVE_CPPFLAGS"
3630 LDFLAGS="$SAVE_LDFLAGS"
3632 if test "x$with_libnetapp" = "xyes"
3634 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3637 AC_SUBST(LIBNETAPP_CPPFLAGS)
3638 AC_SUBST(LIBNETAPP_LDFLAGS)
3639 AC_SUBST(LIBNETAPP_LIBS)
3640 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3643 # --with-libnetsnmp {{{
3644 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3646 if test "x$withval" = "xno"
3648 with_libnetsnmp="no"
3649 else if test "x$withval" = "xyes"
3651 with_libnetsnmp="yes"
3653 with_libnetsnmp_cppflags="-I$withval/include"
3654 with_libnetsnmp_ldflags="-I$withval/lib"
3655 with_libnetsnmp="yes"
3658 [with_libnetsnmp="yes"])
3659 if test "x$with_libnetsnmp" = "xyes"
3661 SAVE_CPPFLAGS="$CPPFLAGS"
3662 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3664 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3666 CPPFLAGS="$SAVE_CPPFLAGS"
3668 if test "x$with_libnetsnmp" = "xyes"
3670 SAVE_LDFLAGS="$LDFLAGS"
3671 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3673 AC_CHECK_LIB(netsnmp, init_snmp,
3674 [with_libnetsnmp="yes"],
3675 [with_libnetsnmp="no (libnetsnmp not found)"],
3678 LDFLAGS="$SAVE_LDFLAGS"
3680 if test "x$with_libnetsnmp" = "xyes"
3682 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3683 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3684 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3686 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3687 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3688 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3691 # --with-liboconfig {{{
3692 with_own_liboconfig="no"
3693 liboconfig_LDFLAGS="$LDFLAGS"
3694 liboconfig_CPPFLAGS="$CPPFLAGS"
3695 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3697 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3699 if test -d "$withval/lib"
3701 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3703 if test -d "$withval/include"
3705 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3708 if test "x$withval" = "xno"
3710 AC_MSG_ERROR("liboconfig is required")
3714 with_liboconfig="yes"
3717 save_LDFLAGS="$LDFLAGS"
3718 save_CPPFLAGS="$CPPFLAGS"
3719 LDFLAGS="$liboconfig_LDFLAGS"
3720 CPPFLAGS="$liboconfig_CPPFLAGS"
3721 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3723 with_liboconfig="yes"
3724 with_own_liboconfig="no"
3727 with_liboconfig="yes"
3728 with_own_liboconfig="yes"
3729 LDFLAGS="$save_LDFLAGS"
3730 CPPFLAGS="$save_CPPFLAGS"
3733 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3734 if test "x$with_own_liboconfig" = "xyes"
3736 with_liboconfig="yes (shipped version)"
3740 # --with-liboping {{{
3741 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3743 if test "x$withval" = "xyes"
3746 else if test "x$withval" = "xno"
3751 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3752 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3755 [with_liboping="yes"])
3757 SAVE_CPPFLAGS="$CPPFLAGS"
3758 SAVE_LDFLAGS="$LDFLAGS"
3760 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3761 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3763 if test "x$with_liboping" = "xyes"
3765 if test "x$LIBOPING_CPPFLAGS" != "x"
3767 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3769 AC_CHECK_HEADERS(oping.h,
3770 [with_liboping="yes"],
3771 [with_liboping="no (oping.h not found)"])
3773 if test "x$with_liboping" = "xyes"
3775 if test "x$LIBOPING_LDFLAGS" != "x"
3777 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3779 AC_CHECK_LIB(oping, ping_construct,
3780 [with_liboping="yes"],
3781 [with_liboping="no (symbol 'ping_construct' not found)"])
3784 CPPFLAGS="$SAVE_CPPFLAGS"
3785 LDFLAGS="$SAVE_LDFLAGS"
3787 if test "x$with_liboping" = "xyes"
3789 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3790 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3791 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3792 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3794 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3798 with_oracle_cppflags=""
3800 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3802 if test "x$withval" = "xyes"
3804 if test "x$ORACLE_HOME" = "x"
3806 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3809 else if test "x$withval" = "xno"
3814 ORACLE_HOME="$withval"
3818 if test "x$ORACLE_HOME" = "x"
3820 with_oracle="no (ORACLE_HOME is not set)"
3825 if test "x$ORACLE_HOME" != "x"
3827 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3829 if test -e "$ORACLE_HOME/lib/ldflags"
3831 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3833 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3834 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3836 if test "x$with_oracle" = "xyes"
3838 SAVE_CPPFLAGS="$CPPFLAGS"
3839 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3841 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3843 CPPFLAGS="$SAVE_CPPFLAGS"
3845 if test "x$with_oracle" = "xyes"
3847 SAVE_CPPFLAGS="$CPPFLAGS"
3849 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3850 LIBS="$LIBS $with_oracle_libs"
3852 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3854 CPPFLAGS="$SAVE_CPPFLAGS"
3857 if test "x$with_oracle" = "xyes"
3859 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3860 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3861 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3862 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3866 # --with-libowcapi {{{
3867 with_libowcapi_cppflags=""
3868 with_libowcapi_ldflags=""
3869 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3871 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3873 with_libowcapi_cppflags="-I$withval/include"
3874 with_libowcapi_ldflags="-L$withval/lib"
3875 with_libowcapi="yes"
3877 with_libowcapi="$withval"
3881 with_libowcapi="yes"
3883 if test "x$with_libowcapi" = "xyes"
3885 SAVE_CPPFLAGS="$CPPFLAGS"
3886 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3888 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3890 CPPFLAGS="$SAVE_CPPFLAGS"
3892 if test "x$with_libowcapi" = "xyes"
3894 SAVE_LDFLAGS="$LDFLAGS"
3895 SAVE_CPPFLAGS="$CPPFLAGS"
3896 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3897 CPPFLAGS="$with_libowcapi_cppflags"
3899 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3901 LDFLAGS="$SAVE_LDFLAGS"
3902 CPPFLAGS="$SAVE_CPPFLAGS"
3904 if test "x$with_libowcapi" = "xyes"
3906 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3907 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3908 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3909 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3910 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3911 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3915 # --with-libpcap {{{
3916 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3918 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3920 LDFLAGS="$LDFLAGS -L$withval/lib"
3921 CPPFLAGS="$CPPFLAGS -I$withval/include"
3924 with_libpcap="$withval"
3930 if test "x$with_libpcap" = "xyes"
3932 AC_CHECK_LIB(pcap, pcap_open_live,
3934 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3935 ], [with_libpcap="no (libpcap not found)"])
3937 if test "x$with_libpcap" = "xyes"
3939 AC_CHECK_HEADERS(pcap.h,,
3940 [with_libpcap="no (pcap.h not found)"])
3942 if test "x$with_libpcap" = "xyes"
3944 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3945 [c_cv_libpcap_have_pcap_error_iface_not_up],
3946 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3951 int val = PCAP_ERROR_IFACE_NOT_UP;
3955 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3956 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3958 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3960 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3962 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3965 # --with-libperl {{{
3966 perl_interpreter="perl"
3967 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3969 if test -f "$withval" && test -x "$withval"
3971 perl_interpreter="$withval"
3973 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3975 LDFLAGS="$LDFLAGS -L$withval/lib"
3976 CPPFLAGS="$CPPFLAGS -I$withval/include"
3977 perl_interpreter="$withval/bin/perl"
3980 with_libperl="$withval"
3987 AC_MSG_CHECKING([for perl])
3988 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3989 if test -x "$perl_interpreter"
3991 AC_MSG_RESULT([yes ($perl_interpreter)])
3997 AC_SUBST(PERL, "$perl_interpreter")
3999 if test "x$with_libperl" = "xyes" \
4000 && test -n "$perl_interpreter"
4002 SAVE_CFLAGS="$CFLAGS"
4004 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4005 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
4006 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
4007 CFLAGS="$CFLAGS $PERL_CFLAGS"
4008 LIBS="$LIBS $PERL_LIBS"
4010 AC_CACHE_CHECK([for libperl],
4011 [c_cv_have_libperl],
4012 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4014 #define PERL_NO_GET_CONTEXT
4021 load_module (PERL_LOADMOD_NOIMPORT,
4022 newSVpv ("Collectd::Plugin::FooBar", 24),
4026 [c_cv_have_libperl="yes"],
4027 [c_cv_have_libperl="no"]
4031 if test "x$c_cv_have_libperl" = "xyes"
4033 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
4034 AC_SUBST(PERL_CFLAGS)
4040 CFLAGS="$SAVE_CFLAGS"
4042 else if test -z "$perl_interpreter"; then
4043 with_libperl="no (no perl interpreter found)"
4044 c_cv_have_libperl="no"
4046 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
4048 if test "x$with_libperl" = "xyes"
4050 SAVE_CFLAGS="$CFLAGS"
4052 CFLAGS="$CFLAGS $PERL_CFLAGS"
4053 LIBS="$LIBS $PERL_LIBS"
4055 AC_CACHE_CHECK([if perl supports ithreads],
4056 [c_cv_have_perl_ithreads],
4057 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4063 #if !defined(USE_ITHREADS)
4064 # error "Perl does not support ithreads!"
4065 #endif /* !defined(USE_ITHREADS) */
4069 [c_cv_have_perl_ithreads="yes"],
4070 [c_cv_have_perl_ithreads="no"]
4074 if test "x$c_cv_have_perl_ithreads" = "xyes"
4076 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4079 CFLAGS="$SAVE_CFLAGS"
4083 if test "x$with_libperl" = "xyes"
4085 SAVE_CFLAGS="$CFLAGS"
4087 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4088 # (see issues #41 and #42)
4089 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4090 LIBS="$LIBS $PERL_LIBS"
4092 AC_CACHE_CHECK([for broken Perl_load_module()],
4093 [c_cv_have_broken_perl_load_module],
4094 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4096 #define PERL_NO_GET_CONTEXT
4103 load_module (PERL_LOADMOD_NOIMPORT,
4104 newSVpv ("Collectd::Plugin::FooBar", 24),
4108 [c_cv_have_broken_perl_load_module="no"],
4109 [c_cv_have_broken_perl_load_module="yes"]
4113 CFLAGS="$SAVE_CFLAGS"
4116 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4117 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4119 if test "x$with_libperl" = "xyes"
4121 SAVE_CFLAGS="$CFLAGS"
4123 CFLAGS="$CFLAGS $PERL_CFLAGS"
4124 LIBS="$LIBS $PERL_LIBS"
4127 [struct mgvtbl.svt_local],
4128 [have_struct_mgvtbl_svt_local="yes"],
4129 [have_struct_mgvtbl_svt_local="no"],
4136 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4138 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4139 [Define if Perl's struct mgvtbl has member svt_local.])
4142 CFLAGS="$SAVE_CFLAGS"
4148 with_pg_config="pg_config"
4149 with_libpq_includedir=""
4150 with_libpq_libdir=""
4151 with_libpq_cppflags=""
4152 with_libpq_ldflags=""
4153 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4156 if test "x$withval" = "xno"
4159 else if test "x$withval" = "xyes"
4163 if test -f "$withval" && test -x "$withval";
4165 with_pg_config="$withval"
4166 else if test -x "$withval/bin/pg_config"
4168 with_pg_config="$withval/bin/pg_config"
4176 if test "x$with_libpq" = "xyes"
4178 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4181 if test $pg_config_status -eq 0
4183 if test -n "$with_libpq_includedir"; then
4184 for dir in $with_libpq_includedir; do
4185 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4189 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4192 SAVE_CPPFLAGS="$CPPFLAGS"
4193 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4195 AC_CHECK_HEADERS(libpq-fe.h, [],
4196 [with_libpq="no (libpq-fe.h not found)"], [])
4198 CPPFLAGS="$SAVE_CPPFLAGS"
4200 if test "x$with_libpq" = "xyes"
4202 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4205 if test $pg_config_status -eq 0
4207 if test -n "$with_libpq_libdir"; then
4208 for dir in $with_libpq_libdir; do
4209 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4213 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4216 SAVE_LDFLAGS="$LDFLAGS"
4217 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4219 AC_CHECK_LIB(pq, PQconnectdb,
4221 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4223 AC_CHECK_LIB(pq, PQserverVersion,
4225 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4227 LDFLAGS="$SAVE_LDFLAGS"
4229 if test "x$with_libpq" = "xyes"
4231 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4232 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4233 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4234 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4236 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4239 # --with-libpqos {{{
4240 with_libpqos_cppflags=""
4241 with_libpqos_ldflags=""
4242 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4244 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4246 with_libpqos_cppflags="-I$withval/include"
4247 with_libpqos_ldflags="-L$withval/lib"
4250 with_libpqos="$withval"
4256 if test "x$with_libpqos" = "xyes"
4258 SAVE_CPPFLAGS="$CPPFLAGS"
4259 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4261 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4263 CPPFLAGS="$SAVE_CPPFLAGS"
4265 if test "x$with_libpqos" = "xyes"
4267 SAVE_CPPFLAGS="$CPPFLAGS"
4268 SAVE_LDFLAGS="$LDFLAGS"
4269 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4270 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4272 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4274 CPPFLAGS="$SAVE_CPPFLAGS"
4275 LDFLAGS="$SAVE_LDFLAGS"
4277 if test "x$with_libpqos" = "xyes"
4279 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4280 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4281 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4282 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4283 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4284 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4288 # --with-libprotobuf {{{
4289 with_libprotobuf_cppflags=""
4290 with_libprotobuf_ldflags=""
4291 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4293 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4295 with_libprotobuf_cppflags="-I$withval/include"
4296 with_libprotobuf_ldflags="-L$withval/lib"
4297 with_libprotobuf="yes"
4299 if test "x$withval" = "xno"
4301 with_libprotobuf="no (disabled on command line)"
4306 if test "x$withval" = "xyes"
4308 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4309 [with_libprotobuf="yes"],
4310 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4314 if test "x$withval" != "xno"
4316 SAVE_LDFLAGS="$LDFLAGS"
4318 LDFLAGS="$with_libprotobuf_ldflags"
4319 LIBS="$PROTOBUF_LIBS $LIBS"
4321 AC_CHECK_LIB([protobuf], [main],
4323 SAVE_CPPFLAGS="$CPPFLAGS"
4324 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4325 if test "x$PROTOBUF_LIBS" = "x"
4327 PROTOBUF_LIBS="-lprotobuf"
4329 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4330 [with_libprotobuf="yes"],
4331 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4333 CPPFLAGS="$SAVE_CPPFLAGS"
4335 [with_libprotobuf="no (libprotobuf not found)"]
4338 LDFLAGS="$SAVE_LDFLAGS"
4341 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4342 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4343 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4344 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4345 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4346 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4349 # --with-libprotobuf-c {{{
4350 with_libprotobuf_c_cppflags=""
4351 with_libprotobuf_c_ldflags=""
4352 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4354 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4356 with_libprotobuf_c_cppflags="-I$withval/include"
4357 with_libprotobuf_c_ldflags="-L$withval/lib"
4358 with_libprotobuf_c="yes"
4360 if test "x$withval" = "xno"
4362 with_libprotobuf_c="no (disabled on command line)"
4367 if test "x$withval" = "xyes"
4369 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4370 [with_libprotobuf_c="yes"],
4371 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4375 if test "x$withval" != "xno"
4377 SAVE_LDFLAGS="$LDFLAGS"
4379 LDFLAGS="$with_libprotobuf_c_ldflags"
4380 LIBS="$PROTOBUF_C_LIBS $LIBS"
4381 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4383 SAVE_CPPFLAGS="$CPPFLAGS"
4384 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4385 if test "x$PROTOBUF_C_LIBS" = "x"
4387 PROTOBUF_C_LIBS="-lprotobuf-c"
4389 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4391 with_libprotobuf_c="yes"
4394 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4396 CPPFLAGS="$SAVE_CPPFLAGS"
4398 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4400 LDFLAGS="$SAVE_LDFLAGS"
4403 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4404 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4405 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4406 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4407 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4408 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4411 # --with-libpython {{{
4412 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4413 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4414 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4416 AC_ARG_WITH([libpython],
4417 [AS_HELP_STRING([--with-libpython],
4418 [if we should build with libpython @<:@default=yes@:>@])
4420 [with_libpython="$withval"],
4421 [with_libpython="check"]
4423 if test "$with_libpython" != "no"; then
4424 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4425 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4426 AC_PATH_PROGS([PYTHON_CONFIG],
4427 [python3-config python2-config python-config]
4429 if test "$PYTHON_CONFIG" = ""; then
4430 if test "$with_libpython" = "yes"; then
4431 AC_MSG_ERROR([Unable to find python-config])
4438 if test "$PYTHON_CONFIG" != ""; then
4439 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4440 if test $? -ne 0; then
4443 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4444 if test $? -ne 0; then
4447 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4448 if test $? -ne 0; then
4453 if test "$with_libpython" != "xno"; then
4454 SAVE_CPPFLAGS="$CPPFLAGS"
4455 SAVE_LDFLAGS="$LDFLAGS"
4457 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4458 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4459 LIBS="$LIBPYTHON_LIBS $LIBS"
4460 AC_CHECK_HEADERS([Python.h],
4462 AC_MSG_CHECKING([for libpython])
4463 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4464 [[#include <Python.h>]],
4465 [[Py_Initialize();]])
4467 [with_libpython="yes"],
4468 [with_libpython="no"]
4470 AC_MSG_RESULT([$with_libpython])
4472 [with_libpython="no"]
4474 CPPFLAGS="$SAVE_CPPFLAGS"
4475 LDFLAGS="$SAVE_LDFLAGS"
4478 # }}} --with-libpython
4480 # --with-librabbitmq {{{
4481 with_librabbitmq_cppflags=""
4482 with_librabbitmq_ldflags=""
4483 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4485 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4487 with_librabbitmq_cppflags="-I$withval/include"
4488 with_librabbitmq_ldflags="-L$withval/lib"
4489 with_librabbitmq="yes"
4491 with_librabbitmq="$withval"
4495 with_librabbitmq="yes"
4497 SAVE_CPPFLAGS="$CPPFLAGS"
4498 SAVE_LDFLAGS="$LDFLAGS"
4499 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4500 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4501 if test "x$with_librabbitmq" = "xyes"
4503 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4505 if test "x$with_librabbitmq" = "xyes"
4507 # librabbitmq up to version 0.9.1 provides "library_errno", later
4508 # versions use "library_error". The library does not provide a version
4509 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4510 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4513 # include <stdlib.h>
4519 # include <stdint.h>
4522 # include <inttypes.h>
4527 if test "x$with_librabbitmq" = "xyes"
4529 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4531 if test "x$with_librabbitmq" = "xyes"
4533 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4534 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4535 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4536 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4537 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4538 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4539 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4541 CPPFLAGS="$SAVE_CPPFLAGS"
4542 LDFLAGS="$SAVE_LDFLAGS"
4543 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4545 with_amqp_tcp_socket="no"
4546 if test "x$with_librabbitmq" = "xyes"
4548 SAVE_CPPFLAGS="$CPPFLAGS"
4549 SAVE_LDFLAGS="$LDFLAGS"
4551 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4552 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4555 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4556 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4557 if test "x$with_amqp_tcp_socket" = "xyes"
4559 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4560 [Define if librabbitmq provides the new TCP socket interface.])
4563 AC_CHECK_DECLS(amqp_socket_close,
4564 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4567 #ifdef HAVE_AMQP_TCP_SOCKET_H
4568 # include <amqp_tcp_socket.h>
4570 #ifdef HAVE_AMQP_SOCKET_H
4571 # include <amqp_socket.h>
4575 CPPFLAGS="$SAVE_CPPFLAGS"
4576 LDFLAGS="$SAVE_LDFLAGS"
4581 # --with-librdkafka {{{
4582 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4584 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4586 with_librdkafka_cppflags="-I$withval/include"
4587 with_librdkafka_ldflags="-L$withval/lib"
4588 with_librdkafka_rpath="$withval/lib"
4589 with_librdkafka="yes"
4591 with_librdkafka="$withval"
4595 with_librdkafka="yes"
4597 SAVE_CPPFLAGS="$CPPFLAGS"
4598 SAVE_LDFLAGS="$LDFLAGS"
4600 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4601 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4603 if test "x$with_librdkafka" = "xyes"
4605 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4608 if test "x$with_librdkafka" = "xyes"
4610 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4611 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4612 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4614 if test "x$with_librdkafka" = "xyes"
4616 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4617 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4618 if test "x$with_librdkafka_rpath" != "x"
4620 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4622 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4624 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4625 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4626 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4627 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4628 if test "x$with_librdkafka_log_cb" = "xyes"
4630 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4631 else if test "x$with_librdkafka_logger" = "xyes"
4633 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4636 CPPFLAGS="$SAVE_CPPFLAGS"
4637 LDFLAGS="$SAVE_LDFLAGS"
4638 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4642 # --with-librouteros {{{
4643 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4645 if test "x$withval" = "xyes"
4647 with_librouteros="yes"
4648 else if test "x$withval" = "xno"
4650 with_librouteros="no"
4652 with_librouteros="yes"
4653 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4654 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4657 [with_librouteros="yes"])
4659 SAVE_CPPFLAGS="$CPPFLAGS"
4660 SAVE_LDFLAGS="$LDFLAGS"
4662 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4663 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4665 if test "x$with_librouteros" = "xyes"
4667 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4669 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4671 AC_CHECK_HEADERS(routeros_api.h,
4672 [with_librouteros="yes"],
4673 [with_librouteros="no (routeros_api.h not found)"])
4675 if test "x$with_librouteros" = "xyes"
4677 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4679 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4681 AC_CHECK_LIB(routeros, ros_interface,
4682 [with_librouteros="yes"],
4683 [with_librouteros="no (symbol 'ros_interface' not found)"])
4686 CPPFLAGS="$SAVE_CPPFLAGS"
4687 LDFLAGS="$SAVE_LDFLAGS"
4689 if test "x$with_librouteros" = "xyes"
4691 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4692 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4693 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4694 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4696 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4702 librrd_threadsafe="no"
4703 librrd_rrdc_update="no"
4705 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4707 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4709 librrd_cflags="-I$withval/include"
4710 librrd_ldflags="-L$withval/lib"
4713 with_librrd="$withval"
4719 if test "x$with_librrd" = "xyes"
4721 SAVE_LDFLAGS="$LDFLAGS"
4722 LDFLAGS="$LDFLAGS $librrd_ldflags"
4723 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4725 AC_CHECK_LIB([rrd], [rrd_update_r],
4726 [librrd_threadsafe="yes"],
4729 AC_CHECK_LIB([rrd], [rrdc_update],
4730 [librrd_rrdc_update="yes"],
4735 LDFLAGS="$SAVE_LDFLAGS"
4737 SAVE_CPPFLAGS="$CPPFLAGS"
4738 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4740 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4742 CPPFLAGS="$SAVE_CPPFLAGS"
4745 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4747 SAVE_LDFLAGS="$LDFLAGS"
4748 LDFLAGS="$LDFLAGS $librrd_ldflags"
4750 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4752 librrd_ldflags="$librrd_ldflags -lrrd_th"
4753 librrd_threadsafe="yes"
4754 AC_CHECK_LIB([rrd_th], [rrdc_update],
4755 [librrd_rrdc_update="yes"],
4761 LDFLAGS="$SAVE_LDFLAGS"
4764 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4766 SAVE_LDFLAGS="$LDFLAGS"
4767 LDFLAGS="$LDFLAGS $librrd_ldflags"
4769 AC_CHECK_LIB([rrd], [rrd_update],
4771 librrd_ldflags="$librrd_ldflags -lrrd"
4772 AC_CHECK_LIB([rrd], [rrdc_update],
4773 [librrd_rrdc_update="yes"],
4777 [with_librrd="no (symbol 'rrd_update' not found)"]
4779 LDFLAGS="$SAVE_LDFLAGS"
4782 if test "x$with_librrd" = "xyes"
4784 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4785 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4786 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4787 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4788 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4789 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4791 if test "x$librrd_threadsafe" = "xyes"
4793 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4794 [Define to 1 if the rrd library is thread-safe]
4799 # --with-libsensors {{{
4800 with_sensors_cflags=""
4801 with_sensors_ldflags=""
4802 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4804 if test "x$withval" = "xno"
4806 with_libsensors="no"
4808 with_libsensors="yes"
4809 if test "x$withval" != "xyes"
4811 with_sensors_cflags="-I$withval/include"
4812 with_sensors_ldflags="-L$withval/lib"
4813 with_libsensors="yes"
4818 if test "x$ac_system" = "xLinux"
4820 with_libsensors="yes"
4822 with_libsensors="no (Linux only library)"
4825 if test "x$with_libsensors" = "xyes"
4827 SAVE_CPPFLAGS="$CPPFLAGS"
4828 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4830 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4832 CPPFLAGS="$SAVE_CPPFLAGS"
4834 if test "x$with_libsensors" = "xyes"
4836 SAVE_CPPFLAGS="$CPPFLAGS"
4837 SAVE_LDFLAGS="$LDFLAGS"
4838 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4839 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4841 AC_CHECK_LIB(sensors, sensors_init,
4843 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4845 [with_libsensors="no (libsensors not found)"])
4847 CPPFLAGS="$SAVE_CPPFLAGS"
4848 LDFLAGS="$SAVE_LDFLAGS"
4850 if test "x$with_libsensors" = "xyes"
4852 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4853 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4854 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4855 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4857 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4861 AC_SUBST([LIBSIGROK_CFLAGS])
4862 AC_SUBST([LIBSIGROK_LIBS])
4863 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4864 [with_libsigrok="yes"],
4865 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4869 # --with-libstatgrab {{{
4870 with_libstatgrab_cflags=""
4871 with_libstatgrab_ldflags=""
4872 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4874 if test "x$withval" != "xno" \
4875 && test "x$withval" != "xyes"
4877 with_libstatgrab_cflags="-I$withval/include"
4878 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4879 with_libstatgrab="yes"
4880 with_libstatgrab_pkg_config="no"
4882 with_libstatgrab="$withval"
4883 with_libstatgrab_pkg_config="yes"
4887 with_libstatgrab="yes"
4888 with_libstatgrab_pkg_config="yes"
4891 if test "x$with_libstatgrab" = "xyes" \
4892 && test "x$with_libstatgrab_pkg_config" = "xyes"
4894 AC_MSG_CHECKING([pkg-config for libstatgrab])
4896 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4899 with_libstatgrab_pkg_config="no"
4900 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4901 temp_result="not found"
4903 AC_MSG_RESULT([$temp_result])
4906 if test "x$with_libstatgrab" = "xyes" \
4907 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4908 && test "x$with_libstatgrab_cflags" = "x"
4910 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4911 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4914 with_libstatgrab_cflags="$temp_result"
4916 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4917 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4919 AC_MSG_RESULT([$temp_result])
4922 if test "x$with_libstatgrab" = "xyes" \
4923 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4924 && test "x$with_libstatgrab_ldflags" = "x"
4926 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4927 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4930 with_libstatgrab_ldflags="$temp_result"
4932 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4933 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4935 AC_MSG_RESULT([$temp_result])
4938 if test "x$with_libstatgrab" = "xyes"
4940 SAVE_CPPFLAGS="$CPPFLAGS"
4941 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4943 AC_CHECK_HEADERS(statgrab.h,
4944 [with_libstatgrab="yes"],
4945 [with_libstatgrab="no (statgrab.h not found)"])
4947 CPPFLAGS="$SAVE_CPPFLAGS"
4950 if test "x$with_libstatgrab" = "xyes"
4952 SAVE_CFLAGS="$CFLAGS"
4953 SAVE_LDFLAGS="$LDFLAGS"
4955 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4956 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4958 AC_CHECK_LIB(statgrab, sg_init,
4959 [with_libstatgrab="yes"],
4960 [with_libstatgrab="no (symbol sg_init not found)"])
4962 CFLAGS="$SAVE_CFLAGS"
4963 LDFLAGS="$SAVE_LDFLAGS"
4966 if test "x$with_libstatgrab" = "xyes"
4968 SAVE_CFLAGS="$CFLAGS"
4969 SAVE_LDFLAGS="$LDFLAGS"
4972 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4973 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4974 LIBS="-lstatgrab $LIBS"
4976 AC_CACHE_CHECK([if libstatgrab >= 0.90],
4977 [c_cv_have_libstatgrab_0_90],
4978 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4981 #include <statgrab.h>
4984 if (sg_init()) return 0;
4987 [c_cv_have_libstatgrab_0_90="no"],
4988 [c_cv_have_libstatgrab_0_90="yes"]
4992 CFLAGS="$SAVE_CFLAGS"
4993 LDFLAGS="$SAVE_LDFLAGS"
4997 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4998 if test "x$with_libstatgrab" = "xyes"
5000 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
5001 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5002 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5003 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
5004 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
5005 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
5007 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
5012 # --with-libtokyotyrant {{{
5013 with_libtokyotyrant_cppflags=""
5014 with_libtokyotyrant_ldflags=""
5015 with_libtokyotyrant_libs=""
5016 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5018 if test "x$withval" = "xno"
5020 with_libtokyotyrant="no"
5021 else if test "x$withval" = "xyes"
5023 with_libtokyotyrant="yes"
5025 with_libtokyotyrant_cppflags="-I$withval/include"
5026 with_libtokyotyrant_ldflags="-L$withval/include"
5027 with_libtokyotyrant_libs="-ltokyotyrant"
5028 with_libtokyotyrant="yes"
5032 with_libtokyotyrant="yes"
5035 if test "x$with_libtokyotyrant" = "xyes"
5037 if $PKG_CONFIG --exists tokyotyrant
5039 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5040 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5041 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5045 SAVE_CPPFLAGS="$CPPFLAGS"
5046 SAVE_LDFLAGS="$LDFLAGS"
5047 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5048 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5050 if test "x$with_libtokyotyrant" = "xyes"
5052 AC_CHECK_HEADERS(tcrdb.h,
5054 AC_DEFINE(HAVE_TCRDB_H, 1,
5055 [Define to 1 if you have the <tcrdb.h> header file.])
5056 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5059 if test "x$with_libtokyotyrant" = "xyes"
5061 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5063 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5064 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5066 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5067 [$with_libtokyotyrant_libs])
5070 CPPFLAGS="$SAVE_CPPFLAGS"
5071 LDFLAGS="$SAVE_LDFLAGS"
5073 if test "x$with_libtokyotyrant" = "xyes"
5075 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5076 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5077 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5078 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5079 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5080 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5082 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5085 # --with-libudev {{{
5086 with_libudev_cflags=""
5087 with_libudev_ldflags=""
5088 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5090 if test "x$withval" = "xno"
5095 if test "x$withval" != "xyes"
5097 with_libudev_cflags="-I$withval/include"
5098 with_libudev_ldflags="-L$withval/lib"
5104 if test "x$ac_system" = "xLinux"
5108 with_libudev="no (Linux only library)"
5111 if test "x$with_libudev" = "xyes"
5113 SAVE_CPPFLAGS="$CPPFLAGS"
5114 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5116 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5118 CPPFLAGS="$SAVE_CPPFLAGS"
5120 if test "x$with_libudev" = "xyes"
5122 SAVE_CPPFLAGS="$CPPFLAGS"
5123 SAVE_LDFLAGS="$LDFLAGS"
5124 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5125 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5127 AC_CHECK_LIB(udev, udev_new,
5129 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5131 [with_libudev="no (libudev not found)"])
5133 CPPFLAGS="$SAVE_CPPFLAGS"
5134 LDFLAGS="$SAVE_LDFLAGS"
5136 if test "x$with_libudev" = "xyes"
5138 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5139 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5140 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5141 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5142 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5143 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5145 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5148 # --with-libupsclient {{{
5149 with_libupsclient_config=""
5150 with_libupsclient_cflags=""
5151 with_libupsclient_libs=""
5152 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5154 if test "x$withval" = "xno"
5156 with_libupsclient="no"
5157 else if test "x$withval" = "xyes"
5159 with_libupsclient="use_pkgconfig"
5161 if test -x "$withval"
5163 with_libupsclient_config="$withval"
5164 with_libupsclient="use_libupsclient_config"
5165 else if test -x "$withval/bin/libupsclient-config"
5167 with_libupsclient_config="$withval/bin/libupsclient-config"
5168 with_libupsclient="use_libupsclient_config"
5170 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5171 with_libupsclient_cflags="-I$withval/include"
5172 with_libupsclient_libs="-L$withval/lib -lupsclient"
5173 with_libupsclient="yes"
5177 [with_libupsclient="use_pkgconfig"])
5179 # configure using libupsclient-config
5180 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5182 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5183 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5186 with_libupsclient="no ($with_libupsclient_config failed)"
5188 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5191 with_libupsclient="no ($with_libupsclient_config failed)"
5194 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5196 with_libupsclient="yes"
5199 # configure using pkg-config
5200 if test "x$with_libupsclient" = "xuse_pkgconfig"
5202 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5203 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5206 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5209 if test "x$with_libupsclient" = "xuse_pkgconfig"
5211 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5214 with_libupsclient="no ($PKG_CONFIG failed)"
5216 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5219 with_libupsclient="no ($PKG_CONFIG failed)"
5222 if test "x$with_libupsclient" = "xuse_pkgconfig"
5224 with_libupsclient="yes"
5227 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5228 # the actual checks.
5229 if test "x$with_libupsclient" = "xyes"
5231 SAVE_CPPFLAGS="$CPPFLAGS"
5232 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5234 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5236 CPPFLAGS="$SAVE_CPPFLAGS"
5238 if test "x$with_libupsclient" = "xyes"
5240 SAVE_CPPFLAGS="$CPPFLAGS"
5241 SAVE_LDFLAGS="$LDFLAGS"
5243 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5244 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5246 AC_CHECK_LIB(upsclient, upscli_connect,
5247 [with_libupsclient="yes"],
5248 [with_libupsclient="no (symbol upscli_connect not found)"])
5250 CPPFLAGS="$SAVE_CPPFLAGS"
5251 LDFLAGS="$SAVE_LDFLAGS"
5253 if test "x$with_libupsclient" = "xyes"
5255 SAVE_CPPFLAGS="$CPPFLAGS"
5256 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5258 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5259 [#include <stdlib.h>
5261 #include <upsclient.h>])
5263 CPPFLAGS="$SAVE_CPPFLAGS"
5265 if test "x$with_libupsclient" = "xyes"
5267 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5268 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5269 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5270 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5274 # --with-libxenctrl {{{
5275 with_libxenctrl_cppflags=""
5276 with_libxenctrl_ldflags=""
5277 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5279 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5281 with_libxenctrl_cppflags="-I$withval/include"
5282 with_libxenctrl_ldflags="-L$withval/lib"
5283 with_libxenctrl="yes"
5285 with_libxenctrl="$withval"
5289 with_libxenctrl="yes"
5291 if test "x$with_libxenctrl" = "xyes"
5293 SAVE_CPPFLAGS="$CPPFLAGS"
5294 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5296 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5298 CPPFLAGS="$SAVE_CPPFLAGS"
5300 if test "x$with_libxenctrl" = "xyes"
5302 SAVE_CPPFLAGS="$CPPFLAGS"
5303 SAVE_LDFLAGS="$LDFLAGS"
5304 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5305 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5307 #Xen versions older than 3.4 has no xc_getcpuinfo()
5308 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5310 CPPFLAGS="$SAVE_CPPFLAGS"
5311 LDFLAGS="$SAVE_LDFLAGS"
5312 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5313 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5314 AC_SUBST(LIBXENCTL_CPPFLAGS)
5315 AC_SUBST(LIBXENCTL_LDFLAGS)
5319 # --with-libxmms {{{
5320 with_xmms_config="xmms-config"
5323 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5325 if test "x$withval" != "xno" \
5326 && test "x$withval" != "xyes"
5328 if test -f "$withval" && test -x "$withval";
5330 with_xmms_config="$withval"
5331 else if test -x "$withval/bin/xmms-config"
5333 with_xmms_config="$withval/bin/xmms-config"
5336 else if test "x$withval" = "xno"
5346 if test "x$with_libxmms" = "xyes"
5348 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5349 xmms_config_status=$?
5351 if test $xmms_config_status -ne 0
5356 if test "x$with_libxmms" = "xyes"
5358 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5359 xmms_config_status=$?
5361 if test $xmms_config_status -ne 0
5366 if test "x$with_libxmms" = "xyes"
5368 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5370 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5371 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5372 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5373 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5380 with_libxmms_numeric=0
5381 if test "x$with_libxmms" = "xyes"
5383 with_libxmms_numeric=1
5385 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5386 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5389 # --with-libyajl {{{
5390 with_libyajl_cppflags=""
5391 with_libyajl_ldflags=""
5392 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5394 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5396 with_libyajl_cppflags="-I$withval/include"
5397 with_libyajl_ldflags="-L$withval/lib"
5400 with_libyajl="$withval"
5406 if test "x$with_libyajl" = "xyes"
5408 SAVE_CPPFLAGS="$CPPFLAGS"
5409 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5411 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5412 AC_CHECK_HEADERS(yajl/yajl_version.h)
5414 CPPFLAGS="$SAVE_CPPFLAGS"
5416 if test "x$with_libyajl" = "xyes"
5418 SAVE_CPPFLAGS="$CPPFLAGS"
5419 SAVE_LDFLAGS="$LDFLAGS"
5420 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5421 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5423 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5425 CPPFLAGS="$SAVE_CPPFLAGS"
5426 LDFLAGS="$SAVE_LDFLAGS"
5428 if test "x$with_libyajl" = "xyes"
5430 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5431 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5432 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5433 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5434 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5435 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5436 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5438 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5442 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5443 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5445 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5447 if test "x$withval" = "xno"
5450 else if test "x$withval" = "xyes"
5453 else if test -d "$with_mic/lib"
5455 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5456 with_mic_cflags="-I$withval/include"
5457 with_mic_ldpath="-L$withval/lib/Linux"
5458 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5463 if test "x$with_mic" = "xyes"
5465 SAVE_CPPFLAGS="$CPPFLAGS"
5466 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5467 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5468 CPPFLAGS="$SAVE_CPPFLAGS"
5470 if test "x$with_mic" = "xyes"
5472 SAVE_CPPFLAGS="$CPPFLAGS"
5473 SAVE_LDFLAGS="$LDFLAGS"
5475 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5476 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5478 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5479 [with_mic_ldpath="$with_mic_ldpath"
5480 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5481 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5483 CPPFLAGS="$SAVE_CPPFLAGS"
5484 LDFLAGS="$SAVE_LDFLAGS"
5487 if test "x$with_mic" = "xyes"
5489 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5490 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5491 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5492 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5493 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5494 AC_SUBST(BUILD_WITH_MIC_LDADD)
5498 # --with-libvarnish {{{
5499 with_libvarnish_cppflags=""
5500 with_libvarnish_cflags=""
5501 with_libvarnish_libs=""
5502 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5504 if test "x$withval" = "xno"
5506 with_libvarnish="no"
5507 else if test "x$withval" = "xyes"
5509 with_libvarnish="use_pkgconfig"
5510 else if test -d "$with_libvarnish/lib"
5512 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5513 with_libvarnish_cflags="-I$withval/include"
5514 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5515 with_libvarnish="yes"
5518 [with_libvarnish="use_pkgconfig"])
5520 # configure using pkg-config
5521 if test "x$with_libvarnish" = "xuse_pkgconfig"
5523 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5524 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5527 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5530 if test "x$with_libvarnish" = "xuse_pkgconfig"
5532 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5535 with_libvarnish="no ($PKG_CONFIG failed)"
5537 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5540 with_libvarnish="no ($PKG_CONFIG failed)"
5543 if test "x$with_libvarnish" = "xuse_pkgconfig"
5545 with_libvarnish="yes"
5548 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5549 # the actual checks.
5550 if test "x$with_libvarnish" = "xyes"
5552 SAVE_CPPFLAGS="$CPPFLAGS"
5554 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5556 AC_CHECK_HEADERS(vapi/vsc.h,
5557 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5558 [AC_CHECK_HEADERS(vsc.h,
5559 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5560 [AC_CHECK_HEADERS(varnishapi.h,
5561 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5562 [with_libvarnish="no (found none of the varnish header files)"])])])
5564 CPPFLAGS="$SAVE_CPPFLAGS"
5566 if test "x$with_libvarnish" = "xyes"
5568 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5569 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5570 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5571 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5575 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5576 with_libxml2="no (pkg-config isn't available)"
5577 with_libxml2_cflags=""
5578 with_libxml2_ldflags=""
5579 with_libvirt="no (pkg-config isn't available)"
5580 with_libvirt_cflags=""
5581 with_libvirt_ldflags=""
5582 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5587 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5590 $PKG_CONFIG --exists libvirt 2>/dev/null
5595 with_libvirt="no (pkg-config doesn't know libvirt)"
5597 if test "x$with_libxml2" = "xyes"
5599 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5604 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5610 if test "x$with_libxml2" = "xyes"
5612 SAVE_CPPFLAGS="$CPPFLAGS"
5613 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5615 AC_CHECK_HEADERS(libxml/parser.h, [],
5616 [with_libxml2="no (libxml/parser.h not found)"])
5618 CPPFLAGS="$SAVE_CPPFLAGS"
5620 if test "x$with_libxml2" = "xyes"
5622 SAVE_CFLAGS="$CFLAGS"
5623 SAVE_LDFLAGS="$LDFLAGS"
5625 CFLAGS="$CFLAGS $with_libxml2_cflags"
5626 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5628 AC_CHECK_LIB(xml2, xmlXPathEval,
5629 [with_libxml2="yes"],
5630 [with_libxml2="no (symbol xmlXPathEval not found)"])
5632 CFLAGS="$SAVE_CFLAGS"
5633 LDFLAGS="$SAVE_LDFLAGS"
5635 dnl Add the right compiler flags and libraries.
5636 if test "x$with_libxml2" = "xyes"; then
5637 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5638 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5639 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5640 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5642 if test "x$with_libvirt" = "xyes"
5644 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5649 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5655 if test "x$with_libvirt" = "xyes"
5657 SAVE_CPPFLAGS="$CPPFLAGS"
5658 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5660 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5661 [with_libvirt="no (libvirt/libvirt.h not found)"])
5663 CPPFLAGS="$SAVE_CPPFLAGS"
5665 if test "x$with_libvirt" = "xyes"
5667 SAVE_CFLAGS="$CFLAGS"
5668 SAVE_LDFLAGS="$LDFLAGS"
5670 CFLAGS="$CFLAGS $with_libvirt_cflags"
5671 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5673 AC_CHECK_LIB(virt, virDomainBlockStats,
5674 [with_libvirt="yes"],
5675 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5677 CFLAGS="$SAVE_CFLAGS"
5678 LDFLAGS="$SAVE_LDFLAGS"
5680 dnl Add the right compiler flags and libraries.
5681 if test "x$with_libvirt" = "xyes"; then
5682 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5683 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5684 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5685 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5689 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5690 with_libopenipmipthread="yes"
5691 with_libopenipmipthread_cflags=""
5692 with_libopenipmipthread_libs=""
5694 if test "x$with_libopenipmipthread" = "xyes"
5696 AC_MSG_CHECKING([for libOpenIPMIpthread])
5697 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5700 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5702 AC_MSG_RESULT([$with_libopenipmipthread])
5705 if test "x$with_libopenipmipthread" = "xyes"
5707 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5708 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5711 with_libopenipmipthread_cflags="$temp_result"
5713 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5714 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5716 AC_MSG_RESULT([$temp_result])
5719 if test "x$with_libopenipmipthread" = "xyes"
5721 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5722 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5725 with_libopenipmipthread_ldflags="$temp_result"
5727 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5728 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5730 AC_MSG_RESULT([$temp_result])
5733 if test "x$with_libopenipmipthread" = "xyes"
5735 SAVE_CPPFLAGS="$CPPFLAGS"
5736 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5738 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5739 [with_libopenipmipthread="yes"],
5740 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5741 [#include <OpenIPMI/ipmiif.h>
5742 #include <OpenIPMI/ipmi_err.h>
5743 #include <OpenIPMI/ipmi_posix.h>
5744 #include <OpenIPMI/ipmi_conn.h>
5747 CPPFLAGS="$SAVE_CPPFLAGS"
5750 if test "x$with_libopenipmipthread" = "xyes"
5752 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5753 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5754 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5755 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5759 # --with-libatasmart {{{
5760 with_libatasmart_cppflags=""
5761 with_libatasmart_ldflags=""
5762 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5764 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5766 with_libatasmart_cppflags="-I$withval/include"
5767 with_libatasmart_ldflags="-L$withval/lib"
5768 with_libatasmart="yes"
5770 with_libatasmart="$withval"
5774 if test "x$ac_system" = "xLinux"
5776 with_libatasmart="yes"
5778 with_libatasmart="no (Linux only library)"
5781 if test "x$with_libatasmart" = "xyes"
5783 SAVE_CPPFLAGS="$CPPFLAGS"
5784 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5786 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5788 CPPFLAGS="$SAVE_CPPFLAGS"
5790 if test "x$with_libatasmart" = "xyes"
5792 SAVE_CPPFLAGS="$CPPFLAGS"
5793 SAVE_LDFLAGS="$LDFLAGS"
5794 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5795 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5797 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5799 CPPFLAGS="$SAVE_CPPFLAGS"
5800 LDFLAGS="$SAVE_LDFLAGS"
5802 if test "x$with_libatasmart" = "xyes"
5804 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5805 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5806 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5807 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5808 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5809 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5810 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5812 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5815 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5816 [with_libnotify="yes"],
5817 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5820 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5821 [with_libriemann_client="yes"],
5822 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5824 # Check for enabled/disabled features
5827 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5828 # ------------------------------------------------------------
5830 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5835 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5840 m4_define([EnDis],[disabled])dnl
5841 m4_define([YesNo],[no])dnl
5847 m4_define([EnDis],[enabled])dnl
5848 m4_define([YesNo],[yes])dnl
5851 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5855 m4_if([$3], [feature], [],
5859 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5865 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5867 enable_$1='[YesNo]'dnl
5869 if test "x$enable_$1" = "xno"
5873 if test "x$enable_$1" = "xyes"
5877 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5882 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5883 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5885 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5887 # AC_PLUGIN(name, default, info)
5888 # ------------------------------------------------------------
5895 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5897 if test "x$enableval" = "xyes"
5900 else if test "x$enableval" = "xforce"
5905 enable_plugin="no (disabled on command line)"
5909 if test "x$enable_all_plugins" = "xauto"
5911 if test "x$2" = "xyes"
5918 enable_plugin="$enable_all_plugins"
5921 if test "x$enable_plugin" = "xyes"
5923 if test "x$2" = "xyes" || test "x$force" = "xyes"
5925 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
5926 if test "x$2" != "xyes"
5928 dependency_warning="yes"
5930 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
5931 dependency_error="yes"
5932 enable_plugin="$2 (dependency error)"
5935 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
5936 enable_$1="$enable_plugin"
5938 )# AC_PLUGIN(name, default, info)
5940 m4_divert_once([HELP_ENABLE], [
5941 collectd features:])
5942 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
5943 AC_COLLECTD([debug], [enable], [feature], [debugging])
5944 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
5945 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
5946 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
5948 dependency_warning="no"
5949 dependency_error="no"
5952 plugin_barometer="no"
5957 plugin_conntrack="no"
5958 plugin_contextswitch="no"
5961 plugin_cpusleep="no"
5962 plugin_curl_json="no"
5963 plugin_curl_xml="no"
5974 plugin_hugepages="no"
5975 plugin_intel_rdt="no"
5976 plugin_interface="no"
5981 plugin_log_logstash="no"
5983 plugin_multimeter="no"
5988 plugin_processes="no"
5989 plugin_protocols="no"
5995 plugin_tcpconns="no"
5998 plugin_turbostat="no"
6004 plugin_wireless="no"
6005 plugin_write_prometheus="no"
6009 plugin_zookeeper="no"
6012 if test "x$ac_system" = "xLinux"
6014 plugin_battery="yes"
6015 plugin_cgroups="yes"
6016 plugin_conntrack="yes"
6017 plugin_contextswitch="yes"
6019 plugin_cpufreq="yes"
6022 plugin_entropy="yes"
6023 plugin_fhcount="yes"
6024 plugin_fscache="yes"
6025 plugin_hugepages="yes"
6026 plugin_interface="yes"
6034 plugin_processes="yes"
6035 plugin_protocols="yes"
6038 plugin_tcpconns="yes"
6039 plugin_thermal="yes"
6042 plugin_vserver="yes"
6043 plugin_wireless="yes"
6044 plugin_zfs_arc="yes"
6046 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
6050 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
6052 plugin_turbostat="yes"
6055 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6057 plugin_cpusleep="yes"
6061 if test "x$ac_system" = "xOpenBSD"
6063 plugin_tcpconns="yes"
6066 if test "x$ac_system" = "xNetBSD"
6069 plugin_entropy="yes"
6071 plugin_processes="yes"
6075 if test "x$with_libiokit" = "xyes"
6077 plugin_battery="yes"
6083 if test "x$ac_system" = "xAIX"
6086 plugin_tcpconns="yes"
6091 if test "x$ac_system" = "xFreeBSD"
6094 plugin_zfs_arc="yes"
6098 if test "x$with_perfstat" = "xyes"
6100 plugin_contextswitch="yes"
6103 plugin_interface="yes"
6110 if test "x$with_procinfo" = "xyes"
6112 plugin_processes="yes"
6116 if test "x$with_kstat" = "xyes"
6119 plugin_processes="yes"
6121 plugin_zfs_arc="yes"
6125 if test "x$with_devinfo$with_kstat" = "xyesyes"
6129 plugin_interface="yes"
6135 if test "x$ac_system" = "xLinux"
6137 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6138 [with_libi2c="yes"],
6139 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6140 [[#include <stdlib.h>
6141 #include <linux/i2c-dev.h>]])
6143 with_libi2c="no (Linux only)"
6146 if test "x$with_libi2c" = "xyes"
6148 plugin_barometer="yes"
6153 if test "x$with_libstatgrab" = "xyes"
6157 plugin_interface="yes"
6164 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6167 if test "x$have_strptime" = "xyes"
6173 if test "x$with_libopenipmipthread" = "xyes"
6178 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6180 plugin_curl_json="yes"
6183 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6185 plugin_curl_xml="yes"
6188 if test "x$with_libyajl" = "xyes"
6193 if test "x$have_processor_info" = "xyes"
6197 if test "x$have_sysctl" = "xyes"
6202 if test "x$ac_system" = "xDarwin"
6207 if test "x$have_sysctlbyname" = "xyes"
6209 plugin_contextswitch="yes"
6212 plugin_tcpconns="yes"
6215 # Df plugin: Check if we know how to determine mount points first.
6216 #if test "x$have_listmntent" = "xyes"; then
6219 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6223 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6227 #if test "x$have_getmntent" = "xseq"
6231 if test "x$c_cv_have_one_getmntent" = "xyes"
6236 if test "x$c_cv_have_getmntent_r" = "xyes"
6241 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6242 if test "x$plugin_df" = "xyes"
6245 if test "x$have_statfs" = "xyes"
6249 if test "x$have_statvfs" = "xyes"
6255 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6257 plugin_ethstat="yes"
6260 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6265 if test "x$have_getifaddrs" = "xyes"
6267 plugin_interface="yes"
6270 if test "x$with_libgps" = "xyes"
6275 if test "x$have_getloadavg" = "xyes"
6280 if test "x$with_libyajl" = "xyes"
6282 plugin_log_logstash="yes"
6285 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6290 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6293 if test "x$with_libmicrohttpd" = "xyes"
6295 plugin_write_prometheus="yes"
6299 # Mac OS X memory interface
6300 if test "x$have_host_statistics" = "xyes"
6305 if test "x$have_termios_h" = "xyes"
6307 if test "x$ac_system" != "xAIX"
6309 plugin_multimeter="yes"
6314 if test "x$have_thread_info" = "xyes"
6316 plugin_processes="yes"
6319 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6321 plugin_processes="yes"
6324 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6326 plugin_processes="yes"
6329 if test "x$with_libpython" != "xno"
6334 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6339 if test "x$with_kvm_getswapinfo" = "xyes"
6344 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6349 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6354 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6356 plugin_tcpconns="yes"
6359 if test "x$have_getutent" = "xyes"
6363 if test "x$have_getutxent" = "xyes"
6368 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6373 if test "x$with_libxenctrl" = "xyes"
6378 m4_divert_once([HELP_ENABLE], [
6381 AC_ARG_ENABLE([all-plugins],
6382 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6384 if test "x$enableval" = "xyes"
6386 enable_all_plugins="yes"
6387 else if test "x$enableval" = "xauto"
6389 enable_all_plugins="auto"
6391 enable_all_plugins="no"
6394 [enable_all_plugins="auto"])
6396 m4_divert_once([HELP_ENABLE], [])
6398 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6399 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6400 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6401 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6402 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6403 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6404 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6405 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6406 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6407 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6408 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6409 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6410 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6411 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6412 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6413 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6414 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6415 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6416 AC_PLUGIN([csv], [yes], [CSV output plugin])
6417 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6418 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6419 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6420 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6421 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6422 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6423 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6424 AC_PLUGIN([dpdkstat], [$with_libdpdk], [Stats & Status from DPDK])
6425 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6426 AC_PLUGIN([email], [yes], [EMail statistics])
6427 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6428 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6429 AC_PLUGIN([exec], [yes], [Execution of external programs])
6430 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6431 AC_PLUGIN([filecount], [yes], [Count files in directories])
6432 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6433 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6434 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6435 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6436 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6437 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6438 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6439 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6440 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6441 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6442 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6443 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6444 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6445 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6446 AC_PLUGIN([load], [$plugin_load], [System load])
6447 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6448 AC_PLUGIN([logfile], [yes], [File logging plugin])
6449 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6450 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6451 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6452 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6453 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6454 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6455 AC_PLUGIN([match_regex], [yes], [The regex match])
6456 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6457 AC_PLUGIN([match_value], [yes], [The value match])
6458 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6459 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6460 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6461 AC_PLUGIN([memcached], [yes], [memcached statistics])
6462 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6463 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6464 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6465 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6466 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6467 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6468 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6469 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6470 AC_PLUGIN([network], [yes], [Network communication plugin])
6471 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6472 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6473 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6474 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6475 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6476 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6477 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6478 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6479 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6480 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6481 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6482 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6483 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6484 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6485 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6486 # FIXME: Check for libevent, too.
6487 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6488 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6489 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6490 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6491 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6492 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6493 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6494 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6495 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6496 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6497 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6498 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6499 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6500 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6501 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6502 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6503 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6504 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6505 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6506 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6507 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6508 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6509 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6510 AC_PLUGIN([target_notification], [yes], [The notification target])
6511 AC_PLUGIN([target_replace], [yes], [The replace target])
6512 AC_PLUGIN([target_scale], [yes], [The scale target])
6513 AC_PLUGIN([target_set], [yes], [The set target])
6514 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6515 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6516 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6517 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6518 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6519 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6520 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6521 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6522 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6523 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6524 AC_PLUGIN([users], [$plugin_users], [User statistics])
6525 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6526 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6527 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6528 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6529 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6530 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6531 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6532 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6533 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6534 AC_PLUGIN([write_log], [yes], [Log output plugin])
6535 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6536 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6537 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6538 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6539 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6540 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6541 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6542 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6543 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6544 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6545 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6547 dnl Default configuration file
6548 # Load either syslog or logfile
6549 LOAD_PLUGIN_SYSLOG=""
6550 LOAD_PLUGIN_LOGFILE=""
6551 LOAD_PLUGIN_LOG_LOGSTASH=""
6553 AC_MSG_CHECKING([which default log plugin to load])
6554 default_log_plugin="none"
6555 if test "x$enable_syslog" = "xyes"
6557 default_log_plugin="syslog"
6559 LOAD_PLUGIN_SYSLOG="##"
6562 if test "x$enable_logfile" = "xyes"
6564 if test "x$default_log_plugin" = "xnone"
6566 default_log_plugin="logfile"
6568 LOAD_PLUGIN_LOGFILE="#"
6571 LOAD_PLUGIN_LOGFILE="##"
6574 if test "x$enable_log_logstash" = "xyes"
6576 LOAD_PLUGIN_LOG_LOGSTASH="#"
6578 LOAD_PLUGIN_LOG_LOGSTASH="##"
6582 AC_MSG_RESULT([$default_log_plugin])
6584 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6585 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6586 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6588 DEFAULT_LOG_LEVEL="info"
6589 if test "x$enable_debug" = "xyes"
6591 DEFAULT_LOG_LEVEL="debug"
6593 AC_SUBST(DEFAULT_LOG_LEVEL)
6595 # Load only one of rrdtool, network, csv in the default config.
6596 LOAD_PLUGIN_RRDTOOL=""
6597 LOAD_PLUGIN_NETWORK=""
6600 AC_MSG_CHECKING([which default write plugin to load])
6601 default_write_plugin="none"
6602 if test "x$enable_rrdtool" = "xyes"
6604 default_write_plugin="rrdtool"
6606 LOAD_PLUGIN_RRDTOOL="##"
6609 if test "x$enable_network" = "xyes"
6611 if test "x$default_write_plugin" = "xnone"
6613 default_write_plugin="network"
6615 LOAD_PLUGIN_NETWORK="#"
6618 LOAD_PLUGIN_NETWORK="##"
6621 if test "x$enable_csv" = "xyes"
6623 if test "x$default_write_plugin" = "xnone"
6625 default_write_plugin="csv"
6630 LOAD_PLUGIN_CSV="##"
6632 AC_MSG_RESULT([$default_write_plugin])
6634 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6635 AC_SUBST(LOAD_PLUGIN_NETWORK)
6636 AC_SUBST(LOAD_PLUGIN_CSV)
6639 if test "x$ac_system" = "xLinux" \
6640 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6642 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6645 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6647 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6651 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6652 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6654 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6656 PERL_BINDINGS_OPTIONS="$withval"
6657 with_perl_bindings="yes"
6659 with_perl_bindings="$withval"
6663 if test -n "$perl_interpreter"
6665 with_perl_bindings="yes"
6667 with_perl_bindings="no (no perl interpreter found)"
6671 if test "x$with_perl_bindings" = "xyes"
6673 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6674 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6675 AC_MSG_RESULT([yes])
6678 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6682 if test "x$with_perl_bindings" = "xyes"
6684 PERL_BINDINGS="perl"
6688 AC_SUBST(PERL_BINDINGS)
6689 AC_SUBST(PERL_BINDINGS_OPTIONS)
6691 dnl libcollectdclient
6692 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6693 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6694 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6696 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6698 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6700 AC_SUBST(LCC_VERSION_MAJOR)
6701 AC_SUBST(LCC_VERSION_MINOR)
6702 AC_SUBST(LCC_VERSION_PATCH)
6703 AC_SUBST(LCC_VERSION_EXTRA)
6704 AC_SUBST(LCC_VERSION_STRING)
6706 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6710 if test "x$enable_werror" != "xno"
6712 AM_CFLAGS="$AM_CFLAGS -Werror"
6713 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6715 AC_SUBST([AM_CFLAGS])
6716 AC_SUBST([AM_CXXFLAGS])
6718 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])
6721 if test "x$with_librrd" = "xyes" \
6722 && test "x$librrd_threadsafe" != "xyes"
6724 with_librrd="yes (warning: librrd is not thread-safe)"
6727 if test "x$with_libperl" = "xyes"
6729 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6731 enable_perl="no (needs libperl)"
6734 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6736 enable_perl="no (libperl doesn't support ithreads)"
6739 if test "x$with_perl_bindings" = "xyes" \
6740 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6742 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6746 AC_MSG_RESULT([Configuration:])
6747 AC_MSG_RESULT([ Build:])
6748 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6749 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6750 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6751 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6752 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6753 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6754 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6755 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6756 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6757 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6758 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6759 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6761 AC_MSG_RESULT([ Libraries:])
6762 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6763 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6764 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6765 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6766 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6767 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6768 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6769 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6770 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6771 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6772 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6773 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6774 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6775 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6776 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6777 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6778 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6779 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6780 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6781 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6782 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6783 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6784 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6785 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6786 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6787 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6788 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6789 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6790 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6791 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6792 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6793 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6794 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6795 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6796 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6797 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6798 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6799 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6800 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6801 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6802 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6803 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6804 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6805 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6806 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6807 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6808 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6809 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6810 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6811 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6812 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6813 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6814 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6815 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6816 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6817 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6818 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6819 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6820 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6821 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6822 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6823 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6824 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6825 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6827 AC_MSG_RESULT([ Features:])
6828 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6829 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6831 AC_MSG_RESULT([ Bindings:])
6832 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6834 AC_MSG_RESULT([ Modules:])
6835 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6836 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6837 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6838 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6839 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6840 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6841 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6842 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6843 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6844 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6845 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6846 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6847 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6848 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6849 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6850 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6851 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6852 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6853 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6854 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6855 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6856 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6857 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6858 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6859 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6860 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6861 AC_MSG_RESULT([ dpdkstat . . . . . . .$enable_dpdkstat])
6862 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6863 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6864 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6865 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6866 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6867 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6868 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6869 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6870 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6871 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6872 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6873 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6874 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6875 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6876 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6877 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6878 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6879 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6880 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6881 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6882 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6883 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6884 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6885 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6886 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6887 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6888 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6889 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6890 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6891 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6892 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6893 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6894 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6895 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6896 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6897 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6898 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
6899 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
6900 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
6901 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
6902 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
6903 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
6904 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
6905 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
6906 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
6907 AC_MSG_RESULT([ network . . . . . . . $enable_network])
6908 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
6909 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
6910 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
6911 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
6912 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
6913 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
6914 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
6915 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
6916 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
6917 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
6918 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
6919 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
6920 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
6921 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
6922 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
6923 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
6924 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
6925 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
6926 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
6927 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
6928 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
6929 AC_MSG_RESULT([ python . . . . . . . $enable_python])
6930 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
6931 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
6932 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
6933 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
6934 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
6935 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
6936 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
6937 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
6938 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
6939 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
6940 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
6941 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
6942 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
6943 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
6944 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
6945 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
6946 AC_MSG_RESULT([ target_notification . $enable_target_notification])
6947 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
6948 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
6949 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
6950 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
6951 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
6952 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
6953 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
6954 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
6955 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
6956 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
6957 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
6958 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
6959 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
6960 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
6961 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
6962 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
6963 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
6964 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
6965 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
6966 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
6967 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
6968 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
6969 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
6970 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
6971 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
6972 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
6973 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
6974 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
6975 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
6976 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
6977 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
6978 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
6979 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
6980 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
6981 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
6984 if test "x$dependency_error" = "xyes"; then
6985 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
6988 if test "x$dependency_warning" = "xyes"; then
6989 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
6992 # vim: set fdm=marker :