1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
4 AC_CONFIG_SRCDIR(src/target_set.c)
5 AC_CONFIG_HEADERS(src/config.h)
6 AC_CONFIG_AUX_DIR([libltdl/config])
8 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
9 dnl we don't really need the 'u' even in older toolchains. Then there is
10 dnl older libtool, which spelled it AR_FLAGS
11 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
13 m4_ifdef([LT_PACKAGE_VERSION],
16 LT_CONFIG_LTDL_DIR([libltdl])
18 LTDL_INIT([convenience])
19 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
24 AC_LIBLTDL_CONVENIENCE
28 AC_CONFIG_SUBDIRS(libltdl)
29 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
33 AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
35 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 AC_PREFIX_DEFAULT("/opt/collectd")
44 # Checks for programs.
47 [AC_MSG_ERROR([No compiler found that supports C99])]
56 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
63 AC_PATH_PROG([VALGRIND], [valgrind])
65 # Warn when pkg.m4 is missing
66 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
70 AC_CACHE_CHECK([if bison is the parser generator],
71 [collectd_cv_prog_bison],
72 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
73 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
77 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
79 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
82 AC_ARG_VAR([PROTOC], [path to the protoc binary])
83 AC_PATH_PROG([PROTOC], [protoc])
85 if test "x$PROTOC" != "x"; then
86 AC_MSG_CHECKING([for protoc 3.0.0+])
87 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
88 protoc3="yes (`$PROTOC --version`)"
91 protoc3="no (`$PROTOC --version`)"
93 AC_MSG_RESULT([$protoc3])
95 AM_CONDITIONAL(HAVE_PROTOC3, test "x$have_protoc3" = "xyes")
97 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
98 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
99 AM_CONDITIONAL(HAVE_GRPC_CPP, test "x$GRPC_CPP_PLUGIN" != "x")
101 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
102 AC_PATH_PROG([PROTOC_C], [protoc-c])
103 if test "x$PROTOC_C" = "x"
105 have_protoc_c="no (protoc-c compiler not found)"
110 AC_MSG_CHECKING([for kernel type ($host_os)])
113 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
117 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
121 AC_DEFINE([KERNEL_DARWIN], 1, [True if program is to be compiled for a Darwin kernel])
125 AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel])
129 AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel])
133 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
137 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
143 AC_MSG_RESULT([$ac_system])
145 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
146 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
147 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
148 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
149 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
150 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
152 if test "x$ac_system" = "xLinux"
154 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
155 if test -z "$KERNEL_DIR"
157 KERNEL_DIR="/lib/modules/`uname -r`/source"
160 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
161 AC_SUBST(KERNEL_CFLAGS)
164 if test "x$ac_system" = "xSolaris"
166 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
167 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
169 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
170 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
172 # error "Compiler not in 64bit mode."
175 [AC_MSG_RESULT([yes])],
178 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
182 if test "x$ac_system" = "xAIX"
184 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
187 # Where to install .pc files.
188 pkgconfigdir="${libdir}/pkgconfig"
189 AC_SUBST(pkgconfigdir)
191 # Check for standards compliance mode
192 AC_ARG_ENABLE(standards,
193 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
194 [enable_standards="$enableval"],
195 [enable_standards="no"])
196 if test "x$enable_standards" = "xyes"
198 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
199 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
200 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
201 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
202 if test "x$GCC" = "xyes"
204 CFLAGS="$CFLAGS -std=c99"
207 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
210 # Checks for header files.
266 # For entropy plugin on newer NetBSD
267 AC_CHECK_HEADERS(sys/rndio.h, [], [],
268 [#if HAVE_SYS_TYPES_H
269 # include <sys/types.h>
272 # include <sys/ioctl.h>
275 # include <sys/param.h>
280 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
285 # include <sys/types.h>
288 AC_CHECK_HEADERS(netinet/in.h, [], [],
293 # include <sys/types.h>
295 #if HAVE_NETINET_IN_SYSTM_H
296 # include <netinet/in_systm.h>
299 AC_CHECK_HEADERS(netinet/ip.h, [], [],
304 # include <sys/types.h>
306 #if HAVE_NETINET_IN_SYSTM_H
307 # include <netinet/in_systm.h>
309 #if HAVE_NETINET_IN_H
310 # include <netinet/in.h>
313 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
318 # include <sys/types.h>
320 #if HAVE_NETINET_IN_SYSTM_H
321 # include <netinet/in_systm.h>
323 #if HAVE_NETINET_IN_H
324 # include <netinet/in.h>
326 #if HAVE_NETINET_IP_H
327 # include <netinet/ip.h>
330 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
335 # include <sys/types.h>
337 #if HAVE_NETINET_IN_SYSTM_H
338 # include <netinet/in_systm.h>
340 #if HAVE_NETINET_IN_H
341 # include <netinet/in.h>
343 #if HAVE_NETINET_IP_H
344 # include <netinet/ip.h>
347 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
352 # include <sys/types.h>
354 #if HAVE_NETINET_IN_SYSTM_H
355 # include <netinet/in_systm.h>
357 #if HAVE_NETINET_IN_H
358 # include <netinet/in.h>
361 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
366 # include <sys/types.h>
368 #if HAVE_NETINET_IN_SYSTM_H
369 # include <netinet/in_systm.h>
371 #if HAVE_NETINET_IN_H
372 # include <netinet/in.h>
374 #if HAVE_NETINET_IP6_H
375 # include <netinet/ip6.h>
378 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
383 # include <sys/types.h>
385 #if HAVE_NETINET_IN_SYSTM_H
386 # include <netinet/in_systm.h>
388 #if HAVE_NETINET_IN_H
389 # include <netinet/in.h>
391 #if HAVE_NETINET_IP_H
392 # include <netinet/ip.h>
395 AC_CHECK_HEADERS(netinet/udp.h, [], [],
400 # include <sys/types.h>
402 #if HAVE_NETINET_IN_SYSTM_H
403 # include <netinet/in_systm.h>
405 #if HAVE_NETINET_IN_H
406 # include <netinet/in.h>
408 #if HAVE_NETINET_IP_H
409 # include <netinet/ip.h>
414 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
419 # include <sys/types.h>
421 #if HAVE_NETINET_IN_SYSTM_H
422 # include <netinet/in_systm.h>
424 #if HAVE_NETINET_IN_H
425 # include <netinet/in.h>
427 #if HAVE_NETINET_IP6_H
428 # include <netinet/ip6.h>
432 if test "x$have_ip6_ext" = "xno"; then
433 SAVE_CFLAGS="$CFLAGS"
434 CFLAGS="$CFLAGS -DSOLARIS2=8"
436 AC_CHECK_TYPES([struct ip6_ext],
437 [have_ip6_ext="yes, with -DSOLARIS2=8"],
443 # include <sys/types.h>
445 #if HAVE_NETINET_IN_SYSTM_H
446 # include <netinet/in_systm.h>
448 #if HAVE_NETINET_IN_H
449 # include <netinet/in.h>
451 #if HAVE_NETINET_IP6_H
452 # include <netinet/ip6.h>
456 if test "x$have_ip6_ext" = "xno"; then
457 CFLAGS="$SAVE_CFLAGS"
462 AC_CHECK_HEADERS(sys/dkstat.h)
463 if test "x$ac_system" = "xDarwin"
465 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
466 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
467 # For the battery plugin
468 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
470 #if HAVE_IOKIT_IOKITLIB_H
471 # include <IOKit/IOKitLib.h>
473 #if HAVE_IOKIT_IOTYPES_H
474 # include <IOKit/IOTypes.h>
480 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
483 # include <sys/types.h>
486 # include <sys/param.h>
490 AC_MSG_CHECKING([for sysctl kern.cp_times])
491 if test -x /sbin/sysctl
493 /sbin/sysctl kern.cp_times >/dev/null 2>&1
497 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
498 [Define if sysctl supports kern.cp_times])
506 AC_MSG_CHECKING([for sysctl kern.cp_time])
507 if test -x /sbin/sysctl
509 /sbin/sysctl kern.cp_time >/dev/null 2>&1
513 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1,
514 [Define if sysctl supports kern.cp_time])
523 AC_CHECK_HEADERS(linux/major.h)
525 # For md module (Linux only)
526 if test "x$ac_system" = "xLinux"
528 AC_CHECK_HEADERS(linux/raid/md_u.h,
529 [have_linux_raid_md_u_h="yes"],
530 [have_linux_raid_md_u_h="no"],
532 #include <sys/ioctl.h>
533 #include <linux/major.h>
534 #include <linux/types.h>
536 AC_CHECK_HEADERS([sys/sysmacros.h])
538 have_linux_raid_md_u_h="no"
541 # For the wireless module
542 have_linux_wireless_h="no"
543 if test "x$ac_system" = "xLinux"
545 AC_CHECK_HEADERS(linux/wireless.h,
546 [have_linux_wireless_h="yes"],
547 [have_linux_wireless_h="no"],
550 #include <sys/ioctl.h>
551 #include <sys/socket.h>
555 # For the swap module
556 have_sys_swap_h="yes"
557 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
559 #undef _FILE_OFFSET_BITS
560 #undef _LARGEFILE64_SOURCE
562 # include <sys/types.h>
565 # include <sys/param.h>
570 # For the processes plugin
572 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
574 # For interface plugin
575 AC_CHECK_HEADERS(ifaddrs.h)
576 AC_CHECK_HEADERS(net/if.h, [], [],
579 # include <sys/types.h>
581 #if HAVE_SYS_SOCKET_H
582 # include <sys/socket.h>
585 AC_CHECK_HEADERS(linux/if.h, [], [],
588 # include <sys/types.h>
590 #if HAVE_SYS_SOCKET_H
591 # include <sys/socket.h>
594 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
597 # include <sys/types.h>
599 #if HAVE_SYS_SOCKET_H
600 # include <sys/socket.h>
602 #if HAVE_LINUX_INET_DIAG_H
603 # include <linux/inet_diag.h>
606 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
609 # include <sys/types.h>
611 #if HAVE_SYS_SOCKET_H
612 # include <sys/socket.h>
615 # include <linux/if.h>
620 AC_CHECK_HEADERS(linux/sockios.h,
621 [have_linux_sockios_h="yes"],
622 [have_linux_sockios_h="no"],
625 # include <sys/ioctl.h>
631 AC_CHECK_HEADERS(linux/ethtool.h,
632 [have_linux_ethtool_h="yes"],
633 [have_linux_ethtool_h="no"],
636 # include <sys/ioctl.h>
641 #if HAVE_LINUX_SOCKIOS_H
642 # include <linux/sockios.h>
647 have_linux_ip_vs_h="no"
648 have_net_ip_vs_h="no"
650 ip_vs_h_needs_kernel_cflags="no"
651 if test "x$ac_system" = "xLinux"
653 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
654 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
655 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
657 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
659 SAVE_CFLAGS="$CFLAGS"
660 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
662 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
664 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
665 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
666 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
668 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
670 ip_vs_h_needs_kernel_cflags="yes"
673 CFLAGS="$SAVE_CFLAGS"
676 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
679 AC_CHECK_HEADERS(sys/ucred.h, [], [],
682 # include <sys/types.h>
685 # include <sys/param.h>
689 # For mount interface
690 AC_CHECK_HEADERS(sys/mount.h, [], [],
693 # include <sys/types.h>
696 # include <sys/param.h>
700 # For the email plugin
701 AC_CHECK_HEADERS(linux/un.h, [], [],
703 #if HAVE_SYS_SOCKET_H
704 # include <sys/socket.h>
710 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
715 if test "x$enable_xfs" != "xno"; then
716 AC_CHECK_HEADERS([xfs/xqm.h],
719 if test "x$enable_xfs" = "xyes"; then
720 AC_MSG_ERROR([xfs/xqm.h not found])
723 [[#define _GNU_SOURCE]]
730 AC_CHECK_HEADERS(arpa/nameser.h)
731 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
733 #if HAVE_ARPA_NAMESER_H
734 # include <arpa/nameser.h>
738 AC_CHECK_HEADERS(net/if_arp.h, [], [],
739 [#if HAVE_SYS_SOCKET_H
740 # include <sys/socket.h>
743 AC_CHECK_HEADERS(net/ppp_defs.h)
744 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
745 [#if HAVE_NET_PPP_DEFS_H
746 # include <net/ppp_defs.h>
749 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
754 # include <sys/types.h>
756 #if HAVE_SYS_SOCKET_H
757 # include <sys/socket.h>
762 #if HAVE_NETINET_IN_H
763 # include <netinet/in.h>
767 have_net_pfvar_h="no"
768 AC_CHECK_HEADERS(net/pfvar.h,
769 [have_net_pfvar_h="yes"],
770 [have_net_pfvar_h="no"],
773 # include <sys/ioctl.h>
775 #if HAVE_SYS_SOCKET_H
776 # include <sys/socket.h>
781 #if HAVE_NETINET_IN_H
782 # include <netinet/in.h>
786 # For the multimeter plugin
788 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
790 # For cpusleep plugin
791 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
792 [c_cv_have_clock_boottime_monotonic],
793 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
798 struct timespec b, m;
799 clock_gettime(CLOCK_BOOTTIME, &b );
800 clock_gettime(CLOCK_MONOTONIC, &m );
803 [c_cv_have_clock_boottime_monotonic="yes"],
804 [c_cv_have_clock_boottime_monotonic="no"]))
807 # For the turbostat plugin
808 have_asm_msrindex_h="no"
809 AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
811 if test "x$have_asm_msrindex_h" = "xyes"
813 AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
814 [c_cv_have_usable_asm_msrindex_h],
815 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
817 #include<asm/msr-index.h>
820 int y = MSR_PKG_C10_RESIDENCY;
824 [c_cv_have_usable_asm_msrindex_h="yes"],
825 [c_cv_have_usable_asm_msrindex_h="no"],
831 AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
833 have_capability="yes"
834 AC_CHECK_HEADERS(sys/capability.h,
835 [have_capability="yes"],
836 [have_capability="no (<sys/capability.h> not found)"])
837 if test "x$have_capability" = "xyes"; then
838 AC_CHECK_LIB(cap, cap_get_proc,
839 [have_capability="yes"],
840 [have_capability="no (cap_get_proc() not found)"])
842 if test "x$have_capability" = "xyes"; then
843 AC_CHECK_DECL([CAP_IS_SUPPORTED],
844 [have_capability="yes"],
845 [have_capability="no (CAP_IS_SUPPORTED not found)"],
846 [[#include <sys/capability.h>]])
848 if test "x$have_capability" = "xyes"; then
849 AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_proc() (-lcap).])
851 AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes")
854 # Checks for typedefs, structures, and compiler characteristics.
863 # Checks for library functions.
865 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname setlocale asprintf)
872 AC_LANG_SOURCE([[int main(void){}]])
874 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
881 SAVE_CFLAGS="$CFLAGS"
882 # Emulate behavior of src/Makefile.am
883 if test "x$GCC" = "xyes"
885 CFLAGS="$CFLAGS -Wall -Werror"
888 AC_CACHE_CHECK([for strtok_r],
889 [c_cv_have_strtok_r_default],
898 char buffer[] = "foo,bar,baz";
905 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
908 printf ("token = %s;\n", token);
912 [c_cv_have_strtok_r_default="yes"],
913 [c_cv_have_strtok_r_default="no"]
917 if test "x$c_cv_have_strtok_r_default" = "xno"
919 CFLAGS="$CFLAGS -D_REENTRANT=1"
921 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
922 [c_cv_have_strtok_r_reentrant],
931 char buffer[] = "foo,bar,baz";
938 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
941 printf ("token = %s;\n", token);
945 [c_cv_have_strtok_r_reentrant="yes"],
946 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
951 CFLAGS="$SAVE_CFLAGS"
952 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
954 CFLAGS="$CFLAGS -D_REENTRANT=1"
957 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
959 socket_needs_socket="no"
960 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
961 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
963 clock_gettime_needs_rt="no"
964 clock_gettime_needs_posix4="no"
965 have_clock_gettime="no"
966 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
967 if test "x$have_clock_gettime" = "xno"
969 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
970 have_clock_gettime="yes"])
972 if test "x$have_clock_gettime" = "xno"
974 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
975 have_clock_gettime="yes"])
977 if test "x$have_clock_gettime" = "xyes"
979 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
982 nanosleep_needs_rt="no"
983 nanosleep_needs_posix4="no"
984 AC_CHECK_FUNCS(nanosleep,
986 AC_CHECK_LIB(rt, nanosleep,
987 [nanosleep_needs_rt="yes"],
988 AC_CHECK_LIB(posix4, nanosleep,
989 [nanosleep_needs_posix4="yes"],
990 AC_MSG_ERROR(cannot find nanosleep))))
992 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
993 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
995 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
996 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
997 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
998 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
999 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
1000 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
1001 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
1002 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
1003 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
1004 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
1005 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
1006 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
1008 # Check for strptime {{{
1009 if test "x$GCC" = "xyes"
1011 SAVE_CFLAGS="$CFLAGS"
1012 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
1015 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
1016 if test "x$have_strptime" = "xyes"
1018 AC_CACHE_CHECK([whether strptime is exported by default],
1019 [c_cv_have_strptime_default],
1020 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1026 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1029 [c_cv_have_strptime_default="yes"],
1030 [c_cv_have_strptime_default="no"]))
1032 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
1034 AC_CACHE_CHECK([whether strptime needs standards mode],
1035 [c_cv_have_strptime_standards],
1036 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1038 #ifndef _ISOC99_SOURCE
1039 # define _ISOC99_SOURCE 1
1041 #ifndef _POSIX_C_SOURCE
1042 # define _POSIX_C_SOURCE 200112L
1044 #ifndef _XOPEN_SOURCE
1045 # define _XOPEN_SOURCE 500
1051 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
1054 [c_cv_have_strptime_standards="yes"],
1055 [c_cv_have_strptime_standards="no"]))
1057 if test "x$c_cv_have_strptime_standards" = "xyes"
1059 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
1065 if test "x$GCC" = "xyes"
1067 CFLAGS="$SAVE_CFLAGS"
1069 # }}} Check for strptime
1071 # Check for timegm {{{
1073 # These checks need -Werror because implicit function declarations are only a
1075 SAVE_CFLAGS="$CFLAGS"
1076 CFLAGS="$CFLAGS -Werror"
1078 AC_CACHE_CHECK([for timegm],
1083 #if STRPTIME_NEEDS_STANDARDS
1084 # ifndef _ISOC99_SOURCE
1085 # define _ISOC99_SOURCE 1
1087 # ifndef _POSIX_C_SOURCE
1088 # define _POSIX_C_SOURCE 200112L
1090 # ifndef _XOPEN_SOURCE
1091 # define _XOPEN_SOURCE 500
1097 time_t t = timegm(&(struct tm){0});
1098 if (t == ((time_t) -1)) {
1103 [c_cv_have_timegm="yes"],
1104 [c_cv_have_timegm="no"]
1108 if test "x$c_cv_have_timegm" != "xyes"
1110 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1111 [c_cv_have_timegm_bsd],
1115 #if STRPTIME_NEEDS_STANDARDS
1116 # ifndef _ISOC99_SOURCE
1117 # define _ISOC99_SOURCE 1
1119 # ifndef _POSIX_C_SOURCE
1120 # define _POSIX_C_SOURCE 200112L
1122 # ifndef _XOPEN_SOURCE
1123 # define _XOPEN_SOURCE 500
1127 # define _BSD_SOURCE 1
1132 time_t t = timegm(&(struct tm){0});
1133 if (t == ((time_t) -1)) {
1138 [c_cv_have_timegm_bsd="yes"
1139 c_cv_have_timegm="yes"],
1140 [c_cv_have_timegm_bsd="no"]
1145 if test "x$c_cv_have_timegm" = "xyes"
1147 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1148 if test "x$c_cv_have_timegm_bsd" = "xyes"
1150 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1154 CFLAGS="$SAVE_CFLAGS"
1155 # }}} Check for timegm
1157 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
1158 if test "x$have_swapctl" = "xyes"; then
1159 AC_CACHE_CHECK([whether swapctl takes two arguments],
1160 [c_cv_have_swapctl_two_args],
1161 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1163 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1164 # undef _FILE_OFFSET_BITS
1165 # undef _LARGEFILE64_SOURCE
1167 #include <sys/stat.h>
1168 #include <sys/param.h>
1169 #include <sys/swap.h>
1173 int num = swapctl(0, NULL);
1176 [c_cv_have_swapctl_two_args="yes"],
1177 [c_cv_have_swapctl_two_args="no"]
1180 AC_CACHE_CHECK([whether swapctl takes three arguments],
1181 [c_cv_have_swapctl_three_args],
1185 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1186 # undef _FILE_OFFSET_BITS
1187 # undef _LARGEFILE64_SOURCE
1189 #include <sys/stat.h>
1190 #include <sys/param.h>
1191 #include <sys/swap.h>
1195 int num = swapctl(0, NULL, 0);
1198 [c_cv_have_swapctl_three_args="yes"],
1199 [c_cv_have_swapctl_three_args="no"]
1203 # Check for different versions of `swapctl' here..
1204 if test "x$have_swapctl" = "xyes"; then
1205 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1206 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
1207 [Define if the function swapctl exists and takes two arguments.])
1209 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1210 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
1211 [Define if the function swapctl exists and takes three arguments.])
1216 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1218 if test "x$withval" = "xno"; then
1220 else if test "x$withval" = "xyes"; then
1227 if test "x$nan_type" = "xnone"; then
1228 AC_CACHE_CHECK([whether NAN is defined by default],
1229 [c_cv_have_nan_default],
1230 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1234 static double foo = NAN;
1243 [c_cv_have_nan_default="yes"],
1244 [c_cv_have_nan_default="no"]
1247 if test "x$c_cv_have_nan_default" = "xyes"
1252 if test "x$nan_type" = "xnone"; then
1253 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1254 [c_cv_have_nan_isoc],
1255 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1258 #define __USE_ISOC99 1
1260 static double foo = NAN;
1269 [c_cv_have_nan_isoc="yes"],
1270 [c_cv_have_nan_isoc="no"]
1273 if test "x$c_cv_have_nan_isoc" = "xyes"
1278 if test "x$nan_type" = "xnone"; then
1279 SAVE_LDFLAGS=$LDFLAGS
1280 LDFLAGS="$LDFLAGS -lm"
1281 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1282 [c_cv_have_nan_zero],
1283 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1290 #define NAN (0.0 / 0.0)
1292 # define isnan(f) ((f) != (f))
1294 static double foo = NAN;
1303 [c_cv_have_nan_zero="yes"],
1304 [c_cv_have_nan_zero="no"]
1307 LDFLAGS=$SAVE_LDFLAGS
1308 if test "x$c_cv_have_nan_zero" = "xyes"
1314 if test "x$nan_type" = "xdefault"; then
1315 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1316 [Define if NAN is defined by default and can initialize static variables.])
1317 else if test "x$nan_type" = "xisoc99"; then
1318 AC_DEFINE(NAN_STATIC_ISOC, 1,
1319 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1320 else if test "x$nan_type" = "xzero"; then
1321 AC_DEFINE(NAN_ZERO_ZERO, 1,
1322 [Define if NAN can be defined as (0.0 / 0.0)])
1324 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1327 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1329 if test "x$withval" = "xnothing"; then
1330 fp_layout_type="nothing"
1331 else if test "x$withval" = "xendianflip"; then
1332 fp_layout_type="endianflip"
1333 else if test "x$withval" = "xintswap"; then
1334 fp_layout_type="intswap"
1336 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1339 [fp_layout_type="unknown"])
1341 if test "x$fp_layout_type" = "xunknown"; then
1342 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1343 [c_cv_fp_layout_need_nothing],
1344 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1350 # include <stdint.h>
1353 # include <inttypes.h>
1356 # include <stdbool.h>
1366 memcpy ((void *) &i0, (void *) &d, 8);
1369 memcpy ((void *) c, (void *) &i1, 8);
1371 if ((c[0] == 0x2f) && (c[1] == 0x25)
1372 && (c[2] == 0xc0) && (c[3] == 0xc7)
1373 && (c[4] == 0x43) && (c[5] == 0x2b)
1374 && (c[6] == 0x1f) && (c[7] == 0x5b))
1380 [c_cv_fp_layout_need_nothing="yes"],
1381 [c_cv_fp_layout_need_nothing="no"]
1384 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1385 fp_layout_type="nothing"
1388 if test "x$fp_layout_type" = "xunknown"; then
1389 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1390 [c_cv_fp_layout_need_endianflip],
1391 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1397 # include <stdint.h>
1400 # include <inttypes.h>
1403 # include <stdbool.h>
1405 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1406 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1407 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1408 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1409 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1410 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1411 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1412 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1421 memcpy ((void *) &i0, (void *) &d, 8);
1423 i1 = endianflip (i0);
1424 memcpy ((void *) c, (void *) &i1, 8);
1426 if ((c[0] == 0x2f) && (c[1] == 0x25)
1427 && (c[2] == 0xc0) && (c[3] == 0xc7)
1428 && (c[4] == 0x43) && (c[5] == 0x2b)
1429 && (c[6] == 0x1f) && (c[7] == 0x5b))
1435 [c_cv_fp_layout_need_endianflip="yes"],
1436 [c_cv_fp_layout_need_endianflip="no"]
1439 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1440 fp_layout_type="endianflip"
1443 if test "x$fp_layout_type" = "xunknown"; then
1444 AC_CACHE_CHECK([if intswap converts to x86 representation],
1445 [c_cv_fp_layout_need_intswap],
1446 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1452 # include <stdint.h>
1455 # include <inttypes.h>
1458 # include <stdbool.h>
1460 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1461 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1470 memcpy ((void *) &i0, (void *) &d, 8);
1473 memcpy ((void *) c, (void *) &i1, 8);
1475 if ((c[0] == 0x2f) && (c[1] == 0x25)
1476 && (c[2] == 0xc0) && (c[3] == 0xc7)
1477 && (c[4] == 0x43) && (c[5] == 0x2b)
1478 && (c[6] == 0x1f) && (c[7] == 0x5b))
1484 [c_cv_fp_layout_need_intswap="yes"],
1485 [c_cv_fp_layout_need_intswap="no"]
1488 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1489 fp_layout_type="intswap"
1493 if test "x$fp_layout_type" = "xnothing"; then
1494 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1495 [Define if doubles are stored in x86 representation.])
1496 else if test "x$fp_layout_type" = "xendianflip"; then
1497 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1498 [Define if endianflip is needed to convert to x86 representation.])
1499 else if test "x$fp_layout_type" = "xintswap"; then
1500 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1501 [Define if intswap is needed to convert to x86 representation.])
1503 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1506 # --with-useragent {{{
1507 AC_ARG_WITH(useragent, [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1509 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1511 AC_DEFINE_UNQUOTED(COLLECTD_USERAGENT, ["$withval"], [User agent for http requests])
1517 # --with-data-max-name-len {{{
1518 AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1520 if test "x$withval" != "x" && test $withval -gt 0
1522 AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
1524 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1527 [ AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
1532 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1533 have_getvfsstat="no"
1534 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1535 have_listmntent="no"
1536 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1537 have_getmntent_r="no"
1538 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1541 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1542 if test "x$have_getmntent" = "xno"; then
1543 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1545 if test "x$have_getmntent" = "xno"; then
1546 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1548 if test "x$have_getmntent" = "xno"; then
1549 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1552 if test "x$have_getmntent" = "xc"; then
1553 AC_CACHE_CHECK([whether getmntent takes one argument],
1554 [c_cv_have_one_getmntent],
1558 #include "$srcdir/src/utils_mount.h"
1563 fh = setmntent ("/etc/mtab", "r");
1564 me = getmntent (fh);
1565 return(me->mnt_passno);
1568 [c_cv_have_one_getmntent="yes"],
1569 [c_cv_have_one_getmntent="no"]
1572 AC_CACHE_CHECK([whether getmntent takes two arguments],
1573 [c_cv_have_two_getmntent],
1577 #include "$srcdir/src/utils_mount.h"
1583 fh = fopen ("/etc/mnttab", "r");
1584 status = getmntent (fh, &mt);
1588 [c_cv_have_two_getmntent="yes"],
1589 [c_cv_have_two_getmntent="no"]
1594 # Check for different versions of `getmntent' here..
1596 if test "x$have_getmntent" = "xc"; then
1597 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1598 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1599 [Define if the function getmntent exists and takes one argument.])
1601 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1602 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1603 [Define if the function getmntent exists and takes two arguments.])
1606 if test "x$have_getmntent" = "xsun"; then
1607 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1608 [Define if the function getmntent exists. It is the version from libsun.])
1610 if test "x$have_getmntent" = "xseq"; then
1611 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1612 [Define if the function getmntent exists. It is the version from libseq.])
1614 if test "x$have_getmntent" = "xgen"; then
1615 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1616 [Define if the function getmntent exists. It is the version from libgen.])
1620 AC_CACHE_CHECK([if have htonll defined],
1622 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1624 #include <sys/types.h>
1625 #include <netinet/in.h>
1627 # include <inttypes.h>
1634 [c_cv_have_htonll="yes"],
1635 [c_cv_have_htonll="no"]
1638 if test "x$c_cv_have_htonll" = "xyes"
1640 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1643 # Check for structures
1644 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1645 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1648 #include <sys/types.h>
1649 #include <sys/socket.h>
1652 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1653 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1656 #include <sys/types.h>
1657 #include <sys/socket.h>
1658 #include <linux/if.h>
1659 #include <linux/netdevice.h>
1661 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1662 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1665 #include <linux/inet_diag.h>
1669 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1672 #include <netinet/in.h>
1676 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1678 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1679 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1680 have_struct_kinfo_proc_freebsd="yes"
1683 have_struct_kinfo_proc_freebsd="no"
1687 #include <sys/param.h>
1688 #include <sys/sysctl.h>
1689 #include <sys/user.h>
1692 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1694 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1695 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1696 have_struct_kinfo_proc_openbsd="yes"
1699 have_struct_kinfo_proc_openbsd="no"
1702 #include <sys/param.h>
1703 #include <sys/sysctl.h>
1708 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1710 AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
1711 [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1712 have_struct_kinfo_proc2_netbsd="yes"
1715 have_struct_kinfo_proc2_netbsd="no"
1718 #include <sys/param.h>
1719 #include <sys/sysctl.h>
1725 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1726 [#define _BSD_SOURCE
1727 #define _DEFAULT_SOURCE
1729 # include <stdint.h>
1731 #if HAVE_SYS_TYPES_H
1732 # include <sys/types.h>
1734 #if HAVE_NETINET_IN_SYSTM_H
1735 # include <netinet/in_systm.h>
1737 #if HAVE_NETINET_IN_H
1738 # include <netinet/in.h>
1740 #if HAVE_NETINET_IP_H
1741 # include <netinet/ip.h>
1743 #if HAVE_NETINET_UDP_H
1744 # include <netinet/udp.h>
1747 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1748 [#define _BSD_SOURCE
1749 #define _DEFAULT_SOURCE
1751 # include <stdint.h>
1753 #if HAVE_SYS_TYPES_H
1754 # include <sys/types.h>
1756 #if HAVE_NETINET_IN_SYSTM_H
1757 # include <netinet/in_systm.h>
1759 #if HAVE_NETINET_IN_H
1760 # include <netinet/in.h>
1762 #if HAVE_NETINET_IP_H
1763 # include <netinet/ip.h>
1765 #if HAVE_NETINET_UDP_H
1766 # include <netinet/udp.h>
1770 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1779 # check for pthread_setname_np
1780 SAVE_LDFLAGS="$LDFLAGS"
1781 LDFLAGS="$LDFLAGS -lpthread"
1783 AC_MSG_CHECKING([for pthread_setname_np])
1784 have_pthread_setname_np="no"
1785 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1788 #include <pthread.h>
1791 pthread_setname_np((pthread_t) {0}, "conftest");
1794 have_pthread_setname_np="yes"
1795 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1798 AC_MSG_RESULT([$have_pthread_setname_np])
1800 # check for pthread_set_name_np(3) (FreeBSD)
1801 AC_MSG_CHECKING([for pthread_set_name_np])
1802 have_pthread_set_name_np="no"
1803 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1805 #include <pthread_np.h>
1808 pthread_set_name_np((pthread_t) {0}, "conftest");
1811 have_pthread_set_name_np="yes"
1812 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1814 AC_MSG_RESULT([$have_pthread_set_name_np])
1816 LDFLAGS="$SAVE_LDFLAGS"
1819 # Checks for libraries begin here
1822 with_libresolv="yes"
1823 AC_CHECK_LIB(resolv, res_search,
1825 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1827 [with_libresolv="no"])
1828 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1830 dnl Check for HAL (hardware abstraction library)
1832 PKG_CHECK_MODULES([HAL], [hal],
1835 LIBS="$HAL_LIBS $LIBS"
1836 AC_CHECK_LIB([hal], [libhal_device_property_exists],
1838 SAVE_CPPFLAGS="$CPPFLAGS"
1839 CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
1840 AC_CHECK_HEADERS([libhal.h],
1843 BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
1844 BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
1846 CPPFLAGS="$SAVE_CPPFLAGS"
1854 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1855 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1859 AC_CHECK_LIB([pthread],
1862 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
1865 PTHREAD_LIBS="$LIBS"
1868 AC_CHECK_HEADERS([pthread.h],
1870 [AC_MSG_ERROR([pthread.h not found])]
1872 AC_SUBST([PTHREAD_LIBS])
1874 m4_divert_once([HELP_WITH], [
1875 collectd additional packages:])
1877 if test "x$ac_system" = "xAIX"
1882 with_perfstat="no (AIX only)"
1883 with_procinfo="no (AIX only)"
1886 if test "x$with_perfstat" = "xyes"
1888 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1889 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1891 if test "x$with_perfstat" = "xyes"
1893 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1894 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1895 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1896 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1898 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1901 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1903 # Processes plugin under AIX.
1904 if test "x$with_procinfo" = "xyes"
1906 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1908 if test "x$with_procinfo" = "xyes"
1910 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1913 if test "x$ac_system" = "xSolaris"
1918 with_kstat="no (Solaris only)"
1919 with_devinfo="no (Solaris only)"
1922 if test "x$with_kstat" = "xyes"
1924 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1926 if test "x$with_kstat" = "xyes"
1928 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1929 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1931 if test "x$with_kstat" = "xyes"
1933 AC_DEFINE(HAVE_LIBKSTAT, 1,
1934 [Define to 1 if you have the 'kstat' library (-lkstat)])
1936 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1937 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1940 if test "x$ac_system" = "xDarwin"
1946 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1949 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1950 if test "x$with_kvm_getprocs" = "xyes"
1952 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1953 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1956 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1958 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1959 if test "x$with_kvm_getswapinfo" = "xyes"
1961 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1962 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1965 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1967 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1968 if test "x$with_kvm_nlist" = "xyes"
1970 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1971 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1972 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1975 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1977 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1978 if test "x$with_kvm_openfiles" = "xyes"
1980 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1981 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1984 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1986 # --with-libaquaero5 {{{
1987 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1989 if test "x$withval" = "xyes"
1991 with_libaquaero5="yes"
1992 else if test "x$withval" = "xno"
1994 with_libaquaero5="no"
1996 with_libaquaero5="yes"
1997 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1998 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
2001 [with_libaquaero5="yes"])
2003 SAVE_CPPFLAGS="$CPPFLAGS"
2004 SAVE_LDFLAGS="$LDFLAGS"
2006 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
2007 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
2009 if test "x$with_libaquaero5" = "xyes"
2011 if test "x$LIBAQUAERO5_CFLAGS" != "x"
2013 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
2015 AC_CHECK_HEADERS(libaquaero5.h,
2016 [with_libaquaero5="yes"],
2017 [with_libaquaero5="no (libaquaero5.h not found)"])
2019 if test "x$with_libaquaero5" = "xyes"
2021 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
2023 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
2025 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
2026 [with_libaquaero5="yes"],
2027 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
2030 CPPFLAGS="$SAVE_CPPFLAGS"
2031 LDFLAGS="$SAVE_LDFLAGS"
2033 if test "x$with_libaquaero5" = "xyes"
2035 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2036 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2037 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
2038 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
2040 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
2043 # --with-libhiredis {{{
2044 AC_ARG_WITH(libhiredis, [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@],
2045 [Path to libhiredis.])],
2047 if test "x$withval" = "xyes"
2049 with_libhiredis="yes"
2050 else if test "x$withval" = "xno"
2052 with_libhiredis="no"
2054 with_libhiredis="yes"
2055 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2056 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2059 [with_libhiredis="yes"])
2061 SAVE_CPPFLAGS="$CPPFLAGS"
2062 SAVE_LDFLAGS="$LDFLAGS"
2064 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2065 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2067 if test "x$with_libhiredis" = "xyes"
2069 if test "x$LIBHIREDIS_CPPFLAGS" != "x"
2071 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
2073 AC_CHECK_HEADERS(hiredis/hiredis.h,
2074 [with_libhiredis="yes"],
2075 [with_libhiredis="no (hiredis.h not found)"])
2077 if test "x$with_libhiredis" = "xyes"
2079 if test "x$LIBHIREDIS_LDFLAGS" != "x"
2081 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
2083 AC_CHECK_LIB(hiredis, redisCommand,
2084 [with_libhiredis="yes"],
2085 [with_libhiredis="no (symbol 'redisCommand' not found)"])
2089 CPPFLAGS="$SAVE_CPPFLAGS"
2090 LDFLAGS="$SAVE_LDFLAGS"
2092 if test "x$with_libhiredis" = "xyes"
2094 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2095 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2096 AC_SUBST(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
2097 AC_SUBST(BUILD_WITH_LIBHIREDIS_LDFLAGS)
2099 AM_CONDITIONAL(BUILD_WITH_LIBHIREDIS, test "x$with_libhiredis" = "xyes")
2102 # --with-libcurl {{{
2103 with_curl_config="curl-config"
2106 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2108 if test "x$withval" = "xno"
2111 else if test "x$withval" = "xyes"
2115 if test -f "$withval" && test -x "$withval"
2117 with_curl_config="$withval"
2119 else if test -x "$withval/bin/curl-config"
2121 with_curl_config="$withval/bin/curl-config"
2130 if test "x$with_libcurl" = "xyes"
2132 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2133 curl_config_status=$?
2135 if test $curl_config_status -ne 0
2137 with_libcurl="no ($with_curl_config failed)"
2139 SAVE_CPPFLAGS="$CPPFLAGS"
2140 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2142 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
2144 CPPFLAGS="$SAVE_CPPFLAGS"
2147 if test "x$with_libcurl" = "xyes"
2149 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2150 curl_config_status=$?
2152 if test $curl_config_status -ne 0
2154 with_libcurl="no ($with_curl_config failed)"
2156 AC_CHECK_LIB(curl, curl_easy_init,
2157 [with_libcurl="yes"],
2158 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2160 AC_CHECK_DECL(CURLOPT_USERNAME,
2161 [have_curlopt_username="yes"],
2162 [have_curlopt_username="no"],
2163 [[#include <curl/curl.h>]])
2164 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2165 [have_curlopt_timeout="yes"],
2166 [have_curlopt_timeout="no"],
2167 [[#include <curl/curl.h>]])
2170 if test "x$with_libcurl" = "xyes"
2172 SAVE_CPPFLAGS="$CPPFLAGS"
2173 SAVE_LDFLAGS="$LDFLAGS"
2174 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2175 LDFLAGS="$LDFLAGS $with_curl_libs"
2176 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2177 [c_cv_have_curlinfo_appconnect_time],
2178 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2180 #include <curl/curl.h>
2183 int val = CURLINFO_APPCONNECT_TIME;
2187 [c_cv_have_curlinfo_appconnect_time="yes"],
2188 [c_cv_have_curlinfo_appconnect_time="no"]
2191 CPPFLAGS="$SAVE_CPPFLAGS"
2192 LDFLAGS="$SAVE_LDFLAGS"
2194 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
2195 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
2197 AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
2200 if test "x$with_libcurl" = "xyes"
2202 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2203 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2204 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2205 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2207 if test "x$have_curlopt_username" = "xyes"
2209 AC_DEFINE(HAVE_CURLOPT_USERNAME, 1, [Define if libcurl supports CURLOPT_USERNAME option.])
2212 if test "x$have_curlopt_timeout" = "xyes"
2214 AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
2220 with_libdbi_cppflags=""
2221 with_libdbi_ldflags=""
2222 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2224 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2226 with_libdbi_cppflags="-I$withval/include"
2227 with_libdbi_ldflags="-L$withval/lib"
2230 with_libdbi="$withval"
2236 if test "x$with_libdbi" = "xyes"
2238 SAVE_CPPFLAGS="$CPPFLAGS"
2239 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2241 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
2243 CPPFLAGS="$SAVE_CPPFLAGS"
2245 if test "x$with_libdbi" = "xyes"
2247 SAVE_CPPFLAGS="$CPPFLAGS"
2248 SAVE_LDFLAGS="$LDFLAGS"
2249 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2250 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2252 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
2254 CPPFLAGS="$SAVE_CPPFLAGS"
2255 LDFLAGS="$SAVE_LDFLAGS"
2257 if test "x$with_libdbi" = "xyes"
2259 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2260 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2261 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2262 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2263 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2264 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2266 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
2269 # --with-libesmtp {{{
2270 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2272 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2274 LDFLAGS="$LDFLAGS -L$withval/lib"
2275 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
2278 with_libesmtp="$withval"
2284 if test "x$with_libesmtp" = "xyes"
2286 AC_CHECK_LIB(esmtp, smtp_create_session,
2288 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
2289 ], [with_libesmtp="no (libesmtp not found)"])
2291 if test "x$with_libesmtp" = "xyes"
2293 AC_CHECK_HEADERS(libesmtp.h,
2295 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
2296 ], [with_libesmtp="no (libesmtp.h not found)"])
2298 if test "x$with_libesmtp" = "xyes"
2304 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
2305 [Wether or not to use the esmtp library])
2306 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
2309 # --with-libganglia {{{
2310 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2312 if test -f "$withval" && test -x "$withval"
2314 with_libganglia_config="$withval"
2315 with_libganglia="yes"
2316 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
2318 with_libganglia_config="$withval/bin/ganglia-config"
2319 with_libganglia="yes"
2320 else if test -d "$withval"
2322 GANGLIA_CPPFLAGS="-I$withval/include"
2323 GANGLIA_LDFLAGS="-L$withval/lib"
2324 with_libganglia="yes"
2326 with_libganglia="$withval"
2330 with_libganglia="yes"
2333 if test "x$with_libganglia" = "xyes"
2335 if test "x$with_libganglia_config" != "x"
2337 if test "x$GANGLIA_CPPFLAGS" = "x"
2339 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2342 if test "x$GANGLIA_LDFLAGS" = "x"
2344 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2347 if test "x$GANGLIA_LIBS" = "x"
2349 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2352 GANGLIA_LIBS="-lganglia"
2356 SAVE_CPPFLAGS="$CPPFLAGS"
2357 SAVE_LDFLAGS="$LDFLAGS"
2358 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2359 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2361 if test "x$with_libganglia" = "xyes"
2363 AC_CHECK_HEADERS(gm_protocol.h,
2365 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
2366 [Define to 1 if you have the <gm_protocol.h> header file.])
2367 ], [with_libganglia="no (gm_protocol.h not found)"])
2370 if test "x$with_libganglia" = "xyes"
2372 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
2374 AC_DEFINE(HAVE_LIBGANGLIA, 1,
2375 [Define to 1 if you have the ganglia library (-lganglia).])
2376 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
2379 CPPFLAGS="$SAVE_CPPFLAGS"
2380 LDFLAGS="$SAVE_LDFLAGS"
2382 AC_SUBST(GANGLIA_CPPFLAGS)
2383 AC_SUBST(GANGLIA_LDFLAGS)
2384 AC_SUBST(GANGLIA_LIBS)
2385 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
2388 # --with-libgcrypt {{{
2389 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2390 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2391 GCRYPT_LIBS="$GCRYPT_LIBS"
2392 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2394 if test -f "$withval" && test -x "$withval"
2396 with_libgcrypt_config="$withval"
2397 with_libgcrypt="yes"
2398 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
2400 with_libgcrypt_config="$withval/bin/gcrypt-config"
2401 with_libgcrypt="yes"
2402 else if test -d "$withval"
2404 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2405 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2406 with_libgcrypt="yes"
2408 with_libgcrypt_config="gcrypt-config"
2409 with_libgcrypt="$withval"
2413 with_libgcrypt_config="libgcrypt-config"
2414 with_libgcrypt="yes"
2417 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2419 if test "x$GCRYPT_CPPFLAGS" = "x"
2421 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2424 if test "x$GCRYPT_LIBS" = "x"
2426 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2430 SAVE_CPPFLAGS="$CPPFLAGS"
2431 SAVE_LDFLAGS="$LDFLAGS"
2433 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2434 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2435 LIBS="$LIBS $GCRYPT_LIBS"
2437 if test "x$with_libgcrypt" = "xyes"
2439 if test "x$GCRYPT_CPPFLAGS" != "x"
2441 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2443 AC_CHECK_HEADERS(gcrypt.h,
2444 [with_libgcrypt="yes"],
2445 [with_libgcrypt="no (gcrypt.h not found)"])
2448 if test "x$with_libgcrypt" = "xyes"
2450 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2451 [with_libgcrypt="yes"],
2452 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2455 CPPFLAGS="$SAVE_CPPFLAGS"
2456 LDFLAGS="$SAVE_LDFLAGS"
2459 if test "x$with_libgcrypt" = "xyes"
2461 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2464 AC_SUBST(GCRYPT_CPPFLAGS)
2465 AC_SUBST(GCRYPT_LDFLAGS)
2466 AC_SUBST(GCRYPT_LIBS)
2467 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2471 with_libgps_cflags=""
2472 with_libgps_ldflags=""
2473 AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2475 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2477 with_libgps_cflags="-I$withval/include"
2478 with_libgps_ldflags="-L$withval/lib"
2481 with_libgps="$withval"
2487 if test "x$with_libgps" = "xyes"
2489 SAVE_CFLAGS="$CFLAGS"
2490 CFLAGS="$CFLAGS $with_libgps_cflags"
2492 AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
2494 CFLAGS="$SAVE_CFLAGS"
2496 if test "x$with_libgps" = "xyes"
2498 SAVE_CFLAGS="$CFLAGS"
2499 SAVE_LDFLAGS="$LDFLAGS"
2500 CFLAGS="$CFLAGS $with_libgps_cflags"
2501 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2503 AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
2505 CFLAGS="$SAVE_CFLAGS"
2506 LDFLAGS="$SAVE_LDFLAGS"
2508 if test "x$with_libgps" = "xyes"
2510 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2511 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2512 BUILD_WITH_LIBGPS_LIBS="-lgps"
2513 AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
2514 AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
2515 AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
2517 AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
2520 # --with-libgrpc++ {{{
2521 with_libgrpcpp_cppflags=""
2522 with_libgrpcpp_ldflags=""
2523 AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2525 with_grpcpp="$withval"
2526 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2528 with_libgrpcpp_cppflags="-I$withval/include"
2529 with_libgrpcpp_ldflags="-L$withval/lib"
2530 with_libgrpcpp="yes"
2532 if test "x$withval" = "xno"
2534 with_libgrpcpp="no (disabled on command line)"
2539 if test "x$withval" = "xyes"
2541 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2542 [with_libgrpcpp="yes"],
2543 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2547 if test "x$withval" != "xno"
2549 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2550 if test_cxx_flags -std=c++11; then
2551 AC_MSG_RESULT([yes])
2554 with_libgrpcpp="no (requires C++11 support)"
2558 if test "x$with_libgrpcpp" = "xyes"
2561 SAVE_CPPFLAGS="$CPPFLAGS"
2562 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2563 AC_CHECK_HEADERS([grpc++/grpc++.h], [],
2564 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2566 CPPFLAGS="$SAVE_CPPFLAGS"
2569 if test "x$with_libgrpcpp" = "xyes"
2572 SAVE_CPPFLAGS="$CPPFLAGS"
2573 SAVE_LDFLAGS="$LDFLAGS"
2575 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2576 LDFLAGS="$with_libgrpcpp_ldflags"
2577 if test "x$GRPCPP_LIBS" = "x"
2585 [[#include <grpc++/grpc++.h>]],
2586 [[grpc::ServerBuilder sb;]]
2589 with_libgrpcpp="yes"
2590 if test "x$GRPCPP_LIBS" = "x"
2592 GRPCPP_LIBS="-lgrpc++"
2595 [with_libgrpcpp="no (libgrpc++ not found)"]
2597 CPPFLAGS="$SAVE_CPPFLAGS"
2598 LDFLAGS="$SAVE_LDFLAGS"
2602 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2603 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2604 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2605 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2606 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2607 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2610 # --with-libiptc {{{
2611 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2613 if test "x$withval" = "xyes"
2615 with_libiptc="pkgconfig"
2616 else if test "x$withval" = "xno"
2621 with_libiptc_cflags="-I$withval/include"
2622 with_libiptc_libs="-L$withval/lib"
2626 if test "x$ac_system" = "xLinux"
2628 with_libiptc="pkgconfig"
2630 with_libiptc="no (Linux only)"
2634 if test "x$with_libiptc" = "xpkgconfig"
2636 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2639 with_libiptc="no (pkg-config doesn't know libiptc)"
2642 if test "x$with_libiptc" = "xpkgconfig"
2644 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2647 with_libiptc="no ($PKG_CONFIG failed)"
2649 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2652 with_libiptc="no ($PKG_CONFIG failed)"
2656 SAVE_CPPFLAGS="$CPPFLAGS"
2657 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2659 # check whether the header file for libiptc is available.
2660 if test "x$with_libiptc" = "xpkgconfig"
2662 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2663 [with_libiptc="no (header file missing)"])
2665 # If the header file is available, check for the required type declaractions.
2666 # They may be missing in old versions of libiptc. In that case, they will be
2667 # declared in the iptables plugin.
2668 if test "x$with_libiptc" = "xpkgconfig"
2670 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2672 # Check for the iptc_init symbol in the library.
2673 # This could be in iptc or ip4tc
2674 if test "x$with_libiptc" = "xpkgconfig"
2677 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2678 [with_libiptc="pkgconfig"],
2679 [with_libiptc="no"],
2680 [$with_libiptc_libs])
2683 if test "x$with_libiptc" = "xpkgconfig"
2688 CPPFLAGS="$SAVE_CPPFLAGS"
2690 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2691 if test "x$with_libiptc" = "xyes"
2693 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2694 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2695 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2696 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2700 # --with-libdpdk {{{
2701 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2702 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2704 AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])])
2706 if test "x$with_libdpdk" != "xno"
2708 if test "x$LIBDPDK_CPPFLAGS" = "x"
2710 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2712 SAVE_CPPFLAGS="$CPPFLAGS"
2713 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2714 AC_CHECK_HEADERS([rte_config.h],
2715 [with_libdpdk="yes"],
2716 [with_libdpdk="no (rte_config.h not found)"]
2718 CPPFLAGS="$SAVE_CPPFLAGS"
2721 if test "x$with_libdpdk" = "xyes"
2723 SAVE_LDFLAGS="$LDFLAGS"
2724 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2725 AC_CHECK_LIB([dpdk], [rte_eal_init],
2726 [with_libdpdk="yes"],
2727 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2729 LDFLAGS="$SAVE_LDFLAGS"
2735 with_java_home="$JAVA_HOME"
2736 if test "x$with_java_home" = "x"
2738 with_java_home="/usr/lib/jvm"
2742 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2744 if test "x$withval" = "xno"
2747 else if test "x$withval" = "xyes"
2751 with_java_home="$withval"
2756 if test "x$with_java" = "xyes"
2758 if test -d "$with_java_home"
2760 AC_MSG_CHECKING([for jni.h])
2761 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2762 if test "x$TMPVAR" != "x"
2764 AC_MSG_RESULT([found in $TMPVAR])
2765 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2767 AC_MSG_RESULT([not found])
2770 AC_MSG_CHECKING([for jni_md.h])
2771 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2772 if test "x$TMPVAR" != "x"
2774 AC_MSG_RESULT([found in $TMPVAR])
2775 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2777 AC_MSG_RESULT([not found])
2780 AC_MSG_CHECKING([for libjvm.so])
2781 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`
2782 if test "x$TMPVAR" != "x"
2784 AC_MSG_RESULT([found in $TMPVAR])
2785 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2787 AC_MSG_RESULT([not found])
2790 if test "x$JAVAC" = "x"
2792 AC_MSG_CHECKING([for javac])
2793 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2794 if test "x$TMPVAR" != "x"
2797 AC_MSG_RESULT([$JAVAC])
2799 AC_MSG_RESULT([not found])
2802 if test "x$JAR" = "x"
2804 AC_MSG_CHECKING([for jar])
2805 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2806 if test "x$TMPVAR" != "x"
2809 AC_MSG_RESULT([$JAR])
2811 AC_MSG_RESULT([not found])
2814 else if test "x$with_java_home" != "x"
2816 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2820 if test "x$JAVA_CPPFLAGS" != "x"
2822 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2824 if test "x$JAVA_CFLAGS" != "x"
2826 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2828 if test "x$JAVA_LDFLAGS" != "x"
2830 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2832 if test "x$JAVA_LIBS" != "x"
2834 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2836 if test "x$JAVAC" = "x"
2838 with_javac_path="$PATH"
2839 if test "x$with_java_home" != "x"
2841 with_javac_path="$with_java_home:with_javac_path"
2842 if test -d "$with_java_home/bin"
2844 with_javac_path="$with_java_home/bin:with_javac_path"
2848 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2850 if test "x$JAVAC" = "x"
2852 with_java="no (javac not found)"
2854 if test "x$JAR" = "x"
2856 with_jar_path="$PATH"
2857 if test "x$with_java_home" != "x"
2859 with_jar_path="$with_java_home:$with_jar_path"
2860 if test -d "$with_java_home/bin"
2862 with_jar_path="$with_java_home/bin:$with_jar_path"
2866 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2868 if test "x$JAR" = "x"
2870 with_java="no (jar not found)"
2873 SAVE_CPPFLAGS="$CPPFLAGS"
2874 SAVE_CFLAGS="$CFLAGS"
2875 SAVE_LDFLAGS="$LDFLAGS"
2877 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2878 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2879 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2880 LIBS="$LIBS $JAVA_LIBS"
2882 if test "x$with_java" = "xyes"
2884 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2886 if test "x$with_java" = "xyes"
2888 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2890 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2891 [$JAVA_LIBS $PTHREAD_LIBS])
2893 if test "x$with_java" = "xyes"
2895 JAVA_LIBS="$JAVA_LIBS -ljvm"
2896 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2899 CPPFLAGS="$SAVE_CPPFLAGS"
2900 CFLAGS="$SAVE_CFLAGS"
2901 LDFLAGS="$SAVE_LDFLAGS"
2904 AC_SUBST(JAVA_CPPFLAGS)
2905 AC_SUBST(JAVA_CFLAGS)
2906 AC_SUBST(JAVA_LDFLAGS)
2908 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2911 # --with-libldap {{{
2912 AC_ARG_WITH(libldap, [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2914 if test "x$withval" = "xyes"
2917 else if test "x$withval" = "xno"
2922 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2923 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2926 [with_libldap="yes"])
2928 SAVE_CPPFLAGS="$CPPFLAGS"
2929 SAVE_LDFLAGS="$LDFLAGS"
2931 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
2932 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
2934 if test "x$with_libldap" = "xyes"
2936 if test "x$LIBLDAP_CPPFLAGS" != "x"
2938 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
2940 AC_CHECK_HEADERS(ldap.h,
2941 [with_libldap="yes"],
2942 [with_libldap="no ('ldap.h' not found)"])
2944 if test "x$with_libldap" = "xyes"
2946 if test "x$LIBLDAP_LDFLAGS" != "x"
2948 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
2950 AC_CHECK_LIB(ldap, ldap_initialize,
2951 [with_libldap="yes"],
2952 [with_libldap="no (symbol 'ldap_initialize' not found)"])
2956 CPPFLAGS="$SAVE_CPPFLAGS"
2957 LDFLAGS="$SAVE_LDFLAGS"
2959 if test "x$with_libldap" = "xyes"
2961 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
2962 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
2963 AC_SUBST(BUILD_WITH_LIBLDAP_CPPFLAGS)
2964 AC_SUBST(BUILD_WITH_LIBLDAP_LDFLAGS)
2966 AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes")
2970 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
2971 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
2973 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
2974 [with_liblua="yes"],
2978 PKG_CHECK_MODULES([LUA], [lua],
2979 [with_liblua="yes"],
2981 PKG_CHECK_MODULES([LUA], [lua-5.3],
2982 [with_liblua="yes"],
2984 PKG_CHECK_MODULES([LUA], [lua5.3],
2985 [with_liblua="yes"],
2987 PKG_CHECK_MODULES([LUA], [lua-5.2],
2988 [with_liblua="yes"],
2990 PKG_CHECK_MODULES([LUA], [lua5.2],
2991 [with_liblua="yes"],
2993 PKG_CHECK_MODULES([LUA], [lua-5.1],
2994 [with_liblua="yes"],
2996 PKG_CHECK_MODULES([LUA], [lua5.1],
2997 [with_liblua="yes"],
2998 [with_liblua="no (pkg-config cannot find liblua)"]
3014 if test "x$with_liblua" = "xyes"
3016 SAVE_CPPFLAGS="$CPPFLAGS"
3017 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
3019 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
3020 [with_liblua="yes"],
3021 [with_liblua="no (header not found)"]
3024 CPPFLAGS="$SAVE_CPPFLAGS"
3027 if test "x$with_liblua" = "xyes"
3030 LIBS="$LIBS $LUA_LIBS"
3032 AC_CHECK_FUNC([lua_settop],
3033 [with_liblua="yes"],
3034 [with_liblua="no (symbol 'lua_settop' not found)"]
3040 if test "x$with_liblua" = "xyes"
3042 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
3043 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
3045 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
3046 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
3049 # --with-liblvm2app {{{
3050 with_liblvm2app_cppflags=""
3051 with_liblvm2app_ldflags=""
3052 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
3054 if test "x$withval" = "xno"
3056 with_liblvm2app="no"
3058 with_liblvm2app="yes"
3059 if test "x$withval" != "xyes"
3061 with_liblvm2app_cppflags="-I$withval/include"
3062 with_liblvm2app_ldflags="-L$withval/lib"
3067 if test "x$ac_system" = "xLinux"
3069 with_liblvm2app="yes"
3071 with_liblvm2app="no (Linux only library)"
3074 if test "x$with_liblvm2app" = "xyes"
3076 SAVE_CPPFLAGS="$CPPFLAGS"
3077 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3079 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
3081 CPPFLAGS="$SAVE_CPPFLAGS"
3084 if test "x$with_liblvm2app" = "xyes"
3086 SAVE_CPPFLAGS="$CPPFLAGS"
3087 SAVE_LDFLAGS="$LDFLAGS"
3088 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3089 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
3091 AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
3093 CPPFLAGS="$SAVE_CPPFLAGS"
3094 LDFLAGS="$SAVE_LDFLAGS"
3096 if test "x$with_liblvm2app" = "xyes"
3098 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
3099 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
3100 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
3101 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
3102 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
3103 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
3104 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
3106 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
3109 # --with-libmemcached {{{
3110 with_libmemcached_cppflags=""
3111 with_libmemcached_ldflags=""
3112 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3114 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3116 with_libmemcached_cppflags="-I$withval/include"
3117 with_libmemcached_ldflags="-L$withval/lib"
3118 with_libmemcached="yes"
3120 with_libmemcached="$withval"
3124 with_libmemcached="yes"
3126 if test "x$with_libmemcached" = "xyes"
3128 SAVE_CPPFLAGS="$CPPFLAGS"
3129 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3131 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
3133 CPPFLAGS="$SAVE_CPPFLAGS"
3135 if test "x$with_libmemcached" = "xyes"
3137 SAVE_CPPFLAGS="$CPPFLAGS"
3138 SAVE_LDFLAGS="$LDFLAGS"
3139 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3140 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3142 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
3144 CPPFLAGS="$SAVE_CPPFLAGS"
3145 LDFLAGS="$SAVE_LDFLAGS"
3147 if test "x$with_libmemcached" = "xyes"
3149 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3150 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3151 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3152 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
3153 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
3154 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
3155 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
3157 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
3160 # --with-libmicrohttpd {{{
3161 with_libmicrohttpd_cppflags=""
3162 with_libmicrohttpd_ldflags=""
3163 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3165 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3167 with_libmicrohttpd_cppflags="-I$withval/include"
3168 with_libmicrohttpd_ldflags="-L$withval/lib"
3169 with_libmicrohttpd="yes"
3171 if test "x$withval" = "xno"
3173 with_libmicrohttpd="no (disabled on command line)"
3178 if test "x$withval" = "xyes"
3180 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3181 [with_libmicrohttpd="yes"],
3182 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3186 if test "x$MICROHTTPD_LIBS" = "x"
3188 MICROHTTPD_LIBS="-lmicrohttpd"
3191 SAVE_CPPFLAGS="$CPPFLAGS"
3192 SAVE_LDFLAGS="$LDFLAGS"
3194 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3195 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3196 LIBS="$LIBS $MICROHTTPD_LIBS"
3198 if test "x$with_libmicrohttpd" = "xyes"
3200 AC_CHECK_HEADERS([microhttpd.h],
3201 [with_libmicrohttpd="yes"],
3202 [with_libmicrohttpd="no (<microhttpd.h> not found)"])
3205 if test "x$with_libmicrohttpd" = "xyes"
3207 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3208 [with_libmicrohttpd="yes"],
3209 [with_libmicrohttpd="no (libmicrohttpd not found)"])
3212 CPPFLAGS="$SAVE_CPPFLAGS"
3213 LDFLAGS="$SAVE_LDFLAGS"
3216 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3217 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3218 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3219 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3220 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3221 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3224 # --with-libmodbus {{{
3225 with_libmodbus_config=""
3226 with_libmodbus_cflags=""
3227 with_libmodbus_libs=""
3228 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3230 if test "x$withval" = "xno"
3233 else if test "x$withval" = "xyes"
3235 with_libmodbus="use_pkgconfig"
3236 else if test -d "$with_libmodbus/lib"
3238 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3239 with_libmodbus_cflags="-I$withval/include"
3240 with_libmodbus_libs="-L$withval/lib -lmodbus"
3241 with_libmodbus="yes"
3244 [with_libmodbus="use_pkgconfig"])
3246 # configure using pkg-config
3247 if test "x$with_libmodbus" = "xuse_pkgconfig"
3249 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3250 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3253 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3256 if test "x$with_libmodbus" = "xuse_pkgconfig"
3258 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3261 with_libmodbus="no ($PKG_CONFIG failed)"
3263 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3266 with_libmodbus="no ($PKG_CONFIG failed)"
3269 if test "x$with_libmodbus" = "xuse_pkgconfig"
3271 with_libmodbus="yes"
3274 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
3275 # the actual checks.
3276 if test "x$with_libmodbus" = "xyes"
3278 SAVE_CPPFLAGS="$CPPFLAGS"
3279 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3281 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
3283 CPPFLAGS="$SAVE_CPPFLAGS"
3285 if test "x$with_libmodbus" = "xyes"
3287 SAVE_CPPFLAGS="$CPPFLAGS"
3288 SAVE_LDFLAGS="$LDFLAGS"
3290 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3291 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3293 AC_CHECK_LIB(modbus, modbus_connect,
3294 [with_libmodbus="yes"],
3295 [with_libmodbus="no (symbol modbus_connect not found)"])
3297 CPPFLAGS="$SAVE_CPPFLAGS"
3298 LDFLAGS="$SAVE_LDFLAGS"
3300 if test "x$with_libmodbus" = "xyes"
3302 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3303 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3304 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
3305 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
3309 # --with-libmongoc {{{
3310 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3312 if test "x$withval" = "xyes"
3314 with_libmongoc="yes"
3315 else if test "x$withval" = "xno"
3319 with_libmongoc="yes"
3320 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
3321 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
3324 [with_libmongoc="yes"])
3326 SAVE_CPPFLAGS="$CPPFLAGS"
3327 SAVE_LDFLAGS="$LDFLAGS"
3329 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
3330 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3332 if test "x$with_libmongoc" = "xyes"
3334 if test "x$LIBMONGOC_CPPFLAGS" != "x"
3336 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
3338 AC_CHECK_HEADERS(mongo.h,
3339 [with_libmongoc="yes"],
3340 [with_libmongoc="no ('mongo.h' not found)"],
3342 # define MONGO_HAVE_STDINT 1
3344 # define MONGO_USE_LONG_LONG_INT 1
3348 if test "x$with_libmongoc" = "xyes"
3350 if test "x$LIBMONGOC_LDFLAGS" != "x"
3352 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3354 AC_CHECK_LIB(mongoc, mongo_run_command,
3355 [with_libmongoc="yes"],
3356 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
3359 CPPFLAGS="$SAVE_CPPFLAGS"
3360 LDFLAGS="$SAVE_LDFLAGS"
3362 if test "x$with_libmongoc" = "xyes"
3364 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
3365 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3366 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
3367 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
3369 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
3372 # --with-libmosquitto {{{
3373 with_libmosquitto_cppflags=""
3374 with_libmosquitto_ldflags=""
3375 AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3377 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3379 with_libmosquitto_cppflags="-I$withval/include"
3380 with_libmosquitto_ldflags="-L$withval/lib"
3381 with_libmosquitto="yes"
3383 with_libmosquitto="$withval"
3387 with_libmosquitto="yes"
3389 if test "x$with_libmosquitto" = "xyes"
3391 SAVE_CPPFLAGS="$CPPFLAGS"
3392 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3394 AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
3396 CPPFLAGS="$SAVE_CPPFLAGS"
3398 if test "x$with_libmosquitto" = "xyes"
3400 SAVE_LDFLAGS="$LDFLAGS"
3401 SAVE_CPPFLAGS="$CPPFLAGS"
3402 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3403 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3405 AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
3407 LDFLAGS="$SAVE_LDFLAGS"
3408 CPPFLAGS="$SAVE_CPPFLAGS"
3410 if test "x$with_libmosquitto" = "xyes"
3412 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3413 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3414 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3415 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
3416 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
3417 AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
3421 # --with-libmysql {{{
3422 with_mysql_config="mysql_config"
3423 with_mysql_cflags=""
3425 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3427 if test "x$withval" = "xno"
3430 else if test "x$withval" = "xyes"
3434 if test -f "$withval" && test -x "$withval";
3436 with_mysql_config="$withval"
3437 else if test -x "$withval/bin/mysql_config"
3439 with_mysql_config="$withval/bin/mysql_config"
3447 if test "x$with_libmysql" = "xyes"
3449 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3450 mysql_config_status=$?
3452 if test $mysql_config_status -ne 0
3454 with_libmysql="no ($with_mysql_config failed)"
3456 SAVE_CPPFLAGS="$CPPFLAGS"
3457 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3460 have_mysql_mysql_h="no"
3461 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
3463 if test "x$have_mysql_h" = "xno"
3465 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
3468 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
3470 with_libmysql="no (mysql.h not found)"
3473 CPPFLAGS="$SAVE_CPPFLAGS"
3476 if test "x$with_libmysql" = "xyes"
3478 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3479 mysql_config_status=$?
3481 if test $mysql_config_status -ne 0
3483 with_libmysql="no ($with_mysql_config failed)"
3485 SAVE_CPPFLAGS="$CPPFLAGS"
3486 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3488 LIBS="$with_mysql_libs"
3489 AC_SEARCH_LIBS([mysql_get_server_version],
3491 [with_libmysql="yes"],
3492 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
3494 CPPFLAGS="$SAVE_CPPFLAGS"
3498 if test "x$with_libmysql" = "xyes"
3500 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3501 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3502 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
3503 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
3505 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
3509 with_libmnl_cflags=""
3511 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3513 echo "libmnl: withval = $withval"
3514 if test "x$withval" = "xyes"
3517 else if test "x$withval" = "xno"
3521 if test -d "$withval/include"
3523 with_libmnl_cflags="-I$withval/include"
3524 with_libmnl_libs="-L$withval/lib -lmnl"
3527 AC_MSG_ERROR("no such directory: $withval/include")
3532 if test "x$ac_system" = "xLinux"
3536 with_libmnl="no (Linux only library)"
3539 if test "x$with_libmnl" = "xyes"
3541 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3542 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3543 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3546 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
3552 #include <sys/types.h>
3553 #include <asm/types.h>
3554 #include <sys/socket.h>
3555 #include <linux/netlink.h>
3556 #include <linux/rtnetlink.h>])
3557 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
3559 #include <sys/types.h>
3560 #include <asm/types.h>
3561 #include <sys/socket.h>])
3563 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3566 #include <sys/types.h>
3567 #include <asm/types.h>
3568 #include <sys/socket.h>
3569 #include <linux/netlink.h>
3570 #include <linux/rtnetlink.h>
3573 int retval = TCA_STATS2;
3577 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
3579 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3582 #include <sys/types.h>
3583 #include <asm/types.h>
3584 #include <sys/socket.h>
3585 #include <linux/netlink.h>
3586 #include <linux/rtnetlink.h>
3589 int retval = TCA_STATS;
3593 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
3595 if test "x$with_libmnl" = "xyes"
3597 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3598 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3601 #include <linux/if_link.h>
3604 if test "x$with_libmnl" = "xyes"
3606 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
3607 [with_libmnl="yes"],
3608 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3609 [$with_libmnl_libs])
3611 if test "x$with_libmnl" = "xyes"
3613 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
3614 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3615 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3616 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
3617 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
3619 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
3622 # --with-libnetapp {{{
3623 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3624 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3625 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3626 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
3627 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
3628 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
3629 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3631 if test -d "$withval"
3633 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3634 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3635 with_libnetapp="yes"
3637 with_libnetapp="$withval"
3641 with_libnetapp="yes"
3644 SAVE_CPPFLAGS="$CPPFLAGS"
3645 SAVE_LDFLAGS="$LDFLAGS"
3646 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3647 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3649 if test "x$with_libnetapp" = "xyes"
3651 if test "x$LIBNETAPP_CPPFLAGS" != "x"
3653 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3655 AC_CHECK_HEADERS(netapp_api.h,
3656 [with_libnetapp="yes"],
3657 [with_libnetapp="no (netapp_api.h not found)"])
3660 if test "x$with_libnetapp" = "xyes"
3662 if test "x$LIBNETAPP_LDFLAGS" != "x"
3664 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3667 if test "x$LIBNETAPP_LIBS" = "x"
3669 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3671 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3673 AC_CHECK_LIB(netapp, na_server_invoke_elem,
3674 [with_libnetapp="yes"],
3675 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3677 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3680 CPPFLAGS="$SAVE_CPPFLAGS"
3681 LDFLAGS="$SAVE_LDFLAGS"
3683 if test "x$with_libnetapp" = "xyes"
3685 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
3688 AC_SUBST(LIBNETAPP_CPPFLAGS)
3689 AC_SUBST(LIBNETAPP_LDFLAGS)
3690 AC_SUBST(LIBNETAPP_LIBS)
3691 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
3694 # --with-libnetsnmp {{{
3695 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3697 if test "x$withval" = "xno"
3699 with_libnetsnmp="no"
3700 else if test "x$withval" = "xyes"
3702 with_libnetsnmp="yes"
3704 with_libnetsnmp_cppflags="-I$withval/include"
3705 with_libnetsnmp_ldflags="-I$withval/lib"
3706 with_libnetsnmp="yes"
3709 [with_libnetsnmp="yes"])
3710 if test "x$with_libnetsnmp" = "xyes"
3712 SAVE_CPPFLAGS="$CPPFLAGS"
3713 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3715 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
3717 CPPFLAGS="$SAVE_CPPFLAGS"
3719 if test "x$with_libnetsnmp" = "xyes"
3721 SAVE_LDFLAGS="$LDFLAGS"
3722 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3724 AC_CHECK_LIB(netsnmp, init_snmp,
3725 [with_libnetsnmp="yes"],
3726 [with_libnetsnmp="no (libnetsnmp not found)"],
3729 LDFLAGS="$SAVE_LDFLAGS"
3731 if test "x$with_libnetsnmp" = "xyes"
3733 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3734 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3735 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3737 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
3738 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
3739 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
3742 # --with-liboconfig {{{
3743 with_own_liboconfig="no"
3744 liboconfig_LDFLAGS="$LDFLAGS"
3745 liboconfig_CPPFLAGS="$CPPFLAGS"
3746 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
3748 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3750 if test -d "$withval/lib"
3752 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
3754 if test -d "$withval/include"
3756 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
3759 if test "x$withval" = "xno"
3761 AC_MSG_ERROR("liboconfig is required")
3765 with_liboconfig="yes"
3768 save_LDFLAGS="$LDFLAGS"
3769 save_CPPFLAGS="$CPPFLAGS"
3770 LDFLAGS="$liboconfig_LDFLAGS"
3771 CPPFLAGS="$liboconfig_CPPFLAGS"
3772 AC_CHECK_LIB(oconfig, oconfig_parse_file,
3774 with_liboconfig="yes"
3775 with_own_liboconfig="no"
3778 with_liboconfig="yes"
3779 with_own_liboconfig="yes"
3780 LDFLAGS="$save_LDFLAGS"
3781 CPPFLAGS="$save_CPPFLAGS"
3784 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
3785 if test "x$with_own_liboconfig" = "xyes"
3787 with_liboconfig="yes (shipped version)"
3791 # --with-liboping {{{
3792 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3794 if test "x$withval" = "xyes"
3797 else if test "x$withval" = "xno"
3802 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3803 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3806 [with_liboping="yes"])
3808 SAVE_CPPFLAGS="$CPPFLAGS"
3809 SAVE_LDFLAGS="$LDFLAGS"
3811 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3812 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3814 if test "x$with_liboping" = "xyes"
3816 if test "x$LIBOPING_CPPFLAGS" != "x"
3818 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3820 AC_CHECK_HEADERS(oping.h,
3821 [with_liboping="yes"],
3822 [with_liboping="no (oping.h not found)"])
3824 if test "x$with_liboping" = "xyes"
3826 if test "x$LIBOPING_LDFLAGS" != "x"
3828 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3830 AC_CHECK_LIB(oping, ping_construct,
3831 [with_liboping="yes"],
3832 [with_liboping="no (symbol 'ping_construct' not found)"])
3835 CPPFLAGS="$SAVE_CPPFLAGS"
3836 LDFLAGS="$SAVE_LDFLAGS"
3838 if test "x$with_liboping" = "xyes"
3840 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3841 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3842 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3843 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3845 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3849 with_oracle_cppflags=""
3851 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3853 if test "x$withval" = "xyes"
3855 if test "x$ORACLE_HOME" = "x"
3857 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3860 else if test "x$withval" = "xno"
3865 ORACLE_HOME="$withval"
3869 if test "x$ORACLE_HOME" = "x"
3871 with_oracle="no (ORACLE_HOME is not set)"
3876 if test "x$ORACLE_HOME" != "x"
3878 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3880 if test -e "$ORACLE_HOME/lib/ldflags"
3882 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3884 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3885 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3887 if test "x$with_oracle" = "xyes"
3889 SAVE_CPPFLAGS="$CPPFLAGS"
3890 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3892 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3894 CPPFLAGS="$SAVE_CPPFLAGS"
3896 if test "x$with_oracle" = "xyes"
3898 SAVE_CPPFLAGS="$CPPFLAGS"
3900 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3901 LIBS="$LIBS $with_oracle_libs"
3903 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3905 CPPFLAGS="$SAVE_CPPFLAGS"
3908 if test "x$with_oracle" = "xyes"
3910 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3911 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3912 AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
3913 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3917 # --with-libowcapi {{{
3918 with_libowcapi_cppflags=""
3919 with_libowcapi_ldflags=""
3920 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3922 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3924 with_libowcapi_cppflags="-I$withval/include"
3925 with_libowcapi_ldflags="-L$withval/lib"
3926 with_libowcapi="yes"
3928 with_libowcapi="$withval"
3932 with_libowcapi="yes"
3934 if test "x$with_libowcapi" = "xyes"
3936 SAVE_CPPFLAGS="$CPPFLAGS"
3937 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
3939 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3941 CPPFLAGS="$SAVE_CPPFLAGS"
3943 if test "x$with_libowcapi" = "xyes"
3945 SAVE_LDFLAGS="$LDFLAGS"
3946 SAVE_CPPFLAGS="$CPPFLAGS"
3947 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
3948 CPPFLAGS="$with_libowcapi_cppflags"
3950 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3952 LDFLAGS="$SAVE_LDFLAGS"
3953 CPPFLAGS="$SAVE_CPPFLAGS"
3955 if test "x$with_libowcapi" = "xyes"
3957 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3958 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
3959 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
3960 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3961 AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
3962 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3966 # --with-libpcap {{{
3967 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3969 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3971 LDFLAGS="$LDFLAGS -L$withval/lib"
3972 CPPFLAGS="$CPPFLAGS -I$withval/include"
3975 with_libpcap="$withval"
3981 if test "x$with_libpcap" = "xyes"
3983 AC_CHECK_LIB(pcap, pcap_open_live,
3985 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3986 ], [with_libpcap="no (libpcap not found)"])
3988 if test "x$with_libpcap" = "xyes"
3990 AC_CHECK_HEADERS(pcap.h,,
3991 [with_libpcap="no (pcap.h not found)"])
3993 if test "x$with_libpcap" = "xyes"
3995 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3996 [c_cv_libpcap_have_pcap_error_iface_not_up],
3997 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
4002 int val = PCAP_ERROR_IFACE_NOT_UP;
4006 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
4007 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
4009 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
4011 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
4013 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
4016 # --with-libperl {{{
4017 perl_interpreter="perl"
4018 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
4020 if test -f "$withval" && test -x "$withval"
4022 perl_interpreter="$withval"
4024 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
4026 LDFLAGS="$LDFLAGS -L$withval/lib"
4027 CPPFLAGS="$CPPFLAGS -I$withval/include"
4028 perl_interpreter="$withval/bin/perl"
4031 with_libperl="$withval"
4038 AC_MSG_CHECKING([for perl])
4039 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
4040 if test -x "$perl_interpreter"
4042 AC_MSG_RESULT([yes ($perl_interpreter)])
4048 AC_SUBST(PERL, "$perl_interpreter")
4050 if test "x$with_libperl" = "xyes" \
4051 && test -n "$perl_interpreter"
4053 SAVE_CFLAGS="$CFLAGS"
4055 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4056 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
4057 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
4058 CFLAGS="$CFLAGS $PERL_CFLAGS"
4059 LIBS="$LIBS $PERL_LIBS"
4061 AC_CACHE_CHECK([for libperl],
4062 [c_cv_have_libperl],
4063 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4065 #define PERL_NO_GET_CONTEXT
4072 load_module (PERL_LOADMOD_NOIMPORT,
4073 newSVpv ("Collectd::Plugin::FooBar", 24),
4077 [c_cv_have_libperl="yes"],
4078 [c_cv_have_libperl="no"]
4082 if test "x$c_cv_have_libperl" = "xyes"
4084 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
4085 AC_SUBST(PERL_CFLAGS)
4091 CFLAGS="$SAVE_CFLAGS"
4093 else if test -z "$perl_interpreter"; then
4094 with_libperl="no (no perl interpreter found)"
4095 c_cv_have_libperl="no"
4097 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
4099 if test "x$with_libperl" = "xyes"
4101 SAVE_CFLAGS="$CFLAGS"
4103 CFLAGS="$CFLAGS $PERL_CFLAGS"
4104 LIBS="$LIBS $PERL_LIBS"
4106 AC_CACHE_CHECK([if perl supports ithreads],
4107 [c_cv_have_perl_ithreads],
4108 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4114 #if !defined(USE_ITHREADS)
4115 # error "Perl does not support ithreads!"
4116 #endif /* !defined(USE_ITHREADS) */
4120 [c_cv_have_perl_ithreads="yes"],
4121 [c_cv_have_perl_ithreads="no"]
4125 if test "x$c_cv_have_perl_ithreads" = "xyes"
4127 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
4130 CFLAGS="$SAVE_CFLAGS"
4134 if test "x$with_libperl" = "xyes"
4136 SAVE_CFLAGS="$CFLAGS"
4138 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4139 # (see issues #41 and #42)
4140 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4141 LIBS="$LIBS $PERL_LIBS"
4143 AC_CACHE_CHECK([for broken Perl_load_module()],
4144 [c_cv_have_broken_perl_load_module],
4145 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4147 #define PERL_NO_GET_CONTEXT
4154 load_module (PERL_LOADMOD_NOIMPORT,
4155 newSVpv ("Collectd::Plugin::FooBar", 24),
4159 [c_cv_have_broken_perl_load_module="no"],
4160 [c_cv_have_broken_perl_load_module="yes"]
4164 CFLAGS="$SAVE_CFLAGS"
4167 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
4168 test "x$c_cv_have_broken_perl_load_module" = "xyes")
4170 if test "x$with_libperl" = "xyes"
4172 SAVE_CFLAGS="$CFLAGS"
4174 CFLAGS="$CFLAGS $PERL_CFLAGS"
4175 LIBS="$LIBS $PERL_LIBS"
4178 [struct mgvtbl.svt_local],
4179 [have_struct_mgvtbl_svt_local="yes"],
4180 [have_struct_mgvtbl_svt_local="no"],
4187 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
4189 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
4190 [Define if Perl's struct mgvtbl has member svt_local.])
4193 CFLAGS="$SAVE_CFLAGS"
4199 with_pg_config="pg_config"
4200 with_libpq_includedir=""
4201 with_libpq_libdir=""
4202 with_libpq_cppflags=""
4203 with_libpq_ldflags=""
4204 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
4207 if test "x$withval" = "xno"
4210 else if test "x$withval" = "xyes"
4214 if test -f "$withval" && test -x "$withval";
4216 with_pg_config="$withval"
4217 else if test -x "$withval/bin/pg_config"
4219 with_pg_config="$withval/bin/pg_config"
4227 if test "x$with_libpq" = "xyes"
4229 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4232 if test $pg_config_status -eq 0
4234 if test -n "$with_libpq_includedir"; then
4235 for dir in $with_libpq_includedir; do
4236 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4240 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4243 SAVE_CPPFLAGS="$CPPFLAGS"
4244 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4246 AC_CHECK_HEADERS(libpq-fe.h, [],
4247 [with_libpq="no (libpq-fe.h not found)"], [])
4249 CPPFLAGS="$SAVE_CPPFLAGS"
4251 if test "x$with_libpq" = "xyes"
4253 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4256 if test $pg_config_status -eq 0
4258 if test -n "$with_libpq_libdir"; then
4259 for dir in $with_libpq_libdir; do
4260 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4264 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4267 SAVE_LDFLAGS="$LDFLAGS"
4268 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4270 AC_CHECK_LIB(pq, PQconnectdb,
4272 [with_libpq="no (symbol 'PQconnectdb' not found)"])
4274 AC_CHECK_LIB(pq, PQserverVersion,
4276 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4278 LDFLAGS="$SAVE_LDFLAGS"
4280 if test "x$with_libpq" = "xyes"
4282 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4283 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4284 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
4285 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
4287 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
4290 # --with-libpqos {{{
4291 with_libpqos_cppflags=""
4292 with_libpqos_ldflags=""
4293 AC_ARG_WITH(libpqos, [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4295 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4297 with_libpqos_cppflags="-I$withval/include"
4298 with_libpqos_ldflags="-L$withval/lib"
4301 with_libpqos="$withval"
4307 if test "x$with_libpqos" = "xyes"
4309 SAVE_CPPFLAGS="$CPPFLAGS"
4310 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4312 AC_CHECK_HEADERS(pqos.h, [with_libpqos="yes"], [with_libpqos="no (pqos.h not found)"])
4314 CPPFLAGS="$SAVE_CPPFLAGS"
4316 if test "x$with_libpqos" = "xyes"
4318 SAVE_CPPFLAGS="$CPPFLAGS"
4319 SAVE_LDFLAGS="$LDFLAGS"
4320 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4321 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4323 AC_CHECK_LIB(pqos, pqos_init, [with_libpqos="yes"], [with_libpqos="no (Can't find libpqos)"])
4325 CPPFLAGS="$SAVE_CPPFLAGS"
4326 LDFLAGS="$SAVE_LDFLAGS"
4328 if test "x$with_libpqos" = "xyes"
4330 SAVE_CPPFLAGS="$CPPFLAGS"
4331 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4332 AC_RUN_IFELSE([AC_LANG_PROGRAM(
4333 [[#include <pqos.h>]],
4334 [[return !(PQOS_VERSION >= 106)]])],
4335 [with_libpqos="yes"], [with_libpqos="no (pqos library version 1.06 or higher is required)"])
4336 CPPFLAGS="$SAVE_CPPFLAGS"
4338 if test "x$with_libpqos" = "xyes"
4340 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4341 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4342 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4343 AC_SUBST(BUILD_WITH_LIBPQOS_CPPFLAGS)
4344 AC_SUBST(BUILD_WITH_LIBPQOS_LDFLAGS)
4345 AC_SUBST(BUILD_WITH_LIBPQOS_LIBS)
4349 # --with-libprotobuf {{{
4350 with_libprotobuf_cppflags=""
4351 with_libprotobuf_ldflags=""
4352 AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4354 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4356 with_libprotobuf_cppflags="-I$withval/include"
4357 with_libprotobuf_ldflags="-L$withval/lib"
4358 with_libprotobuf="yes"
4360 if test "x$withval" = "xno"
4362 with_libprotobuf="no (disabled on command line)"
4367 if test "x$withval" = "xyes"
4369 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4370 [with_libprotobuf="yes"],
4371 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4375 if test "x$withval" != "xno"
4377 SAVE_LDFLAGS="$LDFLAGS"
4379 LDFLAGS="$with_libprotobuf_ldflags"
4380 LIBS="$PROTOBUF_LIBS $LIBS"
4382 AC_CHECK_LIB([protobuf], [main],
4384 SAVE_CPPFLAGS="$CPPFLAGS"
4385 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4386 if test "x$PROTOBUF_LIBS" = "x"
4388 PROTOBUF_LIBS="-lprotobuf"
4390 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4391 [with_libprotobuf="yes"],
4392 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4394 CPPFLAGS="$SAVE_CPPFLAGS"
4396 [with_libprotobuf="no (libprotobuf not found)"]
4399 LDFLAGS="$SAVE_LDFLAGS"
4402 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4403 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4404 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4405 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4406 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4407 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4410 # --with-libprotobuf-c {{{
4411 with_libprotobuf_c_cppflags=""
4412 with_libprotobuf_c_ldflags=""
4413 AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4415 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4417 with_libprotobuf_c_cppflags="-I$withval/include"
4418 with_libprotobuf_c_ldflags="-L$withval/lib"
4419 with_libprotobuf_c="yes"
4421 if test "x$withval" = "xno"
4423 with_libprotobuf_c="no (disabled on command line)"
4428 if test "x$withval" = "xyes"
4430 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4431 [with_libprotobuf_c="yes"],
4432 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4436 if test "x$withval" != "xno"
4438 SAVE_LDFLAGS="$LDFLAGS"
4440 LDFLAGS="$with_libprotobuf_c_ldflags"
4441 LIBS="$PROTOBUF_C_LIBS $LIBS"
4442 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4444 SAVE_CPPFLAGS="$CPPFLAGS"
4445 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4446 if test "x$PROTOBUF_C_LIBS" = "x"
4448 PROTOBUF_C_LIBS="-lprotobuf-c"
4450 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4452 with_libprotobuf_c="yes"
4455 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4457 CPPFLAGS="$SAVE_CPPFLAGS"
4459 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4461 LDFLAGS="$SAVE_LDFLAGS"
4464 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4465 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4466 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4467 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4468 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4469 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4472 # --with-libpython {{{
4473 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4474 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4475 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4477 AC_ARG_WITH([libpython],
4478 [AS_HELP_STRING([--with-libpython],
4479 [if we should build with libpython @<:@default=yes@:>@])
4481 [with_libpython="$withval"],
4482 [with_libpython="check"]
4484 if test "$with_libpython" != "no"; then
4485 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4486 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4487 AC_PATH_PROGS([PYTHON_CONFIG],
4488 [python3-config python2-config python-config]
4490 if test "$PYTHON_CONFIG" = ""; then
4491 if test "$with_libpython" = "yes"; then
4492 AC_MSG_ERROR([Unable to find python-config])
4499 if test "$PYTHON_CONFIG" != ""; then
4500 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4501 if test $? -ne 0; then
4504 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4505 if test $? -ne 0; then
4508 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4509 if test $? -ne 0; then
4514 if test "$with_libpython" != "xno"; then
4515 SAVE_CPPFLAGS="$CPPFLAGS"
4516 SAVE_LDFLAGS="$LDFLAGS"
4518 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4519 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4520 LIBS="$LIBPYTHON_LIBS $LIBS"
4521 AC_CHECK_HEADERS([Python.h],
4523 AC_MSG_CHECKING([for libpython])
4524 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4525 [[#include <Python.h>]],
4526 [[Py_Initialize();]])
4528 [with_libpython="yes"],
4529 [with_libpython="no"]
4531 AC_MSG_RESULT([$with_libpython])
4533 [with_libpython="no"]
4535 CPPFLAGS="$SAVE_CPPFLAGS"
4536 LDFLAGS="$SAVE_LDFLAGS"
4539 # }}} --with-libpython
4541 # --with-librabbitmq {{{
4542 with_librabbitmq_cppflags=""
4543 with_librabbitmq_ldflags=""
4544 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4546 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4548 with_librabbitmq_cppflags="-I$withval/include"
4549 with_librabbitmq_ldflags="-L$withval/lib"
4550 with_librabbitmq="yes"
4552 with_librabbitmq="$withval"
4556 with_librabbitmq="yes"
4558 SAVE_CPPFLAGS="$CPPFLAGS"
4559 SAVE_LDFLAGS="$LDFLAGS"
4560 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4561 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4562 if test "x$with_librabbitmq" = "xyes"
4564 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
4566 if test "x$with_librabbitmq" = "xyes"
4568 # librabbitmq up to version 0.9.1 provides "library_errno", later
4569 # versions use "library_error". The library does not provide a version
4570 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
4571 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
4574 # include <stdlib.h>
4580 # include <stdint.h>
4583 # include <inttypes.h>
4588 if test "x$with_librabbitmq" = "xyes"
4590 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
4592 if test "x$with_librabbitmq" = "xyes"
4594 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4595 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4596 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4597 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4598 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4599 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4600 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
4602 CPPFLAGS="$SAVE_CPPFLAGS"
4603 LDFLAGS="$SAVE_LDFLAGS"
4604 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
4606 with_amqp_tcp_socket="no"
4607 if test "x$with_librabbitmq" = "xyes"
4609 SAVE_CPPFLAGS="$CPPFLAGS"
4610 SAVE_LDFLAGS="$LDFLAGS"
4612 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4613 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4616 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
4617 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
4618 if test "x$with_amqp_tcp_socket" = "xyes"
4620 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
4621 [Define if librabbitmq provides the new TCP socket interface.])
4624 AC_CHECK_DECLS(amqp_socket_close,
4625 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
4628 #ifdef HAVE_AMQP_TCP_SOCKET_H
4629 # include <amqp_tcp_socket.h>
4631 #ifdef HAVE_AMQP_SOCKET_H
4632 # include <amqp_socket.h>
4636 CPPFLAGS="$SAVE_CPPFLAGS"
4637 LDFLAGS="$SAVE_LDFLAGS"
4642 # --with-librdkafka {{{
4643 AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4645 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4647 with_librdkafka_cppflags="-I$withval/include"
4648 with_librdkafka_ldflags="-L$withval/lib"
4649 with_librdkafka_rpath="$withval/lib"
4650 with_librdkafka="yes"
4652 with_librdkafka="$withval"
4656 with_librdkafka="yes"
4658 SAVE_CPPFLAGS="$CPPFLAGS"
4659 SAVE_LDFLAGS="$LDFLAGS"
4661 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4662 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4664 if test "x$with_librdkafka" = "xyes"
4666 AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
4669 if test "x$with_librdkafka" = "xyes"
4671 AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4672 AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
4673 AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
4675 if test "x$with_librdkafka" = "xyes"
4677 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4678 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4679 if test "x$with_librdkafka_rpath" != "x"
4681 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4683 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4685 AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
4686 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
4687 AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
4688 AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
4689 if test "x$with_librdkafka_log_cb" = "xyes"
4691 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4692 else if test "x$with_librdkafka_logger" = "xyes"
4694 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4697 CPPFLAGS="$SAVE_CPPFLAGS"
4698 LDFLAGS="$SAVE_LDFLAGS"
4699 AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
4703 # --with-librouteros {{{
4704 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4706 if test "x$withval" = "xyes"
4708 with_librouteros="yes"
4709 else if test "x$withval" = "xno"
4711 with_librouteros="no"
4713 with_librouteros="yes"
4714 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
4715 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
4718 [with_librouteros="yes"])
4720 SAVE_CPPFLAGS="$CPPFLAGS"
4721 SAVE_LDFLAGS="$LDFLAGS"
4723 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
4724 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
4726 if test "x$with_librouteros" = "xyes"
4728 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
4730 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
4732 AC_CHECK_HEADERS(routeros_api.h,
4733 [with_librouteros="yes"],
4734 [with_librouteros="no (routeros_api.h not found)"])
4736 if test "x$with_librouteros" = "xyes"
4738 if test "x$LIBROUTEROS_LDFLAGS" != "x"
4740 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
4742 AC_CHECK_LIB(routeros, ros_interface,
4743 [with_librouteros="yes"],
4744 [with_librouteros="no (symbol 'ros_interface' not found)"])
4747 CPPFLAGS="$SAVE_CPPFLAGS"
4748 LDFLAGS="$SAVE_LDFLAGS"
4750 if test "x$with_librouteros" = "xyes"
4752 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
4753 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
4754 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
4755 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
4757 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
4763 librrd_threadsafe="no"
4764 librrd_rrdc_update="no"
4766 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4768 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4770 librrd_cflags="-I$withval/include"
4771 librrd_ldflags="-L$withval/lib"
4774 with_librrd="$withval"
4780 if test "x$with_librrd" = "xyes"
4782 SAVE_LDFLAGS="$LDFLAGS"
4783 LDFLAGS="$LDFLAGS $librrd_ldflags"
4784 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4786 AC_CHECK_LIB([rrd], [rrd_update_r],
4787 [librrd_threadsafe="yes"],
4790 AC_CHECK_LIB([rrd], [rrdc_update],
4791 [librrd_rrdc_update="yes"],
4796 LDFLAGS="$SAVE_LDFLAGS"
4798 SAVE_CPPFLAGS="$CPPFLAGS"
4799 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4801 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4803 CPPFLAGS="$SAVE_CPPFLAGS"
4806 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4808 SAVE_LDFLAGS="$LDFLAGS"
4809 LDFLAGS="$LDFLAGS $librrd_ldflags"
4811 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4813 librrd_ldflags="$librrd_ldflags -lrrd_th"
4814 librrd_threadsafe="yes"
4815 AC_CHECK_LIB([rrd_th], [rrdc_update],
4816 [librrd_rrdc_update="yes"],
4822 LDFLAGS="$SAVE_LDFLAGS"
4825 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
4827 SAVE_LDFLAGS="$LDFLAGS"
4828 LDFLAGS="$LDFLAGS $librrd_ldflags"
4830 AC_CHECK_LIB([rrd], [rrd_update],
4832 librrd_ldflags="$librrd_ldflags -lrrd"
4833 AC_CHECK_LIB([rrd], [rrdc_update],
4834 [librrd_rrdc_update="yes"],
4838 [with_librrd="no (symbol 'rrd_update' not found)"]
4840 LDFLAGS="$SAVE_LDFLAGS"
4843 if test "x$with_librrd" = "xyes"
4845 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
4846 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
4847 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
4848 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
4849 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
4850 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
4852 if test "x$librrd_threadsafe" = "xyes"
4854 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
4855 [Define to 1 if the rrd library is thread-safe]
4860 # --with-libsensors {{{
4861 with_sensors_cflags=""
4862 with_sensors_ldflags=""
4863 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
4865 if test "x$withval" = "xno"
4867 with_libsensors="no"
4869 with_libsensors="yes"
4870 if test "x$withval" != "xyes"
4872 with_sensors_cflags="-I$withval/include"
4873 with_sensors_ldflags="-L$withval/lib"
4874 with_libsensors="yes"
4879 if test "x$ac_system" = "xLinux"
4881 with_libsensors="yes"
4883 with_libsensors="no (Linux only library)"
4886 if test "x$with_libsensors" = "xyes"
4888 SAVE_CPPFLAGS="$CPPFLAGS"
4889 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4891 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
4893 CPPFLAGS="$SAVE_CPPFLAGS"
4895 if test "x$with_libsensors" = "xyes"
4897 SAVE_CPPFLAGS="$CPPFLAGS"
4898 SAVE_LDFLAGS="$LDFLAGS"
4899 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
4900 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
4902 AC_CHECK_LIB(sensors, sensors_init,
4904 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
4906 [with_libsensors="no (libsensors not found)"])
4908 CPPFLAGS="$SAVE_CPPFLAGS"
4909 LDFLAGS="$SAVE_LDFLAGS"
4911 if test "x$with_libsensors" = "xyes"
4913 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
4914 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
4915 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
4916 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
4918 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
4922 AC_SUBST([LIBSIGROK_CFLAGS])
4923 AC_SUBST([LIBSIGROK_LIBS])
4924 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
4925 [with_libsigrok="yes"],
4926 [with_libsigrok="no (pkg-config could not find libsigrok)"]
4930 # --with-libstatgrab {{{
4931 with_libstatgrab_cflags=""
4932 with_libstatgrab_ldflags=""
4933 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4935 if test "x$withval" != "xno" \
4936 && test "x$withval" != "xyes"
4938 with_libstatgrab_cflags="-I$withval/include"
4939 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4940 with_libstatgrab="yes"
4941 with_libstatgrab_pkg_config="no"
4943 with_libstatgrab="$withval"
4944 with_libstatgrab_pkg_config="yes"
4948 with_libstatgrab="yes"
4949 with_libstatgrab_pkg_config="yes"
4952 if test "x$with_libstatgrab" = "xyes" \
4953 && test "x$with_libstatgrab_pkg_config" = "xyes"
4955 AC_MSG_CHECKING([pkg-config for libstatgrab])
4957 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4960 with_libstatgrab_pkg_config="no"
4961 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4962 temp_result="not found"
4964 AC_MSG_RESULT([$temp_result])
4967 if test "x$with_libstatgrab" = "xyes" \
4968 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4969 && test "x$with_libstatgrab_cflags" = "x"
4971 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4972 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4975 with_libstatgrab_cflags="$temp_result"
4977 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4978 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4980 AC_MSG_RESULT([$temp_result])
4983 if test "x$with_libstatgrab" = "xyes" \
4984 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4985 && test "x$with_libstatgrab_ldflags" = "x"
4987 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4988 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4991 with_libstatgrab_ldflags="$temp_result"
4993 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4994 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4996 AC_MSG_RESULT([$temp_result])
4999 if test "x$with_libstatgrab" = "xyes"
5001 SAVE_CPPFLAGS="$CPPFLAGS"
5002 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
5004 AC_CHECK_HEADERS(statgrab.h,
5005 [with_libstatgrab="yes"],
5006 [with_libstatgrab="no (statgrab.h not found)"])
5008 CPPFLAGS="$SAVE_CPPFLAGS"
5011 if test "x$with_libstatgrab" = "xyes"
5013 SAVE_CFLAGS="$CFLAGS"
5014 SAVE_LDFLAGS="$LDFLAGS"
5016 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5017 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5019 AC_CHECK_LIB(statgrab, sg_init,
5020 [with_libstatgrab="yes"],
5021 [with_libstatgrab="no (symbol sg_init not found)"])
5023 CFLAGS="$SAVE_CFLAGS"
5024 LDFLAGS="$SAVE_LDFLAGS"
5027 if test "x$with_libstatgrab" = "xyes"
5029 SAVE_CFLAGS="$CFLAGS"
5030 SAVE_LDFLAGS="$LDFLAGS"
5033 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5034 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5035 LIBS="-lstatgrab $LIBS"
5037 AC_CACHE_CHECK([if libstatgrab >= 0.90],
5038 [c_cv_have_libstatgrab_0_90],
5039 AC_LINK_IFELSE([AC_LANG_PROGRAM(
5042 #include <statgrab.h>
5045 if (sg_init()) return 0;
5048 [c_cv_have_libstatgrab_0_90="no"],
5049 [c_cv_have_libstatgrab_0_90="yes"]
5053 CFLAGS="$SAVE_CFLAGS"
5054 LDFLAGS="$SAVE_LDFLAGS"
5058 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
5059 if test "x$with_libstatgrab" = "xyes"
5061 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
5062 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5063 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5064 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
5065 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
5066 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"
5068 AC_DEFINE(HAVE_LIBSTATGRAB_0_90, 1, [Define to 1 if libstatgrab version >= 0.90])
5073 # --with-libtokyotyrant {{{
5074 with_libtokyotyrant_cppflags=""
5075 with_libtokyotyrant_ldflags=""
5076 with_libtokyotyrant_libs=""
5077 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5079 if test "x$withval" = "xno"
5081 with_libtokyotyrant="no"
5082 else if test "x$withval" = "xyes"
5084 with_libtokyotyrant="yes"
5086 with_libtokyotyrant_cppflags="-I$withval/include"
5087 with_libtokyotyrant_ldflags="-L$withval/include"
5088 with_libtokyotyrant_libs="-ltokyotyrant"
5089 with_libtokyotyrant="yes"
5093 with_libtokyotyrant="yes"
5096 if test "x$with_libtokyotyrant" = "xyes"
5098 if $PKG_CONFIG --exists tokyotyrant
5100 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5101 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5102 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5106 SAVE_CPPFLAGS="$CPPFLAGS"
5107 SAVE_LDFLAGS="$LDFLAGS"
5108 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5109 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5111 if test "x$with_libtokyotyrant" = "xyes"
5113 AC_CHECK_HEADERS(tcrdb.h,
5115 AC_DEFINE(HAVE_TCRDB_H, 1,
5116 [Define to 1 if you have the <tcrdb.h> header file.])
5117 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
5120 if test "x$with_libtokyotyrant" = "xyes"
5122 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
5124 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
5125 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
5127 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5128 [$with_libtokyotyrant_libs])
5131 CPPFLAGS="$SAVE_CPPFLAGS"
5132 LDFLAGS="$SAVE_LDFLAGS"
5134 if test "x$with_libtokyotyrant" = "xyes"
5136 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5137 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5138 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5139 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
5140 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
5141 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
5143 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
5146 # --with-libudev {{{
5147 with_libudev_cflags=""
5148 with_libudev_ldflags=""
5149 AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5151 if test "x$withval" = "xno"
5156 if test "x$withval" != "xyes"
5158 with_libudev_cflags="-I$withval/include"
5159 with_libudev_ldflags="-L$withval/lib"
5165 if test "x$ac_system" = "xLinux"
5169 with_libudev="no (Linux only library)"
5172 if test "x$with_libudev" = "xyes"
5174 SAVE_CPPFLAGS="$CPPFLAGS"
5175 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5177 AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
5179 CPPFLAGS="$SAVE_CPPFLAGS"
5181 if test "x$with_libudev" = "xyes"
5183 SAVE_CPPFLAGS="$CPPFLAGS"
5184 SAVE_LDFLAGS="$LDFLAGS"
5185 CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
5186 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5188 AC_CHECK_LIB(udev, udev_new,
5190 AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
5192 [with_libudev="no (libudev not found)"])
5194 CPPFLAGS="$SAVE_CPPFLAGS"
5195 LDFLAGS="$SAVE_LDFLAGS"
5197 if test "x$with_libudev" = "xyes"
5199 BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
5200 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5201 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5202 AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
5203 AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
5204 AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
5206 AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
5209 # --with-libupsclient {{{
5210 with_libupsclient_config=""
5211 with_libupsclient_cflags=""
5212 with_libupsclient_libs=""
5213 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5215 if test "x$withval" = "xno"
5217 with_libupsclient="no"
5218 else if test "x$withval" = "xyes"
5220 with_libupsclient="use_pkgconfig"
5222 if test -x "$withval"
5224 with_libupsclient_config="$withval"
5225 with_libupsclient="use_libupsclient_config"
5226 else if test -x "$withval/bin/libupsclient-config"
5228 with_libupsclient_config="$withval/bin/libupsclient-config"
5229 with_libupsclient="use_libupsclient_config"
5231 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5232 with_libupsclient_cflags="-I$withval/include"
5233 with_libupsclient_libs="-L$withval/lib -lupsclient"
5234 with_libupsclient="yes"
5238 [with_libupsclient="use_pkgconfig"])
5240 # configure using libupsclient-config
5241 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5243 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
5244 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5247 with_libupsclient="no ($with_libupsclient_config failed)"
5249 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5252 with_libupsclient="no ($with_libupsclient_config failed)"
5255 if test "x$with_libupsclient" = "xuse_libupsclient_config"
5257 with_libupsclient="yes"
5260 # configure using pkg-config
5261 if test "x$with_libupsclient" = "xuse_pkgconfig"
5263 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5264 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5267 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5270 if test "x$with_libupsclient" = "xuse_pkgconfig"
5272 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5275 with_libupsclient="no ($PKG_CONFIG failed)"
5277 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5280 with_libupsclient="no ($PKG_CONFIG failed)"
5283 if test "x$with_libupsclient" = "xuse_pkgconfig"
5285 with_libupsclient="yes"
5288 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
5289 # the actual checks.
5290 if test "x$with_libupsclient" = "xyes"
5292 SAVE_CPPFLAGS="$CPPFLAGS"
5293 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5295 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
5297 CPPFLAGS="$SAVE_CPPFLAGS"
5299 if test "x$with_libupsclient" = "xyes"
5301 SAVE_CPPFLAGS="$CPPFLAGS"
5302 SAVE_LDFLAGS="$LDFLAGS"
5304 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5305 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5307 AC_CHECK_LIB(upsclient, upscli_connect,
5308 [with_libupsclient="yes"],
5309 [with_libupsclient="no (symbol upscli_connect not found)"])
5311 CPPFLAGS="$SAVE_CPPFLAGS"
5312 LDFLAGS="$SAVE_LDFLAGS"
5314 if test "x$with_libupsclient" = "xyes"
5316 SAVE_CPPFLAGS="$CPPFLAGS"
5317 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5319 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
5320 [#include <stdlib.h>
5322 #include <upsclient.h>])
5324 CPPFLAGS="$SAVE_CPPFLAGS"
5326 if test "x$with_libupsclient" = "xyes"
5328 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5329 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5330 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
5331 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
5335 # --with-libxenctrl {{{
5336 with_libxenctrl_cppflags=""
5337 with_libxenctrl_ldflags=""
5338 AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5340 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5342 with_libxenctrl_cppflags="-I$withval/include"
5343 with_libxenctrl_ldflags="-L$withval/lib"
5344 with_libxenctrl="yes"
5346 with_libxenctrl="$withval"
5350 with_libxenctrl="yes"
5352 if test "x$with_libxenctrl" = "xyes"
5354 SAVE_CPPFLAGS="$CPPFLAGS"
5355 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5357 AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
5359 CPPFLAGS="$SAVE_CPPFLAGS"
5361 if test "x$with_libxenctrl" = "xyes"
5363 SAVE_CPPFLAGS="$CPPFLAGS"
5364 SAVE_LDFLAGS="$LDFLAGS"
5365 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5366 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5368 #Xen versions older than 3.4 has no xc_getcpuinfo()
5369 AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
5371 CPPFLAGS="$SAVE_CPPFLAGS"
5372 LDFLAGS="$SAVE_LDFLAGS"
5373 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5374 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5375 AC_SUBST(LIBXENCTL_CPPFLAGS)
5376 AC_SUBST(LIBXENCTL_LDFLAGS)
5380 # --with-libxmms {{{
5381 with_xmms_config="xmms-config"
5384 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5386 if test "x$withval" != "xno" \
5387 && test "x$withval" != "xyes"
5389 if test -f "$withval" && test -x "$withval";
5391 with_xmms_config="$withval"
5392 else if test -x "$withval/bin/xmms-config"
5394 with_xmms_config="$withval/bin/xmms-config"
5397 else if test "x$withval" = "xno"
5407 if test "x$with_libxmms" = "xyes"
5409 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5410 xmms_config_status=$?
5412 if test $xmms_config_status -ne 0
5417 if test "x$with_libxmms" = "xyes"
5419 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5420 xmms_config_status=$?
5422 if test $xmms_config_status -ne 0
5427 if test "x$with_libxmms" = "xyes"
5429 AC_CHECK_LIB(xmms, xmms_remote_get_info,
5431 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5432 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5433 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
5434 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
5441 with_libxmms_numeric=0
5442 if test "x$with_libxmms" = "xyes"
5444 with_libxmms_numeric=1
5446 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
5447 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
5450 # --with-libyajl {{{
5451 with_libyajl_cppflags=""
5452 with_libyajl_ldflags=""
5453 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5455 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5457 with_libyajl_cppflags="-I$withval/include"
5458 with_libyajl_ldflags="-L$withval/lib"
5461 with_libyajl="$withval"
5467 if test "x$with_libyajl" = "xyes"
5469 SAVE_CPPFLAGS="$CPPFLAGS"
5470 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5472 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
5473 AC_CHECK_HEADERS(yajl/yajl_version.h)
5475 CPPFLAGS="$SAVE_CPPFLAGS"
5477 if test "x$with_libyajl" = "xyes"
5479 SAVE_CPPFLAGS="$CPPFLAGS"
5480 SAVE_LDFLAGS="$LDFLAGS"
5481 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5482 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5484 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
5486 CPPFLAGS="$SAVE_CPPFLAGS"
5487 LDFLAGS="$SAVE_LDFLAGS"
5489 if test "x$with_libyajl" = "xyes"
5491 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5492 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5493 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5494 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
5495 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
5496 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
5497 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
5499 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
5503 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5504 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5506 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5508 if test "x$withval" = "xno"
5511 else if test "x$withval" = "xyes"
5514 else if test -d "$with_mic/lib"
5516 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
5517 with_mic_cflags="-I$withval/include"
5518 with_mic_ldpath="-L$withval/lib/Linux"
5519 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
5524 if test "x$with_mic" = "xyes"
5526 SAVE_CPPFLAGS="$CPPFLAGS"
5527 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5528 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
5529 CPPFLAGS="$SAVE_CPPFLAGS"
5531 if test "x$with_mic" = "xyes"
5533 SAVE_CPPFLAGS="$CPPFLAGS"
5534 SAVE_LDFLAGS="$LDFLAGS"
5536 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
5537 LDFLAGS="$LDFLAGS $with_mic_ldpath"
5539 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
5540 [with_mic_ldpath="$with_mic_ldpath"
5541 with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
5542 [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
5544 CPPFLAGS="$SAVE_CPPFLAGS"
5545 LDFLAGS="$SAVE_LDFLAGS"
5548 if test "x$with_mic" = "xyes"
5550 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
5551 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
5552 BUILD_WITH_MIC_LDADD="$with_mic_libs"
5553 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
5554 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
5555 AC_SUBST(BUILD_WITH_MIC_LDADD)
5559 # --with-libvarnish {{{
5560 with_libvarnish_cppflags=""
5561 with_libvarnish_cflags=""
5562 with_libvarnish_libs=""
5563 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5565 if test "x$withval" = "xno"
5567 with_libvarnish="no"
5568 else if test "x$withval" = "xyes"
5570 with_libvarnish="use_pkgconfig"
5571 else if test -d "$with_libvarnish/lib"
5573 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
5574 with_libvarnish_cflags="-I$withval/include"
5575 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5576 with_libvarnish="yes"
5579 [with_libvarnish="use_pkgconfig"])
5581 # configure using pkg-config
5582 if test "x$with_libvarnish" = "xuse_pkgconfig"
5584 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
5585 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5588 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5591 if test "x$with_libvarnish" = "xuse_pkgconfig"
5593 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5596 with_libvarnish="no ($PKG_CONFIG failed)"
5598 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5601 with_libvarnish="no ($PKG_CONFIG failed)"
5604 if test "x$with_libvarnish" = "xuse_pkgconfig"
5606 with_libvarnish="yes"
5609 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
5610 # the actual checks.
5611 if test "x$with_libvarnish" = "xyes"
5613 SAVE_CPPFLAGS="$CPPFLAGS"
5615 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5617 AC_CHECK_HEADERS(vapi/vsc.h,
5618 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5619 [AC_CHECK_HEADERS(vsc.h,
5620 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
5621 [AC_CHECK_HEADERS(varnishapi.h,
5622 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5623 [with_libvarnish="no (found none of the varnish header files)"])])])
5625 CPPFLAGS="$SAVE_CPPFLAGS"
5627 if test "x$with_libvarnish" = "xyes"
5629 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5630 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5631 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
5632 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
5636 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5637 with_libxml2="no (pkg-config isn't available)"
5638 with_libxml2_cflags=""
5639 with_libxml2_ldflags=""
5640 with_libvirt="no (pkg-config isn't available)"
5641 with_libvirt_cflags=""
5642 with_libvirt_ldflags=""
5643 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5648 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5651 $PKG_CONFIG --exists libvirt 2>/dev/null
5656 with_libvirt="no (pkg-config doesn't know libvirt)"
5658 if test "x$with_libxml2" = "xyes"
5660 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5665 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5671 if test "x$with_libxml2" = "xyes"
5673 SAVE_CPPFLAGS="$CPPFLAGS"
5674 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5676 AC_CHECK_HEADERS(libxml/parser.h, [],
5677 [with_libxml2="no (libxml/parser.h not found)"])
5679 CPPFLAGS="$SAVE_CPPFLAGS"
5681 if test "x$with_libxml2" = "xyes"
5683 SAVE_CFLAGS="$CFLAGS"
5684 SAVE_LDFLAGS="$LDFLAGS"
5686 CFLAGS="$CFLAGS $with_libxml2_cflags"
5687 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5689 AC_CHECK_LIB(xml2, xmlXPathEval,
5690 [with_libxml2="yes"],
5691 [with_libxml2="no (symbol xmlXPathEval not found)"])
5693 CFLAGS="$SAVE_CFLAGS"
5694 LDFLAGS="$SAVE_LDFLAGS"
5696 dnl Add the right compiler flags and libraries.
5697 if test "x$with_libxml2" = "xyes"; then
5698 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5699 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5700 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
5701 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
5703 if test "x$with_libvirt" = "xyes"
5705 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5710 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5716 if test "x$with_libvirt" = "xyes"
5718 SAVE_CPPFLAGS="$CPPFLAGS"
5719 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5721 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
5722 [with_libvirt="no (libvirt/libvirt.h not found)"])
5724 CPPFLAGS="$SAVE_CPPFLAGS"
5726 if test "x$with_libvirt" = "xyes"
5728 SAVE_CFLAGS="$CFLAGS"
5729 SAVE_LDFLAGS="$LDFLAGS"
5731 CFLAGS="$CFLAGS $with_libvirt_cflags"
5732 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5734 AC_CHECK_LIB(virt, virDomainBlockStats,
5735 [with_libvirt="yes"],
5736 [with_libvirt="no (symbol virDomainBlockStats not found)"])
5738 CFLAGS="$SAVE_CFLAGS"
5739 LDFLAGS="$SAVE_LDFLAGS"
5741 dnl Add the right compiler flags and libraries.
5742 if test "x$with_libvirt" = "xyes"; then
5743 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5744 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5745 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
5746 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
5750 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5751 with_libopenipmipthread="yes"
5752 with_libopenipmipthread_cflags=""
5753 with_libopenipmipthread_libs=""
5755 if test "x$with_libopenipmipthread" = "xyes"
5757 AC_MSG_CHECKING([for libOpenIPMIpthread])
5758 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5761 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5763 AC_MSG_RESULT([$with_libopenipmipthread])
5766 if test "x$with_libopenipmipthread" = "xyes"
5768 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5769 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5772 with_libopenipmipthread_cflags="$temp_result"
5774 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5775 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5777 AC_MSG_RESULT([$temp_result])
5780 if test "x$with_libopenipmipthread" = "xyes"
5782 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5783 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5786 with_libopenipmipthread_ldflags="$temp_result"
5788 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5789 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5791 AC_MSG_RESULT([$temp_result])
5794 if test "x$with_libopenipmipthread" = "xyes"
5796 SAVE_CPPFLAGS="$CPPFLAGS"
5797 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5799 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
5800 [with_libopenipmipthread="yes"],
5801 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5802 [#include <OpenIPMI/ipmiif.h>
5803 #include <OpenIPMI/ipmi_err.h>
5804 #include <OpenIPMI/ipmi_posix.h>
5805 #include <OpenIPMI/ipmi_conn.h>
5808 CPPFLAGS="$SAVE_CPPFLAGS"
5811 if test "x$with_libopenipmipthread" = "xyes"
5813 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5814 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5815 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
5816 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
5820 # --with-libatasmart {{{
5821 with_libatasmart_cppflags=""
5822 with_libatasmart_ldflags=""
5823 AC_ARG_WITH(libatasmart, [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5825 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5827 with_libatasmart_cppflags="-I$withval/include"
5828 with_libatasmart_ldflags="-L$withval/lib"
5829 with_libatasmart="yes"
5831 with_libatasmart="$withval"
5835 if test "x$ac_system" = "xLinux"
5837 with_libatasmart="yes"
5839 with_libatasmart="no (Linux only library)"
5842 if test "x$with_libatasmart" = "xyes"
5844 SAVE_CPPFLAGS="$CPPFLAGS"
5845 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5847 AC_CHECK_HEADERS(atasmart.h, [with_libatasmart="yes"], [with_libatasmart="no (atasmart.h not found)"])
5849 CPPFLAGS="$SAVE_CPPFLAGS"
5851 if test "x$with_libatasmart" = "xyes"
5853 SAVE_CPPFLAGS="$CPPFLAGS"
5854 SAVE_LDFLAGS="$LDFLAGS"
5855 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5856 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5858 AC_CHECK_LIB(atasmart, sk_disk_open, [with_libatasmart="yes"], [with_libatasmart="no (Symbol 'sk_disk_open' not found)"])
5860 CPPFLAGS="$SAVE_CPPFLAGS"
5861 LDFLAGS="$SAVE_LDFLAGS"
5863 if test "x$with_libatasmart" = "xyes"
5865 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5866 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5867 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5868 AC_SUBST(BUILD_WITH_LIBATASMART_CPPFLAGS)
5869 AC_SUBST(BUILD_WITH_LIBATASMART_LDFLAGS)
5870 AC_SUBST(BUILD_WITH_LIBATASMART_LIBS)
5871 AC_DEFINE(HAVE_LIBATASMART, 1, [Define if libatasmart is present and usable.])
5873 AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes")
5876 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5877 [with_libnotify="yes"],
5878 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5881 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5882 [with_libriemann_client="yes"],
5883 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
5885 # Check for enabled/disabled features
5888 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
5889 # ------------------------------------------------------------
5891 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
5896 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
5901 m4_define([EnDis],[disabled])dnl
5902 m4_define([YesNo],[no])dnl
5908 m4_define([EnDis],[enabled])dnl
5909 m4_define([YesNo],[yes])dnl
5912 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
5916 m4_if([$3], [feature], [],
5920 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
5926 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
5928 enable_$1='[YesNo]'dnl
5930 if test "x$enable_$1" = "xno"
5934 if test "x$enable_$1" = "xyes"
5938 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
5943 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
5944 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
5946 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
5948 # AC_PLUGIN(name, default, info)
5949 # ------------------------------------------------------------
5956 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
5958 if test "x$enableval" = "xyes"
5961 else if test "x$enableval" = "xforce"
5966 enable_plugin="no (disabled on command line)"
5970 if test "x$enable_all_plugins" = "xauto"
5972 if test "x$2" = "xyes"
5979 enable_plugin="$enable_all_plugins"
5982 if test "x$enable_plugin" = "xyes"
5984 if test "x$2" = "xyes" || test "x$force" = "xyes"
5986 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
5987 if test "x$2" != "xyes"
5989 dependency_warning="yes"
5991 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
5992 dependency_error="yes"
5993 enable_plugin="$2 (dependency error)"
5996 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
5997 enable_$1="$enable_plugin"
5999 )# AC_PLUGIN(name, default, info)
6001 m4_divert_once([HELP_ENABLE], [
6002 collectd features:])
6003 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
6004 AC_COLLECTD([debug], [enable], [feature], [debugging])
6005 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
6006 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
6007 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
6009 dependency_warning="no"
6010 dependency_error="no"
6013 plugin_barometer="no"
6018 plugin_conntrack="no"
6019 plugin_contextswitch="no"
6022 plugin_cpusleep="no"
6023 plugin_curl_json="no"
6024 plugin_curl_xml="no"
6028 plugin_dpdkstat="no"
6035 plugin_hugepages="no"
6036 plugin_intel_rdt="no"
6037 plugin_interface="no"
6042 plugin_log_logstash="no"
6044 plugin_multimeter="no"
6049 plugin_processes="no"
6050 plugin_protocols="no"
6056 plugin_tcpconns="no"
6059 plugin_turbostat="no"
6065 plugin_wireless="no"
6066 plugin_write_prometheus="no"
6070 plugin_zookeeper="no"
6073 if test "x$ac_system" = "xLinux"
6075 plugin_battery="yes"
6076 plugin_cgroups="yes"
6077 plugin_conntrack="yes"
6078 plugin_contextswitch="yes"
6080 plugin_cpufreq="yes"
6083 plugin_entropy="yes"
6084 plugin_fhcount="yes"
6085 plugin_fscache="yes"
6086 plugin_hugepages="yes"
6087 plugin_interface="yes"
6095 plugin_processes="yes"
6096 plugin_protocols="yes"
6099 plugin_tcpconns="yes"
6100 plugin_thermal="yes"
6103 plugin_vserver="yes"
6104 plugin_wireless="yes"
6105 plugin_zfs_arc="yes"
6107 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
6111 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
6113 plugin_turbostat="yes"
6116 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
6118 plugin_cpusleep="yes"
6122 if test "x$ac_system" = "xOpenBSD"
6124 plugin_tcpconns="yes"
6127 if test "x$ac_system" = "xNetBSD"
6130 plugin_entropy="yes"
6132 plugin_processes="yes"
6136 if test "x$with_libiokit" = "xyes"
6138 plugin_battery="yes"
6144 if test "x$ac_system" = "xAIX"
6147 plugin_tcpconns="yes"
6152 if test "x$ac_system" = "xFreeBSD"
6155 plugin_zfs_arc="yes"
6159 if test "x$with_perfstat" = "xyes"
6161 plugin_contextswitch="yes"
6164 plugin_interface="yes"
6171 if test "x$with_procinfo" = "xyes"
6173 plugin_processes="yes"
6177 if test "x$with_kstat" = "xyes"
6180 plugin_processes="yes"
6182 plugin_zfs_arc="yes"
6186 if test "x$with_devinfo$with_kstat" = "xyesyes"
6190 plugin_interface="yes"
6196 if test "x$ac_system" = "xLinux"
6198 AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
6199 [with_libi2c="yes"],
6200 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
6201 [[#include <stdlib.h>
6202 #include <linux/i2c-dev.h>]])
6204 with_libi2c="no (Linux only)"
6207 if test "x$with_libi2c" = "xyes"
6209 plugin_barometer="yes"
6214 if test "x$with_libstatgrab" = "xyes"
6218 plugin_interface="yes"
6225 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6228 if test "x$have_strptime" = "xyes"
6234 if test "x$with_libopenipmipthread" = "xyes"
6239 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
6241 plugin_curl_json="yes"
6244 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
6246 plugin_curl_xml="yes"
6249 if test "x$with_libyajl" = "xyes"
6254 if test "x$have_processor_info" = "xyes"
6258 if test "x$have_sysctl" = "xyes"
6263 if test "x$ac_system" = "xDarwin"
6268 if test "x$have_sysctlbyname" = "xyes"
6270 plugin_contextswitch="yes"
6273 plugin_tcpconns="yes"
6276 # Df plugin: Check if we know how to determine mount points first.
6277 #if test "x$have_listmntent" = "xyes"; then
6280 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
6284 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
6288 #if test "x$have_getmntent" = "xseq"
6292 if test "x$c_cv_have_one_getmntent" = "xyes"
6297 if test "x$c_cv_have_getmntent_r" = "xyes"
6302 # Df plugin: Check if we have either `statfs' or `statvfs' second.
6303 if test "x$plugin_df" = "xyes"
6306 if test "x$have_statfs" = "xyes"
6310 if test "x$have_statvfs" = "xyes"
6316 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
6318 plugin_ethstat="yes"
6321 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
6326 if test "x$have_getifaddrs" = "xyes"
6328 plugin_interface="yes"
6331 if test "x$with_libgps" = "xyes"
6336 if test "x$have_getloadavg" = "xyes"
6341 if test "x$with_libyajl" = "xyes"
6343 plugin_log_logstash="yes"
6346 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
6351 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
6354 if test "x$with_libmicrohttpd" = "xyes"
6356 plugin_write_prometheus="yes"
6360 # Mac OS X memory interface
6361 if test "x$have_host_statistics" = "xyes"
6366 if test "x$have_termios_h" = "xyes"
6368 if test "x$ac_system" != "xAIX"
6370 plugin_multimeter="yes"
6375 if test "x$have_thread_info" = "xyes"
6377 plugin_processes="yes"
6380 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
6382 plugin_processes="yes"
6385 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
6387 plugin_processes="yes"
6390 if test "x$with_libpython" != "xno"
6395 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
6400 if test "x$with_kvm_getswapinfo" = "xyes"
6405 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
6410 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
6415 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
6417 plugin_tcpconns="yes"
6420 if test "x$have_getutent" = "xyes"
6424 if test "x$have_getutxent" = "xyes"
6429 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
6434 if test "x$with_libxenctrl" = "xyes"
6439 if test "x$with_libdpdk" = "xyes"
6441 plugin_dpdkstat="yes"
6444 m4_divert_once([HELP_ENABLE], [
6447 AC_ARG_ENABLE([all-plugins],
6448 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
6450 if test "x$enableval" = "xyes"
6452 enable_all_plugins="yes"
6453 else if test "x$enableval" = "xauto"
6455 enable_all_plugins="auto"
6457 enable_all_plugins="no"
6460 [enable_all_plugins="auto"])
6462 m4_divert_once([HELP_ENABLE], [])
6464 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6465 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6466 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6467 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6468 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6469 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6470 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6471 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6472 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6473 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6474 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6475 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6476 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6477 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6478 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6479 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6480 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6481 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6482 AC_PLUGIN([csv], [yes], [CSV output plugin])
6483 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6484 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6485 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6486 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6487 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6488 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6489 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6490 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats & Status from DPDK])
6491 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6492 AC_PLUGIN([email], [yes], [EMail statistics])
6493 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6494 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6495 AC_PLUGIN([exec], [yes], [Execution of external programs])
6496 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6497 AC_PLUGIN([filecount], [yes], [Count files in directories])
6498 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6499 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6500 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6501 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6502 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6503 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6504 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6505 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6506 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6507 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6508 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6509 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6510 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6511 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6512 AC_PLUGIN([load], [$plugin_load], [System load])
6513 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6514 AC_PLUGIN([logfile], [yes], [File logging plugin])
6515 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6516 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6517 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6518 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6519 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6520 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6521 AC_PLUGIN([match_regex], [yes], [The regex match])
6522 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6523 AC_PLUGIN([match_value], [yes], [The value match])
6524 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6525 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6526 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6527 AC_PLUGIN([memcached], [yes], [memcached statistics])
6528 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6529 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6530 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6531 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6532 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6533 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6534 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6535 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6536 AC_PLUGIN([network], [yes], [Network communication plugin])
6537 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6538 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6539 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6540 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6541 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6542 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6543 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6544 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6545 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6546 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6547 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6548 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6549 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6550 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6551 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6552 # FIXME: Check for libevent, too.
6553 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6554 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6555 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6556 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6557 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6558 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6559 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6560 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6561 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6562 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6563 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6564 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6565 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6566 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6567 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6568 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6569 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6570 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6571 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6572 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6573 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6574 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6575 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6576 AC_PLUGIN([target_notification], [yes], [The notification target])
6577 AC_PLUGIN([target_replace], [yes], [The replace target])
6578 AC_PLUGIN([target_scale], [yes], [The scale target])
6579 AC_PLUGIN([target_set], [yes], [The set target])
6580 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6581 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6582 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6583 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6584 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6585 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6586 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6587 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6588 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6589 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6590 AC_PLUGIN([users], [$plugin_users], [User statistics])
6591 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6592 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6593 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6594 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6595 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6596 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6597 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6598 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6599 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6600 AC_PLUGIN([write_log], [yes], [Log output plugin])
6601 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6602 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6603 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6604 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6605 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6606 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6607 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6608 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6609 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6610 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6611 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6613 dnl Default configuration file
6614 # Load either syslog or logfile
6615 LOAD_PLUGIN_SYSLOG=""
6616 LOAD_PLUGIN_LOGFILE=""
6617 LOAD_PLUGIN_LOG_LOGSTASH=""
6619 AC_MSG_CHECKING([which default log plugin to load])
6620 default_log_plugin="none"
6621 if test "x$enable_syslog" = "xyes"
6623 default_log_plugin="syslog"
6625 LOAD_PLUGIN_SYSLOG="##"
6628 if test "x$enable_logfile" = "xyes"
6630 if test "x$default_log_plugin" = "xnone"
6632 default_log_plugin="logfile"
6634 LOAD_PLUGIN_LOGFILE="#"
6637 LOAD_PLUGIN_LOGFILE="##"
6640 if test "x$enable_log_logstash" = "xyes"
6642 LOAD_PLUGIN_LOG_LOGSTASH="#"
6644 LOAD_PLUGIN_LOG_LOGSTASH="##"
6648 AC_MSG_RESULT([$default_log_plugin])
6650 AC_SUBST(LOAD_PLUGIN_SYSLOG)
6651 AC_SUBST(LOAD_PLUGIN_LOGFILE)
6652 AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
6654 DEFAULT_LOG_LEVEL="info"
6655 if test "x$enable_debug" = "xyes"
6657 DEFAULT_LOG_LEVEL="debug"
6659 AC_SUBST(DEFAULT_LOG_LEVEL)
6661 # Load only one of rrdtool, network, csv in the default config.
6662 LOAD_PLUGIN_RRDTOOL=""
6663 LOAD_PLUGIN_NETWORK=""
6666 AC_MSG_CHECKING([which default write plugin to load])
6667 default_write_plugin="none"
6668 if test "x$enable_rrdtool" = "xyes"
6670 default_write_plugin="rrdtool"
6672 LOAD_PLUGIN_RRDTOOL="##"
6675 if test "x$enable_network" = "xyes"
6677 if test "x$default_write_plugin" = "xnone"
6679 default_write_plugin="network"
6681 LOAD_PLUGIN_NETWORK="#"
6684 LOAD_PLUGIN_NETWORK="##"
6687 if test "x$enable_csv" = "xyes"
6689 if test "x$default_write_plugin" = "xnone"
6691 default_write_plugin="csv"
6696 LOAD_PLUGIN_CSV="##"
6698 AC_MSG_RESULT([$default_write_plugin])
6700 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
6701 AC_SUBST(LOAD_PLUGIN_NETWORK)
6702 AC_SUBST(LOAD_PLUGIN_CSV)
6705 if test "x$ac_system" = "xLinux" \
6706 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
6708 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
6711 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
6713 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
6717 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6718 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6720 if test "x$withval" != "xno" && test "x$withval" != "xyes"
6722 PERL_BINDINGS_OPTIONS="$withval"
6723 with_perl_bindings="yes"
6725 with_perl_bindings="$withval"
6729 if test -n "$perl_interpreter"
6731 with_perl_bindings="yes"
6733 with_perl_bindings="no (no perl interpreter found)"
6737 if test "x$with_perl_bindings" = "xyes"
6739 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6740 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6741 AC_MSG_RESULT([yes])
6744 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6748 if test "x$with_perl_bindings" = "xyes"
6750 PERL_BINDINGS="perl"
6754 AC_SUBST(PERL_BINDINGS)
6755 AC_SUBST(PERL_BINDINGS_OPTIONS)
6757 dnl libcollectdclient
6758 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6759 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6760 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6762 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6764 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6766 AC_SUBST(LCC_VERSION_MAJOR)
6767 AC_SUBST(LCC_VERSION_MINOR)
6768 AC_SUBST(LCC_VERSION_PATCH)
6769 AC_SUBST(LCC_VERSION_EXTRA)
6770 AC_SUBST(LCC_VERSION_STRING)
6772 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
6776 if test "x$enable_werror" != "xno"
6778 AM_CFLAGS="$AM_CFLAGS -Werror"
6779 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6781 AC_SUBST([AM_CFLAGS])
6782 AC_SUBST([AM_CXXFLAGS])
6784 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])
6787 if test "x$with_librrd" = "xyes" \
6788 && test "x$librrd_threadsafe" != "xyes"
6790 with_librrd="yes (warning: librrd is not thread-safe)"
6793 if test "x$with_libperl" = "xyes"
6795 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
6797 enable_perl="no (needs libperl)"
6800 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
6802 enable_perl="no (libperl doesn't support ithreads)"
6805 if test "x$with_perl_bindings" = "xyes" \
6806 && test "x$PERL_BINDINGS_OPTIONS" != "x"
6808 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6812 AC_MSG_RESULT([Configuration:])
6813 AC_MSG_RESULT([ Build:])
6814 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6815 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6816 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6817 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6818 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6819 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6820 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6821 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6822 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6823 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6824 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6825 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6827 AC_MSG_RESULT([ Libraries:])
6828 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6829 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6830 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6831 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6832 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6833 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6834 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6835 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6836 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6837 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6838 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6839 AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
6840 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6841 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6842 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6843 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6844 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6845 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6846 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6847 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6848 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6849 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6850 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6851 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6852 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6853 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6854 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6855 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6856 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6857 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6858 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6859 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6860 AC_MSG_RESULT([ liboconfig . . . . . $with_liboconfig])
6861 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6862 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6863 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6864 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6865 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6866 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6867 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6868 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6869 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6870 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6871 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6872 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6873 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6874 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6875 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6876 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6877 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6878 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6879 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6880 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6881 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6882 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6883 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6884 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6885 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6886 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6887 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6888 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6889 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6890 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6891 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6893 AC_MSG_RESULT([ Features:])
6894 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6895 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6897 AC_MSG_RESULT([ Bindings:])
6898 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6900 AC_MSG_RESULT([ Modules:])
6901 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6902 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6903 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6904 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6905 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6906 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6907 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6908 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6909 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6910 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6911 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6912 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6913 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6914 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6915 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6916 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6917 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6918 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6919 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6920 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6921 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6922 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6923 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6924 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6925 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6926 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6927 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6928 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6929 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6930 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6931 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6932 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6933 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6934 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6935 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6936 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6937 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6938 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6939 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6940 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6941 AC_MSG_RESULT([ intel_rdt. . . . . . $enable_intel_rdt])
6942 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6943 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6944 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6945 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6946 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6947 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6948 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6949 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6950 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6951 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6952 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6953 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6954 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6955 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6956 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6957 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6958 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6959 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6960 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6961 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6962 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
6963 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
6964 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
6965 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
6966 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
6967 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
6968 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
6969 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
6970 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
6971 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
6972 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
6973 AC_MSG_RESULT([ network . . . . . . . $enable_network])
6974 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
6975 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
6976 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
6977 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
6978 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
6979 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
6980 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
6981 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
6982 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
6983 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
6984 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
6985 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
6986 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
6987 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
6988 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
6989 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
6990 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
6991 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
6992 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
6993 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
6994 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
6995 AC_MSG_RESULT([ python . . . . . . . $enable_python])
6996 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
6997 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
6998 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
6999 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
7000 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
7001 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
7002 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
7003 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
7004 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
7005 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
7006 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
7007 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
7008 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
7009 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
7010 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
7011 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
7012 AC_MSG_RESULT([ target_notification . $enable_target_notification])
7013 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
7014 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
7015 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
7016 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
7017 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
7018 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
7019 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
7020 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
7021 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
7022 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
7023 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
7024 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
7025 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
7026 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
7027 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
7028 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
7029 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
7030 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
7031 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
7032 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
7033 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
7034 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
7035 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
7036 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
7037 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
7038 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
7039 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
7040 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
7041 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
7042 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
7043 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
7044 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
7045 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
7046 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
7047 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
7050 if test "x$dependency_error" = "xyes"; then
7051 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
7054 if test "x$dependency_warning" = "xyes"; then
7055 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
7058 # vim: set fdm=marker :