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([build-aux])
7 AC_CONFIG_MACRO_DIR([m4])
9 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
10 dnl we don't really need the 'u' even in older toolchains. Then there is
11 dnl older libtool, which spelled it AR_FLAGS
12 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
14 LT_INIT([dlopen disable-static])
16 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
17 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20 AC_PREFIX_DEFAULT("/opt/collectd")
25 # Checks for programs.
28 [AC_MSG_ERROR([No compiler found that supports C99])]
44 AC_PATH_PROG([VALGRIND], [valgrind])
46 # Warn when pkg.m4 is missing
47 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
51 AC_CACHE_CHECK([if Bison is the parser generator],
52 [collectd_cv_prog_bison],
54 AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
55 [collectd_cv_prog_bison=yes],
56 [collectd_cv_prog_bison=no]
61 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"; then
62 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
65 if test "x$lt_cv_dlopen" = "xno"; then
66 AC_MSG_ERROR([Your system does not support dlopen])
69 AC_SUBST([DLOPEN_LIBS], [$lt_cv_dlopen_libs])
72 AC_MSG_CHECKING([for kernel type ($host_os)])
75 AC_DEFINE([KERNEL_AIX], [1], [True if program is to be compiled for a AIX kernel])
79 AC_DEFINE([KERNEL_DARWIN], [1], [True if program is to be compiled for a Darwin kernel])
83 AC_DEFINE([KERNEL_FREEBSD], [1], [True if program is to be compiled for a FreeBSD kernel])
87 AC_DEFINE([KERNEL_LINUX], [1], [True if program is to be compiled for a Linux kernel])
91 AC_DEFINE([KERNEL_NETBSD], [1], [True if program is to be compiled for a NetBSD kernel])
95 AC_DEFINE([KERNEL_OPENBSD], [1], [True if program is to be compiled for an OpenBSD kernel])
99 AC_DEFINE([KERNEL_SOLARIS], [1], [True if program is to be compiled for a Solaris kernel])
106 AC_MSG_RESULT([$ac_system])
108 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
109 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
110 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
111 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
112 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
113 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
115 if test "x$ac_system" = "xSolaris"; then
116 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Define to enforce POSIX thread semantics under Solaris.])
117 AC_DEFINE([_REENTRANT], [1], [Define to enable reentrancy interfaces.])
119 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
125 # error "Compiler not in 64bit mode."
130 [AC_MSG_RESULT([yes])],
133 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
138 if test "x$ac_system" = "xAIX"; then
139 AC_DEFINE([_THREAD_SAFE_ERRNO], [1], [Define to use the thread-safe version of errno under AIX.])
142 # Where to install .pc files.
143 pkgconfigdir="${libdir}/pkgconfig"
144 AC_SUBST([pkgconfigdir])
147 # Checks for header files.
152 AC_CHECK_HEADERS_ONCE([ \
193 if test "x$ac_system" = "xNetBSD"; then
194 # For entropy plugin on newer NetBSD
195 AC_CHECK_HEADERS([sys/rndio.h], [], [],
198 # include <sys/types.h>
201 # include <sys/ioctl.h>
204 # include <sys/param.h>
211 AC_CHECK_HEADERS([netinet/in_systm.h], [], [],
215 # include <sys/types.h>
220 AC_CHECK_HEADERS([netinet/in.h], [], [],
224 # include <sys/types.h>
226 #if HAVE_NETINET_IN_SYSTM_H
227 # include <netinet/in_systm.h>
232 AC_CHECK_HEADERS([netinet/ip.h], [], [],
236 # include <sys/types.h>
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
247 AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [],
251 # include <sys/types.h>
253 #if HAVE_NETINET_IN_SYSTM_H
254 # include <netinet/in_systm.h>
256 #if HAVE_NETINET_IN_H
257 # include <netinet/in.h>
259 #if HAVE_NETINET_IP_H
260 # include <netinet/ip.h>
265 AC_CHECK_HEADERS([netinet/ip_var.h], [], [],
269 # include <sys/types.h>
271 #if HAVE_NETINET_IN_SYSTM_H
272 # include <netinet/in_systm.h>
274 #if HAVE_NETINET_IN_H
275 # include <netinet/in.h>
277 #if HAVE_NETINET_IP_H
278 # include <netinet/ip.h>
283 AC_CHECK_HEADERS([netinet/ip6.h], [], [],
287 # include <sys/types.h>
289 #if HAVE_NETINET_IN_SYSTM_H
290 # include <netinet/in_systm.h>
292 #if HAVE_NETINET_IN_H
293 # include <netinet/in.h>
298 AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
302 # include <sys/types.h>
304 #if HAVE_NETINET_IN_SYSTM_H
305 # include <netinet/in_systm.h>
307 #if HAVE_NETINET_IN_H
308 # include <netinet/in.h>
310 #if HAVE_NETINET_IP6_H
311 # include <netinet/ip6.h>
316 AC_CHECK_HEADERS([netinet/tcp.h], [], [],
320 # include <sys/types.h>
322 #if HAVE_NETINET_IN_SYSTM_H
323 # include <netinet/in_systm.h>
325 #if HAVE_NETINET_IN_H
326 # include <netinet/in.h>
328 #if HAVE_NETINET_IP_H
329 # include <netinet/ip.h>
334 AC_CHECK_HEADERS([netinet/udp.h], [], [],
338 # include <sys/types.h>
340 #if HAVE_NETINET_IN_SYSTM_H
341 # include <netinet/in_systm.h>
343 #if HAVE_NETINET_IN_H
344 # include <netinet/in.h>
346 #if HAVE_NETINET_IP_H
347 # include <netinet/ip.h>
353 AC_CHECK_HEADERS([sys/dkstat.h])
354 if test "x$ac_system" = "xDarwin"; then
364 mach/processor_set.h \
366 mach/processor_info.h \
372 mach/vm_statistics.h \
374 CoreFoundation/CoreFoundation.h \
377 IOKit/ps/IOPSKeys.h \
379 IOKit/storage/IOBlockStorageDriver.h
383 # For the battery plugin
384 AC_CHECK_HEADERS([IOKit/ps/IOPowerSources.h], [], [],
386 #if HAVE_IOKIT_IOKITLIB_H
387 # include <IOKit/IOKitLib.h>
389 #if HAVE_IOKIT_IOTYPES_H
390 # include <IOKit/IOTypes.h>
396 AC_CHECK_HEADERS([sys/sysctl.h], [], [],
399 # include <sys/types.h>
402 # include <sys/param.h>
407 # For interface plugin
408 AC_CHECK_HEADERS([ifaddrs.h])
409 AC_CHECK_HEADERS([net/if.h], [], [],
412 # include <sys/types.h>
414 #if HAVE_SYS_SOCKET_H
415 # include <sys/socket.h>
420 if test "x$ac_system" = "xLinux"; then
422 AC_CHECK_HEADERS([linux/major.h])
424 # For md module (Linux only)
425 AC_CHECK_HEADERS([linux/raid/md_u.h],
426 [have_linux_raid_md_u_h="yes"],
427 [have_linux_raid_md_u_h="no"],
429 #include <sys/ioctl.h>
430 #include <linux/major.h>
431 #include <linux/types.h>
434 AC_CHECK_HEADERS([sys/sysmacros.h])
436 AC_CHECK_HEADERS([linux/wireless.h],
437 [have_linux_wireless_h="yes"],
438 [have_linux_wireless_h="no"],
441 #include <sys/ioctl.h>
442 #include <sys/socket.h>
446 AC_CHECK_HEADERS([linux/if.h], [], [],
449 # include <sys/types.h>
451 #if HAVE_SYS_SOCKET_H
452 # include <sys/socket.h>
457 AC_CHECK_HEADERS([linux/inet_diag.h], [], [],
460 # include <sys/types.h>
462 #if HAVE_SYS_SOCKET_H
463 # include <sys/socket.h>
468 AC_CHECK_HEADERS([linux/netdevice.h], [], [],
471 # include <sys/types.h>
473 #if HAVE_SYS_SOCKET_H
474 # include <sys/socket.h>
477 # include <linux/if.h>
483 AC_CHECK_HEADERS([linux/sockios.h],
484 [have_linux_sockios_h="yes"],
485 [have_linux_sockios_h="no"],
488 # include <sys/ioctl.h>
496 AC_CHECK_HEADERS([linux/ethtool.h],
497 [have_linux_ethtool_h="yes"],
498 [have_linux_ethtool_h="no"],
501 # include <sys/ioctl.h>
506 #if HAVE_LINUX_SOCKIOS_H
507 # include <linux/sockios.h>
513 AC_CHECK_HEADERS_ONCE([linux/ip_vs.h])
515 # For the email plugin
516 AC_CHECK_HEADERS([linux/un.h], [], [],
518 #if HAVE_SYS_SOCKET_H
519 # include <sys/socket.h>
523 # For the turbostat plugin
524 AC_CHECK_HEADERS([asm/msr-index.h],
525 [have_asm_msrindex_h="yes"],
526 [have_asm_msrindex_h="no"]
529 if test "x$have_asm_msrindex_h" = "xyes"; then
530 AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
531 [c_cv_have_usable_asm_msrindex_h],
536 [[#include<asm/msr-index.h>]],
538 int y = MSR_PKG_C10_RESIDENCY;
543 [c_cv_have_usable_asm_msrindex_h="yes"],
544 [c_cv_have_usable_asm_msrindex_h="no"],
550 AC_CHECK_HEADERS([cpuid.h],
551 [have_cpuid_h="yes"],
552 [have_cpuid_h="no (cpuid.h not found)"]
555 AC_CHECK_HEADERS([sys/capability.h],
556 [have_capability="yes"],
557 [have_capability="no (<sys/capability.h> not found)"]
560 if test "x$have_capability" = "xyes"; then
561 AC_CHECK_LIB([cap], [cap_get_proc],
562 [have_capability="yes"],
563 [have_capability="no (cap_get_proc() not found)"]
567 if test "x$have_capability" = "xyes"; then
568 AC_CHECK_DECL([CAP_IS_SUPPORTED],
569 [have_capability="yes"],
570 [have_capability="no (CAP_IS_SUPPORTED not found)"],
571 [[#include <sys/capability.h>]]
575 if test "x$have_capability" = "xyes"; then
576 AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
580 have_linux_raid_md_u_h="no"
581 have_linux_wireless_h="no"
584 AM_CONDITIONAL([BUILD_WITH_CAPABILITY], [test "x$have_capability" = "xyes"])
586 # For the swap module
587 have_sys_swap_h="yes"
588 AC_CHECK_HEADERS([sys/swap.h vm/anon.h],
590 [have_sys_swap_h="no"],
592 #undef _FILE_OFFSET_BITS
593 #undef _LARGEFILE64_SOURCE
595 # include <sys/types.h>
598 # include <sys/param.h>
604 # For the processes plugin
606 AC_CHECK_HEADERS([sys/loadavg.h linux/config.h utmp.h utmpx.h])
609 AC_CHECK_HEADERS([sys/ucred.h], [], [],
612 # include <sys/types.h>
615 # include <sys/param.h>
620 # For mount interface
621 AC_CHECK_HEADERS([sys/mount.h], [], [],
624 # include <sys/types.h>
627 # include <sys/param.h>
634 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
639 if test "x$enable_xfs" != "xno"; then
640 AC_CHECK_HEADERS([xfs/xqm.h],
643 if test "x$enable_xfs" = "xyes"; then
644 AC_MSG_ERROR([xfs/xqm.h not found])
647 [[#define _GNU_SOURCE]]
654 AC_CHECK_HEADERS([arpa/nameser.h])
655 AC_CHECK_HEADERS([arpa/nameser_compat.h], [], [],
657 #if HAVE_ARPA_NAMESER_H
658 # include <arpa/nameser.h>
663 AC_CHECK_HEADERS([net/if_arp.h], [], [],
665 #if HAVE_SYS_SOCKET_H
666 # include <sys/socket.h>
671 AC_CHECK_HEADERS([net/ppp_defs.h])
672 AC_CHECK_HEADERS([net/if_ppp.h], [], [],
674 #if HAVE_NET_PPP_DEFS_H
675 # include <net/ppp_defs.h>
680 AC_CHECK_HEADERS([netinet/if_ether.h], [], [],
684 # include <sys/types.h>
686 #if HAVE_SYS_SOCKET_H
687 # include <sys/socket.h>
692 #if HAVE_NETINET_IN_H
693 # include <netinet/in.h>
698 AC_CHECK_HEADERS([net/pfvar.h],
699 [have_net_pfvar_h="yes"],
700 [have_net_pfvar_h="no"],
703 # include <sys/ioctl.h>
705 #if HAVE_SYS_SOCKET_H
706 # include <sys/socket.h>
711 #if HAVE_NETINET_IN_H
712 # include <netinet/in.h>
717 # For the multimeter plugin
718 AC_CHECK_HEADERS([termios.h],
719 [have_termios_h="yes"],
720 [have_termios_h="no"]
723 # For cpusleep plugin
724 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
725 [c_cv_have_clock_boottime_monotonic],
729 [[#include <time.h>]],
731 struct timespec b, m;
732 clock_gettime(CLOCK_BOOTTIME, &b );
733 clock_gettime(CLOCK_MONOTONIC, &m );
737 [c_cv_have_clock_boottime_monotonic="yes"],
738 [c_cv_have_clock_boottime_monotonic="no"]
745 # Checks for typedefs, structures, and compiler characteristics.
756 [AC_LANG_SOURCE([[int main(void){}]]) ]
758 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
766 # Checks for library functions.
768 AC_CHECK_FUNCS_ONCE([ \
794 SAVE_CFLAGS="$CFLAGS"
795 # Emulate behavior of src/Makefile.am
796 if test "x$GCC" = "xyes"; then
797 CFLAGS="$CFLAGS -Wall -Werror"
800 AC_CACHE_CHECK([for strtok_r],
801 [c_cv_have_strtok_r_default],
812 char buffer[] = "foo,bar,baz";
819 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
822 printf ("token = %s;\n", token);
827 [c_cv_have_strtok_r_default="yes"],
828 [c_cv_have_strtok_r_default="no"]
833 if test "x$c_cv_have_strtok_r_default" = "xno"; then
834 CFLAGS="$CFLAGS -D_REENTRANT=1"
836 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
837 [c_cv_have_strtok_r_reentrant],
848 char buffer[] = "foo,bar,baz";
855 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
858 printf ("token = %s;\n", token);
863 [c_cv_have_strtok_r_reentrant="yes"],
864 [AC_MSG_FAILURE([strtok_r is not available. Please file a bugreport!])]
870 CFLAGS="$SAVE_CFLAGS"
871 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"; then
872 CFLAGS="$CFLAGS -D_REENTRANT=1"
875 AC_CHECK_FUNCS([socket],
878 AC_CHECK_LIB([socket], [socket],
879 [socket_needs_socket="yes"],
880 [AC_MSG_ERROR([cannot find socket() in libsocket])]
884 AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
886 clock_gettime_needs_posix4="no"
887 AC_CHECK_FUNCS([clock_gettime],
888 [have_clock_gettime="yes"],
889 [have_clock_gettime="no"]
892 if test "x$have_clock_gettime" = "xno"; then
893 AC_CHECK_LIB([rt], [clock_gettime],
895 clock_gettime_needs_rt="yes"
896 have_clock_gettime="yes"
901 if test "x$have_clock_gettime" = "xno"; then
902 AC_CHECK_LIB([posix4], [clock_gettime],
904 clock_gettime_needs_posix4="yes"
905 have_clock_gettime="yes"
910 if test "x$have_clock_gettime" = "xyes"; then
911 AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if the clock_gettime(2) function is available.])
914 AC_CHECK_FUNCS([nanosleep], [],
915 AC_CHECK_LIB([rt], [nanosleep],
916 [nanosleep_needs_rt="yes"],
918 AC_CHECK_LIB([posix4], [nanosleep],
919 [nanosleep_needs_posix4="yes"],
920 [AC_MSG_ERROR([cannot find nanosleep])]
926 AM_CONDITIONAL([BUILD_WITH_LIBRT], [test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes"])
927 AM_CONDITIONAL([BUILD_WITH_LIBPOSIX4], [test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes"])
929 AC_CHECK_FUNCS([getifaddrs], [have_getifaddrs="yes"], [have_getifaddrs="no"])
930 AC_CHECK_FUNCS([getloadavg], [have_getloadavg="yes"], [have_getloadavg="no"])
931 AC_CHECK_FUNCS([getutent], [have_getutent="yes"], [have_getutent="no"])
932 AC_CHECK_FUNCS([getutxent], [have_getutxent="yes"], [have_getutxent="no"])
933 AC_CHECK_FUNCS([host_statistics], [have_host_statistics="yes"], [have_host_statistics="no"])
934 AC_CHECK_FUNCS([processor_info], [have_processor_info="yes"], [have_processor_info="no"])
935 AC_CHECK_FUNCS([statfs], [have_statfs="yes"], [have_statfs="no"])
936 AC_CHECK_FUNCS([statvfs], [have_statvfs="yes"], [have_statvfs="no"])
937 AC_CHECK_FUNCS([sysctl], [have_sysctl="yes"], [have_sysctl="no"])
938 AC_CHECK_FUNCS([sysctlbyname], [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
939 AC_CHECK_FUNCS([syslog], [have_syslog="yes"], [have_syslog="no"])
940 AC_CHECK_FUNCS([thread_info], [have_thread_info="yes"], [have_thread_info="no"])
942 # Check for strptime {{{
943 if test "x$GCC" = "xyes"; then
944 SAVE_CFLAGS="$CFLAGS"
945 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
948 AC_CHECK_FUNCS([strptime], [have_strptime="yes"], [have_strptime="no"])
949 if test "x$have_strptime" = "xyes"; then
950 AC_CACHE_CHECK([whether strptime is exported by default],
951 [c_cv_have_strptime_default],
956 [[#include <time.h>]],
959 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
963 [c_cv_have_strptime_default="yes"],
964 [c_cv_have_strptime_default="no"])
969 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"; then
970 AC_CACHE_CHECK([whether strptime needs standards mode],
971 [c_cv_have_strptime_standards],
977 #ifndef _ISOC99_SOURCE
978 # define _ISOC99_SOURCE 1
980 #ifndef _POSIX_C_SOURCE
981 # define _POSIX_C_SOURCE 200112L
983 #ifndef _XOPEN_SOURCE
984 # define _XOPEN_SOURCE 500
990 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
994 [c_cv_have_strptime_standards="yes"],
995 [c_cv_have_strptime_standards="no"]
1000 if test "x$c_cv_have_strptime_standards" = "xyes"; then
1001 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], [1],
1002 [Set to true if strptime is only exported in X/Open mode (GNU libc).]
1009 if test "x$GCC" = "xyes"; then
1010 CFLAGS="$SAVE_CFLAGS"
1012 # }}} Check for strptime
1014 # Check for timegm {{{
1016 # These checks need -Werror because implicit function declarations are only a
1018 SAVE_CFLAGS="$CFLAGS"
1019 CFLAGS="$CFLAGS -Werror"
1021 AC_CACHE_CHECK([for timegm],
1026 #if STRPTIME_NEEDS_STANDARDS
1027 # ifndef _ISOC99_SOURCE
1028 # define _ISOC99_SOURCE 1
1030 # ifndef _POSIX_C_SOURCE
1031 # define _POSIX_C_SOURCE 200112L
1033 # ifndef _XOPEN_SOURCE
1034 # define _XOPEN_SOURCE 500
1040 time_t t = timegm(&(struct tm){0});
1041 if (t == ((time_t) -1)) {
1046 [c_cv_have_timegm="yes"],
1047 [c_cv_have_timegm="no"]
1051 if test "x$c_cv_have_timegm" != "xyes"
1053 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1054 [c_cv_have_timegm_bsd],
1058 #if STRPTIME_NEEDS_STANDARDS
1059 # ifndef _ISOC99_SOURCE
1060 # define _ISOC99_SOURCE 1
1062 # ifndef _POSIX_C_SOURCE
1063 # define _POSIX_C_SOURCE 200112L
1065 # ifndef _XOPEN_SOURCE
1066 # define _XOPEN_SOURCE 500
1070 # define _BSD_SOURCE 1
1075 time_t t = timegm(&(struct tm){0});
1076 if (t == ((time_t) -1)) {
1081 [c_cv_have_timegm_bsd="yes"
1082 c_cv_have_timegm="yes"],
1083 [c_cv_have_timegm_bsd="no"]
1088 if test "x$c_cv_have_timegm" = "xyes"
1090 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1091 if test "x$c_cv_have_timegm_bsd" = "xyes"
1093 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1097 CFLAGS="$SAVE_CFLAGS"
1098 # }}} Check for timegm
1100 AC_MSG_CHECKING([for sysctl kern.cp_times])
1101 if test -x /sbin/sysctl; then
1102 /sbin/sysctl kern.cp_times >/dev/null 2>&1
1103 if test $? -eq 0; then
1104 AC_MSG_RESULT([yes])
1105 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIMES], [1], [Define if sysctl supports kern.cp_times])
1113 AC_MSG_CHECKING([for sysctl kern.cp_time])
1114 if test -x /sbin/sysctl; then
1115 /sbin/sysctl kern.cp_time >/dev/null 2>&1
1118 AC_MSG_RESULT([yes])
1119 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIME], [1], [Define if sysctl supports kern.cp_time])
1127 AC_CHECK_FUNCS([swapctl], [have_swapctl="yes"], [have_swapctl="no"])
1128 if test "x$have_swapctl" = "xyes"; then
1129 AC_CACHE_CHECK([whether swapctl takes two arguments],
1130 [c_cv_have_swapctl_two_args],
1136 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1137 # undef _FILE_OFFSET_BITS
1138 # undef _LARGEFILE64_SOURCE
1140 #include <sys/stat.h>
1141 #include <sys/param.h>
1142 #include <sys/swap.h>
1145 [[int num = swapctl(0, NULL);]]
1148 [c_cv_have_swapctl_two_args="yes"],
1149 [c_cv_have_swapctl_two_args="no"]
1154 AC_CACHE_CHECK([whether swapctl takes three arguments],
1155 [c_cv_have_swapctl_three_args],
1161 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1162 # undef _FILE_OFFSET_BITS
1163 # undef _LARGEFILE64_SOURCE
1165 #include <sys/stat.h>
1166 #include <sys/param.h>
1167 #include <sys/swap.h>
1170 [[int num = swapctl(0, NULL, 0);]]
1173 [c_cv_have_swapctl_three_args="yes"],
1174 [c_cv_have_swapctl_three_args="no"]
1180 # Check for different versions of `swapctl' here..
1181 if test "x$have_swapctl" = "xyes"; then
1182 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1183 AC_DEFINE([HAVE_SWAPCTL_TWO_ARGS], [1], [Define if the function swapctl exists and takes two arguments.])
1186 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1187 AC_DEFINE([HAVE_SWAPCTL_THREE_ARGS], [1], [Define if the function swapctl exists and takes three arguments.])
1192 AC_ARG_WITH([nan-emulation],
1193 [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1195 if test "x$withval" = "xno"; then
1197 else if test "x$withval" = "xyes"; then
1206 if test "x$nan_type" = "xnone"; then
1207 AC_CACHE_CHECK([whether NAN is defined by default],
1208 [c_cv_have_nan_default],
1216 static double foo = NAN;
1225 [c_cv_have_nan_default="yes"],
1226 [c_cv_have_nan_default="no"]
1232 if test "x$c_cv_have_nan_default" = "xyes"; then
1236 if test "x$nan_type" = "xnone"; then
1237 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1238 [c_cv_have_nan_isoc],
1245 #define __USE_ISOC99 1
1247 static double foo = NAN;
1256 [c_cv_have_nan_isoc="yes"],
1257 [c_cv_have_nan_isoc="no"]
1263 if test "x$c_cv_have_nan_isoc" = "xyes"; then
1267 if test "x$nan_type" = "xnone"; then
1268 SAVE_LDFLAGS="$LDFLAGS"
1269 LDFLAGS="$LDFLAGS -lm"
1270 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1271 [c_cv_have_nan_zero],
1282 #define NAN (0.0 / 0.0)
1284 # define isnan(f) ((f) != (f))
1286 static double foo = NAN;
1295 [c_cv_have_nan_zero="yes"],
1296 [c_cv_have_nan_zero="no"]
1300 LDFLAGS=$SAVE_LDFLAGS
1303 if test "x$c_cv_have_nan_zero" = "xyes"; then
1307 if test "x$nan_type" = "xdefault"; then
1308 AC_DEFINE([NAN_STATIC_DEFAULT], [1],
1309 [Define if NAN is defined by default and can initialize static variables.]
1311 else if test "x$nan_type" = "xisoc99"; then
1312 AC_DEFINE([NAN_STATIC_ISOC], [1],
1313 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]
1315 else if test "x$nan_type" = "xzero"; then
1316 AC_DEFINE([NAN_ZERO_ZERO], [1],
1317 [Define if NAN can be defined as (0.0 / 0.0)]
1320 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1323 AC_ARG_WITH([fp-layout],
1325 AS_HELP_STRING([--with-fp-layout],
1326 [set the memory layout of doubles. For crosscompiling only.]
1330 if test "x$withval" = "xnothing"; then
1331 fp_layout_type="nothing"
1332 else if test "x$withval" = "xendianflip"; then
1333 fp_layout_type="endianflip"
1334 else if test "x$withval" = "xintswap"; then
1335 fp_layout_type="intswap"
1337 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1340 [fp_layout_type="unknown"]
1343 if test "x$fp_layout_type" = "xunknown"; then
1344 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1345 [c_cv_fp_layout_need_nothing],
1355 #include <inttypes.h>
1356 #include <stdbool.h>
1365 memcpy ((void *) &i0, (void *) &d, 8);
1368 memcpy ((void *) c, (void *) &i1, 8);
1370 if ((c[0] == 0x2f) && (c[1] == 0x25)
1371 && (c[2] == 0xc0) && (c[3] == 0xc7)
1372 && (c[4] == 0x43) && (c[5] == 0x2b)
1373 && (c[6] == 0x1f) && (c[7] == 0x5b))
1379 [c_cv_fp_layout_need_nothing="yes"],
1380 [c_cv_fp_layout_need_nothing="no"]
1386 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1387 fp_layout_type="nothing"
1390 if test "x$fp_layout_type" = "xunknown"; then
1391 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1392 [c_cv_fp_layout_need_endianflip],
1402 #include <inttypes.h>
1403 #include <stdbool.h>
1404 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1405 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1406 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1407 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1408 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1409 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1410 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1411 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1420 memcpy ((void *) &i0, (void *) &d, 8);
1422 i1 = endianflip (i0);
1423 memcpy ((void *) c, (void *) &i1, 8);
1425 if ((c[0] == 0x2f) && (c[1] == 0x25)
1426 && (c[2] == 0xc0) && (c[3] == 0xc7)
1427 && (c[4] == 0x43) && (c[5] == 0x2b)
1428 && (c[6] == 0x1f) && (c[7] == 0x5b))
1434 [c_cv_fp_layout_need_endianflip="yes"],
1435 [c_cv_fp_layout_need_endianflip="no"]
1441 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1442 fp_layout_type="endianflip"
1445 if test "x$fp_layout_type" = "xunknown"; then
1446 AC_CACHE_CHECK([if intswap converts to x86 representation],
1447 [c_cv_fp_layout_need_intswap],
1457 #include <inttypes.h>
1458 #include <stdbool.h>
1459 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1460 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1469 memcpy ((void *) &i0, (void *) &d, 8);
1472 memcpy ((void *) c, (void *) &i1, 8);
1474 if ((c[0] == 0x2f) && (c[1] == 0x25)
1475 && (c[2] == 0xc0) && (c[3] == 0xc7)
1476 && (c[4] == 0x43) && (c[5] == 0x2b)
1477 && (c[6] == 0x1f) && (c[7] == 0x5b))
1483 [c_cv_fp_layout_need_intswap="yes"],
1484 [c_cv_fp_layout_need_intswap="no"]
1490 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1491 fp_layout_type="intswap"
1494 if test "x$fp_layout_type" = "xnothing"; then
1495 AC_DEFINE([FP_LAYOUT_NEED_NOTHING], [1],
1496 [Define if doubles are stored in x86 representation.]
1498 else if test "x$fp_layout_type" = "xendianflip"; then
1499 AC_DEFINE([FP_LAYOUT_NEED_ENDIANFLIP], [1],
1500 [Define if endianflip is needed to convert to x86 representation.]
1502 else if test "x$fp_layout_type" = "xintswap"; then
1503 AC_DEFINE([FP_LAYOUT_NEED_INTSWAP], [1],
1504 [Define if intswap is needed to convert to x86 representation.]
1507 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1510 # For cpusleep plugin
1511 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
1512 [c_cv_have_clock_boottime_monotonic],
1516 [[#include <time.h>]],
1518 struct timespec b, m;
1519 clock_gettime(CLOCK_BOOTTIME, &b );
1520 clock_gettime(CLOCK_MONOTONIC, &m );
1524 [c_cv_have_clock_boottime_monotonic="yes"],
1525 [c_cv_have_clock_boottime_monotonic="no"]
1530 # --with-useragent {{{
1531 AC_ARG_WITH([useragent],
1532 [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1534 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
1535 AC_DEFINE_UNQUOTED([COLLECTD_USERAGENT], ["$withval"], [User agent for http requests])
1542 # --with-data-max-name-len {{{
1543 AC_ARG_WITH([data-max-name-len],
1544 [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1546 if test "x$withval" != "x" && test $withval -gt 0; then
1547 AC_DEFINE_UNQUOTED([DATA_MAX_NAME_LEN], [$withval], [Maximum length of data buffers])
1549 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1552 [AC_DEFINE([DATA_MAX_NAME_LEN], [128], [Maximum length of data buffers])]
1556 AC_CHECK_FUNCS([getfsstat], [have_getfsstat="yes"], [have_getfsstat="no"])
1557 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"], [have_getvfsstat="no"])
1558 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"], [have_listmntent="no"])
1559 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"], [have_getmntent_r="no"])
1561 AC_CHECK_FUNCS(getmntent, [have_getmntent="libc"], [have_getmntent="no"])
1562 if test "x$have_getmntent" = "xno"; then
1563 AC_CHECK_LIB([sun], [getmntent],
1564 [have_getmntent="sun"],
1565 [have_gemntent="no"]
1569 if test "x$have_getmntent" = "xno"; then
1570 AC_CHECK_LIB([seq], [getmntent],
1571 [have_getmntent="seq"],
1572 [have_getmntent="no"]
1576 if test "x$have_getmntent" = "xno"; then
1577 AC_CHECK_LIB([gen], [getmntent],
1578 [have_getmntent="gen"],
1579 [have_getmntent="no"]
1583 if test "x$have_getmntent" = "xlibc"; then
1584 AC_CACHE_CHECK([whether getmntent takes one argument],
1585 [c_cv_have_one_getmntent],
1590 [[#include "$srcdir/src/utils_mount.h"]],
1594 fh = setmntent ("/etc/mtab", "r");
1595 me = getmntent (fh);
1596 return(me->mnt_passno);
1600 [c_cv_have_one_getmntent="yes"],
1601 [c_cv_have_one_getmntent="no"]
1606 AC_CACHE_CHECK([whether getmntent takes two arguments],
1607 [c_cv_have_two_getmntent],
1612 [[#include "$srcdir/src/utils_mount.h"]],
1617 fh = fopen ("/etc/mnttab", "r");
1618 status = getmntent (fh, &mt);
1623 [c_cv_have_two_getmntent="yes"],
1624 [c_cv_have_two_getmntent="no"]
1630 # Check for different versions of `getmntent' here..
1632 if test "x$have_getmntent" = "xlibc"; then
1633 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1634 AC_DEFINE([HAVE_ONE_GETMNTENT], [1],
1635 [Define if the function getmntent exists and takes one argument.]
1639 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1640 AC_DEFINE([HAVE_TWO_GETMNTENT], [1],
1641 [Define if the function getmntent exists and takes two arguments.]
1646 if test "x$have_getmntent" = "xsun"; then
1647 AC_DEFINE([HAVE_SUN_GETMNTENT], [1],
1648 [Define if the function getmntent exists. It is the version from libsun.]
1652 if test "x$have_getmntent" = "xgen"; then
1653 AC_DEFINE([HAVE_GEN_GETMNTENT], [1],
1654 [Define if the function getmntent exists. It is the version from libgen.]
1659 AC_CACHE_CHECK([whether htonll is defined],
1666 #include <inttypes.h>
1667 #include <sys/types.h>
1668 #include <netinet/in.h>
1670 [[return htonll(0);]]
1673 [c_cv_have_htonll="yes"],
1674 [c_cv_have_htonll="no"]
1679 if test "x$c_cv_have_htonll" = "xyes"; then
1680 AC_DEFINE([HAVE_HTONLL], [1], [Define if the function htonll exists.])
1683 # Check for structures
1684 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1685 [AC_DEFINE([HAVE_STRUCT_IF_DATA], [1], [Define if struct if_data exists and is usable.])],
1688 #include <sys/types.h>
1689 #include <sys/socket.h>
1694 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1695 [AC_DEFINE([HAVE_STRUCT_NET_DEVICE_STATS], [1], [Define if struct net_device_stats exists and is usable.])],
1698 #include <sys/types.h>
1699 #include <sys/socket.h>
1700 #include <linux/if.h>
1701 #include <linux/netdevice.h>
1705 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1706 [AC_DEFINE([HAVE_STRUCT_LINUX_INET_DIAG_REQ], [1], [Define if struct inet_diag_req exists and is usable.])],
1708 [[#include <linux/inet_diag.h>]]
1711 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1714 #include <netinet/in.h>
1719 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1721 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_FREEBSD], [1], [Define if struct kinfo_proc exists in the FreeBSD variant.])
1722 have_struct_kinfo_proc_freebsd="yes"
1727 #include <sys/param.h>
1728 #include <sys/sysctl.h>
1729 #include <sys/user.h>
1733 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1735 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_OPENBSD], [1], [Define if struct kinfo_proc exists in the OpenBSD variant.])
1736 have_struct_kinfo_proc_openbsd="yes"
1740 #include <sys/param.h>
1741 #include <sys/sysctl.h>
1746 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1748 AC_DEFINE([HAVE_STRUCT_KINFO_PROC2_NETBSD], [1], [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1749 have_struct_kinfo_proc2_netbsd="yes"
1753 #include <sys/param.h>
1754 #include <sys/sysctl.h>
1759 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport],
1764 #define _DEFAULT_SOURCE
1766 #if HAVE_SYS_TYPES_H
1767 # include <sys/types.h>
1769 #if HAVE_NETINET_IN_SYSTM_H
1770 # include <netinet/in_systm.h>
1772 #if HAVE_NETINET_IN_H
1773 # include <netinet/in.h>
1775 #if HAVE_NETINET_IP_H
1776 # include <netinet/ip.h>
1778 #if HAVE_NETINET_UDP_H
1779 # include <netinet/udp.h>
1784 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source],
1789 #define _DEFAULT_SOURCE
1791 #if HAVE_SYS_TYPES_H
1792 # include <sys/types.h>
1794 #if HAVE_NETINET_IN_SYSTM_H
1795 # include <netinet/in_systm.h>
1797 #if HAVE_NETINET_IN_H
1798 # include <netinet/in.h>
1800 #if HAVE_NETINET_IP_H
1801 # include <netinet/ip.h>
1803 #if HAVE_NETINET_UDP_H
1804 # include <netinet/udp.h>
1809 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1812 [[# include <kstat.h>]]
1815 # check for pthread_setname_np
1816 SAVE_LDFLAGS="$LDFLAGS"
1817 LDFLAGS="$LDFLAGS -lpthread"
1819 AC_MSG_CHECKING([for pthread_setname_np])
1820 have_pthread_setname_np="no"
1826 #include <pthread.h>
1828 [[pthread_setname_np((pthread_t) {0}, "conftest");]]
1832 have_pthread_setname_np="yes"
1833 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1837 AC_MSG_RESULT([$have_pthread_setname_np])
1839 # check for pthread_set_name_np(3) (FreeBSD)
1840 AC_MSG_CHECKING([for pthread_set_name_np])
1841 have_pthread_set_name_np="no"
1845 [[#include <pthread_np.h>]],
1846 [[pthread_set_name_np((pthread_t) {0}, "conftest");]]
1850 have_pthread_set_name_np="yes"
1851 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1854 AC_MSG_RESULT([$have_pthread_set_name_np])
1856 LDFLAGS="$SAVE_LDFLAGS"
1858 AC_CHECK_TYPES([struct ip6_ext],
1859 [have_ip6_ext="yes"],
1860 [have_ip6_ext="no"],
1863 #if HAVE_SYS_TYPES_H
1864 # include <sys/types.h>
1866 #if HAVE_NETINET_IN_SYSTM_H
1867 # include <netinet/in_systm.h>
1869 #if HAVE_NETINET_IN_H
1870 # include <netinet/in.h>
1872 #if HAVE_NETINET_IP6_H
1873 # include <netinet/ip6.h>
1878 if test "x$have_ip6_ext" = "xno"; then
1879 SAVE_CFLAGS="$CFLAGS"
1880 CFLAGS="$CFLAGS -DSOLARIS2=8"
1881 AC_CHECK_TYPES([struct ip6_ext],
1882 [have_ip6_ext="yes, with -DSOLARIS2=8"],
1883 [have_ip6_ext="no"],
1886 #if HAVE_SYS_TYPES_H
1887 # include <sys/types.h>
1889 #if HAVE_NETINET_IN_SYSTM_H
1890 # include <netinet/in_systm.h>
1892 #if HAVE_NETINET_IN_H
1893 # include <netinet/in.h>
1895 #if HAVE_NETINET_IP6_H
1896 # include <netinet/ip6.h>
1900 if test "x$have_ip6_ext" = "xno"; then
1901 CFLAGS="$SAVE_CFLAGS"
1906 if test "x$ac_system" = "xLinux"; then
1907 AC_CHECK_DECL([i2c_smbus_read_i2c_block_data],
1908 [with_libi2c="yes"],
1909 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
1912 #include <linux/i2c-dev.h>
1916 with_libi2c="no (Linux only)"
1920 # Checks for libraries begin here
1923 # Check for libpthread
1925 AC_CHECK_LIB([pthread],
1928 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread])],
1931 PTHREAD_LIBS="$LIBS"
1933 AC_SUBST([PTHREAD_LIBS])
1935 AC_CHECK_HEADERS([pthread.h],
1937 [AC_MSG_ERROR([pthread.h not found])]
1940 m4_divert_once([HELP_WITH], [
1941 Collectd additional packages:])
1943 if test "x$ac_system" = "xAIX"; then
1947 with_perfstat="no (AIX only)"
1948 with_procinfo="no (AIX only)"
1951 if test "x$with_perfstat" = "xyes"; then
1952 AC_CHECK_LIB([perfstat], [perfstat_reset],
1953 [with_perfstat="yes"],
1954 [with_perfstat="no (perfstat not found)"]
1958 if test "x$with_perfstat" = "xyes"; then
1959 AC_DEFINE([HAVE_PERFSTAT], [1], [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1960 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1961 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled],
1964 [[#include <libperfstat.h]]
1966 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"; then
1967 AC_DEFINE([PERFSTAT_SUPPORTS_DONATION], [1], [Define to 1 if your version of the 'perfstat' library supports donation])
1970 AM_CONDITIONAL([BUILD_WITH_PERFSTAT], [test "x$with_perfstat" = "xyes"])
1972 # Processes plugin under AIX.
1973 if test "x$with_procinfo" = "xyes"; then
1974 AC_CHECK_HEADERS([procinfo.h],
1975 [AC_DEFINE([HAVE_PROCINFO_H], [1], [Define to 1 if you have the procinfo.h])],
1976 [with_procinfo="no (procinfo.h not found)"]
1980 if test "x$ac_system" = "xSolaris"; then
1984 with_kstat="no (Solaris only)"
1985 with_devinfo="no (Solaris only)"
1988 if test "x$with_kstat" = "xyes"; then
1989 AC_CHECK_LIB([kstat], [kstat_open],
1991 [with_kstat="no (libkstat not found)"]
1995 if test "x$with_kstat" = "xyes"; then
1996 AC_CHECK_LIB([devinfo], [di_init],
1997 [with_devinfo="yes"],
1998 [with_devinfo="no (not found)"]
2000 AC_CHECK_HEADERS([kstat.h],
2001 [AC_DEFINE(HAVE_LIBKSTAT, [1], [Define to 1 if you have the 'kstat' library (-lkstat)])],
2002 [with_kstat="no (kstat.h not found)"]
2006 AM_CONDITIONAL([BUILD_WITH_LIBDEVINFO], [test "x$with_devinfo" = "xyes"])
2007 AM_CONDITIONAL([BUILD_WITH_LIBKSTAT], [test "x$with_kstat" = "xyes"])
2009 if test "x$ac_system" = "xDarwin"; then
2014 AM_CONDITIONAL([BUILD_WITH_LIBIOKIT], [test "x$with_libiokit" = "xyes"])
2017 AC_CHECK_LIB([kvm], [kvm_getprocs],
2018 [with_kvm_getprocs="yes"],
2019 [with_kvm_getprocs="no"]
2022 if test "x$with_kvm_getprocs" = "xyes"; then
2023 AC_DEFINE([HAVE_LIBKVM_GETPROCS], [1],
2024 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)]
2029 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETPROCS], [test "x$with_kvm_getprocs" = "xyes"])
2031 AC_CHECK_LIB([kvm], [kvm_getswapinfo],
2032 [with_kvm_getswapinfo="yes"],
2033 [with_kvm_getswapinfo="no"]
2036 if test "x$with_kvm_getswapinfo" = "xyes"; then
2037 AC_DEFINE([HAVE_LIBKVM_GETSWAPINFO], [1],
2038 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)]
2043 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETSWAPINFO], [test "x$with_kvm_getswapinfo" = "xyes"])
2045 AC_CHECK_LIB([kvm], [kvm_nlist],
2046 [with_kvm_nlist="yes"],
2047 [with_kvm_nlist="no"]
2050 if test "x$with_kvm_nlist" = "xyes"; then
2051 AC_CHECK_HEADERS([bsd/nlist.h nlist.h])
2052 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2053 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)]
2058 AM_CONDITIONAL([BUILD_WITH_LIBKVM_NLIST], [test "x$with_kvm_nlist" = "xyes"])
2060 AC_CHECK_LIB([kvm], [kvm_openfiles],
2061 [with_kvm_openfiles="yes"],
2062 [with_kvm_openfiles="no"]
2065 if test "x$with_kvm_openfiles" = "xyes"; then
2066 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2067 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)]
2072 # --with-libaquaero5 {{{
2073 AC_ARG_WITH([libaquaero5],
2074 [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
2076 if test "x$withval" = "xyes"; then
2077 with_libaquaero5="yes"
2078 else if test "x$withval" = "xno"; then
2079 with_libaquaero5="no"
2081 with_libaquaero5="yes"
2082 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
2083 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
2086 [with_libaquaero5="yes"]
2089 SAVE_CPPFLAGS="$CPPFLAGS"
2090 SAVE_LDFLAGS="$LDFLAGS"
2091 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
2092 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
2094 if test "x$with_libaquaero5" = "xyes"; then
2095 if test "x$LIBAQUAERO5_CFLAGS" != "x"; then
2096 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
2098 AC_CHECK_HEADERS([libaquaero5.h],
2099 [with_libaquaero5="yes"],
2100 [with_libaquaero5="no (libaquaero5.h not found)"]
2104 if test "x$with_libaquaero5" = "xyes"; then
2105 if test "x$LIBAQUAERO5_LDFLAGS" != "x"; then
2106 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
2108 AC_CHECK_LIB([aquaero5], libaquaero5_poll,
2109 [with_libaquaero5="yes"],
2110 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"]
2114 CPPFLAGS="$SAVE_CPPFLAGS"
2115 LDFLAGS="$SAVE_LDFLAGS"
2117 if test "x$with_libaquaero5" = "xyes"; then
2118 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2119 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2121 AC_SUBST([BUILD_WITH_LIBAQUAERO5_CFLAGS])
2122 AC_SUBST([BUILD_WITH_LIBAQUAERO5_LDFLAGS])
2125 # --with-libhiredis {{{
2126 AC_ARG_WITH([libhiredis],
2127 [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@], [Path to libhiredis.])],
2129 if test "x$withval" = "xyes"; then
2130 with_libhiredis="yes"
2131 else if test "x$withval" = "xno"; then
2132 with_libhiredis="no"
2134 with_libhiredis="yes"
2135 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2136 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2139 [with_libhiredis="yes"]
2142 SAVE_CPPFLAGS="$CPPFLAGS"
2143 SAVE_LDFLAGS="$LDFLAGS"
2144 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2145 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2147 if test "x$with_libhiredis" = "xyes"; then
2148 if test "x$LIBHIREDIS_CPPFLAGS" != "x"; then
2149 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
2151 AC_CHECK_HEADERS([hiredis/hiredis.h],
2152 [with_libhiredis="yes"],
2153 [with_libhiredis="no (hiredis.h not found)"]
2157 if test "x$with_libhiredis" = "xyes"; then
2158 if test "x$LIBHIREDIS_LDFLAGS" != "x"; then
2159 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
2161 AC_CHECK_LIB([hiredis], [redisCommand],
2162 [with_libhiredis="yes"],
2163 [with_libhiredis="no (symbol 'redisCommand' not found)"]
2167 CPPFLAGS="$SAVE_CPPFLAGS"
2168 LDFLAGS="$SAVE_LDFLAGS"
2170 if test "x$with_libhiredis" = "xyes"; then
2171 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2172 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2175 AC_SUBST([BUILD_WITH_LIBHIREDIS_CPPFLAGS])
2176 AC_SUBST([BUILD_WITH_LIBHIREDIS_LDFLAGS])
2179 # --with-libcurl {{{
2180 with_curl_config="curl-config"
2183 AC_ARG_WITH(libcurl,
2184 [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2186 if test "x$withval" = "xno"; then
2188 else if test "x$withval" = "xyes"; then
2191 if test -f "$withval" && test -x "$withval"; then
2192 with_curl_config="$withval"
2194 else if test -x "$withval/bin/curl-config"; then
2195 with_curl_config="$withval/bin/curl-config"
2201 [with_libcurl="yes"]
2204 if test "x$with_libcurl" = "xyes"; then
2205 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2206 curl_config_status=$?
2208 if test $curl_config_status -ne 0; then
2209 with_libcurl="no ($with_curl_config failed)"
2211 SAVE_CPPFLAGS="$CPPFLAGS"
2212 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2214 AC_CHECK_HEADERS([curl/curl.h],
2215 [with_libcurl="yes"],
2216 [with_libcurl="no (curl/curl.h not found)"]
2219 CPPFLAGS="$SAVE_CPPFLAGS"
2223 if test "x$with_libcurl" = "xyes"; then
2224 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2225 curl_config_status=$?
2227 if test $curl_config_status -ne 0; then
2228 with_libcurl="no ($with_curl_config failed)"
2230 AC_CHECK_LIB([curl], [curl_easy_init],
2231 [with_libcurl="yes"],
2232 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2236 AC_CHECK_DECL([CURLOPT_USERNAME],
2237 [have_curlopt_username="yes"],
2238 [have_curlopt_username="no"],
2239 [[#include <curl/curl.h>]]
2242 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2243 [have_curlopt_timeout="yes"],
2244 [have_curlopt_timeout="no"],
2245 [[#include <curl/curl.h>]]
2250 if test "x$with_libcurl" = "xyes"; then
2251 SAVE_CPPFLAGS="$CPPFLAGS"
2252 SAVE_LDFLAGS="$LDFLAGS"
2253 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2254 LDFLAGS="$LDFLAGS $with_curl_libs"
2255 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2256 [c_cv_have_curlinfo_appconnect_time],
2261 [[#include <curl/curl.h>]],
2263 int val = CURLINFO_APPCONNECT_TIME;
2268 [c_cv_have_curlinfo_appconnect_time="yes"],
2269 [c_cv_have_curlinfo_appconnect_time="no"]
2273 CPPFLAGS="$SAVE_CPPFLAGS"
2274 LDFLAGS="$SAVE_LDFLAGS"
2277 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"; then
2278 AC_DEFINE([HAVE_CURLINFO_APPCONNECT_TIME], [1],
2279 [Define if curl.h defines CURLINFO_APPCONNECT_TIME.]
2283 if test "x$with_libcurl" = "xyes"; then
2284 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2285 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2287 if test "x$have_curlopt_username" = "xyes"; then
2288 AC_DEFINE([HAVE_CURLOPT_USERNAME], [1],
2289 [Define if libcurl supports CURLOPT_USERNAME option.]
2293 if test "x$have_curlopt_timeout" = "xyes"; then
2294 AC_DEFINE([HAVE_CURLOPT_TIMEOUT_MS], [1],
2295 [Define if libcurl supports CURLOPT_TIMEOUT_MS option.]
2300 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2301 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2305 AC_ARG_WITH([libdbi],
2306 [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2308 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2309 with_libdbi_cppflags="-I$withval/include"
2310 with_libdbi_ldflags="-L$withval/lib"
2313 with_libdbi="$withval"
2319 if test "x$with_libdbi" = "xyes"; then
2320 SAVE_CPPFLAGS="$CPPFLAGS"
2321 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2323 AC_CHECK_HEADERS([dbi/dbi.h],
2324 [with_libdbi="yes"],
2325 [with_libdbi="no (dbi/dbi.h not found)"]
2328 CPPFLAGS="$SAVE_CPPFLAGS"
2331 if test "x$with_libdbi" = "xyes"; then
2332 SAVE_LDFLAGS="$LDFLAGS"
2333 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2335 AC_CHECK_LIB([dbi], [dbi_initialize],
2336 [with_libdbi="yes"],
2337 [with_libdbi="no (Symbol 'dbi_initialize' not found)"]
2340 LDFLAGS="$SAVE_LDFLAGS"
2343 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2344 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2345 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2346 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2347 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2348 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2351 # --with-libdpdk {{{
2352 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2353 AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
2354 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2355 AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
2357 AC_ARG_WITH([libdpdk],
2358 [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
2359 [with_libdpdk="$withval"],
2360 [with_libdpdk="yes"]
2363 if test "x$with_libdpdk" != "xno"; then
2364 PKG_CHECK_MODULES([DPDK], [libdpdk], [],
2365 [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
2366 if test "x$LIBDPDK_CPPFLAGS" = "x"; then
2367 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2369 if test "x$LIBDPDK_CFLAGS" = "x"; then
2370 LIBDPDK_CFLAGS="$DPDK_CFLAGS"
2371 LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
2373 if test "x$LIBDPDK_LIBS" = "x"; then
2374 if test "x$DPDK_LIBS" != "x"; then
2375 LIBDPDK_LIBS="$DPDK_LIBS"
2377 LIBDPDK_LIBS="-ldpdk"
2380 SAVE_CPPFLAGS="$CPPFLAGS"
2381 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2382 SAVE_CFLAGS="$CFLAGS"
2383 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2384 AC_CHECK_HEADERS([rte_config.h],
2391 #include <rte_version.h>
2392 #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
2393 #error "required DPDK >= 16.07"
2398 [dpdk_keepalive="yes"],
2399 [dpdk_keepalive="no (DPDK version < 16.07)"]
2402 [with_libdpdk="no (rte_config.h not found)"]
2404 CPPFLAGS="$SAVE_CPPFLAGS"
2405 CFLAGS="$SAVE_CFLAGS"
2408 if test "x$with_libdpdk" = "xyes"; then
2409 SAVE_LDFLAGS="$LDFLAGS"
2410 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2411 AC_CHECK_LIB([dpdk], [rte_eal_init],
2412 [with_libdpdk="yes"],
2413 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2415 LDFLAGS="$SAVE_LDFLAGS"
2420 # --with-libesmtp {{{
2421 AC_ARG_WITH([libesmtp],
2422 [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2424 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2425 with_libesmtp_cppflags="-I$withval/include"
2426 with_libesmtp_ldflags="-L$withval/lib"
2429 with_libesmtp="$withval"
2432 [with_libesmtp="yes"]
2435 if test "x$with_libesmtp" = "xyes"; then
2436 SAVE_CPPFLAGS="$CPPFLAGS"
2437 CPPFLAGS="$CPPFLAGS $with_libesmtp_cppflags"
2439 AC_CHECK_HEADERS([libesmtp.h],
2440 [with_libesmtp="yes"],
2441 [with_libesmtp="no (libesmtp.h not found)"]
2444 CPPFLAGS="$SAVE_CPPFLAGS"
2447 if test "x$with_libesmtp" = "xyes"; then
2448 SAVE_LDFLAGS="$LDFLAGS"
2449 LDFLAGS="$LDFLAGS $with_esmtp_ldflags"
2451 AC_CHECK_LIB([esmtp], [smtp_create_session],
2452 [with_libesmtp="yes"],
2453 [with_libesmtp="no (Symbol 'smtp_create_session' not found)"]
2456 LDFLAGS="$SAVE_LDFLAGS"
2459 BUILD_WITH_LIBESMTP_CPPFLAGS="$with_libesmtp_cppflags"
2460 BUILD_WITH_LIBESMTP_LDFLAGS="$with_libesmtp_ldflags"
2461 BUILD_WITH_LIBESMTP_LIBS="-lesmtp"
2462 AC_SUBST(BUILD_WITH_LIBESMTP_CPPFLAGS)
2463 AC_SUBST(BUILD_WITH_LIBESMTP_LDFLAGS)
2464 AC_SUBST(BUILD_WITH_LIBESMTP_LIBS)
2467 # --with-libganglia {{{
2468 AC_ARG_WITH([libganglia],
2469 [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2471 if test -f "$withval" && test -x "$withval"; then
2472 with_libganglia_config="$withval"
2473 with_libganglia="yes"
2474 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"; then
2475 with_libganglia_config="$withval/bin/ganglia-config"
2476 with_libganglia="yes"
2477 else if test -d "$withval"; then
2478 GANGLIA_CPPFLAGS="-I$withval/include"
2479 GANGLIA_LDFLAGS="-L$withval/lib"
2480 with_libganglia="yes"
2482 with_libganglia="$withval"
2485 [with_libganglia="yes"]
2488 if test "x$with_libganglia" = "xyes"; then
2489 if test "x$with_libganglia_config" != "x"; then
2490 if test "x$GANGLIA_CPPFLAGS" = "x"; then
2491 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2494 if test "x$GANGLIA_LDFLAGS" = "x"; then
2495 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2498 if test "x$GANGLIA_LIBS" = "x"; then
2499 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2502 GANGLIA_LIBS="-lganglia"
2506 SAVE_CPPFLAGS="$CPPFLAGS"
2507 SAVE_LDFLAGS="$LDFLAGS"
2508 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2509 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2511 if test "x$with_libganglia" = "xyes"; then
2512 AC_CHECK_HEADERS([gm_protocol.h],
2513 [with_libganglia="yes"],
2514 [with_libganglia="no (gm_protocol.h not found)"]
2518 if test "x$with_libganglia" = "xyes"; then
2519 AC_CHECK_LIB([ganglia], [xdr_Ganglia_value_msg],
2520 [with_libganglia="yes"],
2521 [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"]
2525 CPPFLAGS="$SAVE_CPPFLAGS"
2526 LDFLAGS="$SAVE_LDFLAGS"
2528 AC_SUBST(GANGLIA_CPPFLAGS)
2529 AC_SUBST(GANGLIA_LDFLAGS)
2530 AC_SUBST(GANGLIA_LIBS)
2533 # --with-libgcrypt {{{
2534 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2535 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2536 GCRYPT_LIBS="$GCRYPT_LIBS"
2537 AC_ARG_WITH([libgcrypt],
2538 [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2540 if test -f "$withval" && test -x "$withval"; then
2541 with_libgcrypt_config="$withval"
2542 with_libgcrypt="yes"
2543 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"; then
2544 with_libgcrypt_config="$withval/bin/gcrypt-config"
2545 with_libgcrypt="yes"
2546 else if test -d "$withval"; then
2547 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2548 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2549 with_libgcrypt="yes"
2551 with_libgcrypt_config="gcrypt-config"
2552 with_libgcrypt="$withval"
2556 with_libgcrypt_config="libgcrypt-config"
2557 with_libgcrypt="yes"
2561 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"; then
2562 if test "x$GCRYPT_CPPFLAGS" = "x"; then
2563 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2566 if test "x$GCRYPT_LIBS" = "x"; then
2567 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2571 SAVE_CPPFLAGS="$CPPFLAGS"
2572 SAVE_LDFLAGS="$LDFLAGS"
2574 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2575 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2576 LIBS="$LIBS $GCRYPT_LIBS"
2578 if test "x$with_libgcrypt" = "xyes"; then
2579 if test "x$GCRYPT_CPPFLAGS" != "x"; then
2580 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2582 AC_CHECK_HEADERS([gcrypt.h],
2583 [with_libgcrypt="yes"],
2584 [with_libgcrypt="no (gcrypt.h not found)"]
2588 if test "x$with_libgcrypt" = "xyes"; then
2589 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2590 [with_libgcrypt="yes"],
2591 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"]
2595 CPPFLAGS="$SAVE_CPPFLAGS"
2596 LDFLAGS="$SAVE_LDFLAGS"
2599 AC_SUBST([GCRYPT_CPPFLAGS])
2600 AC_SUBST([GCRYPT_LDFLAGS])
2601 AC_SUBST([GCRYPT_LIBS])
2602 AM_CONDITIONAL([BUILD_WITH_LIBGCRYPT], [test "x$with_libgcrypt" = "xyes"])
2606 AC_ARG_WITH([libgps],
2607 [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2609 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2610 with_libgps_cflags="-I$withval/include"
2611 with_libgps_ldflags="-L$withval/lib"
2614 with_libgps="$withval"
2620 if test "x$with_libgps" = "xyes"; then
2621 SAVE_CFLAGS="$CFLAGS"
2622 CFLAGS="$CFLAGS $with_libgps_cflags"
2624 AC_CHECK_HEADERS([gps.h],
2625 [with_libgps="yes"],
2626 [with_libgps="no (gps.h not found)"]
2629 CFLAGS="$SAVE_CFLAGS"
2632 if test "x$with_libgps" = "xyes"; then
2633 SAVE_LDFLAGS="$LDFLAGS"
2634 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2636 AC_CHECK_LIB([gps], [gps_open],
2637 [with_libgps="yes"],
2638 [with_libgps="no (symbol gps_open not found)"]
2641 LDFLAGS="$SAVE_LDFLAGS"
2644 if test "x$with_libgps" = "xyes"; then
2645 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2646 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2647 BUILD_WITH_LIBGPS_LIBS="-lgps"
2650 AC_SUBST([BUILD_WITH_LIBGPS_CFLAGS])
2651 AC_SUBST([BUILD_WITH_LIBGPS_LDFLAGS])
2652 AC_SUBST([BUILD_WITH_LIBGPS_LIBS])
2656 # --with-libgrpc++ {{{
2657 AC_ARG_WITH([libgrpc++],
2658 [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2660 with_grpcpp="$withval"
2661 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2662 with_libgrpcpp_cppflags="-I$withval/include"
2663 with_libgrpcpp_ldflags="-L$withval/lib"
2664 with_libgrpcpp="yes"
2666 if test "x$withval" = "xno"; then
2667 with_libgrpcpp="no (disabled on command line)"
2672 if test "x$withval" = "xyes"; then
2673 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2674 [with_libgrpcpp="yes"],
2675 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2679 if test "x$withval" != "xno"; then
2680 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2681 if test_cxx_flags -std=c++11; then
2682 AC_MSG_RESULT([yes])
2685 with_libgrpcpp="no (requires C++11 support)"
2689 if test "x$with_libgrpcpp" = "xyes"; then
2691 SAVE_CPPFLAGS="$CPPFLAGS"
2692 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2693 AC_CHECK_HEADERS([grpc++/grpc++.h],
2694 [with_libgrpcpp="yes"],
2695 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2697 CPPFLAGS="$SAVE_CPPFLAGS"
2701 if test "x$with_libgrpcpp" = "xyes"; then
2703 SAVE_CPPFLAGS="$CPPFLAGS"
2704 SAVE_LDFLAGS="$LDFLAGS"
2706 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2707 LDFLAGS="$with_libgrpcpp_ldflags"
2708 if test "x$GRPCPP_LIBS" = "x"; then
2716 [[#include <grpc++/grpc++.h>]],
2717 [[grpc::ServerBuilder sb;]]
2721 with_libgrpcpp="yes"
2722 if test "x$GRPCPP_LIBS" = "x"; then
2723 GRPCPP_LIBS="-lgrpc++"
2726 [with_libgrpcpp="no (libgrpc++ not found)"]
2728 CPPFLAGS="$SAVE_CPPFLAGS"
2729 LDFLAGS="$SAVE_LDFLAGS"
2734 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2735 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2736 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2737 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2738 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2739 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2742 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
2743 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
2744 AM_CONDITIONAL([HAVE_GRPC_CPP], [test "x$GRPC_CPP_PLUGIN" != "x"])
2746 # --with-libiptc {{{
2747 AC_ARG_WITH([libiptc],
2748 [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2750 if test "x$withval" = "xyes"; then
2751 with_libiptc="pkgconfig"
2752 else if test "x$withval" = "xno"; then
2756 with_libiptc_cflags="-I$withval/include"
2757 with_libiptc_libs="-L$withval/lib"
2761 if test "x$ac_system" = "xLinux"; then
2762 with_libiptc="pkgconfig"
2764 with_libiptc="no (Linux only)"
2769 if test "x$with_libiptc" = "xpkgconfig"; then
2770 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2771 if test $? -ne 0; then
2772 with_libiptc="no (pkg-config doesn't know libiptc)"
2776 if test "x$with_libiptc" = "xpkgconfig"; then
2777 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2778 if test $? -ne 0; then
2779 with_libiptc="no ($PKG_CONFIG failed)"
2782 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2783 if test $? -ne 0; then
2784 with_libiptc="no ($PKG_CONFIG failed)"
2788 SAVE_CPPFLAGS="$CPPFLAGS"
2789 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2791 # check whether the header file for libiptc is available.
2792 if test "x$with_libiptc" = "xpkgconfig"; then
2793 AC_CHECK_HEADERS([libiptc/libiptc.h libiptc/libip6tc.h],
2795 [with_libiptc="no (header file missing)"]
2799 # If the header file is available, check for the required type declaractions.
2800 # They may be missing in old versions of libiptc. In that case, they will be
2801 # declared in the iptables plugin.
2802 if test "x$with_libiptc" = "xpkgconfig"; then
2803 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2806 # Check for the iptc_init symbol in the library.
2807 # This could be in iptc or ip4tc
2808 if test "x$with_libiptc" = "xpkgconfig"; then
2810 AC_SEARCH_LIBS([iptc_init], [iptc ip4tc],
2811 [with_libiptc="pkgconfig"],
2812 [with_libiptc="no"],
2813 [$with_libiptc_libs]
2818 if test "x$with_libiptc" = "xpkgconfig"; then
2822 CPPFLAGS="$SAVE_CPPFLAGS"
2824 if test "x$with_libiptc" = "xyes"; then
2825 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2826 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2828 AC_SUBST([BUILD_WITH_LIBIPTC_CPPFLAGS])
2829 AC_SUBST([BUILD_WITH_LIBIPTC_LDFLAGS])
2833 with_java_home="$JAVA_HOME"
2834 if test "x$with_java_home" = "x"; then
2835 with_java_home="/usr/lib/jvm"
2841 [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2843 if test "x$withval" = "xno"; then
2845 else if test "x$withval" = "xyes"; then
2848 with_java_home="$withval"
2855 AX_COMPARE_VERSION([$am__api_version],[lt],[1.12],
2856 [JAVA_TIMESTAMP_FILE="classdist_noinst.stamp"],
2857 [JAVA_TIMESTAMP_FILE="classnoinst.stamp"])
2858 if test "x$with_java" = "xyes"; then
2859 if test -d "$with_java_home"; then
2860 AC_MSG_CHECKING([for jni.h])
2861 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2862 if test "x$TMPVAR" != "x"; then
2863 AC_MSG_RESULT([found in $TMPVAR])
2864 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2866 AC_MSG_RESULT([not found])
2869 AC_MSG_CHECKING([for jni_md.h])
2870 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2871 if test "x$TMPVAR" != "x"; then
2872 AC_MSG_RESULT([found in $TMPVAR])
2873 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2875 AC_MSG_RESULT([not found])
2878 AC_MSG_CHECKING([for libjvm.so])
2879 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`
2880 if test "x$TMPVAR" != "x"; then
2881 AC_MSG_RESULT([found in $TMPVAR])
2882 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2884 AC_MSG_RESULT([not found])
2887 if test "x$JAVAC" = "x"; then
2888 AC_MSG_CHECKING([for javac])
2889 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2890 if test "x$TMPVAR" != "x"; then
2892 AC_MSG_RESULT([$JAVAC])
2894 AC_MSG_RESULT([not found])
2898 if test "x$JAR" = "x"; then
2899 AC_MSG_CHECKING([for jar])
2900 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2901 if test "x$TMPVAR" != "x"; then
2903 AC_MSG_RESULT([$JAR])
2905 AC_MSG_RESULT([not found])
2908 else if test "x$with_java_home" != "x"; then
2909 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2913 if test "x$JAVA_CPPFLAGS" != "x"; then
2914 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2916 if test "x$JAVA_CFLAGS" != "x"; then
2917 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2919 if test "x$JAVA_LDFLAGS" != "x"; then
2920 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2922 if test "x$JAVA_LIBS" != "x"; then
2923 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2925 if test "x$JAVAC" = "x"; then
2926 with_javac_path="$PATH"
2927 if test "x$with_java_home" != "x"; then
2928 with_javac_path="$with_java_home:with_javac_path"
2929 if test -d "$with_java_home/bin"; then
2930 with_javac_path="$with_java_home/bin:with_javac_path"
2934 AC_PATH_PROG([JAVAC], [javac], [], "$with_javac_path")
2937 if test "x$JAVAC" = "x"; then
2938 with_java="no (javac not found)"
2941 if test "x$JAR" = "x"; then
2942 with_jar_path="$PATH"
2943 if test "x$with_java_home" != "x"; then
2944 with_jar_path="$with_java_home:$with_jar_path"
2945 if test -d "$with_java_home/bin"; then
2946 with_jar_path="$with_java_home/bin:$with_jar_path"
2950 AC_PATH_PROG([JAR], [jar], [], "$with_jar_path")
2953 if test "x$JAR" = "x"; then
2954 with_java="no (jar not found)"
2957 SAVE_CPPFLAGS="$CPPFLAGS"
2958 SAVE_CFLAGS="$CFLAGS"
2959 SAVE_LDFLAGS="$LDFLAGS"
2961 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2962 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2963 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2964 LIBS="$LIBS $JAVA_LIBS"
2966 if test "x$with_java" = "xyes"; then
2967 AC_CHECK_HEADERS([jni.h],
2969 [with_java="no (jni.h not found)"])
2972 if test "x$with_java" = "xyes"; then
2973 AC_CHECK_LIB([jvm], [JNI_CreateJavaVM],
2975 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2976 [$JAVA_LIBS $PTHREAD_LIBS]
2980 if test "x$with_java" = "xyes"; then
2981 JAVA_LIBS="$JAVA_LIBS -ljvm"
2982 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2985 CPPFLAGS="$SAVE_CPPFLAGS"
2986 CFLAGS="$SAVE_CFLAGS"
2987 LDFLAGS="$SAVE_LDFLAGS"
2990 AC_SUBST([JAVA_CPPFLAGS])
2991 AC_SUBST([JAVA_CFLAGS])
2992 AC_SUBST([JAVA_LDFLAGS])
2993 AC_SUBST([JAVA_LIBS])
2994 AC_SUBST([JAVA_TIMESTAMP_FILE])
2995 AM_CONDITIONAL([BUILD_WITH_JAVA], [test "x$with_java" = "xyes"])
2998 # --with-libldap {{{
2999 AC_ARG_WITH([libldap],
3000 [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
3002 if test "x$withval" = "xyes"; then
3004 else if test "x$withval" = "xno"; then
3008 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
3009 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
3012 [with_libldap="yes"]
3015 SAVE_CPPFLAGS="$CPPFLAGS"
3016 SAVE_LDFLAGS="$LDFLAGS"
3018 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
3019 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
3021 if test "x$with_libldap" = "xyes"; then
3022 if test "x$LIBLDAP_CPPFLAGS" != "x"; then
3023 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
3026 AC_CHECK_HEADERS([ldap.h],
3027 [with_libldap="yes"],
3028 [with_libldap="no ('ldap.h' not found)"]
3032 if test "x$with_libldap" = "xyes"; then
3033 if test "x$LIBLDAP_LDFLAGS" != "x"; then
3034 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
3037 AC_CHECK_LIB([ldap], [ldap_initialize],
3038 [with_libldap="yes"],
3039 [with_libldap="no (symbol 'ldap_initialize' not found)"]
3043 CPPFLAGS="$SAVE_CPPFLAGS"
3044 LDFLAGS="$SAVE_LDFLAGS"
3046 if test "x$with_libldap" = "xyes"
3048 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
3049 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
3051 AC_SUBST([BUILD_WITH_LIBLDAP_CPPFLAGS])
3052 AC_SUBST([BUILD_WITH_LIBLDAP_LDFLAGS])
3056 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
3057 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
3059 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
3060 [with_liblua="yes"],
3064 PKG_CHECK_MODULES([LUA], [lua],
3065 [with_liblua="yes"],
3067 PKG_CHECK_MODULES([LUA], [lua-5.3],
3068 [with_liblua="yes"],
3070 PKG_CHECK_MODULES([LUA], [lua5.3],
3071 [with_liblua="yes"],
3073 PKG_CHECK_MODULES([LUA], [lua-5.2],
3074 [with_liblua="yes"],
3076 PKG_CHECK_MODULES([LUA], [lua5.2],
3077 [with_liblua="yes"],
3079 PKG_CHECK_MODULES([LUA], [lua-5.1],
3080 [with_liblua="yes"],
3082 PKG_CHECK_MODULES([LUA], [lua5.1],
3083 [with_liblua="yes"],
3084 [with_liblua="no (pkg-config cannot find liblua)"]
3100 if test "x$with_liblua" = "xyes"
3102 SAVE_CPPFLAGS="$CPPFLAGS"
3103 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
3105 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
3106 [with_liblua="yes"],
3107 [with_liblua="no (header not found)"]
3110 CPPFLAGS="$SAVE_CPPFLAGS"
3113 if test "x$with_liblua" = "xyes"
3116 LIBS="$LIBS $LUA_LIBS"
3118 AC_CHECK_FUNC([lua_settop],
3119 [with_liblua="yes"],
3120 [with_liblua="no (symbol 'lua_settop' not found)"]
3126 if test "x$with_liblua" = "xyes"
3128 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
3129 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
3131 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
3132 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
3135 # --with-liblvm2app {{{
3136 AC_ARG_WITH([liblvm2app],
3137 [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
3139 if test "x$withval" = "xno"; then
3140 with_liblvm2app="no"
3142 with_liblvm2app="yes"
3143 if test "x$withval" != "xyes"; then
3144 with_liblvm2app_cppflags="-I$withval/include"
3145 with_liblvm2app_ldflags="-L$withval/lib"
3150 if test "x$ac_system" = "xLinux"; then
3151 with_liblvm2app="yes"
3153 with_liblvm2app="no (Linux only library)"
3158 if test "x$with_liblvm2app" = "xyes"; then
3159 SAVE_CPPFLAGS="$CPPFLAGS"
3160 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3162 AC_CHECK_HEADERS([lvm2app.h],
3163 [with_liblvm2app="yes"],
3164 [with_liblvm2app="no (lvm2app.h not found)"]
3167 CPPFLAGS="$SAVE_CPPFLAGS"
3170 if test "x$with_liblvm2app" = "xyes"; then
3171 SAVE_CPPFLAGS="$CPPFLAGS"
3172 SAVE_LDFLAGS="$LDFLAGS"
3173 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
3174 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
3176 AC_CHECK_LIB([lvm2app], [lvm_lv_get_property],
3177 [with_liblvm2app="yes"],
3178 [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"]
3181 CPPFLAGS="$SAVE_CPPFLAGS"
3182 LDFLAGS="$SAVE_LDFLAGS"
3185 if test "x$with_liblvm2app" = "xyes"; then
3186 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
3187 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
3188 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
3191 AC_SUBST([BUILD_WITH_LIBLVM2APP_CPPFLAGS])
3192 AC_SUBST([BUILD_WITH_LIBLVM2APP_LDFLAGS])
3193 AC_SUBST([BUILD_WITH_LIBLVM2APP_LIBS])
3196 # --with-libmemcached {{{
3197 AC_ARG_WITH([libmemcached],
3198 [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3200 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3201 with_libmemcached_cppflags="-I$withval/include"
3202 with_libmemcached_ldflags="-L$withval/lib"
3203 with_libmemcached="yes"
3205 with_libmemcached="$withval"
3208 [with_libmemcached="yes"]
3211 if test "x$with_libmemcached" = "xyes"; then
3212 SAVE_CPPFLAGS="$CPPFLAGS"
3213 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3215 AC_CHECK_HEADERS([libmemcached/memcached.h],
3216 [with_libmemcached="yes"],
3217 [with_libmemcached="no (libmemcached/memcached.h not found)"]
3220 CPPFLAGS="$SAVE_CPPFLAGS"
3223 if test "x$with_libmemcached" = "xyes"; then
3224 SAVE_CPPFLAGS="$CPPFLAGS"
3225 SAVE_LDFLAGS="$LDFLAGS"
3226 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3227 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3229 AC_CHECK_LIB([memcached], [memcached_create],
3230 [with_libmemcached="yes"],
3231 [with_libmemcached="no (Symbol 'memcached_create' not found)"]
3234 CPPFLAGS="$SAVE_CPPFLAGS"
3235 LDFLAGS="$SAVE_LDFLAGS"
3238 if test "x$with_libmemcached" = "xyes"; then
3239 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3240 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3241 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3244 AC_SUBST([BUILD_WITH_LIBMEMCACHED_CPPFLAGS])
3245 AC_SUBST([BUILD_WITH_LIBMEMCACHED_LDFLAGS])
3246 AC_SUBST([BUILD_WITH_LIBMEMCACHED_LIBS])
3249 # --with-libmicrohttpd {{{
3250 with_libmicrohttpd_cppflags=""
3251 with_libmicrohttpd_ldflags=""
3252 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3254 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3255 with_libmicrohttpd_cppflags="-I$withval/include"
3256 with_libmicrohttpd_ldflags="-L$withval/lib"
3257 with_libmicrohttpd="yes"
3259 if test "x$withval" = "xno"; then
3260 with_libmicrohttpd="no (disabled on command line)"
3265 if test "x$withval" = "xyes"; then
3266 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3267 [with_libmicrohttpd="yes"],
3268 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3272 if test "x$MICROHTTPD_LIBS" = "x"; then
3273 MICROHTTPD_LIBS="-lmicrohttpd"
3276 SAVE_CPPFLAGS="$CPPFLAGS"
3277 SAVE_LDFLAGS="$LDFLAGS"
3279 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3280 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3281 LIBS="$LIBS $MICROHTTPD_LIBS"
3283 if test "x$with_libmicrohttpd" = "xyes"; then
3284 AC_CHECK_HEADERS([microhttpd.h],
3285 [with_libmicrohttpd="yes"],
3286 [with_libmicrohttpd="no (<microhttpd.h> not found)"]
3290 if test "x$with_libmicrohttpd" = "xyes"; then
3291 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3292 [with_libmicrohttpd="yes"],
3293 [with_libmicrohttpd="no (libmicrohttpd not found)"]
3297 CPPFLAGS="$SAVE_CPPFLAGS"
3298 LDFLAGS="$SAVE_LDFLAGS"
3301 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3302 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3303 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3304 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3305 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3306 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3309 # --with-libmodbus {{{
3310 AC_ARG_WITH([libmodbus],
3311 [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3313 if test "x$withval" = "xno"; then
3315 else if test "x$withval" = "xyes"; then
3316 with_libmodbus="use_pkgconfig"
3317 else if test -d "$with_libmodbus/lib"; then
3318 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3319 with_libmodbus_cflags="-I$withval/include"
3320 with_libmodbus_libs="-L$withval/lib -lmodbus"
3321 with_libmodbus="yes"
3324 [with_libmodbus="use_pkgconfig"]
3327 # configure using pkg-config
3328 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3329 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
3330 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3331 if test $? -ne 0; then
3332 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3336 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3337 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3338 if test $? -ne 0; then
3339 with_libmodbus="no ($PKG_CONFIG failed)"
3342 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3343 if test $? -ne 0; then
3344 with_libmodbus="no ($PKG_CONFIG failed)"
3348 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3349 with_libmodbus="yes"
3352 if test "x$with_libmodbus" = "xyes"; then
3353 SAVE_CPPFLAGS="$CPPFLAGS"
3354 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3356 AC_CHECK_HEADERS([modbus.h],
3357 [with_libmodbus="yes"],
3358 [with_libmodbus="no (modbus.h not found)"]
3361 CPPFLAGS="$SAVE_CPPFLAGS"
3364 if test "x$with_libmodbus" = "xyes"; then
3365 SAVE_LDFLAGS="$LDFLAGS"
3366 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3368 AC_CHECK_LIB([modbus], [modbus_connect],
3369 [with_libmodbus="yes"],
3370 [with_libmodbus="no (symbol modbus_connect not found)"]
3373 LDFLAGS="$SAVE_LDFLAGS"
3376 if test "x$with_libmodbus" = "xyes"; then
3377 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3378 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3381 AC_SUBST([BUILD_WITH_LIBMODBUS_CFLAGS])
3382 AC_SUBST([BUILD_WITH_LIBMODBUS_LIBS])
3385 # --with-libmongoc {{{
3386 AC_ARG_WITH([libmongoc],
3387 [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3389 if test "x$withval" = "xyes"; then
3390 with_libmongoc="yes"
3391 else if test "x$withval" = "xno"; then
3397 [with_libmongoc="yes"]
3400 if test "x$with_libmongoc" = "xyes"; then
3401 PKG_CHECK_MODULES([LIBMONGOC], [libmongoc-1.0],
3402 [with_libmongoc="yes"],
3403 [with_libmongoc="no (pkg-config could not find libmongoc)"]
3407 if test "x$with_libmongoc" = "xyes"; then
3408 SAVE_CPPFLAGS="$CPPFLAGS"
3410 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS"
3412 if test "x$CPPFLAGS" != "x"; then
3413 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CFLAGS])
3416 AC_CHECK_HEADERS([mongoc.h],
3417 [with_libmongoc="yes"],
3418 [with_libmongoc="no ('mongoc.h' not found)"]
3421 CPPFLAGS="$SAVE_CPPFLAGS"
3424 if test "x$with_libmongoc" = "xyes"; then
3425 SAVE_CPPFLAGS="$CPPFLAGS"
3426 SAVE_LDFLAGS="$LDFLAGS"
3428 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS"
3429 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3431 if test "x$LIBMONGOC_LDFLAGS" != "x"; then
3432 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
3435 AC_CHECK_LIB([mongoc-1.0], [mongoc_init],
3436 [with_libmongoc="yes"],
3437 [with_libmongoc="no (symbol 'mongoc_init' not found)"]
3440 CPPFLAGS="$SAVE_CPPFLAGS"
3441 LDFLAGS="$SAVE_LDFLAGS"
3444 if test "x$with_libmongoc" = "xyes"; then
3445 BUILD_WITH_LIBMONGOC_CFLAGS="$LIBMONGOC_CFLAGS"
3446 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3449 AC_SUBST([BUILD_WITH_LIBMONGOC_CFLAGS])
3450 AC_SUBST([BUILD_WITH_LIBMONGOC_LDFLAGS])
3453 # --with-libmosquitto {{{
3454 AC_ARG_WITH([libmosquitto],
3455 [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3457 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3458 with_libmosquitto_cppflags="-I$withval/include"
3459 with_libmosquitto_ldflags="-L$withval/lib"
3460 with_libmosquitto="yes"
3462 with_libmosquitto="$withval"
3465 [with_libmosquitto="yes"]
3468 if test "x$with_libmosquitto" = "xyes"; then
3469 SAVE_CPPFLAGS="$CPPFLAGS"
3470 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3472 AC_CHECK_HEADERS([mosquitto.h],
3473 [with_libmosquitto="yes"],
3474 [with_libmosquitto="no (mosquitto.h not found)"]
3477 CPPFLAGS="$SAVE_CPPFLAGS"
3480 if test "x$with_libmosquitto" = "xyes"; then
3481 SAVE_LDFLAGS="$LDFLAGS"
3482 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3484 AC_CHECK_LIB([mosquitto], [mosquitto_connect],
3485 [with_libmosquitto="yes"],
3486 [with_libmosquitto="no (libmosquitto not found)"]
3489 LDFLAGS="$SAVE_LDFLAGS"
3492 if test "x$with_libmosquitto" = "xyes"; then
3493 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3494 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3495 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3498 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_CPPFLAGS])
3499 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_LDFLAGS])
3500 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_LIBS])
3503 # --with-libmysql {{{
3504 with_mysql_config="mysql_config"
3505 AC_ARG_WITH([libmysql],
3506 [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3508 if test "x$withval" = "xno"; then
3510 else if test "x$withval" = "xyes"; then
3513 if test -f "$withval" && test -x "$withval"; then
3514 with_mysql_config="$withval"
3515 else if test -x "$withval/bin/mysql_config"; then
3516 with_mysql_config="$withval/bin/mysql_config"
3521 [with_libmysql="yes"]
3524 if test "x$with_libmysql" = "xyes"; then
3525 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3526 if test $? -ne 0; then
3527 with_libmysql="no ($with_mysql_config failed)"
3529 SAVE_CPPFLAGS="$CPPFLAGS"
3530 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3532 AC_CHECK_HEADERS([mysql.h],
3533 [have_mysql_h="yes"],
3537 if test "x$have_mysql_h" != "xyes"; then
3538 AC_CHECK_HEADERS([mysql/mysql.h],
3539 [have_mysql_mysql_h="yes"],
3544 if test "x$have_mysql_h" != "xyes" && test "x$have_mysql_mysql_h" != "xyes"; then
3545 with_libmysql="no (mysql.h not found)"
3548 CPPFLAGS="$SAVE_CPPFLAGS"
3552 if test "x$with_libmysql" = "xyes"; then
3553 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3554 if test $? -ne 0; then
3555 with_libmysql="no ($with_mysql_config failed)"
3558 LIBS="$with_mysql_libs"
3560 AC_SEARCH_LIBS([mysql_get_server_version],
3562 [with_libmysql="yes"],
3563 [with_libmysql="no (symbol 'mysql_get_server_version' not found in ${LIBS})"],
3570 if test "x$with_libmysql" = "xyes"; then
3571 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3572 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3575 AC_SUBST([BUILD_WITH_LIBMYSQL_CFLAGS])
3576 AC_SUBST([BUILD_WITH_LIBMYSQL_LIBS])
3580 AC_ARG_WITH([libmnl],
3581 [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3583 if test "x$withval" = "xyes"; then
3585 else if test "x$withval" = "xno"; then
3588 if test -d "$withval/include"; then
3589 with_libmnl_cflags="-I$withval/include"
3590 with_libmnl_libs="-L$withval/lib -lmnl"
3593 AC_MSG_ERROR("no such directory: $withval/include")
3598 if test "x$ac_system" = "xLinux"; then
3601 with_libmnl="no (Linux only library)"
3606 if test "x$with_libmnl" = "xyes"; then
3607 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3608 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3609 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3612 AC_CHECK_HEADERS([libmnl.h libmnl/libmnl.h],
3620 #include <sys/types.h>
3621 #include <asm/types.h>
3622 #include <sys/socket.h>
3623 #include <linux/netlink.h>
3624 #include <linux/rtnetlink.h>]]
3627 AC_CHECK_HEADERS([linux/gen_stats.h linux/pkt_sched.h],
3632 #include <sys/types.h>
3633 #include <asm/types.h>
3634 #include <sys/socket.h>
3643 #include <sys/types.h>
3644 #include <asm/types.h>
3645 #include <sys/socket.h>
3646 #include <linux/netlink.h>
3647 #include <linux/rtnetlink.h>
3650 int retval = TCA_STATS2;
3655 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])]
3663 #include <sys/types.h>
3664 #include <asm/types.h>
3665 #include <sys/socket.h>
3666 #include <linux/netlink.h>
3667 #include <linux/rtnetlink.h>
3670 int retval = TCA_STATS;
3675 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
3678 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3679 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3681 [[#include <linux/if_link.h>]]
3684 AC_CHECK_LIB([mnl], [mnl_nlmsg_get_payload],
3685 [with_libmnl="yes"],
3686 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3691 if test "x$with_libmnl" = "xyes"; then
3692 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3693 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3695 AC_SUBST([BUILD_WITH_LIBMNL_CFLAGS])
3696 AC_SUBST([BUILD_WITH_LIBMNL_LIBS])
3699 # --with-libnetapp {{{
3700 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3701 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3702 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3703 AC_ARG_WITH([libnetapp],
3704 [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3706 if test -d "$withval"; then
3707 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3708 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3709 with_libnetapp="yes"
3711 with_libnetapp="$withval"
3714 [with_libnetapp="yes"]
3717 SAVE_CPPFLAGS="$CPPFLAGS"
3718 SAVE_LDFLAGS="$LDFLAGS"
3719 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3720 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3722 if test "x$with_libnetapp" = "xyes"; then
3723 if test "x$LIBNETAPP_CPPFLAGS" != "x"; then
3724 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3726 AC_CHECK_HEADERS([netapp_api.h],
3727 [with_libnetapp="yes"],
3728 [with_libnetapp="no (netapp_api.h not found)"]
3732 if test "x$with_libnetapp" = "xyes"; then
3733 if test "x$LIBNETAPP_LDFLAGS" != "x"; then
3734 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3737 if test "x$LIBNETAPP_LIBS" = "x"; then
3738 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3741 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3743 AC_CHECK_LIB([netapp], [na_server_invoke_elem],
3744 [with_libnetapp="yes"],
3745 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3749 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3752 CPPFLAGS="$SAVE_CPPFLAGS"
3753 LDFLAGS="$SAVE_LDFLAGS"
3755 AC_SUBST([LIBNETAPP_CPPFLAGS])
3756 AC_SUBST([LIBNETAPP_LDFLAGS])
3757 AC_SUBST([LIBNETAPP_LIBS])
3760 # --with-libnetsnmp {{{
3761 AC_ARG_WITH([libnetsnmp],
3762 [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to libnetsnmp.])],
3764 if test "x$withval" = "xno"; then
3765 with_libnetsnmp="no"
3766 else if test "x$withval" = "xyes"; then
3767 with_libnetsnmp="yes"
3769 with_libnetsnmp_cppflags="-I$withval/include"
3770 with_libnetsnmp_ldflags="-I$withval/lib"
3771 with_libnetsnmp="yes"
3774 [with_libnetsnmp="yes"]
3777 if test "x$with_libnetsnmp" = "xyes"; then
3778 SAVE_CPPFLAGS="$CPPFLAGS"
3779 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3781 AC_CHECK_HEADERS([net-snmp/net-snmp-config.h],
3782 [with_libnetsnmp="yes"],
3783 [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]
3786 AC_CHECK_HEADERS([net-snmp/net-snmp-includes.h],
3787 [with_libnetsnmp="yes"],
3788 [with_libnetsnmp="no (net-snmp/net-snmp-includes.h not found)"],
3790 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3791 # include <net-snmp/net-snmp-config.h>
3796 CPPFLAGS="$SAVE_CPPFLAGS"
3799 if test "x$with_libnetsnmp" = "xyes"; then
3800 SAVE_LDFLAGS="$LDFLAGS"
3801 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3803 AC_CHECK_LIB([netsnmp], [init_snmp],
3804 [with_libnetsmp="yes"],
3805 [with_libnetsnmp="no (libnetsnmp not found)"]
3808 LDFLAGS="$SAVE_LDFLAGS"
3811 if test "x$with_libnetsnmp" = "xyes"; then
3812 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3813 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3814 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3817 AC_SUBST([BUILD_WITH_LIBNETSNMP_CPPFLAGS])
3818 AC_SUBST([BUILD_WITH_LIBNETSNMP_LDFLAGS])
3819 AC_SUBST([BUILD_WITH_LIBNETSNMP_LIBS])
3822 # --with-libnetsmpagent {{{
3823 AC_ARG_WITH([libnetsnmpagent],
3824 [AS_HELP_STRING([--with-libnetsnmpagent@<:@=PREFIX@:>@], [Path to libnetsnmpagent.])],
3826 if test "x$withval" = "xno"; then
3827 with_libnetsnmpagent="no"
3828 else if test "x$withval" = "xyes"; then
3829 with_libnetsnmpagent="yes"
3831 with_libnetsnmpagent_cppflags="-I$withval/include"
3832 with_libnetsnmpagent_ldflags="-I$withval/lib"
3833 with_libnetsnmpagent="yes"
3836 [with_libnetsnmpagent="yes"]
3839 if test "x$with_libnetsnmpagent" = "xyes"; then
3840 SAVE_CPPFLAGS="$CPPFLAGS"
3841 CPPFLAGS="$CPPFLAGS $with_libnetsnmpagent_cppflags"
3843 AC_CHECK_HEADERS([net-snmp/agent/net-snmp-agent-includes.h],
3845 [with_libnetsnmpagent="no (net-snmp/agent/net-snmp-agent-includes.h not found)"],
3847 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3848 # include <net-snmp/net-snmp-config.h>
3850 #if HAVE_NET_SNMP_NET_SNMP_INCLUDES_H
3851 # include <net-snmp/net-snmp-includes.h>
3856 CPPFLAGS="$SAVE_CPPFLAGS"
3859 if test "x$with_libnetsnmpagent" = "xyes"; then
3860 SAVE_LDFLAGS="$LDFLAGS"
3861 LDFLAGS="$LDFLAGS $with_libnetsnmpagent_ldflags"
3863 # older versions of libnetsnmpagent fail to link
3864 # against the helpers library, so do that explicitly
3865 AC_CHECK_LIB([netsnmphelpers], [netsnmp_init_helpers],
3866 [libnetsnmphelpers="-lnetsnmphelpers"],
3867 [libnetsnmphelpers=""]
3870 AC_CHECK_LIB([netsnmpagent], [init_agent],
3871 [with_libnetsnmpagent="yes"],
3872 [with_libnetsnmpagent="no (libnetsnmpagent not found)"],
3873 [$libnetsnmphelpers]
3876 LDFLAGS="$SAVE_LDFLAGS"
3879 if test "x$with_libnetsnmpagent" = "xyes"; then
3880 BUILD_WITH_LIBNETSNMPAGENT_LIBS="-lnetsnmpagent $libnetsnmphelpers"
3883 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS])
3884 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS])
3885 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LIBS])
3888 # --with-liboping {{{
3889 AC_ARG_WITH([liboping],
3890 [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3892 if test "x$withval" = "xyes"; then
3894 else if test "x$withval" = "xno"; then
3898 LIBOPING_CPPFLAGS="-I$withval/include"
3899 LIBOPING_LDFLAGS="-L$withval/lib"
3902 [with_liboping="yes"]
3905 SAVE_CPPFLAGS="$CPPFLAGS"
3906 SAVE_LDFLAGS="$LDFLAGS"
3907 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3908 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3910 if test "x$with_liboping" = "xyes"; then
3911 AC_CHECK_HEADERS([oping.h],
3912 [with_liboping="yes"],
3913 [with_liboping="no (oping.h not found)"]
3917 if test "x$with_liboping" = "xyes"; then
3918 AC_CHECK_LIB([oping], [ping_construct],
3919 [with_liboping="yes"],
3920 [with_liboping="no (symbol 'ping_construct' not found)"]
3924 CPPFLAGS="$SAVE_CPPFLAGS"
3925 LDFLAGS="$SAVE_LDFLAGS"
3927 if test "x$with_liboping" = "xyes"; then
3928 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3929 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3932 AC_SUBST([BUILD_WITH_LIBOPING_CPPFLAGS])
3933 AC_SUBST([BUILD_WITH_LIBOPING_LDFLAGS])
3937 AC_ARG_WITH([oracle],
3938 [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3940 if test "x$withval" = "xyes"; then
3941 if test "x$ORACLE_HOME" = "x"; then
3942 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3945 else if test "x$withval" = "xno"; then
3949 ORACLE_HOME="$withval"
3953 if test "x$ORACLE_HOME" = "x"; then
3954 with_oracle="no (ORACLE_HOME is not set)"
3961 if test "x$ORACLE_HOME" != "x"; then
3962 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3963 if test -e "$ORACLE_HOME/lib/ldflags"; then
3964 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3966 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3969 if test "x$with_oracle" = "xyes"; then
3970 SAVE_CPPFLAGS="$CPPFLAGS"
3971 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3973 AC_CHECK_HEADERS([oci.h],
3974 [with_oracle="yes"],
3975 [with_oracle="no (oci.h not found)"]
3978 CPPFLAGS="$SAVE_CPPFLAGS"
3981 if test "x$with_oracle" = "xyes"; then
3982 SAVE_CPPFLAGS="$CPPFLAGS"
3984 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3985 LIBS="$LIBS $with_oracle_libs"
3987 AC_CHECK_FUNC([OCIEnvCreate],
3988 [with_oracle="yes"],
3989 [with_oracle="no (Symbol 'OCIEnvCreate' not found)"]
3992 CPPFLAGS="$SAVE_CPPFLAGS"
3996 if test "x$with_oracle" = "xyes"; then
3997 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
3998 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
4001 AC_SUBST([BUILD_WITH_ORACLE_CPPFLAGS])
4002 AC_SUBST([BUILD_WITH_ORACLE_LIBS])
4005 # --with-libowcapi {{{
4006 AC_ARG_WITH([libowcapi],
4007 [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
4009 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4010 with_libowcapi_cppflags="-I$withval/include"
4011 with_libowcapi_ldflags="-L$withval/lib"
4012 with_libowcapi="yes"
4014 with_libowcapi="$withval"
4017 [with_libowcapi="yes"]
4020 if test "x$with_libowcapi" = "xyes"; then
4021 SAVE_CPPFLAGS="$CPPFLAGS"
4022 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
4024 AC_CHECK_HEADERS([owcapi.h],
4025 [with_libowcapi="yes"],
4026 [with_libowcapi="no (owcapi.h not found)"]
4029 CPPFLAGS="$SAVE_CPPFLAGS"
4032 if test "x$with_libowcapi" = "xyes"; then
4033 SAVE_LDFLAGS="$LDFLAGS"
4034 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
4036 AC_CHECK_LIB([owcapi], [OW_get],
4037 [with_libowcapi="yes"],
4038 [with_libowcapi="no (libowcapi not found)"]
4041 LDFLAGS="$SAVE_LDFLAGS"
4044 if test "x$with_libowcapi" = "xyes"; then
4045 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
4046 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
4047 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
4050 AC_SUBST([BUILD_WITH_LIBOWCAPI_CPPFLAGS])
4051 AC_SUBST([BUILD_WITH_LIBOWCAPI_LDFLAGS])
4052 AC_SUBST([BUILD_WITH_LIBOWCAPI_LIBS])
4055 # --with-libpcap {{{
4056 AC_ARG_WITH([libpcap],
4057 [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
4059 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4060 with_libpcap_cppflags="-I$withval/include"
4061 with_libpcap_ldflags="$LDFLAGS -L$withval/lib"
4064 with_libpcap="$withval"
4067 [with_libpcap="yes"]
4070 if test "x$with_libpcap" = "xyes"; then
4071 SAVE_CPPFLAGS="$CPPFLAGS"
4072 CPPFLAGS="$CPPFLAGS $with_libpcap_cppflags"
4074 AC_CHECK_HEADERS([pcap.h],
4075 [with_libpcap="yes"],
4076 [with_libpcap="no (pcap.h not found)"]
4079 CPPFLAGS="$SAVE_CPPFLAGS"
4082 if test "x$with_libpcap" = "xyes"; then
4083 SAVE_LDFLAGS="$LDFLAGS"
4084 LDFLAGS="$LDFLAGS $with_libpcap_ldflags"
4086 AC_CHECK_LIB([pcap], [pcap_open_live],
4087 [with_libpcap="yes"],
4088 [with_libpcap="no (libpcap not found)"]
4091 LDFLAGS="$SAVE_LDFLAGS"
4094 if test "x$with_libpcap" = "xyes"; then
4095 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
4096 [c_cv_libpcap_have_pcap_error_iface_not_up],
4101 [[#include <pcap.h>]],
4103 int val = PCAP_ERROR_IFACE_NOT_UP;
4108 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
4109 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]
4115 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"; then
4116 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
4119 if test "x$with_libpcap" = "xyes"; then
4120 BUILD_WITH_LIBPCAP_CPPFLAGS="$with_libpcap_cppflags"
4121 BUILD_WITH_LIBPCAP_LDFLAGS="$with_libpcap_ldflags"
4122 BUILD_WITH_LIBPCAP_LIBS="-lpcap"
4125 AC_SUBST([BUILD_WITH_LIBPCAP_CPPFLAGS])
4126 AC_SUBST([BUILD_WITH_LIBPCAP_LDFLAGS])
4127 AC_SUBST([BUILD_WITH_LIBPCAP_LIBS])
4130 # --with-libperl {{{
4131 AC_ARG_WITH([libperl],
4132 [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
4134 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4135 LDFLAGS="$LDFLAGS -L$withval/lib"
4136 CPPFLAGS="$CPPFLAGS -I$withval/include"
4139 with_libperl="$withval"
4142 [with_libperl="yes"]
4145 AC_ARG_VAR([PERL], [path to Perl interpreter])
4146 AC_PATH_PROG([PERL], [perl])
4148 if test "x$PERL" = "x"; then
4149 with_libperl="no (no Perl interpreter found)"
4152 if test "x$with_libperl" = "xyes"; then
4153 SAVE_CFLAGS="$CFLAGS"
4155 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4156 PERL_CFLAGS=`ARCHFLAGS="" $PERL -MExtUtils::Embed -e perl_inc`
4157 PERL_LIBS=`ARCHFLAGS="" $PERL -MExtUtils::Embed -e ldopts`
4158 CFLAGS="$CFLAGS $PERL_CFLAGS"
4159 LIBS="$LIBS $PERL_LIBS"
4161 AC_CACHE_CHECK([for libperl],
4162 [c_cv_have_libperl],
4168 #define PERL_NO_GET_CONTEXT
4175 load_module (PERL_LOADMOD_NOIMPORT,
4176 newSVpv ("Collectd::Plugin::FooBar", 24),
4181 [c_cv_have_libperl="yes"],
4182 [c_cv_have_libperl="no"]
4187 CFLAGS="$SAVE_CFLAGS"
4190 if test "x$c_cv_have_libperl" = "xno"; then
4195 if test "x$with_libperl" = "xyes"; then
4196 SAVE_CFLAGS="$CFLAGS"
4198 CFLAGS="$CFLAGS $PERL_CFLAGS"
4199 LIBS="$LIBS $PERL_LIBS"
4201 AC_CACHE_CHECK([if Perl supports ithreads],
4202 [c_cv_have_perl_ithreads],
4212 #if !defined(USE_ITHREADS)
4213 # error "Perl does not support ithreads!"
4214 #endif /* !defined(USE_ITHREADS) */
4219 [c_cv_have_perl_ithreads="yes"],
4220 [c_cv_have_perl_ithreads="no"]
4225 CFLAGS="$SAVE_CFLAGS"
4229 if test "x$with_libperl" = "xyes"; then
4230 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4231 # (see issues #41 and #42)
4232 SAVE_CFLAGS="$CFLAGS"
4234 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4235 LIBS="$LIBS $PERL_LIBS"
4237 AC_CACHE_CHECK([for broken Perl_load_module()],
4238 [c_cv_have_broken_perl_load_module],
4244 #define PERL_NO_GET_CONTEXT
4251 load_module (PERL_LOADMOD_NOIMPORT,
4252 newSVpv ("Collectd::Plugin::FooBar", 24),
4257 [c_cv_have_broken_perl_load_module="no"],
4258 [c_cv_have_broken_perl_load_module="yes"]
4263 CFLAGS="$SAVE_CFLAGS"
4267 if test "x$c_cv_have_broken_perl_load_module" = "xyes"; then
4268 PERL_CFLAGS="$PERL_CFLAGS -Wno-nonnull"
4271 if test "x$with_libperl" = "xyes"; then
4272 SAVE_CFLAGS="$CFLAGS"
4274 CFLAGS="$CFLAGS $PERL_CFLAGS"
4275 LIBS="$LIBS $PERL_LIBS"
4278 [struct mgvtbl.svt_local],
4279 [have_struct_mgvtbl_svt_local="yes"],
4280 [have_struct_mgvtbl_svt_local="no"],
4288 if test "x$have_struct_mgvtbl_svt_local" = "xyes"; then
4289 AC_DEFINE([HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL], [1], [Define if Perls struct mgvtbl has member svt_local.])
4292 CFLAGS="$SAVE_CFLAGS"
4295 AC_SUBST([PERL_CFLAGS])
4296 AC_SUBST([PERL_LIBS])
4301 with_pg_config="pg_config"
4302 AC_ARG_WITH([libpq],
4303 [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@], [Path to libpq.])],
4305 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
4306 with_libpq="$withval"
4308 if test -f "$withval" && test -x "$withval"; then
4309 with_pg_config="$withval"
4310 else if test -x "$withval/bin/pg_config"; then
4311 with_pg_config="$withval/bin/pg_config"
4319 if test "x$with_libpq" = "xyes"; then
4320 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4323 if test $pg_config_status -eq 0; then
4324 if test -n "$with_libpq_includedir"; then
4325 for dir in $with_libpq_includedir; do
4326 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4330 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4333 SAVE_CPPFLAGS="$CPPFLAGS"
4334 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4336 AC_CHECK_HEADERS([libpq-fe.h],
4338 [with_libpq="no (libpq-fe.h not found)"]
4341 CPPFLAGS="$SAVE_CPPFLAGS"
4344 if test "x$with_libpq" = "xyes"; then
4345 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4348 if test $pg_config_status -eq 0
4350 if test -n "$with_libpq_libdir"; then
4351 for dir in $with_libpq_libdir; do
4352 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4356 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4359 SAVE_LDFLAGS="$LDFLAGS"
4360 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4362 AC_CHECK_LIB([pq], [PQserverVersion],
4364 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4366 LDFLAGS="$SAVE_LDFLAGS"
4369 if test "x$with_libpq" = "xyes"; then
4370 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4371 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4372 BUILD_WITH_LIBPQ_LIBS="-lpq"
4375 AC_SUBST([BUILD_WITH_LIBPQ_CPPFLAGS])
4376 AC_SUBST([BUILD_WITH_LIBPQ_LDFLAGS])
4377 AC_SUBST([BUILD_WITH_LIBPQ_LIBS])
4380 # --with-libpqos {{{
4381 AC_ARG_WITH([libpqos],
4382 [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4384 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4385 with_libpqos_cppflags="-I$withval/include"
4386 with_libpqos_ldflags="-L$withval/lib"
4389 with_libpqos="$withval"
4392 [with_libpqos="yes"]
4395 if test "x$with_libpqos" = "xyes"; then
4396 SAVE_CPPFLAGS="$CPPFLAGS"
4397 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4399 AC_CHECK_HEADERS([pqos.h],
4400 [with_libpqos="yes"],
4401 [with_libpqos="no (pqos.h not found)"]
4404 CPPFLAGS="$SAVE_CPPFLAGS"
4407 if test "x$with_libpqos" = "xyes"; then
4408 SAVE_LDFLAGS="$LDFLAGS"
4409 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4411 AC_CHECK_LIB([pqos], [pqos_init],
4412 [with_libpqos="yes"],
4413 [with_libpqos="no (Can't find libpqos)"]
4416 LDFLAGS="$SAVE_LDFLAGS"
4419 if test "x$with_libpqos" = "xyes"; then
4420 SAVE_CPPFLAGS="$CPPFLAGS"
4421 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4427 #if PQOS_VERSION < 106
4428 #error "required PQOS version >= 1.06"
4433 [with_libpqos="yes"],
4434 [with_libpqos="no (pqos library version 1.06 or higher is required)"]
4437 CPPFLAGS="$SAVE_CPPFLAGS"
4440 if test "x$with_libpqos" = "xyes"; then
4441 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4442 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4443 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4446 AC_SUBST([BUILD_WITH_LIBPQOS_CPPFLAGS])
4447 AC_SUBST([BUILD_WITH_LIBPQOS_LDFLAGS])
4448 AC_SUBST([BUILD_WITH_LIBPQOS_LIBS])
4451 # --with-libjevents {{{
4452 with_libjevents_cppflags=""
4453 with_libjevents_ldflags=""
4454 AC_ARG_WITH([libjevents],
4455 [AS_HELP_STRING([--with-libjevents@<:@=PREFIX@:>@], [Path to libjevents.])],
4457 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4458 with_libjevents_cppflags="-I$withval/include"
4459 with_libjevents_ldflags="-L$withval/lib"
4460 with_libjevents="yes"
4462 with_libjevents="$withval"
4465 [with_libjevents="yes"]
4468 if test "x$with_libjevents" = "xyes"; then
4469 SAVE_CPPFLAGS="$CPPFLAGS"
4470 CPPFLAGS="$CPPFLAGS $with_libjevents_cppflags"
4472 AC_CHECK_HEADERS([jevents.h], [with_libjevents="yes"], [with_libjevents="no (jevents.h not found)"])
4474 CPPFLAGS="$SAVE_CPPFLAGS"
4476 if test "x$with_libjevents" = "xyes"; then
4477 SAVE_LDFLAGS="$LDFLAGS"
4478 LDFLAGS="$LDFLAGS $with_libjevents_ldflags"
4480 AC_CHECK_LIB([jevents], [json_events], [with_libjevents="yes"], [with_libjevents="no (Can't find libjevents)"])
4482 LDFLAGS="$SAVE_LDFLAGS"
4484 if test "x$with_libjevents" = "xyes"; then
4485 BUILD_WITH_LIBJEVENTS_CPPFLAGS="$with_libjevents_cppflags"
4486 BUILD_WITH_LIBJEVENTS_LDFLAGS="$with_libjevents_ldflags"
4487 BUILD_WITH_LIBJEVENTS_LIBS="-ljevents"
4489 AC_SUBST([BUILD_WITH_LIBJEVENTS_CPPFLAGS])
4490 AC_SUBST([BUILD_WITH_LIBJEVENTS_LDFLAGS])
4491 AC_SUBST([BUILD_WITH_LIBJEVENTS_LIBS])
4494 # --with-libprotobuf {{{
4495 with_libprotobuf_cppflags=""
4496 with_libprotobuf_ldflags=""
4497 AC_ARG_WITH([libprotobuf],
4498 [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4500 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4501 with_libprotobuf_cppflags="-I$withval/include"
4502 with_libprotobuf_ldflags="-L$withval/lib"
4503 with_libprotobuf="yes"
4505 if test "x$withval" = "xno"; then
4506 with_libprotobuf="no (disabled on command line)"
4512 if test "x$withval" = "xyes"; then
4513 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4514 [with_libprotobuf="yes"],
4515 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4519 if test "x$withval" != "xno"; then
4520 SAVE_LDFLAGS="$LDFLAGS"
4522 LDFLAGS="$with_libprotobuf_ldflags"
4523 LIBS="$PROTOBUF_LIBS $LIBS"
4525 AC_CHECK_LIB([protobuf], [main],
4527 SAVE_CPPFLAGS="$CPPFLAGS"
4528 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4529 if test "x$PROTOBUF_LIBS" = "x"
4531 PROTOBUF_LIBS="-lprotobuf"
4533 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4534 [with_libprotobuf="yes"],
4535 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4537 CPPFLAGS="$SAVE_CPPFLAGS"
4539 [with_libprotobuf="no (libprotobuf not found)"]
4542 LDFLAGS="$SAVE_LDFLAGS"
4546 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4547 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4548 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4549 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4550 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4551 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4554 AC_ARG_VAR([PROTOC], [path to the protoc binary])
4555 AC_PATH_PROG([PROTOC], [protoc])
4557 if test "x$PROTOC" != "x"; then
4558 AC_MSG_CHECKING([for protoc 3.0.0+])
4559 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
4560 protoc3="yes (`$PROTOC --version`)"
4563 protoc3="no (`$PROTOC --version`)"
4565 AC_MSG_RESULT([$protoc3])
4567 AM_CONDITIONAL([HAVE_PROTOC3], [test "x$have_protoc3" = "xyes"])
4569 # --with-libprotobuf-c {{{
4570 AC_ARG_WITH([libprotobuf-c],
4571 [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4573 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4574 with_libprotobuf_c_cppflags="-I$withval/include"
4575 with_libprotobuf_c_ldflags="-L$withval/lib"
4576 with_libprotobuf_c="yes"
4579 if test "x$withval" = "xno"; then
4580 with_libprotobuf_c="no (disabled on command line)"
4586 if test "x$withval" = "xyes"; then
4587 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4588 [with_libprotobuf_c="yes"],
4589 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4593 if test "x$withval" != "xno"; then
4594 SAVE_LDFLAGS="$LDFLAGS"
4596 LDFLAGS="$with_libprotobuf_c_ldflags"
4597 LIBS="$PROTOBUF_C_LIBS $LIBS"
4598 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4600 SAVE_CPPFLAGS="$CPPFLAGS"
4601 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4602 if test "x$PROTOBUF_C_LIBS" = "x"; then
4603 PROTOBUF_C_LIBS="-lprotobuf-c"
4606 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4608 with_libprotobuf_c="yes"
4611 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4614 CPPFLAGS="$SAVE_CPPFLAGS"
4616 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4618 LDFLAGS="$SAVE_LDFLAGS"
4622 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4623 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4624 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4625 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4626 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4627 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4630 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
4631 AC_PATH_PROG([PROTOC_C], [protoc-c])
4632 if test "x$PROTOC_C" = "x"
4634 have_protoc_c="no (protoc-c compiler not found)"
4639 # --with-libpython {{{
4640 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4641 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4642 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4644 AC_ARG_WITH([libpython],
4645 [AS_HELP_STRING([--with-libpython], [if we should build with libpython @<:@default=yes@:>@])],
4646 [with_libpython="$withval"],
4647 [with_libpython="check"]
4650 if test "$with_libpython" != "no"; then
4651 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4652 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4653 AC_PATH_PROGS([PYTHON_CONFIG],
4654 [python3-config python2-config python-config]
4656 if test "$PYTHON_CONFIG" = ""; then
4657 if test "$with_libpython" = "yes"; then
4658 AC_MSG_ERROR([Unable to find python-config])
4665 if test "$PYTHON_CONFIG" != ""; then
4666 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4667 if test $? -ne 0; then
4670 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4671 if test $? -ne 0; then
4674 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4675 if test $? -ne 0; then
4680 if test "$with_libpython" != "xno"; then
4681 SAVE_CPPFLAGS="$CPPFLAGS"
4682 SAVE_LDFLAGS="$LDFLAGS"
4684 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4685 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4686 LIBS="$LIBPYTHON_LIBS $LIBS"
4688 AC_CHECK_HEADERS([Python.h],
4690 AC_MSG_CHECKING([for libpython])
4691 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4692 [[#include <Python.h>]],
4693 [[Py_Initialize();]])
4695 [with_libpython="yes"],
4696 [with_libpython="no"]
4698 AC_MSG_RESULT([$with_libpython])
4700 [with_libpython="no"]
4703 CPPFLAGS="$SAVE_CPPFLAGS"
4704 LDFLAGS="$SAVE_LDFLAGS"
4707 # }}} --with-libpython
4709 # --with-librabbitmq {{{
4710 AC_ARG_WITH([librabbitmq],
4711 [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4713 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4714 with_librabbitmq_cppflags="-I$withval/include"
4715 with_librabbitmq_ldflags="-L$withval/lib"
4716 with_librabbitmq="yes"
4718 with_librabbitmq="$withval"
4721 [with_librabbitmq="yes"]
4724 if test "x$with_librabbitmq" = "xyes"; then
4725 SAVE_CPPFLAGS="$CPPFLAGS"
4726 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4728 AC_CHECK_HEADERS([amqp.h],
4729 [with_librabbitmq="yes"],
4730 [with_librabbitmq="no (amqp.h not found)"]
4733 CPPFLAGS="$SAVE_CPPFLAGS"
4736 if test "x$with_librabbitmq" = "xyes"; then
4737 # librabbitmq up to version 0.9.1 provides "library_errno", later
4738 # versions use "library_error". The library does not provide a version
4741 SAVE_CPPFLAGS="$CPPFLAGS"
4742 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4744 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],
4751 #include <inttypes.h>
4755 CPPFLAGS="$SAVE_CPPFLAGS"
4757 SAVE_LDFLAGS="$LDFLAGS"
4758 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4760 AC_CHECK_LIB([rabbitmq], [amqp_basic_publish],
4761 [with_librabbitmq="yes"],
4762 [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"]
4765 LDFLAGS="$SAVE_LDFLAGS"
4768 if test "x$with_librabbitmq" = "xyes"; then
4769 SAVE_CPPFLAGS="$CPPFLAGS"
4770 SAVE_LDFLAGS="$LDFLAGS"
4772 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4773 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4776 AC_CHECK_HEADERS([amqp_tcp_socket.h amqp_socket.h])
4777 AC_CHECK_FUNC([amqp_tcp_socket_new],
4779 AC_DEFINE([HAVE_AMQP_TCP_SOCKET], [1],
4780 [Define if librabbitmq provides the new TCP socket interface.])
4784 AC_CHECK_DECLS([amqp_socket_close],
4789 #ifdef HAVE_AMQP_TCP_SOCKET_H
4790 # include <amqp_tcp_socket.h>
4792 #ifdef HAVE_AMQP_SOCKET_H
4793 # include <amqp_socket.h>
4798 CPPFLAGS="$SAVE_CPPFLAGS"
4799 LDFLAGS="$SAVE_LDFLAGS"
4803 if test "x$with_librabbitmq" = "xyes"; then
4804 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4805 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4806 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4809 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4810 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4811 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4815 # --with-librdkafka {{{
4816 AC_ARG_WITH([librdkafka],
4817 [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4819 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4820 with_librdkafka_cppflags="-I$withval/include"
4821 with_librdkafka_ldflags="-L$withval/lib"
4822 with_librdkafka_rpath="$withval/lib"
4823 with_librdkafka="yes"
4825 with_librdkafka="$withval"
4828 [with_librdkafka="yes"]
4831 if test "x$with_librdkafka" = "xyes"; then
4832 SAVE_CPPFLAGS="$CPPFLAGS"
4833 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4835 AC_CHECK_HEADERS([librdkafka/rdkafka.h],
4836 [with_librdkafka="yes"],
4837 [with_librdkafka="no (librdkafka/rdkafka.h not found)"]
4840 CPPFLAGS="$SAVE_CPPFLAGS"
4843 if test "x$with_librdkafka" = "xyes"; then
4844 SAVE_LDFLAGS="$LDFLAGS"
4845 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4847 AC_CHECK_LIB([rdkafka], [rd_kafka_new],
4848 [with_librdkafka="yes"],
4849 [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4851 AC_CHECK_LIB([rdkafka], [rd_kafka_conf_set_log_cb],
4852 [with_librdkafka_log_cb="yes"],
4853 [with_librdkafka_log_cb="no"])
4855 AC_CHECK_LIB([rdkafka], [rd_kafka_set_logger],
4856 [with_librdkafka_logger="yes"],
4857 [with_librdkafka_logger="no"]
4860 LDFLAGS="$SAVE_LDFLAGS"
4863 if test "x$with_librdkafka" = "xyes"; then
4864 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4865 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4867 if test "x$with_librdkafka_rpath" != "x"; then
4868 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4870 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4873 if test "x$with_librdkafka_log_cb" = "xyes"; then
4874 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4875 else if test "x$with_librdkafka_logger" = "xyes"; then
4876 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4880 AC_SUBST([BUILD_WITH_LIBRDKAFKA_CPPFLAGS])
4881 AC_SUBST([BUILD_WITH_LIBRDKAFKA_LDFLAGS])
4882 AC_SUBST([BUILD_WITH_LIBRDKAFKA_LIBS])
4885 # --with-librouteros {{{
4886 AC_ARG_WITH([librouteros],
4887 [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4889 if test "x$withval" = "xyes" || test "x$withval" = "xno"; then
4890 with_librouteros="$witval"
4892 with_librouteros_cppflags="-I$withval/include"
4893 with_librouteros_ldflags="-L$withval/lib"
4894 with_librouteros="yes"
4897 [with_librouteros="yes"]
4900 if test "x$with_librouteros" = "xyes"; then
4901 SAVE_CPPFLAGS="$CPPFLAGS"
4902 CPPFLAGS="$CPPFLAGS $with_librouteros_cppflags"
4904 AC_CHECK_HEADERS([routeros_api.h],
4905 [with_librouteros="yes"],
4906 [with_librouteros="no (routeros_api.h not found)"]
4909 CPPFLAGS="$SAVE_CPPFLAGS"
4912 if test "x$with_librouteros" = "xyes"; then
4913 SAVE_LDFLAGS="$LDFLAGS"
4914 LDFLAGS="$LDFLAGS $with_librouteros_ldflags"
4916 AC_CHECK_LIB([routeros], [ros_interface],
4917 [with_librouteros="yes"],
4918 [with_librouteros="no (symbol 'ros_interface' not found)"]
4921 LDFLAGS="$SAVE_LDFLAGS"
4924 if test "x$with_librouteros" = "xyes"; then
4925 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$with_librouteros_cppflags"
4926 BUILD_WITH_LIBROUTEROS_LDFLAGS="$with_librouteros_ldflags"
4929 AC_SUBST([BUILD_WITH_LIBROUTEROS_CPPFLAGS])
4930 AC_SUBST([BUILD_WITH_LIBROUTEROS_LDFLAGS])
4934 librrd_threadsafe="no"
4935 librrd_rrdc_update="no"
4936 AC_ARG_WITH([librrd],
4937 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4939 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4940 librrd_cflags="-I$withval/include"
4941 librrd_ldflags="-L$withval/lib"
4944 with_librrd="$withval"
4950 if test "x$with_librrd" = "xyes"; then
4951 SAVE_LDFLAGS="$LDFLAGS"
4952 LDFLAGS="$LDFLAGS $librrd_ldflags"
4953 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4955 AC_CHECK_LIB([rrd], [rrd_update_r],
4956 [librrd_threadsafe="yes"],
4959 AC_CHECK_LIB([rrd], [rrdc_update],
4960 [librrd_rrdc_update="yes"],
4965 LDFLAGS="$SAVE_LDFLAGS"
4967 SAVE_CPPFLAGS="$CPPFLAGS"
4968 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4970 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4972 CPPFLAGS="$SAVE_CPPFLAGS"
4975 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"; then
4976 SAVE_LDFLAGS="$LDFLAGS"
4977 LDFLAGS="$LDFLAGS $librrd_ldflags"
4979 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4981 librrd_ldflags="$librrd_ldflags -lrrd_th"
4982 librrd_threadsafe="yes"
4983 AC_CHECK_LIB([rrd_th], [rrdc_update],
4984 [librrd_rrdc_update="yes"],
4990 LDFLAGS="$SAVE_LDFLAGS"
4993 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"; then
4994 SAVE_LDFLAGS="$LDFLAGS"
4995 LDFLAGS="$LDFLAGS $librrd_ldflags"
4997 AC_CHECK_LIB([rrd], [rrd_update],
4999 librrd_ldflags="$librrd_ldflags -lrrd"
5000 AC_CHECK_LIB([rrd], [rrdc_update],
5001 [librrd_rrdc_update="yes"],
5005 [with_librrd="no (symbol 'rrd_update' not found)"]
5007 LDFLAGS="$SAVE_LDFLAGS"
5010 if test "x$with_librrd" = "xyes"; then
5011 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
5012 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
5013 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
5016 if test "x$librrd_threadsafe" = "xyes"; then
5017 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
5018 [Define to 1 if the rrd library is thread-safe]
5022 AC_SUBST([BUILD_WITH_LIBRRD_CFLAGS])
5023 AC_SUBST([BUILD_WITH_LIBRRD_LDFLAGS])
5024 AC_SUBST([BUILD_WITH_LIBRRD_LIBS])
5027 # --with-libsensors {{{
5028 AC_ARG_WITH([libsensors],
5029 [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
5031 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5032 with_libsensors="$withval"
5034 with_sensors_cppflags="-I$withval/include"
5035 with_sensors_ldflags="-L$withval/lib"
5036 with_libsensors="yes"
5040 if test "x$ac_system" = "xLinux"; then
5041 with_libsensors="yes"
5043 with_libsensors="no (Linux only library)"
5048 if test "x$with_libsensors" = "xyes"; then
5049 SAVE_CPPFLAGS="$CPPFLAGS"
5050 CPPFLAGS="$CPPFLAGS $with_sensors_cppflags"
5052 AC_CHECK_HEADERS([sensors/sensors.h],
5053 [with_libsensors="yes"],
5054 [with_libsensors="no (sensors/sensors.h not found)"]
5057 CPPFLAGS="$SAVE_CPPFLAGS"
5060 if test "x$with_libsensors" = "xyes"; then
5061 SAVE_LDFLAGS="$LDFLAGS"
5062 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
5064 AC_CHECK_LIB([sensors], [sensors_init],
5065 [with_libsensors="yes"],
5066 [with_libsensors="no (libsensors not found)"]
5069 LDFLAGS="$SAVE_LDFLAGS"
5072 if test "x$with_libsensors" = "xyes"; then
5073 BUILD_WITH_LIBSENSORS_CPPFLAGS="$with_sensors_cppflags"
5074 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
5075 BUILD_WITH_LIBSENSORS_LIBS="-lsensors"
5078 AC_SUBST([BUILD_WITH_LIBSENSORS_CPPFLAGS])
5079 AC_SUBST([BUILD_WITH_LIBSENSORS_LDFLAGS])
5080 AC_SUBST([BUILD_WITH_LIBSENSORS_LIBS])
5085 AC_SUBST([LIBSIGROK_CFLAGS])
5086 AC_SUBST([LIBSIGROK_LIBS])
5087 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
5088 [with_libsigrok="yes"],
5089 [with_libsigrok="no (pkg-config could not find libsigrok)"]
5093 # --with-libstatgrab {{{
5094 AC_ARG_WITH([libstatgrab],
5095 [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
5097 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5098 with_libstatgrab_cflags="-I$withval/include"
5099 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
5100 with_libstatgrab="yes"
5101 with_libstatgrab_pkg_config="no"
5103 with_libstatgrab="$withval"
5104 with_libstatgrab_pkg_config="yes"
5108 with_libstatgrab="yes"
5109 with_libstatgrab_pkg_config="yes"
5112 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes"; then
5113 AC_MSG_CHECKING([pkg-config for libstatgrab])
5115 $PKG_CONFIG --exists libstatgrab 2>/dev/null
5116 if test "$?" != "0"; then
5117 with_libstatgrab_pkg_config="no"
5118 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
5119 temp_result="not found"
5121 AC_MSG_RESULT([$temp_result])
5124 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes" && test "x$with_libstatgrab_cflags" = "x"; then
5125 AC_MSG_CHECKING([for libstatgrab CFLAGS])
5126 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
5127 if test "$?" = "0"; then
5128 with_libstatgrab_cflags="$temp_result"
5130 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
5131 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
5133 AC_MSG_RESULT([$temp_result])
5136 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes" && test "x$with_libstatgrab_ldflags" = "x"; then
5137 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
5138 temp_result="`$PKG_CONFIG --libs libstatgrab`"
5141 with_libstatgrab_ldflags="$temp_result"
5143 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
5144 temp_result="$PKG_CONFIG --libs libstatgrab failed"
5146 AC_MSG_RESULT([$temp_result])
5149 if test "x$with_libstatgrab" = "xyes"; then
5150 SAVE_CPPFLAGS="$CPPFLAGS"
5151 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
5153 AC_CHECK_HEADERS([statgrab.h],
5154 [with_libstatgrab="yes"],
5155 [with_libstatgrab="no (statgrab.h not found)"]
5158 CPPFLAGS="$SAVE_CPPFLAGS"
5161 if test "x$with_libstatgrab" = "xyes"; then
5162 SAVE_LDFLAGS="$LDFLAGS"
5163 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5165 AC_CHECK_LIB([statgrab], [sg_init],
5166 [with_libstatgrab="yes"],
5167 [with_libstatgrab="no (symbol sg_init not found)"]
5170 LDFLAGS="$SAVE_LDFLAGS"
5173 if test "x$with_libstatgrab" = "xyes"; then
5174 SAVE_CFLAGS="$CFLAGS"
5175 SAVE_LDFLAGS="$LDFLAGS"
5178 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5179 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5180 LIBS="-lstatgrab $LIBS"
5182 AC_CACHE_CHECK([if libstatgrab >= 0.90],
5183 [c_cv_have_libstatgrab_0_90],
5190 #include <statgrab.h>
5193 if (sg_init()) return 0;
5197 [c_cv_have_libstatgrab_0_90="no"],
5198 [c_cv_have_libstatgrab_0_90="yes"]
5203 CFLAGS="$SAVE_CFLAGS"
5204 LDFLAGS="$SAVE_LDFLAGS"
5208 AM_CONDITIONAL([BUILD_WITH_LIBSTATGRAB], [test "x$with_libstatgrab" = "xyes"])
5210 if test "x$with_libstatgrab" = "xyes"; then
5211 AC_DEFINE([HAVE_LIBSTATGRAB], [1],
5212 [Define to 1 if you have the 'statgrab' library (-lstatgrab)]
5215 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"; then
5216 AC_DEFINE([HAVE_LIBSTATGRAB_0_90], [1],
5217 [Define to 1 if libstatgrab version >= 0.90]
5221 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5222 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5226 AC_SUBST([BUILD_WITH_LIBSTATGRAB_CFLAGS])
5227 AC_SUBST([BUILD_WITH_LIBSTATGRAB_LDFLAGS])
5230 # --with-libtokyotyrant {{{
5231 AC_ARG_WITH([libtokyotyrant],
5232 [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5234 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5235 with_libtokyotyrant="$withval"
5237 with_libtokyotyrant_cppflags="-I$withval/include"
5238 with_libtokyotyrant_ldflags="-L$withval/include"
5239 with_libtokyotyrant_libs="-ltokyotyrant"
5240 with_libtokyotyrant="yes"
5243 [with_libtokyotyrant="yes"]
5246 if test "x$with_libtokyotyrant" = "xyes"; then
5247 if $PKG_CONFIG --exists tokyotyrant; then
5248 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5249 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5250 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5254 if test "x$with_libtokyotyrant" = "xyes"; then
5255 SAVE_CPPFLAGS="$CPPFLAGS"
5256 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5258 AC_CHECK_HEADERS([tcrdb.h],
5259 [with_libtokyotyrant="yes"],
5260 [with_libtokyotyrant="no (tcrdb.h not found)"]
5263 CPPFLAGS="$SAVE_CPPFLAGS"
5266 if test "x$with_libtokyotyrant" = "xyes"; then
5267 SAVE_LDFLAGS="$LDFLAGS"
5268 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5270 AC_CHECK_LIB([tokyotyrant], [tcrdbrnum],
5271 [with_libtokyotyrant="yes"],
5272 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5273 [$with_libtokyotyrant_libs]
5276 LDFLAGS="$SAVE_LDFLAGS"
5279 if test "x$with_libtokyotyrant" = "xyes"; then
5280 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5281 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5282 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5284 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS])
5285 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS])
5286 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_LIBS])
5289 # --with-libudev {{{
5290 AC_ARG_WITH([libudev],
5291 [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5293 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5294 with_libudev="$withval"
5296 with_libudev_cppflags="-I$withval/include"
5297 with_libudev_ldflags="-L$withval/lib"
5302 if test "x$ac_system" = "xLinux"; then
5305 with_libudev="no (Linux only library)"
5310 if test "x$with_libudev" = "xyes"; then
5311 SAVE_CPPFLAGS="$CPPFLAGS"
5312 CPPFLAGS="$CPPFLAGS $with_libudev_cppflags"
5314 AC_CHECK_HEADERS([libudev.h],
5315 [with_libudev="yes"],
5316 [with_libudev="no (libudev.h not found)"]
5319 CPPFLAGS="$SAVE_CPPFLAGS"
5322 if test "x$with_libudev" = "xyes"; then
5323 SAVE_LDFLAGS="$LDFLAGS"
5324 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5326 AC_CHECK_LIB([udev], [udev_new],
5327 [with_libudev="yes"],
5328 [with_libudev="no (libudev not found)"]
5331 LDFLAGS="$SAVE_LDFLAGS"
5334 if test "x$with_libudev" = "xyes"; then
5335 BUILD_WITH_LIBUDEV_CPPFLAGS="$with_libudev_cppflags"
5336 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5337 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5340 AC_SUBST([BUILD_WITH_LIBUDEV_CPPFLAGS])
5341 AC_SUBST([BUILD_WITH_LIBUDEV_LDFLAGS])
5342 AC_SUBST([BUILD_WITH_LIBUDEV_LIBS])
5344 AM_CONDITIONAL([BUILD_WITH_LIBUDEV], [test "x$with_libudev" = "xyes"])
5347 # --with-libupsclient {{{
5348 with_libupsclient_config=""
5349 AC_ARG_WITH([libupsclient],
5350 [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5352 if test "x$withval" = "xno"; then
5353 with_libupsclient="no"
5354 else if test "x$withval" = "xyes"; then
5355 with_libupsclient="use_pkgconfig"
5357 if test -x "$withval"; then
5358 with_libupsclient_config="$withval"
5359 with_libupsclient="use_libupsclient_config"
5360 else if test -x "$withval/bin/libupsclient-config"; then
5361 with_libupsclient_config="$withval/bin/libupsclient-config"
5362 with_libupsclient="use_libupsclient_config"
5364 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5365 with_libupsclient_cflags="-I$withval/include"
5366 with_libupsclient_libs="-L$withval/lib -lupsclient"
5367 with_libupsclient="yes"
5371 [with_libupsclient="use_pkgconfig"]
5374 # configure using libupsclient-config
5375 if test "x$with_libupsclient" = "xuse_libupsclient_config"; then
5376 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5377 if test $? -ne 0; then
5378 with_libupsclient="no ($with_libupsclient_config failed)"
5380 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5381 if test $? -ne 0; then
5382 with_libupsclient="no ($with_libupsclient_config failed)"
5386 if test "x$with_libupsclient" = "xuse_libupsclient_config"; then
5387 with_libupsclient="yes"
5390 # configure using pkg-config
5391 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5392 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5393 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5394 if test $? -ne 0; then
5395 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5399 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5400 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5401 if test $? -ne 0; then
5402 with_libupsclient="no ($PKG_CONFIG failed)"
5405 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5406 if test $? -ne 0; then
5407 with_libupsclient="no ($PKG_CONFIG failed)"
5411 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5412 with_libupsclient="yes"
5415 if test "x$with_libupsclient" = "xyes"; then
5416 SAVE_CPPFLAGS="$CPPFLAGS"
5417 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5419 AC_CHECK_HEADERS([upsclient.h],
5420 [with_libupsclient="yes"],
5421 [with_libupsclient="no (upsclient.h not found)"]
5424 CPPFLAGS="$SAVE_CPPFLAGS"
5427 if test "x$with_libupsclient" = "xyes"; then
5428 SAVE_LDFLAGS="$LDFLAGS"
5429 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5431 AC_CHECK_LIB([upsclient], [upscli_connect],
5432 [with_libupsclient="yes"],
5433 [with_libupsclient="no (symbol upscli_connect not found)"]
5436 AC_CHECK_LIB([upsclient], [upscli_init],
5437 [AC_DEFINE([HAVE_UPSCLI_INIT], [1], [Define when upscli_init() (since version 2-7) is available.])]
5440 AC_CHECK_LIB([upsclient], [upscli_tryconnect],
5441 [AC_DEFINE([HAVE_UPSCLI_TRYCONNECT], [1], [Define when upscli_tryconnect() (since version 2.6.2) is available.])]
5444 LDFLAGS="$SAVE_LDFLAGS"
5447 if test "x$with_libupsclient" = "xyes"; then
5448 SAVE_CPPFLAGS="$CPPFLAGS"
5449 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5451 AC_CHECK_TYPES([UPSCONN_t, UPSCONN],
5457 #include <upsclient.h>
5461 CPPFLAGS="$SAVE_CPPFLAGS"
5464 if test "x$with_libupsclient" = "xyes"; then
5465 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5466 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5469 AC_SUBST([BUILD_WITH_LIBUPSCLIENT_CFLAGS])
5470 AC_SUBST([BUILD_WITH_LIBUPSCLIENT_LIBS])
5473 # --with-libxenctrl {{{
5474 AC_ARG_WITH([libxenctrl],
5475 [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5477 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5478 with_libxenctrl_cppflags="-I$withval/include"
5479 with_libxenctrl_ldflags="-L$withval/lib"
5480 with_libxenctrl="yes"
5482 with_libxenctrl="$withval"
5485 [with_libxenctrl="yes"]
5488 if test "x$with_libxenctrl" = "xyes"; then
5489 SAVE_CPPFLAGS="$CPPFLAGS"
5490 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5492 AC_CHECK_HEADERS([xenctrl.h],
5493 [with_libxenctrl="yes"],
5494 [with_libxenctrl="no (xenctrl.h not found)"]
5497 CPPFLAGS="$SAVE_CPPFLAGS"
5500 if test "x$with_libxenctrl" = "xyes"; then
5501 SAVE_LDFLAGS="$LDFLAGS"
5502 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5504 #Xen versions older than 3.4 has no xc_getcpuinfo()
5505 AC_CHECK_LIB([xenctrl], [xc_getcpuinfo],
5506 [with_libxenctrl="yes"],
5507 [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"]
5510 LDFLAGS="$SAVE_LDFLAGS"
5513 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5514 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5515 AC_SUBST([LIBXENCTL_CPPFLAGS])
5516 AC_SUBST([LIBXENCTL_LDFLAGS])
5519 # --with-libxmms {{{
5520 with_xmms_config="xmms-config"
5521 AC_ARG_WITH([libxmms],
5522 [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5524 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5525 with_libxmms="$withval"
5527 if test -f "$withval" && test -x "$withval"; then
5528 with_xmms_config="$withval"
5529 else if test -x "$withval/bin/xmms-config"; then
5530 with_xmms_config="$withval/bin/xmms-config"
5535 [with_libxmms="yes"]
5538 if test "x$with_libxmms" = "xyes"; then
5539 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5540 if test $? -ne 0; then
5545 if test "x$with_libxmms" = "xyes"; then
5546 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5547 if test $? -ne 0; then
5552 if test "x$with_libxmms" = "xyes"; then
5553 SAVE_CFLAGS="$CFLAGS"
5554 CFLAGS="$with_xmms_cflags"
5556 AC_CHECK_HEADER([xmmsctrl.h],
5557 [with_libxmms="yes"],
5558 [with_libxmms="no"],
5561 CFLAGS="$SAVE_CFLAGS"
5564 if test "x$with_libxmms" = "xyes"; then
5566 LIBS="$with_xmms_libs"
5568 AC_CHECK_LIB([xmms], [xmms_remote_get_info],
5569 [with_libxmss="yes"],
5570 [with_libxmms="no"],
5578 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5579 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5581 AC_SUBST([BUILD_WITH_LIBXMMS_CFLAGS])
5582 AC_SUBST([BUILD_WITH_LIBXMMS_LIBS])
5585 # --with-libyajl {{{
5586 AC_ARG_WITH([libyajl],
5587 [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5589 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5590 with_libyajl_cppflags="-I$withval/include"
5591 with_libyajl_ldflags="-L$withval/lib"
5594 with_libyajl="$withval"
5597 [with_libyajl="yes"]
5600 if test "x$with_libyajl" = "xyes"; then
5601 SAVE_CPPFLAGS="$CPPFLAGS"
5602 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5604 AC_CHECK_HEADERS([yajl/yajl_parse.h],
5605 [with_libyajl="yes"],
5606 [with_libyajl="no (yajl/yajl_parse.h not found)"]
5609 AC_CHECK_HEADERS([yajl/yajl_tree.h],
5610 [with_libyajl2="yes"],
5611 [with_libyajl2="no (yajl/yajl_tree.h not found)"]
5614 AC_CHECK_HEADERS([yajl/yajl_version.h])
5616 CPPFLAGS="$SAVE_CPPFLAGS"
5619 if test "x$with_libyajl" = "xyes"; then
5620 SAVE_LDFLAGS="$LDFLAGS"
5621 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5623 AC_CHECK_LIB([yajl], [yajl_alloc],
5624 [with_libyajl="yes"],
5625 [with_libyajl="no (Symbol 'yajl_alloc' not found)"]
5628 AC_CHECK_LIB([yajl], [yajl_tree_parse],
5629 [with_libyajl2="yes"],
5630 [with_libyajl2="no (Symbol 'yajl_tree_parse' not found)"]
5633 LDFLAGS="$SAVE_LDFLAGS"
5636 if test "x$with_libyajl" = "xyes"; then
5637 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5638 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5639 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5640 AC_DEFINE([HAVE_LIBYAJL], [1], [Define if libyajl is present and usable.])
5643 AC_SUBST([BUILD_WITH_LIBYAJL_CPPFLAGS])
5644 AC_SUBST([BUILD_WITH_LIBYAJL_LDFLAGS])
5645 AC_SUBST([BUILD_WITH_LIBYAJL_LIBS])
5647 AM_CONDITIONAL([BUILD_WITH_LIBYAJL], [test "x$with_libyajl" = "xyes"])
5651 with_mic_cppflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5652 with_mic_ldflags="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5653 with_mic_libs="-lMicAccessSDK -scif"
5655 [AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5657 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5659 else if test -d "$with_mic/lib"; then
5660 with_mic_cppflags="-I$withval/include"
5661 with_mic_ldflags="-L$withval/lib/Linux"
5668 if test "x$with_mic" = "xyes"; then
5669 SAVE_CPPFLAGS="$CPPFLAGS"
5670 CPPFLAGS="$CPPFLAGS $with_mic_cppflags"
5672 AC_CHECK_HEADERS([MicAccessApi.h],
5674 [with_mic="no (MicAccessApi not found)"]
5677 CPPFLAGS="$SAVE_CPPFLAGS"
5680 if test "x$with_mic" = "xyes"; then
5681 SAVE_LDFLAGS="$LDFLAGS"
5682 LDFLAGS="$LDFLAGS $with_mic_ldflags"
5684 AC_CHECK_LIB([MicAccessSDK], [MicInitAPI],
5686 [with_mic="no (symbol MicInitAPI not found)"],
5687 [$PTHREAD_LIBS -lscif]
5690 LDFLAGS="$SAVE_LDFLAGS"
5693 if test "x$with_mic" = "xyes"; then
5694 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cppflags"
5695 BUILD_WITH_MIC_LDFLAGS="$with_mic_ldflags"
5696 BUILD_WITH_MIC_LIBS="$with_mic_libs"
5698 AC_SUBST([BUILD_WITH_MIC_CPPFLAGS])
5699 AC_SUBST([BUILD_WITH_MIC_LDFLAGS])
5700 AC_SUBST([BUILD_WITH_MIC_LIBS])
5703 # --with-libvarnish {{{
5704 AC_ARG_WITH([libvarnish],
5705 [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5707 if test "x$withval" = "xno"; then
5708 with_libvarnish="no"
5709 else if test "x$withval" = "xyes"; then
5710 with_libvarnish="use_pkgconfig"
5711 else if test -d "$with_libvarnish/lib"; then
5712 with_libvarnish_cflags="-I$withval/include"
5713 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5714 with_libvarnish="yes"
5717 [with_libvarnish="use_pkgconfig"]
5720 # configure using pkg-config
5721 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
5722 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5723 if test $? -ne 0; then
5724 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5728 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
5729 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5730 if test $? -ne 0; then
5731 with_libvarnish="no ($PKG_CONFIG failed)"
5734 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5735 if test $? -ne 0; then
5736 with_libvarnish="no ($PKG_CONFIG failed)"
5739 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
5740 with_libvarnish="yes"
5743 if test "x$with_libvarnish" = "xyes"; then
5744 SAVE_CPPFLAGS="$CPPFLAGS"
5745 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5747 AC_CHECK_HEADERS([vapi/vsc.h],
5748 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5750 AC_CHECK_HEADERS([vsc.h],
5751 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support]) ],
5753 AC_CHECK_HEADERS([varnishapi.h],
5754 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5755 [with_libvarnish="no (found none of the varnish header files)"]
5762 CPPFLAGS="$SAVE_CPPFLAGS"
5765 if test "x$with_libvarnish" = "xyes"; then
5766 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5767 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5770 AC_SUBST([BUILD_WITH_LIBVARNISH_CFLAGS])
5771 AC_SUBST([BUILD_WITH_LIBVARNISH_LIBS])
5774 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5775 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5776 if test $? -eq 0; then
5779 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5782 $PKG_CONFIG --exists libvirt 2>/dev/null
5783 if test $? = 0; then
5786 with_libvirt="no (pkg-config doesn't know libvirt)"
5789 if test "x$with_libxml2" = "xyes"; then
5790 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5791 if test $? -ne 0; then
5795 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5796 if test $? -ne 0; then
5801 if test "x$with_libxml2" = "xyes"; then
5802 SAVE_CPPFLAGS="$CPPFLAGS"
5803 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5805 AC_CHECK_HEADERS([libxml/parser.h],
5806 [with_libxml2="yes"],
5807 [with_libxml2="no (libxml/parser.h not found)"]
5810 CPPFLAGS="$SAVE_CPPFLAGS"
5813 if test "x$with_libxml2" = "xyes"; then
5814 SAVE_LDFLAGS="$LDFLAGS"
5815 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5817 AC_CHECK_LIB([xml2], [xmlXPathEval],
5818 [with_libxml2="yes"],
5819 [with_libxml2="no (symbol xmlXPathEval not found)"]
5822 LDFLAGS="$SAVE_LDFLAGS"
5825 if test "x$with_libxml2" = "xyes"; then
5826 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5827 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5830 AC_SUBST([BUILD_WITH_LIBXML2_CFLAGS])
5831 AC_SUBST([BUILD_WITH_LIBXML2_LIBS])
5833 if test "x$with_libvirt" = "xyes"; then
5834 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5835 if test $? -ne 0; then
5839 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5840 if test $? -ne 0; then
5845 if test "x$with_libvirt" = "xyes"; then
5846 SAVE_CPPFLAGS="$CPPFLAGS"
5847 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5849 AC_CHECK_HEADERS([libvirt/libvirt.h],
5850 [with_libvirt="yes"],
5851 [with_libvirt="no (libvirt/libvirt.h not found)"]
5854 CPPFLAGS="$SAVE_CPPFLAGS"
5857 if test "x$with_libvirt" = "xyes"; then
5858 SAVE_LDFLAGS="$LDFLAGS"
5859 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5861 AC_CHECK_LIB([virt], [virDomainBlockStats],
5862 [with_libvirt="yes"],
5863 [with_libvirt="no (symbol virDomainBlockStats not found)"]
5866 LDFLAGS="$SAVE_LDFLAGS"
5869 if test "x$with_libvirt" = "xyes"; then
5870 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5871 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5874 AC_SUBST([BUILD_WITH_LIBVIRT_CFLAGS])
5875 AC_SUBST([BUILD_WITH_LIBVIRT_LIBS])
5878 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5879 with_libopenipmipthread="yes"
5880 AC_MSG_CHECKING([for libOpenIPMIpthread])
5881 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5882 if test $? -ne 0; then
5883 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5885 AC_MSG_RESULT([$with_libopenipmipthread])
5887 if test "x$with_libopenipmipthread" = "xyes"; then
5888 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5889 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5890 if test $? -eq 0; then
5891 with_libopenipmipthread_cflags="$temp_result"
5893 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5894 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5896 AC_MSG_RESULT([$temp_result])
5899 if test "x$with_libopenipmipthread" = "xyes"; then
5900 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5901 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5902 if test $? -eq 0; then
5903 with_libopenipmipthread_ldflags="$temp_result"
5905 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5906 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5908 AC_MSG_RESULT([$temp_result])
5911 if test "x$with_libopenipmipthread" = "xyes"; then
5912 SAVE_CPPFLAGS="$CPPFLAGS"
5913 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5915 AC_CHECK_HEADERS([OpenIPMI/ipmi_smi.h],
5916 [with_libopenipmipthread="yes"],
5917 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5919 #include <OpenIPMI/ipmiif.h>
5920 #include <OpenIPMI/ipmi_err.h>
5921 #include <OpenIPMI/ipmi_posix.h>
5922 #include <OpenIPMI/ipmi_conn.h>
5926 CPPFLAGS="$SAVE_CPPFLAGS"
5929 if test "x$with_libopenipmipthread" = "xyes"; then
5930 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5931 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5934 AC_SUBST([BUILD_WITH_OPENIPMI_CFLAGS])
5935 AC_SUBST([BUILD_WITH_OPENIPMI_LIBS])
5938 # --with-libatasmart {{{
5939 AC_ARG_WITH([libatasmart],
5940 [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5942 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5943 with_libatasmart_cppflags="-I$withval/include"
5944 with_libatasmart_ldflags="-L$withval/lib"
5945 with_libatasmart="yes"
5947 with_libatasmart="$withval"
5951 if test "x$ac_system" = "xLinux"; then
5952 with_libatasmart="yes"
5954 with_libatasmart="no (Linux only library)"
5959 if test "x$with_libatasmart" = "xyes"; then
5960 SAVE_CPPFLAGS="$CPPFLAGS"
5961 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5963 AC_CHECK_HEADERS([atasmart.h],
5964 [with_libatasmart="yes"],
5965 [with_libatasmart="no (atasmart.h not found)"])
5967 CPPFLAGS="$SAVE_CPPFLAGS"
5970 if test "x$with_libatasmart" = "xyes"; then
5971 SAVE_LDFLAGS="$LDFLAGS"
5972 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5974 AC_CHECK_LIB([atasmart], [sk_disk_open],
5975 [with_libatasmart="yes"],
5976 [with_libatasmart="no (Symbol 'sk_disk_open' not found)"]
5979 LDFLAGS="$SAVE_LDFLAGS"
5982 if test "x$with_libatasmart" = "xyes"; then
5983 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
5984 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
5985 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
5988 AC_SUBST([BUILD_WITH_LIBATASMART_CPPFLAGS])
5989 AC_SUBST([BUILD_WITH_LIBATASMART_LDFLAGS])
5990 AC_SUBST([BUILD_WITH_LIBATASMART_LIBS])
5993 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
5994 [with_libnotify="yes"],
5995 [with_libnotify="no (pkg-config doesn't know libnotify)"]
5998 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
5999 [with_libriemann_client="yes"],
6000 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"]
6003 # Check for enabled/disabled features
6006 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
6007 # ------------------------------------------------------------
6009 m4_define([my_toupper],[m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
6014 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
6019 m4_define([EnDis],[disabled])dnl
6020 m4_define([YesNo],[no])dnl
6026 m4_define([EnDis],[enabled])dnl
6027 m4_define([YesNo],[yes])dnl
6030 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
6034 m4_if([$3], [feature], [],
6038 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
6044 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
6046 enable_$1='[YesNo]'dnl
6048 if test "x$enable_$1" = "xno"; then
6051 if test "x$enable_$1" = "xyes"; then
6054 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
6059 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [whether or not to enable $3 $4])
6060 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
6062 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
6064 # AC_PLUGIN(name, default, info)
6065 # ------------------------------------------------------------
6073 [AS_HELP_STRING([--enable-$1],[$3])],
6075 if test "x$enableval" = "xyes"; then
6077 else if test "x$enableval" = "xforce"; then
6081 enable_plugin="no (disabled on command line)"
6085 if test "x$enable_all_plugins" = "xauto"; then
6086 if test "x$2" = "xyes"; then
6092 enable_plugin="$enable_all_plugins"
6096 if test "x$enable_plugin" = "xyes"; then
6097 if test "x$2" = "xyes" || test "x$force" = "xyes"; then
6098 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
6099 if test "x$2" != "xyes"; then
6100 dependency_warning="yes"
6102 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
6103 dependency_error="yes"
6104 enable_plugin="$2 (dependency error)"
6107 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), [test "x$enable_plugin" = "xyes"])
6108 enable_$1="$enable_plugin"
6110 )# AC_PLUGIN(name, default, info)
6112 m4_divert_once([HELP_ENABLE], [
6113 collectd features:])
6114 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
6115 AC_COLLECTD([debug], [enable], [feature], [debugging])
6116 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
6117 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
6118 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
6120 dependency_warning="no"
6121 dependency_error="no"
6124 plugin_barometer="no"
6129 plugin_conntrack="no"
6130 plugin_contextswitch="no"
6133 plugin_cpusleep="no"
6134 plugin_curl_json="no"
6135 plugin_curl_xml="no"
6139 plugin_dpdkevents="no"
6140 plugin_dpdkstat="no"
6147 plugin_hugepages="no"
6148 plugin_intel_pmu="no"
6149 plugin_intel_rdt="no"
6150 plugin_interface="no"
6156 plugin_log_logstash="no"
6159 plugin_multimeter="no"
6162 plugin_ovs_events="no"
6163 plugin_ovs_stats="no"
6166 plugin_processes="no"
6167 plugin_protocols="no"
6172 plugin_synproxy="no"
6174 plugin_tcpconns="no"
6177 plugin_turbostat="no"
6183 plugin_wireless="no"
6184 plugin_write_prometheus="no"
6188 plugin_zookeeper="no"
6191 if test "x$ac_system" = "xLinux"; then
6192 plugin_battery="yes"
6193 plugin_cgroups="yes"
6194 plugin_conntrack="yes"
6195 plugin_contextswitch="yes"
6197 plugin_cpufreq="yes"
6200 plugin_entropy="yes"
6201 plugin_fhcount="yes"
6202 plugin_fscache="yes"
6203 plugin_hugepages="yes"
6204 plugin_interface="yes"
6213 plugin_processes="yes"
6214 plugin_protocols="yes"
6217 plugin_synproxy="yes"
6218 plugin_tcpconns="yes"
6219 plugin_thermal="yes"
6222 plugin_vserver="yes"
6223 plugin_wireless="yes"
6224 plugin_zfs_arc="yes"
6226 if test "x$ac_cv_header_linux_ip_vs_h" = "xyes"; then
6230 if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"; then
6231 plugin_turbostat="yes"
6234 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"; then
6235 plugin_cpusleep="yes"
6238 if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
6239 plugin_ovs_events="yes"
6240 plugin_ovs_stats="yes"
6244 if test "x$ac_system" = "xOpenBSD"; then
6245 plugin_tcpconns="yes"
6248 if test "x$ac_system" = "xNetBSD"; then
6250 plugin_entropy="yes"
6252 plugin_processes="yes"
6256 if test "x$with_libiokit" = "xyes"; then
6257 plugin_battery="yes"
6263 if test "x$ac_system" = "xAIX"; then
6265 plugin_tcpconns="yes"
6270 if test "x$ac_system" = "xFreeBSD"; then
6272 plugin_zfs_arc="yes"
6276 if test "x$with_perfstat" = "xyes"; then
6277 plugin_contextswitch="yes"
6280 plugin_interface="yes"
6287 if test "x$with_procinfo" = "xyes"; then
6288 plugin_processes="yes"
6292 if test "x$with_kstat" = "xyes"; then
6294 plugin_processes="yes"
6296 plugin_zfs_arc="yes"
6300 if test "x$with_devinfo" = "xyes" && test "x$with_kstat" = "xyes"; then
6303 plugin_interface="yes"
6308 if test "x$with_libi2c" = "xyes"; then
6309 plugin_barometer="yes"
6314 if test "x$with_libstatgrab" = "xyes"; then
6317 plugin_interface="yes"
6324 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
6326 if test "x$have_strptime" = "xyes"; then
6331 if test "x$with_libopenipmipthread" = "xyes"; then
6335 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"; then
6336 plugin_curl_json="yes"
6339 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
6340 plugin_curl_xml="yes"
6343 if test "x$with_libyajl" = "xyes"; then
6347 if test "x$have_processor_info" = "xyes"; then
6351 if test "x$have_sysctl" = "xyes"; then
6355 if test "x$ac_system" = "xDarwin"; then
6360 if test "x$have_sysctlbyname" = "xyes"; then
6361 plugin_contextswitch="yes"
6364 plugin_tcpconns="yes"
6367 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"; then
6371 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"; then
6375 if test "x$c_cv_have_one_getmntent" = "xyes"; then
6379 if test "x$c_cv_have_getmntent_r" = "xyes"; then
6383 if test "x$plugin_df" = "xyes"; then
6385 if test "x$have_statfs" = "xyes"; then
6389 if test "x$have_statvfs" = "xyes"; then
6394 if test "x$have_linux_sockios_h" = "xyes" && test "x$have_linux_ethtool_h" = "xyes"; then
6395 plugin_ethstat="yes"
6398 if test "x$with_libgps" = "xyes"; then
6402 if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"; then
6406 if test "x$have_getifaddrs" = "xyes"; then
6407 plugin_interface="yes"
6410 if test "x$have_getloadavg" = "xyes"; then
6414 if test "x$with_libyajl" = "xyes"; then
6415 plugin_log_logstash="yes"
6418 if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then
6422 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"; then
6424 if test "x$with_libmicrohttpd" = "xyes"; then
6425 plugin_write_prometheus="yes"
6429 # Mac OS X memory interface
6430 if test "x$have_host_statistics" = "xyes"; then
6434 if test "x$have_termios_h" = "xyes"; then
6435 if test "x$ac_system" != "xAIX"; then
6436 plugin_multimeter="yes"
6441 if test "x$have_thread_info" = "xyes"; then
6442 plugin_processes="yes"
6445 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"; then
6446 plugin_processes="yes"
6449 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"; then
6450 plugin_processes="yes"
6453 if test "x$with_libpython" != "xno"; then
6457 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"; then
6461 if test "x$with_kvm_getswapinfo" = "xyes"; then
6465 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"; then
6469 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"; then
6473 if test "x$with_kvm_openfiles = "xyes" && $with_kvm_nlist" = "xyes"; then
6474 plugin_tcpconns="yes"
6477 if test "x$have_getutent" = "xyes"; then
6481 if test "x$have_getutxent" = "xyes"; then
6485 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"; then
6489 if test "x$with_libxenctrl" = "xyes"; then
6493 if test "x$with_libdpdk" = "xyes"; then
6494 plugin_dpdkevents="$dpdk_keepalive"
6495 plugin_dpdkstat="yes"
6498 m4_divert_once([HELP_ENABLE], [
6501 AC_ARG_ENABLE([all-plugins],
6502 [AS_HELP_STRING([--enable-all-plugins], [enable all plugins @<:@default=yes@:>@])],
6504 if test "x$enableval" = "xyes"; then
6505 enable_all_plugins="yes"
6506 else if test "x$enableval" = "xauto"; then
6507 enable_all_plugins="auto"
6509 enable_all_plugins="no"
6512 [enable_all_plugins="auto"]
6515 m4_divert_once([HELP_ENABLE], [])
6517 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6518 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6519 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6520 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6521 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6522 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6523 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6524 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6525 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6526 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6527 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6528 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6529 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6530 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6531 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6532 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6533 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6534 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6535 AC_PLUGIN([csv], [yes], [CSV output plugin])
6536 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6537 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6538 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6539 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6540 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6541 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6542 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6543 AC_PLUGIN([dpdkevents], [$plugin_dpdkevents], [Events from DPDK])
6544 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats from DPDK])
6545 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6546 AC_PLUGIN([email], [yes], [EMail statistics])
6547 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6548 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6549 AC_PLUGIN([exec], [yes], [Execution of external programs])
6550 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6551 AC_PLUGIN([filecount], [yes], [Count files in directories])
6552 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6553 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6554 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6555 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6556 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6557 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6558 AC_PLUGIN([intel_pmu], [$with_libjevents], [Intel performance monitor plugin])
6559 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6560 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6561 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6562 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6563 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6564 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6565 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6566 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6567 AC_PLUGIN([load], [$plugin_load], [System load])
6568 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6569 AC_PLUGIN([logfile], [yes], [File logging plugin])
6570 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6571 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6572 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6573 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6574 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6575 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6576 AC_PLUGIN([match_regex], [yes], [The regex match])
6577 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6578 AC_PLUGIN([match_value], [yes], [The value match])
6579 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6580 AC_PLUGIN([mcelog], [$plugin_mcelog], [Machine Check Exceptions notifications])
6581 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6582 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6583 AC_PLUGIN([memcached], [yes], [memcached statistics])
6584 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6585 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6586 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6587 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6588 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6589 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6590 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6591 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6592 AC_PLUGIN([network], [yes], [Network communication plugin])
6593 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6594 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6595 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6596 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6597 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6598 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6599 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6600 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6601 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6602 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6603 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6604 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6605 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6606 AC_PLUGIN([ovs_events], [$plugin_ovs_events], [OVS events plugin])
6607 AC_PLUGIN([ovs_stats], [$plugin_ovs_stats], [OVS statistics plugin])
6608 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6609 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6610 # FIXME: Check for libevent, too.
6611 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6612 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6613 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6614 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6615 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6616 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6617 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6618 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6619 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6620 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6621 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6622 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6623 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6624 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6625 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6626 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6627 AC_PLUGIN([snmp_agent], [$with_libnetsnmpagent], [SNMP agent plugin])
6628 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6629 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6630 AC_PLUGIN([synproxy], [$plugin_synproxy], [Synproxy stats plugin])
6631 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6632 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6633 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6634 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6635 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6636 AC_PLUGIN([target_notification], [yes], [The notification target])
6637 AC_PLUGIN([target_replace], [yes], [The replace target])
6638 AC_PLUGIN([target_scale], [yes], [The scale target])
6639 AC_PLUGIN([target_set], [yes], [The set target])
6640 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6641 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6642 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6643 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6644 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6645 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6646 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6647 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6648 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6649 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6650 AC_PLUGIN([users], [$plugin_users], [User statistics])
6651 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6652 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6653 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6654 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6655 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6656 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6657 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6658 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6659 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6660 AC_PLUGIN([write_log], [yes], [Log output plugin])
6661 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6662 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6663 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6664 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6665 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6666 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6667 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6668 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6669 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6670 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6671 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6673 dnl Default configuration file
6674 # Load either syslog or logfile
6675 LOAD_PLUGIN_SYSLOG=""
6676 LOAD_PLUGIN_LOGFILE=""
6677 LOAD_PLUGIN_LOG_LOGSTASH=""
6679 AC_MSG_CHECKING([which default log plugin to load])
6680 default_log_plugin="none"
6681 if test "x$enable_syslog" = "xyes"; then
6682 default_log_plugin="syslog"
6684 LOAD_PLUGIN_SYSLOG="##"
6687 if test "x$enable_logfile" = "xyes"; then
6688 if test "x$default_log_plugin" = "xnone"; then
6689 default_log_plugin="logfile"
6691 LOAD_PLUGIN_LOGFILE="#"
6694 LOAD_PLUGIN_LOGFILE="##"
6697 if test "x$enable_log_logstash" = "xyes"; then
6698 LOAD_PLUGIN_LOG_LOGSTASH="#"
6700 LOAD_PLUGIN_LOG_LOGSTASH="##"
6703 AC_MSG_RESULT([$default_log_plugin])
6705 AC_SUBST([LOAD_PLUGIN_SYSLOG])
6706 AC_SUBST([LOAD_PLUGIN_LOGFILE])
6707 AC_SUBST([LOAD_PLUGIN_LOG_LOGSTASH])
6709 if test "x$enable_debug" = "xyes"; then
6710 DEFAULT_LOG_LEVEL="debug"
6712 DEFAULT_LOG_LEVEL="info"
6714 AC_SUBST([DEFAULT_LOG_LEVEL])
6716 # Load only one of rrdtool, network, csv in the default config.
6717 LOAD_PLUGIN_RRDTOOL=""
6718 LOAD_PLUGIN_NETWORK=""
6721 AC_MSG_CHECKING([which default write plugin to load])
6722 default_write_plugin="none"
6723 if test "x$enable_rrdtool" = "xyes"; then
6724 default_write_plugin="rrdtool"
6726 LOAD_PLUGIN_RRDTOOL="##"
6729 if test "x$enable_network" = "xyes"; then
6730 if test "x$default_write_plugin" = "xnone"; then
6731 default_write_plugin="network"
6733 LOAD_PLUGIN_NETWORK="#"
6736 LOAD_PLUGIN_NETWORK="##"
6739 if test "x$enable_csv" = "xyes"; then
6740 if test "x$default_write_plugin" = "xnone"; then
6741 default_write_plugin="csv"
6746 LOAD_PLUGIN_CSV="##"
6748 AC_MSG_RESULT([$default_write_plugin])
6750 AC_SUBST([LOAD_PLUGIN_RRDTOOL])
6751 AC_SUBST([LOAD_PLUGIN_NETWORK])
6752 AC_SUBST([LOAD_PLUGIN_CSV])
6755 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6756 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6758 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
6759 PERL_BINDINGS_OPTIONS="$withval"
6760 with_perl_bindings="yes"
6762 with_perl_bindings="$withval"
6766 if test "x$PERL" != "x"; then
6767 with_perl_bindings="yes"
6769 with_perl_bindings="no (no perl interpreter found)"
6773 if test "x$with_perl_bindings" = "xyes"; then
6774 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6775 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6776 AC_MSG_RESULT([yes])
6779 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6783 if test "x$with_perl_bindings" = "xyes"; then
6784 PERL_BINDINGS="perl"
6789 AC_SUBST([PERL_BINDINGS])
6790 AC_SUBST([PERL_BINDINGS_OPTIONS])
6792 dnl libcollectdclient
6793 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6794 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6795 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6797 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6799 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6801 AC_SUBST([LCC_VERSION_MAJOR])
6802 AC_SUBST([LCC_VERSION_MINOR])
6803 AC_SUBST([LCC_VERSION_PATCH])
6804 AC_SUBST([LCC_VERSION_EXTRA])
6805 AC_SUBST([LCC_VERSION_STRING])
6807 AC_CONFIG_FILES([src/libcollectdclient/collectd/lcc_features.h])
6811 if test "x$enable_werror" != "xno"; then
6812 AM_CFLAGS="$AM_CFLAGS -Werror"
6813 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6816 AC_SUBST([AM_CFLAGS])
6817 AC_SUBST([AM_CXXFLAGS])
6822 src/libcollectdclient/libcollectdclient.pc \
6827 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" != "xyes"; then
6828 with_librrd="yes (warning: librrd is not thread-safe)"
6831 if test "x$with_libperl" = "xyes"; then
6832 with_libperl="yes (version `$PERL -MConfig -e 'print $Config{version};'`)"
6834 enable_perl="no (needs libperl)"
6837 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"; then
6838 enable_perl="no (libperl doesn't support ithreads)"
6841 if test "x$with_perl_bindings" = "xyes" && test "x$PERL_BINDINGS_OPTIONS" != "x"; then
6842 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6846 AC_MSG_RESULT([Configuration:])
6847 AC_MSG_RESULT([ Build:])
6848 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6849 AC_MSG_RESULT([ Compiler vendor . . . $ax_cv_c_compiler_vendor])
6850 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6851 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6852 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6853 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6854 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6855 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6856 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6857 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6858 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6859 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6860 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6862 AC_MSG_RESULT([ Libraries:])
6863 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6864 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6865 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6866 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6867 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6868 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6869 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6870 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6871 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6872 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6873 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6874 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6875 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6876 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6877 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6878 AC_MSG_RESULT([ libjevents . . . . . $with_libjevents])
6879 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6880 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6881 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6882 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6883 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6884 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6885 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6886 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6887 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6888 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6889 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6890 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6891 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6892 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6893 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6894 AC_MSG_RESULT([ libnetsnmpagent . . . $with_libnetsnmpagent])
6895 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6896 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6897 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6898 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6899 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6900 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6901 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6902 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6903 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6904 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6905 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6906 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6907 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6908 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6909 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6910 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6911 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6912 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6913 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6914 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6915 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6916 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6917 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6918 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6919 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6920 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6921 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6922 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6923 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6924 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6925 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6926 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6928 AC_MSG_RESULT([ Features:])
6929 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6930 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6932 AC_MSG_RESULT([ Bindings:])
6933 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6935 AC_MSG_RESULT([ Modules:])
6936 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6937 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6938 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6939 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6940 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6941 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6942 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6943 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6944 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6945 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6946 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6947 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6948 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6949 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6950 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6951 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6952 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6953 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6954 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6955 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6956 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6957 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6958 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6959 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6960 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6961 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6962 AC_MSG_RESULT([ dpdkevents. . . . . . $enable_dpdkevents])
6963 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6964 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6965 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6966 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6967 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6968 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6969 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6970 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6971 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
6972 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
6973 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
6974 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
6975 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
6976 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
6977 AC_MSG_RESULT([ intel_pmu . . . . . . $enable_intel_pmu])
6978 AC_MSG_RESULT([ intel_rdt . . . . . . $enable_intel_rdt])
6979 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
6980 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
6981 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
6982 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
6983 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
6984 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
6985 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
6986 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
6987 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
6988 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
6989 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
6990 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
6991 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
6992 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
6993 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
6994 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
6995 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
6996 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
6997 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
6998 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
6999 AC_MSG_RESULT([ mcelog . . . . . . . $enable_mcelog])
7000 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
7001 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
7002 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
7003 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
7004 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
7005 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
7006 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
7007 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
7008 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
7009 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
7010 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
7011 AC_MSG_RESULT([ network . . . . . . . $enable_network])
7012 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
7013 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
7014 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
7015 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
7016 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
7017 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
7018 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
7019 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
7020 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
7021 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
7022 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
7023 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
7024 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
7025 AC_MSG_RESULT([ ovs_events . . . . . $enable_ovs_events])
7026 AC_MSG_RESULT([ ovs_stats . . . . . . $enable_ovs_stats])
7027 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
7028 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
7029 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
7030 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
7031 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
7032 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
7033 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
7034 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
7035 AC_MSG_RESULT([ python . . . . . . . $enable_python])
7036 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
7037 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
7038 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
7039 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
7040 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
7041 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
7042 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
7043 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
7044 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
7045 AC_MSG_RESULT([ snmp_agent . . . . . $enable_snmp_agent])
7046 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
7047 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
7048 AC_MSG_RESULT([ synproxy . . . . . . $enable_synproxy])
7049 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
7050 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
7051 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
7052 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
7053 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
7054 AC_MSG_RESULT([ target_notification . $enable_target_notification])
7055 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
7056 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
7057 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
7058 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
7059 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
7060 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
7061 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
7062 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
7063 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
7064 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
7065 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
7066 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
7067 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
7068 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
7069 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
7070 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
7071 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
7072 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
7073 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
7074 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
7075 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
7076 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
7077 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
7078 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
7079 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
7080 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
7081 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
7082 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
7083 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
7084 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
7085 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
7086 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
7087 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
7088 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
7089 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
7092 if test "x$dependency_error" = "xyes"; then
7093 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
7096 if test "x$dependency_warning" = "xyes"; then
7097 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
7100 # vim: set fdm=marker sw=2 sts=2 ts=2 et :