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([cpuid.h],
525 [have_cpuid_h="yes"],
526 [have_cpuid_h="no (cpuid.h not found)"]
529 AC_CHECK_HEADERS([sys/capability.h],
530 [have_capability="yes"],
531 [have_capability="no (<sys/capability.h> not found)"]
534 if test "x$have_capability" = "xyes"; then
535 AC_CHECK_LIB([cap], [cap_get_proc],
536 [have_capability="yes"],
537 [have_capability="no (cap_get_proc() not found)"]
541 if test "x$have_capability" = "xyes"; then
542 AC_CHECK_DECL([CAP_IS_SUPPORTED],
543 [have_capability="yes"],
544 [have_capability="no (CAP_IS_SUPPORTED not found)"],
545 [[#include <sys/capability.h>]]
549 if test "x$have_capability" = "xyes"; then
550 AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
554 have_linux_raid_md_u_h="no"
555 have_linux_wireless_h="no"
558 AM_CONDITIONAL([BUILD_WITH_CAPABILITY], [test "x$have_capability" = "xyes"])
560 # For the swap module
561 have_sys_swap_h="yes"
562 AC_CHECK_HEADERS([sys/swap.h vm/anon.h],
564 [have_sys_swap_h="no"],
566 #undef _FILE_OFFSET_BITS
567 #undef _LARGEFILE64_SOURCE
569 # include <sys/types.h>
572 # include <sys/param.h>
578 # For the processes plugin
580 AC_CHECK_HEADERS([sys/loadavg.h linux/config.h utmp.h utmpx.h])
583 AC_CHECK_HEADERS([sys/ucred.h], [], [],
586 # include <sys/types.h>
589 # include <sys/param.h>
594 # For mount interface
595 AC_CHECK_HEADERS([sys/mount.h], [], [],
598 # include <sys/types.h>
601 # include <sys/param.h>
608 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
613 if test "x$enable_xfs" != "xno"; then
614 AC_CHECK_HEADERS([xfs/xqm.h],
617 if test "x$enable_xfs" = "xyes"; then
618 AC_MSG_ERROR([xfs/xqm.h not found])
621 [[#define _GNU_SOURCE]]
628 AC_CHECK_HEADERS([arpa/nameser.h])
629 AC_CHECK_HEADERS([arpa/nameser_compat.h], [], [],
631 #if HAVE_ARPA_NAMESER_H
632 # include <arpa/nameser.h>
637 AC_CHECK_HEADERS([net/if_arp.h], [], [],
639 #if HAVE_SYS_SOCKET_H
640 # include <sys/socket.h>
645 AC_CHECK_HEADERS([net/ppp_defs.h])
646 AC_CHECK_HEADERS([net/if_ppp.h], [], [],
648 #if HAVE_NET_PPP_DEFS_H
649 # include <net/ppp_defs.h>
654 AC_CHECK_HEADERS([netinet/if_ether.h], [], [],
658 # include <sys/types.h>
660 #if HAVE_SYS_SOCKET_H
661 # include <sys/socket.h>
666 #if HAVE_NETINET_IN_H
667 # include <netinet/in.h>
672 AC_CHECK_HEADERS([net/pfvar.h],
673 [have_net_pfvar_h="yes"],
674 [have_net_pfvar_h="no"],
677 # include <sys/ioctl.h>
679 #if HAVE_SYS_SOCKET_H
680 # include <sys/socket.h>
685 #if HAVE_NETINET_IN_H
686 # include <netinet/in.h>
691 # For the multimeter plugin
692 AC_CHECK_HEADERS([termios.h],
693 [have_termios_h="yes"],
694 [have_termios_h="no"]
697 # For cpusleep plugin
698 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
699 [c_cv_have_clock_boottime_monotonic],
703 [[#include <time.h>]],
705 struct timespec b, m;
706 clock_gettime(CLOCK_BOOTTIME, &b );
707 clock_gettime(CLOCK_MONOTONIC, &m );
711 [c_cv_have_clock_boottime_monotonic="yes"],
712 [c_cv_have_clock_boottime_monotonic="no"]
719 # Checks for typedefs, structures, and compiler characteristics.
730 [AC_LANG_SOURCE([[int main(void){}]]) ]
732 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
740 # Checks for library functions.
742 AC_CHECK_FUNCS_ONCE([ \
768 SAVE_CFLAGS="$CFLAGS"
769 CFLAGS="-Wall -Werror"
771 AC_CACHE_CHECK([for strtok_r],
772 [c_cv_have_strtok_r_default],
783 char buffer[] = "foo,bar,baz";
790 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
793 printf ("token = %s;\n", token);
798 [c_cv_have_strtok_r_default="yes"],
799 [c_cv_have_strtok_r_default="no"]
804 if test "x$c_cv_have_strtok_r_default" = "xno"; then
805 CFLAGS="$CFLAGS -D_REENTRANT=1"
807 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
808 [c_cv_have_strtok_r_reentrant],
819 char buffer[] = "foo,bar,baz";
826 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
829 printf ("token = %s;\n", token);
834 [c_cv_have_strtok_r_reentrant="yes"],
835 [AC_MSG_FAILURE([strtok_r is not available. Please file a bugreport!])]
841 CFLAGS="$SAVE_CFLAGS"
842 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"; then
843 CFLAGS="$CFLAGS -D_REENTRANT=1"
846 AC_CHECK_FUNCS([socket],
849 AC_CHECK_LIB([socket], [socket],
850 [socket_needs_socket="yes"],
851 [AC_MSG_ERROR([cannot find socket() in libsocket])]
855 AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
857 clock_gettime_needs_posix4="no"
858 AC_CHECK_FUNCS([clock_gettime],
859 [have_clock_gettime="yes"],
860 [have_clock_gettime="no"]
863 if test "x$have_clock_gettime" = "xno"; then
864 AC_CHECK_LIB([rt], [clock_gettime],
866 clock_gettime_needs_rt="yes"
867 have_clock_gettime="yes"
872 if test "x$have_clock_gettime" = "xno"; then
873 AC_CHECK_LIB([posix4], [clock_gettime],
875 clock_gettime_needs_posix4="yes"
876 have_clock_gettime="yes"
881 if test "x$have_clock_gettime" = "xyes"; then
882 AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if the clock_gettime(2) function is available.])
885 AC_CHECK_FUNCS([nanosleep], [],
886 AC_CHECK_LIB([rt], [nanosleep],
887 [nanosleep_needs_rt="yes"],
889 AC_CHECK_LIB([posix4], [nanosleep],
890 [nanosleep_needs_posix4="yes"],
891 [AC_MSG_ERROR([cannot find nanosleep])]
897 AM_CONDITIONAL([BUILD_WITH_LIBRT], [test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes"])
898 AM_CONDITIONAL([BUILD_WITH_LIBPOSIX4], [test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes"])
900 AC_CHECK_FUNCS([getifaddrs], [have_getifaddrs="yes"], [have_getifaddrs="no"])
901 AC_CHECK_FUNCS([getloadavg], [have_getloadavg="yes"], [have_getloadavg="no"])
902 AC_CHECK_FUNCS([getutent], [have_getutent="yes"], [have_getutent="no"])
903 AC_CHECK_FUNCS([getutxent], [have_getutxent="yes"], [have_getutxent="no"])
904 AC_CHECK_FUNCS([host_statistics], [have_host_statistics="yes"], [have_host_statistics="no"])
905 AC_CHECK_FUNCS([processor_info], [have_processor_info="yes"], [have_processor_info="no"])
906 AC_CHECK_FUNCS([statfs], [have_statfs="yes"], [have_statfs="no"])
907 AC_CHECK_FUNCS([statvfs], [have_statvfs="yes"], [have_statvfs="no"])
908 AC_CHECK_FUNCS([sysctl], [have_sysctl="yes"], [have_sysctl="no"])
909 AC_CHECK_FUNCS([sysctlbyname], [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
910 AC_CHECK_FUNCS([syslog], [have_syslog="yes"], [have_syslog="no"])
911 AC_CHECK_FUNCS([thread_info], [have_thread_info="yes"], [have_thread_info="no"])
913 # Check for strptime {{{
914 if test "x$GCC" = "xyes"; then
915 SAVE_CFLAGS="$CFLAGS"
916 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
919 AC_CHECK_FUNCS([strptime], [have_strptime="yes"], [have_strptime="no"])
920 if test "x$have_strptime" = "xyes"; then
921 AC_CACHE_CHECK([whether strptime is exported by default],
922 [c_cv_have_strptime_default],
927 [[#include <time.h>]],
930 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
934 [c_cv_have_strptime_default="yes"],
935 [c_cv_have_strptime_default="no"])
940 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"; then
941 AC_CACHE_CHECK([whether strptime needs standards mode],
942 [c_cv_have_strptime_standards],
948 #ifndef _ISOC99_SOURCE
949 # define _ISOC99_SOURCE 1
951 #ifndef _POSIX_C_SOURCE
952 # define _POSIX_C_SOURCE 200112L
954 #ifndef _XOPEN_SOURCE
955 # define _XOPEN_SOURCE 500
961 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
965 [c_cv_have_strptime_standards="yes"],
966 [c_cv_have_strptime_standards="no"]
971 if test "x$c_cv_have_strptime_standards" = "xyes"; then
972 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], [1],
973 [Set to true if strptime is only exported in X/Open mode (GNU libc).]
980 if test "x$GCC" = "xyes"; then
981 CFLAGS="$SAVE_CFLAGS"
983 # }}} Check for strptime
985 # Check for timegm {{{
987 # These checks need -Werror because implicit function declarations are only a
989 SAVE_CFLAGS="$CFLAGS"
990 CFLAGS="$CFLAGS -Werror"
992 AC_CACHE_CHECK([for timegm],
997 #if STRPTIME_NEEDS_STANDARDS
998 # ifndef _ISOC99_SOURCE
999 # define _ISOC99_SOURCE 1
1001 # ifndef _POSIX_C_SOURCE
1002 # define _POSIX_C_SOURCE 200112L
1004 # ifndef _XOPEN_SOURCE
1005 # define _XOPEN_SOURCE 500
1011 time_t t = timegm(&(struct tm){0});
1012 if (t == ((time_t) -1)) {
1017 [c_cv_have_timegm="yes"],
1018 [c_cv_have_timegm="no"]
1022 if test "x$c_cv_have_timegm" != "xyes"
1024 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1025 [c_cv_have_timegm_bsd],
1029 #if STRPTIME_NEEDS_STANDARDS
1030 # ifndef _ISOC99_SOURCE
1031 # define _ISOC99_SOURCE 1
1033 # ifndef _POSIX_C_SOURCE
1034 # define _POSIX_C_SOURCE 200112L
1036 # ifndef _XOPEN_SOURCE
1037 # define _XOPEN_SOURCE 500
1041 # define _BSD_SOURCE 1
1046 time_t t = timegm(&(struct tm){0});
1047 if (t == ((time_t) -1)) {
1052 [c_cv_have_timegm_bsd="yes"
1053 c_cv_have_timegm="yes"],
1054 [c_cv_have_timegm_bsd="no"]
1059 if test "x$c_cv_have_timegm" = "xyes"
1061 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1062 if test "x$c_cv_have_timegm_bsd" = "xyes"
1064 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1068 CFLAGS="$SAVE_CFLAGS"
1069 # }}} Check for timegm
1071 AC_MSG_CHECKING([for sysctl kern.cp_times])
1072 if test -x /sbin/sysctl; then
1073 /sbin/sysctl kern.cp_times >/dev/null 2>&1
1074 if test $? -eq 0; then
1075 AC_MSG_RESULT([yes])
1076 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIMES], [1], [Define if sysctl supports kern.cp_times])
1084 AC_MSG_CHECKING([for sysctl kern.cp_time])
1085 if test -x /sbin/sysctl; then
1086 /sbin/sysctl kern.cp_time >/dev/null 2>&1
1089 AC_MSG_RESULT([yes])
1090 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIME], [1], [Define if sysctl supports kern.cp_time])
1098 AC_CHECK_FUNCS([swapctl], [have_swapctl="yes"], [have_swapctl="no"])
1099 if test "x$have_swapctl" = "xyes"; then
1100 AC_CACHE_CHECK([whether swapctl takes two arguments],
1101 [c_cv_have_swapctl_two_args],
1107 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1108 # undef _FILE_OFFSET_BITS
1109 # undef _LARGEFILE64_SOURCE
1111 #include <sys/stat.h>
1112 #include <sys/param.h>
1113 #include <sys/swap.h>
1116 [[int num = swapctl(0, NULL);]]
1119 [c_cv_have_swapctl_two_args="yes"],
1120 [c_cv_have_swapctl_two_args="no"]
1125 AC_CACHE_CHECK([whether swapctl takes three arguments],
1126 [c_cv_have_swapctl_three_args],
1132 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1133 # undef _FILE_OFFSET_BITS
1134 # undef _LARGEFILE64_SOURCE
1136 #include <sys/stat.h>
1137 #include <sys/param.h>
1138 #include <sys/swap.h>
1141 [[int num = swapctl(0, NULL, 0);]]
1144 [c_cv_have_swapctl_three_args="yes"],
1145 [c_cv_have_swapctl_three_args="no"]
1151 # Check for different versions of `swapctl' here..
1152 if test "x$have_swapctl" = "xyes"; then
1153 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1154 AC_DEFINE([HAVE_SWAPCTL_TWO_ARGS], [1], [Define if the function swapctl exists and takes two arguments.])
1157 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1158 AC_DEFINE([HAVE_SWAPCTL_THREE_ARGS], [1], [Define if the function swapctl exists and takes three arguments.])
1163 AC_ARG_WITH([nan-emulation],
1164 [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1166 if test "x$withval" = "xno"; then
1168 else if test "x$withval" = "xyes"; then
1177 if test "x$nan_type" = "xnone"; then
1178 AC_CACHE_CHECK([whether NAN is defined by default],
1179 [c_cv_have_nan_default],
1187 static double foo = NAN;
1196 [c_cv_have_nan_default="yes"],
1197 [c_cv_have_nan_default="no"]
1203 if test "x$c_cv_have_nan_default" = "xyes"; then
1207 if test "x$nan_type" = "xnone"; then
1208 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1209 [c_cv_have_nan_isoc],
1216 #define __USE_ISOC99 1
1218 static double foo = NAN;
1227 [c_cv_have_nan_isoc="yes"],
1228 [c_cv_have_nan_isoc="no"]
1234 if test "x$c_cv_have_nan_isoc" = "xyes"; then
1238 if test "x$nan_type" = "xnone"; then
1239 SAVE_LDFLAGS="$LDFLAGS"
1240 LDFLAGS="$LDFLAGS -lm"
1241 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1242 [c_cv_have_nan_zero],
1253 #define NAN (0.0 / 0.0)
1255 # define isnan(f) ((f) != (f))
1257 static double foo = NAN;
1266 [c_cv_have_nan_zero="yes"],
1267 [c_cv_have_nan_zero="no"]
1271 LDFLAGS=$SAVE_LDFLAGS
1274 if test "x$c_cv_have_nan_zero" = "xyes"; then
1278 if test "x$nan_type" = "xdefault"; then
1279 AC_DEFINE([NAN_STATIC_DEFAULT], [1],
1280 [Define if NAN is defined by default and can initialize static variables.]
1282 else if test "x$nan_type" = "xisoc99"; then
1283 AC_DEFINE([NAN_STATIC_ISOC], [1],
1284 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]
1286 else if test "x$nan_type" = "xzero"; then
1287 AC_DEFINE([NAN_ZERO_ZERO], [1],
1288 [Define if NAN can be defined as (0.0 / 0.0)]
1291 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1294 AC_ARG_WITH([fp-layout],
1296 AS_HELP_STRING([--with-fp-layout],
1297 [set the memory layout of doubles. For crosscompiling only.]
1301 if test "x$withval" = "xnothing"; then
1302 fp_layout_type="nothing"
1303 else if test "x$withval" = "xendianflip"; then
1304 fp_layout_type="endianflip"
1305 else if test "x$withval" = "xintswap"; then
1306 fp_layout_type="intswap"
1308 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1311 [fp_layout_type="unknown"]
1314 if test "x$fp_layout_type" = "xunknown"; then
1315 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1316 [c_cv_fp_layout_need_nothing],
1326 #include <inttypes.h>
1327 #include <stdbool.h>
1336 memcpy ((void *) &i0, (void *) &d, 8);
1339 memcpy ((void *) c, (void *) &i1, 8);
1341 if ((c[0] == 0x2f) && (c[1] == 0x25)
1342 && (c[2] == 0xc0) && (c[3] == 0xc7)
1343 && (c[4] == 0x43) && (c[5] == 0x2b)
1344 && (c[6] == 0x1f) && (c[7] == 0x5b))
1350 [c_cv_fp_layout_need_nothing="yes"],
1351 [c_cv_fp_layout_need_nothing="no"]
1357 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1358 fp_layout_type="nothing"
1361 if test "x$fp_layout_type" = "xunknown"; then
1362 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1363 [c_cv_fp_layout_need_endianflip],
1373 #include <inttypes.h>
1374 #include <stdbool.h>
1375 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1376 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1377 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1378 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1379 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1380 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1381 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1382 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1391 memcpy ((void *) &i0, (void *) &d, 8);
1393 i1 = endianflip (i0);
1394 memcpy ((void *) c, (void *) &i1, 8);
1396 if ((c[0] == 0x2f) && (c[1] == 0x25)
1397 && (c[2] == 0xc0) && (c[3] == 0xc7)
1398 && (c[4] == 0x43) && (c[5] == 0x2b)
1399 && (c[6] == 0x1f) && (c[7] == 0x5b))
1405 [c_cv_fp_layout_need_endianflip="yes"],
1406 [c_cv_fp_layout_need_endianflip="no"]
1412 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1413 fp_layout_type="endianflip"
1416 if test "x$fp_layout_type" = "xunknown"; then
1417 AC_CACHE_CHECK([if intswap converts to x86 representation],
1418 [c_cv_fp_layout_need_intswap],
1428 #include <inttypes.h>
1429 #include <stdbool.h>
1430 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1431 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1440 memcpy ((void *) &i0, (void *) &d, 8);
1443 memcpy ((void *) c, (void *) &i1, 8);
1445 if ((c[0] == 0x2f) && (c[1] == 0x25)
1446 && (c[2] == 0xc0) && (c[3] == 0xc7)
1447 && (c[4] == 0x43) && (c[5] == 0x2b)
1448 && (c[6] == 0x1f) && (c[7] == 0x5b))
1454 [c_cv_fp_layout_need_intswap="yes"],
1455 [c_cv_fp_layout_need_intswap="no"]
1461 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1462 fp_layout_type="intswap"
1465 if test "x$fp_layout_type" = "xnothing"; then
1466 AC_DEFINE([FP_LAYOUT_NEED_NOTHING], [1],
1467 [Define if doubles are stored in x86 representation.]
1469 else if test "x$fp_layout_type" = "xendianflip"; then
1470 AC_DEFINE([FP_LAYOUT_NEED_ENDIANFLIP], [1],
1471 [Define if endianflip is needed to convert to x86 representation.]
1473 else if test "x$fp_layout_type" = "xintswap"; then
1474 AC_DEFINE([FP_LAYOUT_NEED_INTSWAP], [1],
1475 [Define if intswap is needed to convert to x86 representation.]
1478 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1481 # For cpusleep plugin
1482 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
1483 [c_cv_have_clock_boottime_monotonic],
1487 [[#include <time.h>]],
1489 struct timespec b, m;
1490 clock_gettime(CLOCK_BOOTTIME, &b );
1491 clock_gettime(CLOCK_MONOTONIC, &m );
1495 [c_cv_have_clock_boottime_monotonic="yes"],
1496 [c_cv_have_clock_boottime_monotonic="no"]
1501 # --with-useragent {{{
1502 AC_ARG_WITH([useragent],
1503 [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1505 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
1506 AC_DEFINE_UNQUOTED([COLLECTD_USERAGENT], ["$withval"], [User agent for http requests])
1513 # --with-data-max-name-len {{{
1514 AC_ARG_WITH([data-max-name-len],
1515 [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1517 if test "x$withval" != "x" && test $withval -gt 0; then
1518 AC_DEFINE_UNQUOTED([DATA_MAX_NAME_LEN], [$withval], [Maximum length of data buffers])
1520 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1523 [AC_DEFINE([DATA_MAX_NAME_LEN], [128], [Maximum length of data buffers])]
1527 AC_CHECK_FUNCS([getfsstat], [have_getfsstat="yes"], [have_getfsstat="no"])
1528 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"], [have_getvfsstat="no"])
1529 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"], [have_listmntent="no"])
1530 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"], [have_getmntent_r="no"])
1532 AC_CHECK_FUNCS(getmntent, [have_getmntent="libc"], [have_getmntent="no"])
1533 if test "x$have_getmntent" = "xno"; then
1534 AC_CHECK_LIB([sun], [getmntent],
1535 [have_getmntent="sun"],
1536 [have_gemntent="no"]
1540 if test "x$have_getmntent" = "xno"; then
1541 AC_CHECK_LIB([seq], [getmntent],
1542 [have_getmntent="seq"],
1543 [have_getmntent="no"]
1547 if test "x$have_getmntent" = "xno"; then
1548 AC_CHECK_LIB([gen], [getmntent],
1549 [have_getmntent="gen"],
1550 [have_getmntent="no"]
1554 if test "x$have_getmntent" = "xlibc"; then
1555 AC_CACHE_CHECK([whether getmntent takes one argument],
1556 [c_cv_have_one_getmntent],
1561 [[#include "$srcdir/src/utils_mount.h"]],
1565 fh = setmntent ("/etc/mtab", "r");
1566 me = getmntent (fh);
1567 return me->mnt_passno;
1571 [c_cv_have_one_getmntent="yes"],
1572 [c_cv_have_one_getmntent="no"]
1577 AC_CACHE_CHECK([whether getmntent takes two arguments],
1578 [c_cv_have_two_getmntent],
1583 [[#include "$srcdir/src/utils_mount.h"]],
1588 fh = fopen ("/etc/mnttab", "r");
1589 status = getmntent (fh, &mt);
1594 [c_cv_have_two_getmntent="yes"],
1595 [c_cv_have_two_getmntent="no"]
1601 # Check for different versions of `getmntent' here..
1603 if test "x$have_getmntent" = "xlibc"; then
1604 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1605 AC_DEFINE([HAVE_ONE_GETMNTENT], [1],
1606 [Define if the function getmntent exists and takes one argument.]
1610 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1611 AC_DEFINE([HAVE_TWO_GETMNTENT], [1],
1612 [Define if the function getmntent exists and takes two arguments.]
1617 if test "x$have_getmntent" = "xsun"; then
1618 AC_DEFINE([HAVE_SUN_GETMNTENT], [1],
1619 [Define if the function getmntent exists. It is the version from libsun.]
1623 if test "x$have_getmntent" = "xgen"; then
1624 AC_DEFINE([HAVE_GEN_GETMNTENT], [1],
1625 [Define if the function getmntent exists. It is the version from libgen.]
1630 AC_CACHE_CHECK([whether htonll is defined],
1637 #include <inttypes.h>
1638 #include <sys/types.h>
1639 #include <netinet/in.h>
1641 [[return htonll(0);]]
1644 [c_cv_have_htonll="yes"],
1645 [c_cv_have_htonll="no"]
1650 if test "x$c_cv_have_htonll" = "xyes"; then
1651 AC_DEFINE([HAVE_HTONLL], [1], [Define if the function htonll exists.])
1654 # Check for structures
1655 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1656 [AC_DEFINE([HAVE_STRUCT_IF_DATA], [1], [Define if struct if_data exists and is usable.])],
1659 #include <sys/types.h>
1660 #include <sys/socket.h>
1665 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1666 [AC_DEFINE([HAVE_STRUCT_NET_DEVICE_STATS], [1], [Define if struct net_device_stats exists and is usable.])],
1669 #include <sys/types.h>
1670 #include <sys/socket.h>
1671 #include <linux/if.h>
1672 #include <linux/netdevice.h>
1676 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1677 [AC_DEFINE([HAVE_STRUCT_LINUX_INET_DIAG_REQ], [1], [Define if struct inet_diag_req exists and is usable.])],
1679 [[#include <linux/inet_diag.h>]]
1682 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1685 #include <netinet/in.h>
1690 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1692 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_FREEBSD], [1], [Define if struct kinfo_proc exists in the FreeBSD variant.])
1693 have_struct_kinfo_proc_freebsd="yes"
1698 #include <sys/param.h>
1699 #include <sys/sysctl.h>
1700 #include <sys/user.h>
1704 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1706 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_OPENBSD], [1], [Define if struct kinfo_proc exists in the OpenBSD variant.])
1707 have_struct_kinfo_proc_openbsd="yes"
1711 #include <sys/param.h>
1712 #include <sys/sysctl.h>
1717 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1719 AC_DEFINE([HAVE_STRUCT_KINFO_PROC2_NETBSD], [1], [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1720 have_struct_kinfo_proc2_netbsd="yes"
1724 #include <sys/param.h>
1725 #include <sys/sysctl.h>
1730 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport],
1735 #define _DEFAULT_SOURCE
1737 #if HAVE_SYS_TYPES_H
1738 # include <sys/types.h>
1740 #if HAVE_NETINET_IN_SYSTM_H
1741 # include <netinet/in_systm.h>
1743 #if HAVE_NETINET_IN_H
1744 # include <netinet/in.h>
1746 #if HAVE_NETINET_IP_H
1747 # include <netinet/ip.h>
1749 #if HAVE_NETINET_UDP_H
1750 # include <netinet/udp.h>
1755 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source],
1760 #define _DEFAULT_SOURCE
1762 #if HAVE_SYS_TYPES_H
1763 # include <sys/types.h>
1765 #if HAVE_NETINET_IN_SYSTM_H
1766 # include <netinet/in_systm.h>
1768 #if HAVE_NETINET_IN_H
1769 # include <netinet/in.h>
1771 #if HAVE_NETINET_IP_H
1772 # include <netinet/ip.h>
1774 #if HAVE_NETINET_UDP_H
1775 # include <netinet/udp.h>
1780 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1783 [[# include <kstat.h>]]
1786 # check for pthread_setname_np
1787 SAVE_LDFLAGS="$LDFLAGS"
1788 LDFLAGS="$LDFLAGS -lpthread"
1790 AC_MSG_CHECKING([for pthread_setname_np])
1791 have_pthread_setname_np="no"
1797 #include <pthread.h>
1799 [[pthread_setname_np((pthread_t) {0}, "conftest");]]
1803 have_pthread_setname_np="yes"
1804 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1808 AC_MSG_RESULT([$have_pthread_setname_np])
1810 # check for pthread_set_name_np(3) (FreeBSD)
1811 AC_MSG_CHECKING([for pthread_set_name_np])
1812 have_pthread_set_name_np="no"
1816 [[#include <pthread_np.h>]],
1817 [[pthread_set_name_np((pthread_t) {0}, "conftest");]]
1821 have_pthread_set_name_np="yes"
1822 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1825 AC_MSG_RESULT([$have_pthread_set_name_np])
1827 LDFLAGS="$SAVE_LDFLAGS"
1829 AC_CHECK_TYPES([struct ip6_ext],
1830 [have_ip6_ext="yes"],
1831 [have_ip6_ext="no"],
1834 #if HAVE_SYS_TYPES_H
1835 # include <sys/types.h>
1837 #if HAVE_NETINET_IN_SYSTM_H
1838 # include <netinet/in_systm.h>
1840 #if HAVE_NETINET_IN_H
1841 # include <netinet/in.h>
1843 #if HAVE_NETINET_IP6_H
1844 # include <netinet/ip6.h>
1849 if test "x$have_ip6_ext" = "xno"; then
1850 SAVE_CFLAGS="$CFLAGS"
1851 CFLAGS="$CFLAGS -DSOLARIS2=8"
1852 AC_CHECK_TYPES([struct ip6_ext],
1853 [have_ip6_ext="yes, with -DSOLARIS2=8"],
1854 [have_ip6_ext="no"],
1857 #if HAVE_SYS_TYPES_H
1858 # include <sys/types.h>
1860 #if HAVE_NETINET_IN_SYSTM_H
1861 # include <netinet/in_systm.h>
1863 #if HAVE_NETINET_IN_H
1864 # include <netinet/in.h>
1866 #if HAVE_NETINET_IP6_H
1867 # include <netinet/ip6.h>
1871 if test "x$have_ip6_ext" = "xno"; then
1872 CFLAGS="$SAVE_CFLAGS"
1877 if test "x$ac_system" = "xLinux"; then
1879 AC_CHECK_HEADERS([i2c/smbus.h],
1880 [with_libi2c_libs="-li2c"]
1882 AC_CHECK_DECL([i2c_smbus_read_i2c_block_data],
1883 [with_libi2c="yes"],
1884 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
1887 #include <linux/i2c-dev.h>
1888 #if HAVE_I2C_SMBUS_H
1889 # include <i2c/smbus.h>
1893 BUILD_WITH_LIBI2C_LIBS="$with_libi2c_libs"
1894 AC_SUBST([BUILD_WITH_LIBI2C_LIBS])
1896 with_libi2c="no (Linux only)"
1900 # Checks for libraries begin here
1903 # Check for libpthread
1905 AC_CHECK_LIB([pthread],
1908 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread])],
1911 PTHREAD_LIBS="$LIBS"
1913 AC_SUBST([PTHREAD_LIBS])
1915 AC_CHECK_HEADERS([pthread.h],
1917 [AC_MSG_ERROR([pthread.h not found])]
1920 m4_divert_once([HELP_WITH], [
1921 Collectd additional packages:])
1923 if test "x$ac_system" = "xAIX"; then
1927 with_perfstat="no (AIX only)"
1928 with_procinfo="no (AIX only)"
1931 if test "x$with_perfstat" = "xyes"; then
1932 AC_CHECK_LIB([perfstat], [perfstat_reset],
1933 [with_perfstat="yes"],
1934 [with_perfstat="no (perfstat not found)"]
1938 if test "x$with_perfstat" = "xyes"; then
1939 AC_DEFINE([HAVE_PERFSTAT], [1], [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1940 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1941 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled],
1944 [[#include <libperfstat.h]]
1946 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"; then
1947 AC_DEFINE([PERFSTAT_SUPPORTS_DONATION], [1], [Define to 1 if your version of the 'perfstat' library supports donation])
1950 AM_CONDITIONAL([BUILD_WITH_PERFSTAT], [test "x$with_perfstat" = "xyes"])
1952 # Processes plugin under AIX.
1953 if test "x$with_procinfo" = "xyes"; then
1954 AC_CHECK_HEADERS([procinfo.h],
1955 [AC_DEFINE([HAVE_PROCINFO_H], [1], [Define to 1 if you have the procinfo.h])],
1956 [with_procinfo="no (procinfo.h not found)"]
1960 if test "x$ac_system" = "xSolaris"; then
1964 with_kstat="no (Solaris only)"
1965 with_devinfo="no (Solaris only)"
1968 if test "x$with_kstat" = "xyes"; then
1969 AC_CHECK_LIB([kstat], [kstat_open],
1971 [with_kstat="no (libkstat not found)"]
1975 if test "x$with_kstat" = "xyes"; then
1976 AC_CHECK_LIB([devinfo], [di_init],
1977 [with_devinfo="yes"],
1978 [with_devinfo="no (not found)"]
1980 AC_CHECK_HEADERS([kstat.h],
1981 [AC_DEFINE(HAVE_LIBKSTAT, [1], [Define to 1 if you have the 'kstat' library (-lkstat)])],
1982 [with_kstat="no (kstat.h not found)"]
1986 AM_CONDITIONAL([BUILD_WITH_LIBDEVINFO], [test "x$with_devinfo" = "xyes"])
1987 AM_CONDITIONAL([BUILD_WITH_LIBKSTAT], [test "x$with_kstat" = "xyes"])
1989 if test "x$ac_system" = "xDarwin"; then
1994 AM_CONDITIONAL([BUILD_WITH_LIBIOKIT], [test "x$with_libiokit" = "xyes"])
1997 AC_CHECK_LIB([kvm], [kvm_getprocs],
1998 [with_kvm_getprocs="yes"],
1999 [with_kvm_getprocs="no"]
2002 if test "x$with_kvm_getprocs" = "xyes"; then
2003 AC_DEFINE([HAVE_LIBKVM_GETPROCS], [1],
2004 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)]
2009 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETPROCS], [test "x$with_kvm_getprocs" = "xyes"])
2011 AC_CHECK_LIB([kvm], [kvm_getswapinfo],
2012 [with_kvm_getswapinfo="yes"],
2013 [with_kvm_getswapinfo="no"]
2016 if test "x$with_kvm_getswapinfo" = "xyes"; then
2017 AC_DEFINE([HAVE_LIBKVM_GETSWAPINFO], [1],
2018 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)]
2023 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETSWAPINFO], [test "x$with_kvm_getswapinfo" = "xyes"])
2025 AC_CHECK_LIB([kvm], [kvm_nlist],
2026 [with_kvm_nlist="yes"],
2027 [with_kvm_nlist="no"]
2030 if test "x$with_kvm_nlist" = "xyes"; then
2031 AC_CHECK_HEADERS([bsd/nlist.h nlist.h])
2032 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2033 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)]
2038 AM_CONDITIONAL([BUILD_WITH_LIBKVM_NLIST], [test "x$with_kvm_nlist" = "xyes"])
2040 AC_CHECK_LIB([kvm], [kvm_openfiles],
2041 [with_kvm_openfiles="yes"],
2042 [with_kvm_openfiles="no"]
2045 if test "x$with_kvm_openfiles" = "xyes"; then
2046 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2047 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)]
2052 # --with-libaquaero5 {{{
2053 AC_ARG_WITH([libaquaero5],
2054 [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
2056 if test "x$withval" = "xyes"; then
2057 with_libaquaero5="yes"
2058 else if test "x$withval" = "xno"; then
2059 with_libaquaero5="no"
2061 with_libaquaero5="yes"
2062 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
2063 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
2066 [with_libaquaero5="yes"]
2069 SAVE_CPPFLAGS="$CPPFLAGS"
2070 SAVE_LDFLAGS="$LDFLAGS"
2071 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
2072 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
2074 if test "x$with_libaquaero5" = "xyes"; then
2075 if test "x$LIBAQUAERO5_CFLAGS" != "x"; then
2076 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
2078 AC_CHECK_HEADERS([libaquaero5.h],
2079 [with_libaquaero5="yes"],
2080 [with_libaquaero5="no (libaquaero5.h not found)"]
2084 if test "x$with_libaquaero5" = "xyes"; then
2085 if test "x$LIBAQUAERO5_LDFLAGS" != "x"; then
2086 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
2088 AC_CHECK_LIB([aquaero5], libaquaero5_poll,
2089 [with_libaquaero5="yes"],
2090 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"]
2094 CPPFLAGS="$SAVE_CPPFLAGS"
2095 LDFLAGS="$SAVE_LDFLAGS"
2097 if test "x$with_libaquaero5" = "xyes"; then
2098 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2099 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2101 AC_SUBST([BUILD_WITH_LIBAQUAERO5_CFLAGS])
2102 AC_SUBST([BUILD_WITH_LIBAQUAERO5_LDFLAGS])
2105 # --with-libhiredis {{{
2106 AC_ARG_WITH([libhiredis],
2107 [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@], [Path to libhiredis.])],
2109 if test "x$withval" = "xyes"; then
2110 with_libhiredis="yes"
2111 else if test "x$withval" = "xno"; then
2112 with_libhiredis="no"
2114 with_libhiredis="yes"
2115 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2116 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2119 [with_libhiredis="yes"]
2122 SAVE_CPPFLAGS="$CPPFLAGS"
2123 SAVE_LDFLAGS="$LDFLAGS"
2124 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2125 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2127 if test "x$with_libhiredis" = "xyes"; then
2128 if test "x$LIBHIREDIS_CPPFLAGS" != "x"; then
2129 AC_MSG_NOTICE([libhiredis CPPFLAGS: $LIBHIREDIS_CPPFLAGS])
2131 AC_CHECK_HEADERS([hiredis/hiredis.h],
2132 [with_libhiredis="yes"],
2133 [with_libhiredis="no (hiredis.h not found)"]
2137 if test "x$with_libhiredis" = "xyes"; then
2138 if test "x$LIBHIREDIS_LDFLAGS" != "x"; then
2139 AC_MSG_NOTICE([libhiredis LDFLAGS: $LIBHIREDIS_LDFLAGS])
2141 AC_CHECK_LIB([hiredis], [redisCommand],
2142 [with_libhiredis="yes"],
2143 [with_libhiredis="no (symbol 'redisCommand' not found)"]
2147 CPPFLAGS="$SAVE_CPPFLAGS"
2148 LDFLAGS="$SAVE_LDFLAGS"
2150 if test "x$with_libhiredis" = "xyes"; then
2151 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2152 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2155 AC_SUBST([BUILD_WITH_LIBHIREDIS_CPPFLAGS])
2156 AC_SUBST([BUILD_WITH_LIBHIREDIS_LDFLAGS])
2159 # --with-libcurl {{{
2160 with_curl_config="curl-config"
2163 AC_ARG_WITH(libcurl,
2164 [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2166 if test "x$withval" = "xno"; then
2168 else if test "x$withval" = "xyes"; then
2171 if test -f "$withval" && test -x "$withval"; then
2172 with_curl_config="$withval"
2174 else if test -x "$withval/bin/curl-config"; then
2175 with_curl_config="$withval/bin/curl-config"
2181 [with_libcurl="yes"]
2184 if test "x$with_libcurl" = "xyes"; then
2185 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2186 curl_config_status=$?
2188 if test $curl_config_status -ne 0; then
2189 with_libcurl="no ($with_curl_config failed)"
2191 SAVE_CPPFLAGS="$CPPFLAGS"
2192 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2194 AC_CHECK_HEADERS([curl/curl.h],
2195 [with_libcurl="yes"],
2196 [with_libcurl="no (curl/curl.h not found)"]
2199 CPPFLAGS="$SAVE_CPPFLAGS"
2203 if test "x$with_libcurl" = "xyes"; then
2204 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2205 curl_config_status=$?
2207 if test $curl_config_status -ne 0; then
2208 with_libcurl="no ($with_curl_config failed)"
2210 AC_CHECK_LIB([curl], [curl_easy_init],
2211 [with_libcurl="yes"],
2212 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2216 AC_CHECK_DECL([CURLOPT_USERNAME],
2217 [have_curlopt_username="yes"],
2218 [have_curlopt_username="no"],
2219 [[#include <curl/curl.h>]]
2222 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2223 [have_curlopt_timeout="yes"],
2224 [have_curlopt_timeout="no"],
2225 [[#include <curl/curl.h>]]
2230 if test "x$with_libcurl" = "xyes"; then
2231 SAVE_CPPFLAGS="$CPPFLAGS"
2232 SAVE_LDFLAGS="$LDFLAGS"
2233 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2234 LDFLAGS="$LDFLAGS $with_curl_libs"
2235 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2236 [c_cv_have_curlinfo_appconnect_time],
2241 [[#include <curl/curl.h>]],
2243 int val = CURLINFO_APPCONNECT_TIME;
2248 [c_cv_have_curlinfo_appconnect_time="yes"],
2249 [c_cv_have_curlinfo_appconnect_time="no"]
2253 CPPFLAGS="$SAVE_CPPFLAGS"
2254 LDFLAGS="$SAVE_LDFLAGS"
2257 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"; then
2258 AC_DEFINE([HAVE_CURLINFO_APPCONNECT_TIME], [1],
2259 [Define if curl.h defines CURLINFO_APPCONNECT_TIME.]
2263 if test "x$with_libcurl" = "xyes"; then
2264 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2265 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2267 if test "x$have_curlopt_username" = "xyes"; then
2268 AC_DEFINE([HAVE_CURLOPT_USERNAME], [1],
2269 [Define if libcurl supports CURLOPT_USERNAME option.]
2273 if test "x$have_curlopt_timeout" = "xyes"; then
2274 AC_DEFINE([HAVE_CURLOPT_TIMEOUT_MS], [1],
2275 [Define if libcurl supports CURLOPT_TIMEOUT_MS option.]
2280 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2281 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2285 AC_ARG_WITH([libdbi],
2286 [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2288 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2289 with_libdbi_cppflags="-I$withval/include"
2290 with_libdbi_ldflags="-L$withval/lib"
2293 with_libdbi="$withval"
2299 if test "x$with_libdbi" = "xyes"; then
2300 SAVE_CPPFLAGS="$CPPFLAGS"
2301 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2303 AC_CHECK_HEADERS([dbi/dbi.h],
2304 [with_libdbi="yes"],
2305 [with_libdbi="no (dbi/dbi.h not found)"]
2308 CPPFLAGS="$SAVE_CPPFLAGS"
2311 if test "x$with_libdbi" = "xyes"; then
2312 SAVE_LDFLAGS="$LDFLAGS"
2313 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2315 AC_CHECK_LIB([dbi], [dbi_initialize],
2316 [with_libdbi="yes"],
2317 [with_libdbi="no (Symbol 'dbi_initialize' not found)"]
2320 LDFLAGS="$SAVE_LDFLAGS"
2323 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2324 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2325 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2326 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2327 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2328 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2331 # --with-libdpdk {{{
2332 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2333 AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
2334 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2335 AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
2337 AC_ARG_WITH([libdpdk],
2338 [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
2339 [with_libdpdk="$withval"],
2340 [with_libdpdk="yes"]
2343 if test "x$with_libdpdk" != "xno"; then
2344 PKG_CHECK_MODULES([DPDK], [libdpdk], [],
2345 [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
2346 if test "x$LIBDPDK_CPPFLAGS" = "x"; then
2347 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2349 if test "x$LIBDPDK_CFLAGS" = "x"; then
2350 LIBDPDK_CFLAGS="$DPDK_CFLAGS"
2351 LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
2353 if test "x$LIBDPDK_LIBS" = "x"; then
2354 if test "x$DPDK_LIBS" != "x"; then
2355 LIBDPDK_LIBS="$DPDK_LIBS"
2357 LIBDPDK_LIBS="-ldpdk"
2360 SAVE_CPPFLAGS="$CPPFLAGS"
2361 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2362 SAVE_CFLAGS="$CFLAGS"
2363 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2364 AC_CHECK_HEADERS([rte_config.h],
2371 #include <rte_version.h>
2372 #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
2373 #error "required DPDK >= 16.07"
2378 [dpdk_keepalive="yes"],
2379 [dpdk_keepalive="no (DPDK version < 16.07)"]
2382 [with_libdpdk="no (rte_config.h not found)"]
2384 CPPFLAGS="$SAVE_CPPFLAGS"
2385 CFLAGS="$SAVE_CFLAGS"
2388 if test "x$with_libdpdk" = "xyes"; then
2389 SAVE_LDFLAGS="$LDFLAGS"
2390 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2391 AC_CHECK_LIB([dpdk], [rte_eal_init],
2392 [with_libdpdk="yes"],
2393 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2395 LDFLAGS="$SAVE_LDFLAGS"
2400 # --with-libesmtp {{{
2401 AC_ARG_WITH([libesmtp],
2402 [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2404 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2405 with_libesmtp_cppflags="-I$withval/include"
2406 with_libesmtp_ldflags="-L$withval/lib"
2409 with_libesmtp="$withval"
2412 [with_libesmtp="yes"]
2415 if test "x$with_libesmtp" = "xyes"; then
2416 SAVE_CPPFLAGS="$CPPFLAGS"
2417 CPPFLAGS="$CPPFLAGS $with_libesmtp_cppflags"
2419 AC_CHECK_HEADERS([libesmtp.h],
2420 [with_libesmtp="yes"],
2421 [with_libesmtp="no (libesmtp.h not found)"]
2424 CPPFLAGS="$SAVE_CPPFLAGS"
2427 if test "x$with_libesmtp" = "xyes"; then
2428 SAVE_LDFLAGS="$LDFLAGS"
2429 LDFLAGS="$LDFLAGS $with_esmtp_ldflags"
2431 AC_CHECK_LIB([esmtp], [smtp_create_session],
2432 [with_libesmtp="yes"],
2433 [with_libesmtp="no (Symbol 'smtp_create_session' not found)"]
2436 LDFLAGS="$SAVE_LDFLAGS"
2439 BUILD_WITH_LIBESMTP_CPPFLAGS="$with_libesmtp_cppflags"
2440 BUILD_WITH_LIBESMTP_LDFLAGS="$with_libesmtp_ldflags"
2441 BUILD_WITH_LIBESMTP_LIBS="-lesmtp"
2442 AC_SUBST(BUILD_WITH_LIBESMTP_CPPFLAGS)
2443 AC_SUBST(BUILD_WITH_LIBESMTP_LDFLAGS)
2444 AC_SUBST(BUILD_WITH_LIBESMTP_LIBS)
2447 # --with-libganglia {{{
2448 AC_ARG_WITH([libganglia],
2449 [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2451 if test -f "$withval" && test -x "$withval"; then
2452 with_libganglia_config="$withval"
2453 with_libganglia="yes"
2454 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"; then
2455 with_libganglia_config="$withval/bin/ganglia-config"
2456 with_libganglia="yes"
2457 else if test -d "$withval"; then
2458 GANGLIA_CPPFLAGS="-I$withval/include"
2459 GANGLIA_LDFLAGS="-L$withval/lib"
2460 with_libganglia="yes"
2462 with_libganglia="$withval"
2465 [with_libganglia="yes"]
2468 if test "x$with_libganglia" = "xyes"; then
2469 if test "x$with_libganglia_config" != "x"; then
2470 if test "x$GANGLIA_CPPFLAGS" = "x"; then
2471 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2474 if test "x$GANGLIA_LDFLAGS" = "x"; then
2475 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2478 if test "x$GANGLIA_LIBS" = "x"; then
2479 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2482 GANGLIA_LIBS="-lganglia"
2486 SAVE_CPPFLAGS="$CPPFLAGS"
2487 SAVE_LDFLAGS="$LDFLAGS"
2488 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2489 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2491 if test "x$with_libganglia" = "xyes"; then
2492 AC_CHECK_HEADERS([gm_protocol.h],
2493 [with_libganglia="yes"],
2494 [with_libganglia="no (gm_protocol.h not found)"]
2498 if test "x$with_libganglia" = "xyes"; then
2499 AC_CHECK_LIB([ganglia], [xdr_Ganglia_value_msg],
2500 [with_libganglia="yes"],
2501 [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"]
2505 CPPFLAGS="$SAVE_CPPFLAGS"
2506 LDFLAGS="$SAVE_LDFLAGS"
2508 AC_SUBST(GANGLIA_CPPFLAGS)
2509 AC_SUBST(GANGLIA_LDFLAGS)
2510 AC_SUBST(GANGLIA_LIBS)
2513 # --with-libgcrypt {{{
2514 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2515 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2516 GCRYPT_LIBS="$GCRYPT_LIBS"
2517 AC_ARG_WITH([libgcrypt],
2518 [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2520 if test -f "$withval" && test -x "$withval"; then
2521 with_libgcrypt_config="$withval"
2522 with_libgcrypt="yes"
2523 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"; then
2524 with_libgcrypt_config="$withval/bin/gcrypt-config"
2525 with_libgcrypt="yes"
2526 else if test -d "$withval"; then
2527 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2528 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2529 with_libgcrypt="yes"
2531 with_libgcrypt_config="gcrypt-config"
2532 with_libgcrypt="$withval"
2536 with_libgcrypt_config="libgcrypt-config"
2537 with_libgcrypt="yes"
2541 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"; then
2542 if test "x$GCRYPT_CPPFLAGS" = "x"; then
2543 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2546 if test "x$GCRYPT_LIBS" = "x"; then
2547 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2551 SAVE_CPPFLAGS="$CPPFLAGS"
2552 SAVE_LDFLAGS="$LDFLAGS"
2554 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2555 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2556 LIBS="$LIBS $GCRYPT_LIBS"
2558 if test "x$with_libgcrypt" = "xyes"; then
2559 if test "x$GCRYPT_CPPFLAGS" != "x"; then
2560 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2562 AC_CHECK_HEADERS([gcrypt.h],
2563 [with_libgcrypt="yes"],
2564 [with_libgcrypt="no (gcrypt.h not found)"]
2568 if test "x$with_libgcrypt" = "xyes"; then
2569 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2570 [with_libgcrypt="yes"],
2571 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"]
2575 CPPFLAGS="$SAVE_CPPFLAGS"
2576 LDFLAGS="$SAVE_LDFLAGS"
2579 AC_SUBST([GCRYPT_CPPFLAGS])
2580 AC_SUBST([GCRYPT_LDFLAGS])
2581 AC_SUBST([GCRYPT_LIBS])
2582 AM_CONDITIONAL([BUILD_WITH_LIBGCRYPT], [test "x$with_libgcrypt" = "xyes"])
2586 AC_ARG_WITH([libgps],
2587 [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2589 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2590 with_libgps_cflags="-I$withval/include"
2591 with_libgps_ldflags="-L$withval/lib"
2594 with_libgps="$withval"
2600 if test "x$with_libgps" = "xyes"; then
2601 SAVE_CFLAGS="$CFLAGS"
2602 CFLAGS="$CFLAGS $with_libgps_cflags"
2604 AC_CHECK_HEADERS([gps.h],
2605 [with_libgps="yes"],
2606 [with_libgps="no (gps.h not found)"]
2609 CFLAGS="$SAVE_CFLAGS"
2612 if test "x$with_libgps" = "xyes"; then
2613 SAVE_LDFLAGS="$LDFLAGS"
2614 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2616 AC_CHECK_LIB([gps], [gps_open],
2617 [with_libgps="yes"],
2618 [with_libgps="no (symbol gps_open not found)"]
2621 LDFLAGS="$SAVE_LDFLAGS"
2624 if test "x$with_libgps" = "xyes"; then
2625 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2626 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2627 BUILD_WITH_LIBGPS_LIBS="-lgps"
2630 AC_SUBST([BUILD_WITH_LIBGPS_CFLAGS])
2631 AC_SUBST([BUILD_WITH_LIBGPS_LDFLAGS])
2632 AC_SUBST([BUILD_WITH_LIBGPS_LIBS])
2636 # --with-libgrpc++ {{{
2637 AC_ARG_WITH([libgrpc++],
2638 [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2640 with_grpcpp="$withval"
2641 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2642 with_libgrpcpp_cppflags="-I$withval/include"
2643 with_libgrpcpp_ldflags="-L$withval/lib"
2644 with_libgrpcpp_bin="$withval/bin"
2645 with_libgrpcpp="yes"
2647 if test "x$withval" = "xno"; then
2648 with_libgrpcpp="no (disabled on command line)"
2653 if test "x$withval" = "xyes"; then
2654 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2655 [with_libgrpcpp="yes"],
2656 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2660 if test "x$withval" != "xno"; then
2661 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2662 if test_cxx_flags -std=c++11; then
2663 AC_MSG_RESULT([yes])
2666 with_libgrpcpp="no (requires C++11 support)"
2670 if test "x$with_libgrpcpp" = "xyes"; then
2672 SAVE_CPPFLAGS="$CPPFLAGS"
2673 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2674 AC_CHECK_HEADERS([grpc++/grpc++.h],
2675 [with_libgrpcpp="yes"],
2676 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2678 CPPFLAGS="$SAVE_CPPFLAGS"
2682 if test "x$with_libgrpcpp" = "xyes"; then
2684 SAVE_CPPFLAGS="$CPPFLAGS"
2685 SAVE_LDFLAGS="$LDFLAGS"
2687 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2688 LDFLAGS="$with_libgrpcpp_ldflags"
2689 if test "x$GRPCPP_LIBS" = "x"; then
2697 [[#include <grpc++/grpc++.h>]],
2698 [[grpc::ServerBuilder sb;]]
2702 with_libgrpcpp="yes"
2703 if test "x$GRPCPP_LIBS" = "x"; then
2704 GRPCPP_LIBS="-lgrpc++"
2707 [with_libgrpcpp="no (libgrpc++ not found)"]
2709 CPPFLAGS="$SAVE_CPPFLAGS"
2710 LDFLAGS="$SAVE_LDFLAGS"
2715 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2716 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2717 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2718 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2719 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2720 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2723 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
2724 if test "x$with_libgrpcpp_bin" = "x"; then
2725 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
2727 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin], [], "$with_libgrpcpp_bin:$PATH")
2729 AM_CONDITIONAL([HAVE_GRPC_CPP], [test "x$GRPC_CPP_PLUGIN" != "x"])
2731 # --with-libiptc {{{
2732 AC_ARG_WITH([libiptc],
2733 [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2735 if test "x$withval" = "xyes"; then
2736 with_libiptc="pkgconfig"
2737 else if test "x$withval" = "xno"; then
2741 with_libiptc_cflags="-I$withval/include"
2742 with_libiptc_libs="-L$withval/lib"
2746 if test "x$ac_system" = "xLinux"; then
2747 with_libiptc="pkgconfig"
2749 with_libiptc="no (Linux only)"
2754 if test "x$with_libiptc" = "xpkgconfig"; then
2755 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2756 if test $? -ne 0; then
2757 with_libiptc="no (pkg-config doesn't know libiptc)"
2761 if test "x$with_libiptc" = "xpkgconfig"; then
2762 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2763 if test $? -ne 0; then
2764 with_libiptc="no ($PKG_CONFIG failed)"
2767 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2768 if test $? -ne 0; then
2769 with_libiptc="no ($PKG_CONFIG failed)"
2773 SAVE_CPPFLAGS="$CPPFLAGS"
2774 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2776 # check whether the header file for libiptc is available.
2777 if test "x$with_libiptc" = "xpkgconfig"; then
2778 AC_CHECK_HEADERS([libiptc/libiptc.h libiptc/libip6tc.h],
2780 [with_libiptc="no (header file missing)"]
2784 # If the header file is available, check for the required type declaractions.
2785 # They may be missing in old versions of libiptc. In that case, they will be
2786 # declared in the iptables plugin.
2787 if test "x$with_libiptc" = "xpkgconfig"; then
2788 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2791 # Check for the iptc_init symbol in the library.
2792 # This could be in iptc or ip4tc
2793 if test "x$with_libiptc" = "xpkgconfig"; then
2795 AC_SEARCH_LIBS([iptc_init], [iptc ip4tc],
2796 [with_libiptc="pkgconfig"],
2797 [with_libiptc="no"],
2798 [$with_libiptc_libs]
2803 if test "x$with_libiptc" = "xpkgconfig"; then
2807 CPPFLAGS="$SAVE_CPPFLAGS"
2809 if test "x$with_libiptc" = "xyes"; then
2810 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2811 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2813 AC_SUBST([BUILD_WITH_LIBIPTC_CPPFLAGS])
2814 AC_SUBST([BUILD_WITH_LIBIPTC_LDFLAGS])
2818 with_java_home="$JAVA_HOME"
2819 if test "x$with_java_home" = "x"; then
2820 with_java_home="/usr/lib/jvm"
2826 [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2828 if test "x$withval" = "xno"; then
2830 else if test "x$withval" = "xyes"; then
2833 with_java_home="$withval"
2840 AX_COMPARE_VERSION([$am__api_version],[lt],[1.12],
2841 [JAVA_TIMESTAMP_FILE="classdist_noinst.stamp"],
2842 [JAVA_TIMESTAMP_FILE="classnoinst.stamp"])
2843 if test "x$with_java" = "xyes"; then
2844 if test -d "$with_java_home"; then
2845 AC_MSG_CHECKING([for jni.h])
2846 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2847 if test "x$TMPVAR" != "x"; then
2848 AC_MSG_RESULT([found in $TMPVAR])
2849 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2851 AC_MSG_RESULT([not found])
2854 AC_MSG_CHECKING([for jni_md.h])
2855 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2856 if test "x$TMPVAR" != "x"; then
2857 AC_MSG_RESULT([found in $TMPVAR])
2858 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2860 AC_MSG_RESULT([not found])
2863 AC_MSG_CHECKING([for libjvm.so])
2864 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`
2865 if test "x$TMPVAR" != "x"; then
2866 AC_MSG_RESULT([found in $TMPVAR])
2867 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2869 AC_MSG_RESULT([not found])
2872 if test "x$JAVAC" = "x"; then
2873 AC_MSG_CHECKING([for javac])
2874 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2875 if test "x$TMPVAR" != "x"; then
2877 AC_MSG_RESULT([$JAVAC])
2879 AC_MSG_RESULT([not found])
2883 if test "x$JAR" = "x"; then
2884 AC_MSG_CHECKING([for jar])
2885 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2886 if test "x$TMPVAR" != "x"; then
2888 AC_MSG_RESULT([$JAR])
2890 AC_MSG_RESULT([not found])
2893 else if test "x$with_java_home" != "x"; then
2894 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2898 if test "x$JAVA_CPPFLAGS" != "x"; then
2899 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2901 if test "x$JAVA_CFLAGS" != "x"; then
2902 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2904 if test "x$JAVA_LDFLAGS" != "x"; then
2905 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2907 if test "x$JAVA_LIBS" != "x"; then
2908 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2910 if test "x$JAVAC" = "x"; then
2911 with_javac_path="$PATH"
2912 if test "x$with_java_home" != "x"; then
2913 with_javac_path="$with_java_home:with_javac_path"
2914 if test -d "$with_java_home/bin"; then
2915 with_javac_path="$with_java_home/bin:with_javac_path"
2919 AC_PATH_PROG([JAVAC], [javac], [], "$with_javac_path")
2922 if test "x$JAVAC" = "x"; then
2923 with_java="no (javac not found)"
2926 if test "x$JAR" = "x"; then
2927 with_jar_path="$PATH"
2928 if test "x$with_java_home" != "x"; then
2929 with_jar_path="$with_java_home:$with_jar_path"
2930 if test -d "$with_java_home/bin"; then
2931 with_jar_path="$with_java_home/bin:$with_jar_path"
2935 AC_PATH_PROG([JAR], [jar], [], "$with_jar_path")
2938 if test "x$JAR" = "x"; then
2939 with_java="no (jar not found)"
2942 SAVE_CPPFLAGS="$CPPFLAGS"
2943 SAVE_CFLAGS="$CFLAGS"
2944 SAVE_LDFLAGS="$LDFLAGS"
2946 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2947 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2948 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2949 LIBS="$LIBS $JAVA_LIBS"
2951 if test "x$with_java" = "xyes"; then
2952 AC_CHECK_HEADERS([jni.h],
2954 [with_java="no (jni.h not found)"])
2957 if test "x$with_java" = "xyes"; then
2958 AC_CHECK_LIB([jvm], [JNI_CreateJavaVM],
2960 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
2961 [$JAVA_LIBS $PTHREAD_LIBS]
2965 if test "x$with_java" = "xyes"; then
2966 JAVA_LIBS="$JAVA_LIBS -ljvm"
2967 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2970 CPPFLAGS="$SAVE_CPPFLAGS"
2971 CFLAGS="$SAVE_CFLAGS"
2972 LDFLAGS="$SAVE_LDFLAGS"
2975 AC_SUBST([JAVA_CPPFLAGS])
2976 AC_SUBST([JAVA_CFLAGS])
2977 AC_SUBST([JAVA_LDFLAGS])
2978 AC_SUBST([JAVA_LIBS])
2979 AC_SUBST([JAVA_TIMESTAMP_FILE])
2980 AM_CONDITIONAL([BUILD_WITH_JAVA], [test "x$with_java" = "xyes"])
2983 # --with-libldap {{{
2984 AC_ARG_WITH([libldap],
2985 [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
2987 if test "x$withval" = "xyes"; then
2989 else if test "x$withval" = "xno"; then
2993 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
2994 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
2997 [with_libldap="yes"]
3000 SAVE_CPPFLAGS="$CPPFLAGS"
3001 SAVE_LDFLAGS="$LDFLAGS"
3003 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
3004 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
3006 if test "x$with_libldap" = "xyes"; then
3007 if test "x$LIBLDAP_CPPFLAGS" != "x"; then
3008 AC_MSG_NOTICE([libldap CPPFLAGS: $LIBLDAP_CPPFLAGS])
3011 AC_CHECK_HEADERS([ldap.h],
3012 [with_libldap="yes"],
3013 [with_libldap="no ('ldap.h' not found)"]
3017 if test "x$with_libldap" = "xyes"; then
3018 if test "x$LIBLDAP_LDFLAGS" != "x"; then
3019 AC_MSG_NOTICE([libldap LDFLAGS: $LIBLDAP_LDFLAGS])
3022 AC_CHECK_LIB([ldap], [ldap_initialize],
3023 [with_libldap="yes"],
3024 [with_libldap="no (symbol 'ldap_initialize' not found)"]
3028 CPPFLAGS="$SAVE_CPPFLAGS"
3029 LDFLAGS="$SAVE_LDFLAGS"
3031 if test "x$with_libldap" = "xyes"
3033 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
3034 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
3036 AC_SUBST([BUILD_WITH_LIBLDAP_CPPFLAGS])
3037 AC_SUBST([BUILD_WITH_LIBLDAP_LDFLAGS])
3041 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
3042 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
3044 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
3045 [with_liblua="yes"],
3049 PKG_CHECK_MODULES([LUA], [lua],
3050 [with_liblua="yes"],
3052 PKG_CHECK_MODULES([LUA], [lua-5.3],
3053 [with_liblua="yes"],
3055 PKG_CHECK_MODULES([LUA], [lua5.3],
3056 [with_liblua="yes"],
3058 PKG_CHECK_MODULES([LUA], [lua53],
3059 [with_liblua="yes"],
3061 PKG_CHECK_MODULES([LUA], [lua-5.2],
3062 [with_liblua="yes"],
3064 PKG_CHECK_MODULES([LUA], [lua5.2],
3065 [with_liblua="yes"],
3067 PKG_CHECK_MODULES([LUA], [lua52],
3068 [with_liblua="yes"],
3070 PKG_CHECK_MODULES([LUA], [lua-5.1],
3071 [with_liblua="yes"],
3073 PKG_CHECK_MODULES([LUA], [lua5.1],
3074 [with_liblua="yes"],
3076 PKG_CHECK_MODULES([LUA], [lua51],
3077 [with_liblua="yes"],
3078 [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_MEMBERS([struct rtnl_link_stats.rx_nohandler],
3687 [[#include <linux/if_link.h>]]
3690 AC_CHECK_MEMBERS([struct rtnl_link_stats64.rx_nohandler],
3693 [[#include <linux/if_link.h>]]
3696 AC_CHECK_LIB([mnl], [mnl_nlmsg_get_payload],
3697 [with_libmnl="yes"],
3698 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3703 if test "x$with_libmnl" = "xyes"; then
3704 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3705 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3707 AC_SUBST([BUILD_WITH_LIBMNL_CFLAGS])
3708 AC_SUBST([BUILD_WITH_LIBMNL_LIBS])
3709 AM_CONDITIONAL([HAVE_LIBMNL], [test "x$with_libmnl" = "xyes"])
3712 # --with-libnetapp {{{
3713 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3714 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3715 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3716 AC_ARG_WITH([libnetapp],
3717 [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3719 if test -d "$withval"; then
3720 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3721 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3722 with_libnetapp="yes"
3724 with_libnetapp="$withval"
3727 [with_libnetapp="yes"]
3730 SAVE_CPPFLAGS="$CPPFLAGS"
3731 SAVE_LDFLAGS="$LDFLAGS"
3732 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3733 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3735 if test "x$with_libnetapp" = "xyes"; then
3736 if test "x$LIBNETAPP_CPPFLAGS" != "x"; then
3737 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
3739 AC_CHECK_HEADERS([netapp_api.h],
3740 [with_libnetapp="yes"],
3741 [with_libnetapp="no (netapp_api.h not found)"]
3745 if test "x$with_libnetapp" = "xyes"; then
3746 if test "x$LIBNETAPP_LDFLAGS" != "x"; then
3747 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
3750 if test "x$LIBNETAPP_LIBS" = "x"; then
3751 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3754 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
3756 AC_CHECK_LIB([netapp], [na_server_invoke_elem],
3757 [with_libnetapp="yes"],
3758 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3762 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3765 CPPFLAGS="$SAVE_CPPFLAGS"
3766 LDFLAGS="$SAVE_LDFLAGS"
3768 AC_SUBST([LIBNETAPP_CPPFLAGS])
3769 AC_SUBST([LIBNETAPP_LDFLAGS])
3770 AC_SUBST([LIBNETAPP_LIBS])
3773 # --with-libnetsnmp {{{
3774 AC_ARG_WITH([libnetsnmp],
3775 [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to libnetsnmp.])],
3777 if test "x$withval" = "xno"; then
3778 with_libnetsnmp="no"
3779 else if test "x$withval" = "xyes"; then
3780 with_libnetsnmp="yes"
3782 with_libnetsnmp_cppflags="-I$withval/include"
3783 with_libnetsnmp_ldflags="-I$withval/lib"
3784 with_libnetsnmp="yes"
3787 [with_libnetsnmp="yes"]
3790 if test "x$with_libnetsnmp" = "xyes"; then
3791 SAVE_CPPFLAGS="$CPPFLAGS"
3792 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3794 AC_CHECK_HEADERS([net-snmp/net-snmp-config.h],
3795 [with_libnetsnmp="yes"],
3796 [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]
3799 AC_CHECK_HEADERS([net-snmp/net-snmp-includes.h],
3800 [with_libnetsnmp="yes"],
3801 [with_libnetsnmp="no (net-snmp/net-snmp-includes.h not found)"],
3803 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3804 # include <net-snmp/net-snmp-config.h>
3809 CPPFLAGS="$SAVE_CPPFLAGS"
3812 if test "x$with_libnetsnmp" = "xyes"; then
3813 SAVE_LDFLAGS="$LDFLAGS"
3814 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3816 AC_CHECK_LIB([netsnmp], [init_snmp],
3817 [with_libnetsmp="yes"],
3818 [with_libnetsnmp="no (libnetsnmp not found)"]
3821 LDFLAGS="$SAVE_LDFLAGS"
3824 if test "x$with_libnetsnmp" = "xyes"; then
3825 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3826 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3827 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3830 AC_SUBST([BUILD_WITH_LIBNETSNMP_CPPFLAGS])
3831 AC_SUBST([BUILD_WITH_LIBNETSNMP_LDFLAGS])
3832 AC_SUBST([BUILD_WITH_LIBNETSNMP_LIBS])
3835 # --with-libnetsmpagent {{{
3836 AC_ARG_WITH([libnetsnmpagent],
3837 [AS_HELP_STRING([--with-libnetsnmpagent@<:@=PREFIX@:>@], [Path to libnetsnmpagent.])],
3839 if test "x$withval" = "xno"; then
3840 with_libnetsnmpagent="no"
3841 else if test "x$withval" = "xyes"; then
3842 with_libnetsnmpagent="yes"
3844 with_libnetsnmpagent_cppflags="-I$withval/include"
3845 with_libnetsnmpagent_ldflags="-I$withval/lib"
3846 with_libnetsnmpagent="yes"
3849 [with_libnetsnmpagent="yes"]
3852 if test "x$with_libnetsnmpagent" = "xyes"; then
3853 SAVE_CPPFLAGS="$CPPFLAGS"
3854 CPPFLAGS="$CPPFLAGS $with_libnetsnmpagent_cppflags"
3856 AC_CHECK_HEADERS([net-snmp/agent/net-snmp-agent-includes.h],
3858 [with_libnetsnmpagent="no (net-snmp/agent/net-snmp-agent-includes.h not found)"],
3860 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3861 # include <net-snmp/net-snmp-config.h>
3863 #if HAVE_NET_SNMP_NET_SNMP_INCLUDES_H
3864 # include <net-snmp/net-snmp-includes.h>
3869 CPPFLAGS="$SAVE_CPPFLAGS"
3872 if test "x$with_libnetsnmpagent" = "xyes"; then
3873 SAVE_LDFLAGS="$LDFLAGS"
3874 LDFLAGS="$LDFLAGS $with_libnetsnmpagent_ldflags"
3876 # older versions of libnetsnmpagent fail to link
3877 # against the helpers library, so do that explicitly
3878 AC_CHECK_LIB([netsnmphelpers], [netsnmp_init_helpers],
3879 [libnetsnmphelpers="-lnetsnmphelpers"],
3880 [libnetsnmphelpers=""]
3883 AC_CHECK_LIB([netsnmpagent], [init_agent],
3884 [with_libnetsnmpagent="yes"],
3885 [with_libnetsnmpagent="no (libnetsnmpagent not found)"],
3886 [$libnetsnmphelpers]
3889 LDFLAGS="$SAVE_LDFLAGS"
3892 if test "x$with_libnetsnmpagent" = "xyes"; then
3893 BUILD_WITH_LIBNETSNMPAGENT_LIBS="-lnetsnmpagent $libnetsnmphelpers"
3896 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS])
3897 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS])
3898 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LIBS])
3901 # --with-liboping {{{
3902 AC_ARG_WITH([liboping],
3903 [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3905 if test "x$withval" = "xyes"; then
3907 else if test "x$withval" = "xno"; then
3911 LIBOPING_CPPFLAGS="-I$withval/include"
3912 LIBOPING_LDFLAGS="-L$withval/lib"
3915 [with_liboping="yes"]
3918 SAVE_CPPFLAGS="$CPPFLAGS"
3919 SAVE_LDFLAGS="$LDFLAGS"
3920 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3921 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3923 if test "x$with_liboping" = "xyes"; then
3924 AC_CHECK_HEADERS([oping.h],
3925 [with_liboping="yes"],
3926 [with_liboping="no (oping.h not found)"]
3930 if test "x$with_liboping" = "xyes"; then
3931 AC_CHECK_LIB([oping], [ping_construct],
3932 [with_liboping="yes"],
3933 [with_liboping="no (symbol 'ping_construct' not found)"]
3937 CPPFLAGS="$SAVE_CPPFLAGS"
3938 LDFLAGS="$SAVE_LDFLAGS"
3940 if test "x$with_liboping" = "xyes"; then
3941 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3942 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3945 AC_SUBST([BUILD_WITH_LIBOPING_CPPFLAGS])
3946 AC_SUBST([BUILD_WITH_LIBOPING_LDFLAGS])
3950 AC_ARG_WITH([oracle],
3951 [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3953 if test "x$withval" = "xyes"; then
3954 if test "x$ORACLE_HOME" = "x"; then
3955 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3958 else if test "x$withval" = "xno"; then
3962 ORACLE_HOME="$withval"
3966 if test "x$ORACLE_HOME" = "x"; then
3967 with_oracle="no (ORACLE_HOME is not set)"
3974 if test "x$ORACLE_HOME" != "x"; then
3975 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3976 if test -e "$ORACLE_HOME/lib/ldflags"; then
3977 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3979 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3982 if test "x$with_oracle" = "xyes"; then
3983 SAVE_CPPFLAGS="$CPPFLAGS"
3984 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3986 AC_CHECK_HEADERS([oci.h],
3987 [with_oracle="yes"],
3988 [with_oracle="no (oci.h not found)"]
3991 CPPFLAGS="$SAVE_CPPFLAGS"
3994 if test "x$with_oracle" = "xyes"; then
3995 SAVE_CPPFLAGS="$CPPFLAGS"
3997 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3998 LIBS="$LIBS $with_oracle_libs"
4000 AC_CHECK_FUNC([OCIEnvCreate],
4001 [with_oracle="yes"],
4002 [with_oracle="no (Symbol 'OCIEnvCreate' not found)"]
4005 CPPFLAGS="$SAVE_CPPFLAGS"
4009 if test "x$with_oracle" = "xyes"; then
4010 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
4011 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
4014 AC_SUBST([BUILD_WITH_ORACLE_CPPFLAGS])
4015 AC_SUBST([BUILD_WITH_ORACLE_LIBS])
4018 # --with-libowcapi {{{
4019 AC_ARG_WITH([libowcapi],
4020 [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
4022 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4023 with_libowcapi_cppflags="-I$withval/include"
4024 with_libowcapi_ldflags="-L$withval/lib"
4025 with_libowcapi="yes"
4027 with_libowcapi="$withval"
4030 [with_libowcapi="yes"]
4033 if test "x$with_libowcapi" = "xyes"; then
4034 SAVE_CPPFLAGS="$CPPFLAGS"
4035 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
4037 AC_CHECK_HEADERS([owcapi.h],
4038 [with_libowcapi="yes"],
4039 [with_libowcapi="no (owcapi.h not found)"]
4042 CPPFLAGS="$SAVE_CPPFLAGS"
4045 if test "x$with_libowcapi" = "xyes"; then
4046 SAVE_LDFLAGS="$LDFLAGS"
4047 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
4049 AC_CHECK_LIB([owcapi], [OW_get],
4050 [with_libowcapi="yes"],
4051 [with_libowcapi="no (libowcapi not found)"]
4054 LDFLAGS="$SAVE_LDFLAGS"
4057 if test "x$with_libowcapi" = "xyes"; then
4058 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
4059 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
4060 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
4063 AC_SUBST([BUILD_WITH_LIBOWCAPI_CPPFLAGS])
4064 AC_SUBST([BUILD_WITH_LIBOWCAPI_LDFLAGS])
4065 AC_SUBST([BUILD_WITH_LIBOWCAPI_LIBS])
4068 # --with-libpcap {{{
4069 AC_ARG_WITH([libpcap],
4070 [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
4072 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4073 with_libpcap_cppflags="-I$withval/include"
4074 with_libpcap_ldflags="$LDFLAGS -L$withval/lib"
4077 with_libpcap="$withval"
4080 [with_libpcap="yes"]
4083 if test "x$with_libpcap" = "xyes"; then
4084 SAVE_CPPFLAGS="$CPPFLAGS"
4085 CPPFLAGS="$CPPFLAGS $with_libpcap_cppflags"
4087 AC_CHECK_HEADERS([pcap.h],
4088 [with_libpcap="yes"],
4089 [with_libpcap="no (pcap.h not found)"]
4092 CPPFLAGS="$SAVE_CPPFLAGS"
4095 if test "x$with_libpcap" = "xyes"; then
4096 SAVE_LDFLAGS="$LDFLAGS"
4097 LDFLAGS="$LDFLAGS $with_libpcap_ldflags"
4099 AC_CHECK_LIB([pcap], [pcap_open_live],
4100 [with_libpcap="yes"],
4101 [with_libpcap="no (libpcap not found)"]
4104 LDFLAGS="$SAVE_LDFLAGS"
4107 if test "x$with_libpcap" = "xyes"; then
4108 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
4109 [c_cv_libpcap_have_pcap_error_iface_not_up],
4114 [[#include <pcap.h>]],
4116 int val = PCAP_ERROR_IFACE_NOT_UP;
4121 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
4122 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]
4128 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"; then
4129 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
4132 if test "x$with_libpcap" = "xyes"; then
4133 BUILD_WITH_LIBPCAP_CPPFLAGS="$with_libpcap_cppflags"
4134 BUILD_WITH_LIBPCAP_LDFLAGS="$with_libpcap_ldflags"
4135 BUILD_WITH_LIBPCAP_LIBS="-lpcap"
4138 AC_SUBST([BUILD_WITH_LIBPCAP_CPPFLAGS])
4139 AC_SUBST([BUILD_WITH_LIBPCAP_LDFLAGS])
4140 AC_SUBST([BUILD_WITH_LIBPCAP_LIBS])
4143 # --with-libperl {{{
4144 AC_ARG_WITH([libperl],
4145 [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
4147 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4148 LDFLAGS="$LDFLAGS -L$withval/lib"
4149 CPPFLAGS="$CPPFLAGS -I$withval/include"
4152 with_libperl="$withval"
4155 [with_libperl="yes"]
4158 AC_ARG_VAR([PERL], [path to Perl interpreter])
4159 AC_PATH_PROG([PERL], [perl])
4161 if test "x$PERL" = "x"; then
4162 with_libperl="no (no Perl interpreter found)"
4165 if test "x$with_libperl" = "xyes"; then
4166 SAVE_CFLAGS="$CFLAGS"
4168 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
4169 PERL_CFLAGS=`ARCHFLAGS="" $PERL -MExtUtils::Embed -e perl_inc`
4170 PERL_LIBS=`ARCHFLAGS="" $PERL -MExtUtils::Embed -e ldopts`
4171 CFLAGS="$CFLAGS $PERL_CFLAGS"
4172 LIBS="$LIBS $PERL_LIBS"
4174 AC_CACHE_CHECK([for libperl],
4175 [c_cv_have_libperl],
4181 #define PERL_NO_GET_CONTEXT
4188 load_module (PERL_LOADMOD_NOIMPORT,
4189 newSVpv ("Collectd::Plugin::FooBar", 24),
4194 [c_cv_have_libperl="yes"],
4195 [c_cv_have_libperl="no"]
4200 CFLAGS="$SAVE_CFLAGS"
4203 if test "x$c_cv_have_libperl" = "xno"; then
4208 if test "x$with_libperl" = "xyes"; then
4209 SAVE_CFLAGS="$CFLAGS"
4211 CFLAGS="$CFLAGS $PERL_CFLAGS"
4212 LIBS="$LIBS $PERL_LIBS"
4214 AC_CACHE_CHECK([if Perl supports ithreads],
4215 [c_cv_have_perl_ithreads],
4225 #if !defined(USE_ITHREADS)
4226 # error "Perl does not support ithreads!"
4227 #endif /* !defined(USE_ITHREADS) */
4232 [c_cv_have_perl_ithreads="yes"],
4233 [c_cv_have_perl_ithreads="no"]
4238 CFLAGS="$SAVE_CFLAGS"
4242 if test "x$with_libperl" = "xyes"; then
4243 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
4244 # (see issues #41 and #42)
4245 SAVE_CFLAGS="$CFLAGS"
4247 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
4248 LIBS="$LIBS $PERL_LIBS"
4250 AC_CACHE_CHECK([for broken Perl_load_module()],
4251 [c_cv_have_broken_perl_load_module],
4257 #define PERL_NO_GET_CONTEXT
4264 load_module (PERL_LOADMOD_NOIMPORT,
4265 newSVpv ("Collectd::Plugin::FooBar", 24),
4270 [c_cv_have_broken_perl_load_module="no"],
4271 [c_cv_have_broken_perl_load_module="yes"]
4276 CFLAGS="$SAVE_CFLAGS"
4280 if test "x$c_cv_have_broken_perl_load_module" = "xyes"; then
4281 PERL_CFLAGS="$PERL_CFLAGS -Wno-nonnull"
4284 if test "x$with_libperl" = "xyes"; then
4285 SAVE_CFLAGS="$CFLAGS"
4287 CFLAGS="$CFLAGS $PERL_CFLAGS"
4288 LIBS="$LIBS $PERL_LIBS"
4291 [struct mgvtbl.svt_local],
4292 [have_struct_mgvtbl_svt_local="yes"],
4293 [have_struct_mgvtbl_svt_local="no"],
4301 if test "x$have_struct_mgvtbl_svt_local" = "xyes"; then
4302 AC_DEFINE([HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL], [1], [Define if Perls struct mgvtbl has member svt_local.])
4305 CFLAGS="$SAVE_CFLAGS"
4308 AC_SUBST([PERL_CFLAGS])
4309 AC_SUBST([PERL_LIBS])
4314 with_pg_config="pg_config"
4315 AC_ARG_WITH([libpq],
4316 [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@], [Path to libpq.])],
4318 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
4319 with_libpq="$withval"
4321 if test -f "$withval" && test -x "$withval"; then
4322 with_pg_config="$withval"
4323 else if test -x "$withval/bin/pg_config"; then
4324 with_pg_config="$withval/bin/pg_config"
4332 if test "x$with_libpq" = "xyes"; then
4333 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
4336 if test $pg_config_status -eq 0; then
4337 if test -n "$with_libpq_includedir"; then
4338 for dir in $with_libpq_includedir; do
4339 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
4343 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4346 SAVE_CPPFLAGS="$CPPFLAGS"
4347 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
4349 AC_CHECK_HEADERS([libpq-fe.h],
4351 [with_libpq="no (libpq-fe.h not found)"]
4354 CPPFLAGS="$SAVE_CPPFLAGS"
4357 if test "x$with_libpq" = "xyes"; then
4358 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
4361 if test $pg_config_status -eq 0
4363 if test -n "$with_libpq_libdir"; then
4364 for dir in $with_libpq_libdir; do
4365 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
4369 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
4372 SAVE_LDFLAGS="$LDFLAGS"
4373 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
4375 AC_CHECK_LIB([pq], [PQserverVersion],
4377 [with_libpq="no (symbol 'PQserverVersion' not found)"])
4379 LDFLAGS="$SAVE_LDFLAGS"
4382 if test "x$with_libpq" = "xyes"; then
4383 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
4384 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
4385 BUILD_WITH_LIBPQ_LIBS="-lpq"
4388 AC_SUBST([BUILD_WITH_LIBPQ_CPPFLAGS])
4389 AC_SUBST([BUILD_WITH_LIBPQ_LDFLAGS])
4390 AC_SUBST([BUILD_WITH_LIBPQ_LIBS])
4393 # --with-libpqos {{{
4394 AC_ARG_WITH([libpqos],
4395 [AS_HELP_STRING([--with-libpqos@<:@=PREFIX@:>@], [Path to libpqos.])],
4397 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4398 with_libpqos_cppflags="-I$withval/include"
4399 with_libpqos_ldflags="-L$withval/lib"
4402 with_libpqos="$withval"
4405 [with_libpqos="yes"]
4408 if test "x$with_libpqos" = "xyes"; then
4409 SAVE_CPPFLAGS="$CPPFLAGS"
4410 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4412 AC_CHECK_HEADERS([pqos.h],
4413 [with_libpqos="yes"],
4414 [with_libpqos="no (pqos.h not found)"]
4417 CPPFLAGS="$SAVE_CPPFLAGS"
4420 if test "x$with_libpqos" = "xyes"; then
4421 SAVE_LDFLAGS="$LDFLAGS"
4422 LDFLAGS="$LDFLAGS $with_libpqos_ldflags"
4424 AC_CHECK_LIB([pqos], [pqos_init],
4425 [with_libpqos="yes"],
4426 [with_libpqos="no (Can't find libpqos)"]
4429 LDFLAGS="$SAVE_LDFLAGS"
4432 if test "x$with_libpqos" = "xyes"; then
4433 SAVE_CPPFLAGS="$CPPFLAGS"
4434 CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
4440 #if PQOS_VERSION < 106
4441 #error "required PQOS version >= 1.06"
4446 [with_libpqos="yes"],
4447 [with_libpqos="no (pqos library version 1.06 or higher is required)"]
4450 CPPFLAGS="$SAVE_CPPFLAGS"
4453 if test "x$with_libpqos" = "xyes"; then
4454 BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
4455 BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
4456 BUILD_WITH_LIBPQOS_LIBS="-lpqos"
4459 AC_SUBST([BUILD_WITH_LIBPQOS_CPPFLAGS])
4460 AC_SUBST([BUILD_WITH_LIBPQOS_LDFLAGS])
4461 AC_SUBST([BUILD_WITH_LIBPQOS_LIBS])
4464 # --with-libjevents {{{
4465 with_libjevents_cppflags=""
4466 with_libjevents_ldflags=""
4467 AC_ARG_WITH([libjevents],
4468 [AS_HELP_STRING([--with-libjevents@<:@=PREFIX@:>@], [Path to libjevents.])],
4470 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4471 with_libjevents_cppflags="-I$withval/include"
4472 with_libjevents_ldflags="-L$withval/lib"
4473 with_libjevents="yes"
4475 with_libjevents="$withval"
4478 [with_libjevents="yes"]
4481 if test "x$with_libjevents" = "xyes"; then
4482 SAVE_CPPFLAGS="$CPPFLAGS"
4483 CPPFLAGS="$CPPFLAGS $with_libjevents_cppflags"
4485 AC_CHECK_HEADERS([jevents.h], [with_libjevents="yes"], [with_libjevents="no (jevents.h not found)"])
4487 CPPFLAGS="$SAVE_CPPFLAGS"
4489 if test "x$with_libjevents" = "xyes"; then
4490 SAVE_LDFLAGS="$LDFLAGS"
4491 LDFLAGS="$LDFLAGS $with_libjevents_ldflags"
4493 AC_CHECK_LIB([jevents], [json_events], [with_libjevents="yes"], [with_libjevents="no (Can't find libjevents)"])
4495 LDFLAGS="$SAVE_LDFLAGS"
4497 if test "x$with_libjevents" = "xyes"; then
4498 BUILD_WITH_LIBJEVENTS_CPPFLAGS="$with_libjevents_cppflags"
4499 BUILD_WITH_LIBJEVENTS_LDFLAGS="$with_libjevents_ldflags"
4500 BUILD_WITH_LIBJEVENTS_LIBS="-ljevents"
4502 AC_SUBST([BUILD_WITH_LIBJEVENTS_CPPFLAGS])
4503 AC_SUBST([BUILD_WITH_LIBJEVENTS_LDFLAGS])
4504 AC_SUBST([BUILD_WITH_LIBJEVENTS_LIBS])
4507 # --with-libprotobuf {{{
4508 with_libprotobuf_cppflags=""
4509 with_libprotobuf_ldflags=""
4510 AC_ARG_WITH([libprotobuf],
4511 [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
4513 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4514 with_libprotobuf_cppflags="-I$withval/include"
4515 with_libprotobuf_ldflags="-L$withval/lib"
4516 with_libprotobuf="yes"
4518 if test "x$withval" = "xno"; then
4519 with_libprotobuf="no (disabled on command line)"
4525 if test "x$withval" = "xyes"; then
4526 PKG_CHECK_MODULES([PROTOBUF], [protobuf],
4527 [with_libprotobuf="yes"],
4528 [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
4532 if test "x$withval" != "xno"; then
4533 SAVE_LDFLAGS="$LDFLAGS"
4535 LDFLAGS="$with_libprotobuf_ldflags"
4536 LIBS="$PROTOBUF_LIBS $LIBS"
4538 AC_CHECK_LIB([protobuf], [main],
4540 SAVE_CPPFLAGS="$CPPFLAGS"
4541 CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4542 if test "x$PROTOBUF_LIBS" = "x"
4544 PROTOBUF_LIBS="-lprotobuf"
4546 AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
4547 [with_libprotobuf="yes"],
4548 [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
4550 CPPFLAGS="$SAVE_CPPFLAGS"
4552 [with_libprotobuf="no (libprotobuf not found)"]
4555 LDFLAGS="$SAVE_LDFLAGS"
4559 BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
4560 BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
4561 BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
4562 AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
4563 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
4564 AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
4567 AC_ARG_VAR([PROTOC], [path to the protoc binary])
4568 AC_PATH_PROG([PROTOC], [protoc])
4570 if test "x$PROTOC" != "x"; then
4571 AC_MSG_CHECKING([for protoc 3.0.0+])
4572 if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
4573 protoc3="yes (`$PROTOC --version`)"
4576 protoc3="no (`$PROTOC --version`)"
4578 AC_MSG_RESULT([$protoc3])
4580 AM_CONDITIONAL([HAVE_PROTOC3], [test "x$have_protoc3" = "xyes"])
4582 # --with-libprotobuf-c {{{
4583 AC_ARG_WITH([libprotobuf-c],
4584 [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
4586 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4587 with_libprotobuf_c_cppflags="-I$withval/include"
4588 with_libprotobuf_c_ldflags="-L$withval/lib"
4589 with_libprotobuf_c="yes"
4592 if test "x$withval" = "xno"; then
4593 with_libprotobuf_c="no (disabled on command line)"
4599 if test "x$withval" = "xyes"; then
4600 PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
4601 [with_libprotobuf_c="yes"],
4602 [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
4606 if test "x$withval" != "xno"; then
4607 SAVE_LDFLAGS="$LDFLAGS"
4609 LDFLAGS="$with_libprotobuf_c_ldflags"
4610 LIBS="$PROTOBUF_C_LIBS $LIBS"
4611 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
4613 SAVE_CPPFLAGS="$CPPFLAGS"
4614 CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4615 if test "x$PROTOBUF_C_LIBS" = "x"; then
4616 PROTOBUF_C_LIBS="-lprotobuf-c"
4619 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
4621 with_libprotobuf_c="yes"
4624 [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
4627 CPPFLAGS="$SAVE_CPPFLAGS"
4629 [with_libprotobuf_c="no (libprotobuf-c not found)"]
4631 LDFLAGS="$SAVE_LDFLAGS"
4635 BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
4636 BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
4637 BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
4638 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
4639 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
4640 AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
4643 AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
4644 AC_PATH_PROG([PROTOC_C], [protoc-c])
4645 if test "x$PROTOC_C" = "x"
4647 have_protoc_c="no (protoc-c compiler not found)"
4652 # --with-libpython {{{
4653 AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
4654 AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
4655 AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
4657 AC_ARG_WITH([libpython],
4658 [AS_HELP_STRING([--with-libpython], [if we should build with libpython @<:@default=yes@:>@])],
4659 [with_libpython="$withval"],
4660 [with_libpython="check"]
4663 if test "$with_libpython" != "no"; then
4664 if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
4665 AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
4666 AC_PATH_PROGS([PYTHON_CONFIG],
4667 [python3-config python2-config python-config]
4669 if test "$PYTHON_CONFIG" = ""; then
4670 if test "$with_libpython" = "yes"; then
4671 AC_MSG_ERROR([Unable to find python-config])
4678 if test "$PYTHON_CONFIG" != ""; then
4679 LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
4680 if test $? -ne 0; then
4683 LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
4684 if test $? -ne 0; then
4687 LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
4688 if test $? -ne 0; then
4693 if test "$with_libpython" != "xno"; then
4694 SAVE_CPPFLAGS="$CPPFLAGS"
4695 SAVE_LDFLAGS="$LDFLAGS"
4697 CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
4698 LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
4699 LIBS="$LIBPYTHON_LIBS $LIBS"
4701 AC_CHECK_HEADERS([Python.h],
4703 AC_MSG_CHECKING([for libpython])
4704 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4705 [[#include <Python.h>]],
4706 [[Py_Initialize();]])
4708 [with_libpython="yes"],
4709 [with_libpython="no"]
4711 AC_MSG_RESULT([$with_libpython])
4713 [with_libpython="no"]
4716 CPPFLAGS="$SAVE_CPPFLAGS"
4717 LDFLAGS="$SAVE_LDFLAGS"
4720 # }}} --with-libpython
4722 # --with-librabbitmq {{{
4723 AC_ARG_WITH([librabbitmq],
4724 [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
4726 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4727 with_librabbitmq_cppflags="-I$withval/include"
4728 with_librabbitmq_ldflags="-L$withval/lib"
4729 with_librabbitmq="yes"
4731 with_librabbitmq="$withval"
4734 [with_librabbitmq="yes"]
4737 if test "x$with_librabbitmq" = "xyes"; then
4738 SAVE_CPPFLAGS="$CPPFLAGS"
4739 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4741 AC_CHECK_HEADERS([amqp.h],
4742 [with_librabbitmq="yes"],
4743 [with_librabbitmq="no (amqp.h not found)"]
4746 CPPFLAGS="$SAVE_CPPFLAGS"
4749 if test "x$with_librabbitmq" = "xyes"; then
4750 # librabbitmq up to version 0.9.1 provides "library_errno", later
4751 # versions use "library_error". The library does not provide a version
4754 SAVE_CPPFLAGS="$CPPFLAGS"
4755 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4757 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],
4764 #include <inttypes.h>
4768 CPPFLAGS="$SAVE_CPPFLAGS"
4770 SAVE_LDFLAGS="$LDFLAGS"
4771 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4773 AC_CHECK_LIB([rabbitmq], [amqp_basic_publish],
4774 [with_librabbitmq="yes"],
4775 [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"]
4778 LDFLAGS="$SAVE_LDFLAGS"
4781 if test "x$with_librabbitmq" = "xyes"; then
4782 SAVE_CPPFLAGS="$CPPFLAGS"
4783 SAVE_LDFLAGS="$LDFLAGS"
4785 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
4786 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
4789 AC_CHECK_HEADERS([amqp_tcp_socket.h amqp_socket.h])
4790 AC_CHECK_FUNC([amqp_tcp_socket_new],
4792 AC_DEFINE([HAVE_AMQP_TCP_SOCKET], [1],
4793 [Define if librabbitmq provides the new TCP socket interface.])
4797 AC_CHECK_DECLS([amqp_socket_close],
4802 #ifdef HAVE_AMQP_TCP_SOCKET_H
4803 # include <amqp_tcp_socket.h>
4805 #ifdef HAVE_AMQP_SOCKET_H
4806 # include <amqp_socket.h>
4811 CPPFLAGS="$SAVE_CPPFLAGS"
4812 LDFLAGS="$SAVE_LDFLAGS"
4816 if test "x$with_librabbitmq" = "xyes"; then
4817 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
4818 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
4819 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
4822 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
4823 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
4824 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
4828 # --with-librdkafka {{{
4829 AC_ARG_WITH([librdkafka],
4830 [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
4832 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4833 with_librdkafka_cppflags="-I$withval/include"
4834 with_librdkafka_ldflags="-L$withval/lib"
4835 with_librdkafka_rpath="$withval/lib"
4836 with_librdkafka="yes"
4838 with_librdkafka="$withval"
4841 [with_librdkafka="yes"]
4844 if test "x$with_librdkafka" = "xyes"; then
4845 SAVE_CPPFLAGS="$CPPFLAGS"
4846 CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
4848 AC_CHECK_HEADERS([librdkafka/rdkafka.h],
4849 [with_librdkafka="yes"],
4850 [with_librdkafka="no (librdkafka/rdkafka.h not found)"]
4853 CPPFLAGS="$SAVE_CPPFLAGS"
4856 if test "x$with_librdkafka" = "xyes"; then
4857 SAVE_LDFLAGS="$LDFLAGS"
4858 LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
4860 AC_CHECK_LIB([rdkafka], [rd_kafka_new],
4861 [with_librdkafka="yes"],
4862 [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
4864 AC_CHECK_LIB([rdkafka], [rd_kafka_conf_set_log_cb],
4865 [with_librdkafka_log_cb="yes"],
4866 [with_librdkafka_log_cb="no"])
4868 AC_CHECK_LIB([rdkafka], [rd_kafka_set_logger],
4869 [with_librdkafka_logger="yes"],
4870 [with_librdkafka_logger="no"]
4873 LDFLAGS="$SAVE_LDFLAGS"
4876 if test "x$with_librdkafka" = "xyes"; then
4877 BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
4878 BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
4880 if test "x$with_librdkafka_rpath" != "x"; then
4881 BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
4883 BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
4886 if test "x$with_librdkafka_log_cb" = "xyes"; then
4887 AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
4888 else if test "x$with_librdkafka_logger" = "xyes"; then
4889 AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
4893 AC_SUBST([BUILD_WITH_LIBRDKAFKA_CPPFLAGS])
4894 AC_SUBST([BUILD_WITH_LIBRDKAFKA_LDFLAGS])
4895 AC_SUBST([BUILD_WITH_LIBRDKAFKA_LIBS])
4898 # --with-librouteros {{{
4899 AC_ARG_WITH([librouteros],
4900 [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
4902 if test "x$withval" = "xyes" || test "x$withval" = "xno"; then
4903 with_librouteros="$witval"
4905 with_librouteros_cppflags="-I$withval/include"
4906 with_librouteros_ldflags="-L$withval/lib"
4907 with_librouteros="yes"
4910 [with_librouteros="yes"]
4913 if test "x$with_librouteros" = "xyes"; then
4914 SAVE_CPPFLAGS="$CPPFLAGS"
4915 CPPFLAGS="$CPPFLAGS $with_librouteros_cppflags"
4917 AC_CHECK_HEADERS([routeros_api.h],
4918 [with_librouteros="yes"],
4919 [with_librouteros="no (routeros_api.h not found)"]
4922 CPPFLAGS="$SAVE_CPPFLAGS"
4925 if test "x$with_librouteros" = "xyes"; then
4926 SAVE_LDFLAGS="$LDFLAGS"
4927 LDFLAGS="$LDFLAGS $with_librouteros_ldflags"
4929 AC_CHECK_LIB([routeros], [ros_interface],
4930 [with_librouteros="yes"],
4931 [with_librouteros="no (symbol 'ros_interface' not found)"]
4934 LDFLAGS="$SAVE_LDFLAGS"
4937 if test "x$with_librouteros" = "xyes"; then
4938 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$with_librouteros_cppflags"
4939 BUILD_WITH_LIBROUTEROS_LDFLAGS="$with_librouteros_ldflags"
4942 AC_SUBST([BUILD_WITH_LIBROUTEROS_CPPFLAGS])
4943 AC_SUBST([BUILD_WITH_LIBROUTEROS_LDFLAGS])
4947 librrd_threadsafe="no"
4948 librrd_rrdc_update="no"
4949 AC_ARG_WITH([librrd],
4950 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
4952 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4953 librrd_cflags="-I$withval/include"
4954 librrd_ldflags="-L$withval/lib"
4957 with_librrd="$withval"
4963 if test "x$with_librrd" = "xyes"; then
4964 SAVE_LDFLAGS="$LDFLAGS"
4965 LDFLAGS="$LDFLAGS $librrd_ldflags"
4966 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
4968 AC_CHECK_LIB([rrd], [rrd_update_r],
4969 [librrd_threadsafe="yes"],
4972 AC_CHECK_LIB([rrd], [rrdc_update],
4973 [librrd_rrdc_update="yes"],
4978 LDFLAGS="$SAVE_LDFLAGS"
4980 SAVE_CPPFLAGS="$CPPFLAGS"
4981 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
4983 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
4985 CPPFLAGS="$SAVE_CPPFLAGS"
4988 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"; then
4989 SAVE_LDFLAGS="$LDFLAGS"
4990 LDFLAGS="$LDFLAGS $librrd_ldflags"
4992 AC_CHECK_LIB([rrd_th], [rrd_update_r],
4994 librrd_ldflags="$librrd_ldflags -lrrd_th"
4995 librrd_threadsafe="yes"
4996 AC_CHECK_LIB([rrd_th], [rrdc_update],
4997 [librrd_rrdc_update="yes"],
5003 LDFLAGS="$SAVE_LDFLAGS"
5006 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"; then
5007 SAVE_LDFLAGS="$LDFLAGS"
5008 LDFLAGS="$LDFLAGS $librrd_ldflags"
5010 AC_CHECK_LIB([rrd], [rrd_update],
5012 librrd_ldflags="$librrd_ldflags -lrrd"
5013 AC_CHECK_LIB([rrd], [rrdc_update],
5014 [librrd_rrdc_update="yes"],
5018 [with_librrd="no (symbol 'rrd_update' not found)"]
5020 LDFLAGS="$SAVE_LDFLAGS"
5023 if test "x$with_librrd" = "xyes"; then
5024 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
5025 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
5026 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
5029 if test "x$librrd_threadsafe" = "xyes"; then
5030 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
5031 [Define to 1 if the rrd library is thread-safe]
5035 AC_SUBST([BUILD_WITH_LIBRRD_CFLAGS])
5036 AC_SUBST([BUILD_WITH_LIBRRD_LDFLAGS])
5037 AC_SUBST([BUILD_WITH_LIBRRD_LIBS])
5040 # --with-libsensors {{{
5041 AC_ARG_WITH([libsensors],
5042 [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
5044 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5045 with_libsensors="$withval"
5047 with_sensors_cppflags="-I$withval/include"
5048 with_sensors_ldflags="-L$withval/lib"
5049 with_libsensors="yes"
5053 if test "x$ac_system" = "xLinux"; then
5054 with_libsensors="yes"
5056 with_libsensors="no (Linux only library)"
5061 if test "x$with_libsensors" = "xyes"; then
5062 SAVE_CPPFLAGS="$CPPFLAGS"
5063 CPPFLAGS="$CPPFLAGS $with_sensors_cppflags"
5065 AC_CHECK_HEADERS([sensors/sensors.h],
5066 [with_libsensors="yes"],
5067 [with_libsensors="no (sensors/sensors.h not found)"]
5070 CPPFLAGS="$SAVE_CPPFLAGS"
5073 if test "x$with_libsensors" = "xyes"; then
5074 SAVE_LDFLAGS="$LDFLAGS"
5075 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
5077 AC_CHECK_LIB([sensors], [sensors_init],
5078 [with_libsensors="yes"],
5079 [with_libsensors="no (libsensors not found)"]
5082 LDFLAGS="$SAVE_LDFLAGS"
5085 if test "x$with_libsensors" = "xyes"; then
5086 BUILD_WITH_LIBSENSORS_CPPFLAGS="$with_sensors_cppflags"
5087 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
5088 BUILD_WITH_LIBSENSORS_LIBS="-lsensors"
5091 AC_SUBST([BUILD_WITH_LIBSENSORS_CPPFLAGS])
5092 AC_SUBST([BUILD_WITH_LIBSENSORS_LDFLAGS])
5093 AC_SUBST([BUILD_WITH_LIBSENSORS_LIBS])
5098 AC_SUBST([LIBSIGROK_CFLAGS])
5099 AC_SUBST([LIBSIGROK_LIBS])
5100 PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
5101 [with_libsigrok="yes"],
5102 [with_libsigrok="no (pkg-config could not find libsigrok)"]
5106 # --with-libstatgrab {{{
5107 AC_ARG_WITH([libstatgrab],
5108 [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
5110 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5111 with_libstatgrab_cflags="-I$withval/include"
5112 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
5113 with_libstatgrab="yes"
5114 with_libstatgrab_pkg_config="no"
5116 with_libstatgrab="$withval"
5117 with_libstatgrab_pkg_config="yes"
5121 with_libstatgrab="yes"
5122 with_libstatgrab_pkg_config="yes"
5125 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes"; then
5126 AC_MSG_CHECKING([pkg-config for libstatgrab])
5128 $PKG_CONFIG --exists libstatgrab 2>/dev/null
5129 if test "$?" != "0"; then
5130 with_libstatgrab_pkg_config="no"
5131 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
5132 temp_result="not found"
5134 AC_MSG_RESULT([$temp_result])
5137 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes" && test "x$with_libstatgrab_cflags" = "x"; then
5138 AC_MSG_CHECKING([for libstatgrab CFLAGS])
5139 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
5140 if test "$?" = "0"; then
5141 with_libstatgrab_cflags="$temp_result"
5143 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
5144 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
5146 AC_MSG_RESULT([$temp_result])
5149 if test "x$with_libstatgrab" = "xyes" && test "x$with_libstatgrab_pkg_config" = "xyes" && test "x$with_libstatgrab_ldflags" = "x"; then
5150 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
5151 temp_result="`$PKG_CONFIG --libs libstatgrab`"
5154 with_libstatgrab_ldflags="$temp_result"
5156 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
5157 temp_result="$PKG_CONFIG --libs libstatgrab failed"
5159 AC_MSG_RESULT([$temp_result])
5162 if test "x$with_libstatgrab" = "xyes"; then
5163 SAVE_CPPFLAGS="$CPPFLAGS"
5164 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
5166 AC_CHECK_HEADERS([statgrab.h],
5167 [with_libstatgrab="yes"],
5168 [with_libstatgrab="no (statgrab.h not found)"]
5171 CPPFLAGS="$SAVE_CPPFLAGS"
5174 if test "x$with_libstatgrab" = "xyes"; then
5175 SAVE_LDFLAGS="$LDFLAGS"
5176 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5178 AC_CHECK_LIB([statgrab], [sg_init],
5179 [with_libstatgrab="yes"],
5180 [with_libstatgrab="no (symbol sg_init not found)"]
5183 LDFLAGS="$SAVE_LDFLAGS"
5186 if test "x$with_libstatgrab" = "xyes"; then
5187 SAVE_CFLAGS="$CFLAGS"
5188 SAVE_LDFLAGS="$LDFLAGS"
5191 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
5192 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
5193 LIBS="-lstatgrab $LIBS"
5195 AC_CACHE_CHECK([if libstatgrab >= 0.90],
5196 [c_cv_have_libstatgrab_0_90],
5203 #include <statgrab.h>
5206 if (sg_init()) return 0;
5210 [c_cv_have_libstatgrab_0_90="no"],
5211 [c_cv_have_libstatgrab_0_90="yes"]
5216 CFLAGS="$SAVE_CFLAGS"
5217 LDFLAGS="$SAVE_LDFLAGS"
5221 AM_CONDITIONAL([BUILD_WITH_LIBSTATGRAB], [test "x$with_libstatgrab" = "xyes"])
5223 if test "x$with_libstatgrab" = "xyes"; then
5224 AC_DEFINE([HAVE_LIBSTATGRAB], [1],
5225 [Define to 1 if you have the 'statgrab' library (-lstatgrab)]
5228 if test "x$c_cv_have_libstatgrab_0_90" = "xyes"; then
5229 AC_DEFINE([HAVE_LIBSTATGRAB_0_90], [1],
5230 [Define to 1 if libstatgrab version >= 0.90]
5234 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
5235 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
5239 AC_SUBST([BUILD_WITH_LIBSTATGRAB_CFLAGS])
5240 AC_SUBST([BUILD_WITH_LIBSTATGRAB_LDFLAGS])
5243 # --with-libtokyotyrant {{{
5244 AC_ARG_WITH([libtokyotyrant],
5245 [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
5247 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5248 with_libtokyotyrant="$withval"
5250 with_libtokyotyrant_cppflags="-I$withval/include"
5251 with_libtokyotyrant_ldflags="-L$withval/include"
5252 with_libtokyotyrant_libs="-ltokyotyrant"
5253 with_libtokyotyrant="yes"
5256 [with_libtokyotyrant="yes"]
5259 if test "x$with_libtokyotyrant" = "xyes"; then
5260 if $PKG_CONFIG --exists tokyotyrant; then
5261 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
5262 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
5263 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
5267 if test "x$with_libtokyotyrant" = "xyes"; then
5268 SAVE_CPPFLAGS="$CPPFLAGS"
5269 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
5271 AC_CHECK_HEADERS([tcrdb.h],
5272 [with_libtokyotyrant="yes"],
5273 [with_libtokyotyrant="no (tcrdb.h not found)"]
5276 CPPFLAGS="$SAVE_CPPFLAGS"
5279 if test "x$with_libtokyotyrant" = "xyes"; then
5280 SAVE_LDFLAGS="$LDFLAGS"
5281 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
5283 AC_CHECK_LIB([tokyotyrant], [tcrdbrnum],
5284 [with_libtokyotyrant="yes"],
5285 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
5286 [$with_libtokyotyrant_libs]
5289 LDFLAGS="$SAVE_LDFLAGS"
5292 if test "x$with_libtokyotyrant" = "xyes"; then
5293 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
5294 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
5295 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
5297 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS])
5298 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS])
5299 AC_SUBST([BUILD_WITH_LIBTOKYOTYRANT_LIBS])
5302 # --with-libudev {{{
5303 AC_ARG_WITH([libudev],
5304 [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
5306 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5307 with_libudev="$withval"
5309 with_libudev_cppflags="-I$withval/include"
5310 with_libudev_ldflags="-L$withval/lib"
5315 if test "x$ac_system" = "xLinux"; then
5318 with_libudev="no (Linux only library)"
5323 if test "x$with_libudev" = "xyes"; then
5324 SAVE_CPPFLAGS="$CPPFLAGS"
5325 CPPFLAGS="$CPPFLAGS $with_libudev_cppflags"
5327 AC_CHECK_HEADERS([libudev.h],
5328 [with_libudev="yes"],
5329 [with_libudev="no (libudev.h not found)"]
5332 CPPFLAGS="$SAVE_CPPFLAGS"
5335 if test "x$with_libudev" = "xyes"; then
5336 SAVE_LDFLAGS="$LDFLAGS"
5337 LDFLAGS="$LDFLAGS $with_libudev_ldflags"
5339 AC_CHECK_LIB([udev], [udev_new],
5340 [with_libudev="yes"],
5341 [with_libudev="no (libudev not found)"]
5344 LDFLAGS="$SAVE_LDFLAGS"
5347 if test "x$with_libudev" = "xyes"; then
5348 BUILD_WITH_LIBUDEV_CPPFLAGS="$with_libudev_cppflags"
5349 BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
5350 BUILD_WITH_LIBUDEV_LIBS="-ludev"
5353 AC_SUBST([BUILD_WITH_LIBUDEV_CPPFLAGS])
5354 AC_SUBST([BUILD_WITH_LIBUDEV_LDFLAGS])
5355 AC_SUBST([BUILD_WITH_LIBUDEV_LIBS])
5357 AM_CONDITIONAL([BUILD_WITH_LIBUDEV], [test "x$with_libudev" = "xyes"])
5360 # --with-libupsclient {{{
5361 with_libupsclient_config=""
5362 AC_ARG_WITH([libupsclient],
5363 [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
5365 if test "x$withval" = "xno"; then
5366 with_libupsclient="no"
5367 else if test "x$withval" = "xyes"; then
5368 with_libupsclient="use_pkgconfig"
5370 if test -x "$withval"; then
5371 with_libupsclient_config="$withval"
5372 with_libupsclient="use_libupsclient_config"
5373 else if test -x "$withval/bin/libupsclient-config"; then
5374 with_libupsclient_config="$withval/bin/libupsclient-config"
5375 with_libupsclient="use_libupsclient_config"
5377 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
5378 with_libupsclient_cflags="-I$withval/include"
5379 with_libupsclient_libs="-L$withval/lib -lupsclient"
5380 with_libupsclient="yes"
5384 [with_libupsclient="use_pkgconfig"]
5387 # configure using libupsclient-config
5388 if test "x$with_libupsclient" = "xuse_libupsclient_config"; then
5389 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
5390 if test $? -ne 0; then
5391 with_libupsclient="no ($with_libupsclient_config failed)"
5393 with_libupsclient_libs="`$with_libupsclient_config --libs`"
5394 if test $? -ne 0; then
5395 with_libupsclient="no ($with_libupsclient_config failed)"
5399 if test "x$with_libupsclient" = "xuse_libupsclient_config"; then
5400 with_libupsclient="yes"
5403 # configure using pkg-config
5404 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5405 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
5406 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
5407 if test $? -ne 0; then
5408 with_libupsclient="no (pkg-config doesn't know libupsclient)"
5412 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5413 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
5414 if test $? -ne 0; then
5415 with_libupsclient="no ($PKG_CONFIG failed)"
5418 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
5419 if test $? -ne 0; then
5420 with_libupsclient="no ($PKG_CONFIG failed)"
5424 if test "x$with_libupsclient" = "xuse_pkgconfig"; then
5425 with_libupsclient="yes"
5428 if test "x$with_libupsclient" = "xyes"; then
5429 SAVE_CPPFLAGS="$CPPFLAGS"
5430 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5432 AC_CHECK_HEADERS([upsclient.h],
5433 [with_libupsclient="yes"],
5434 [with_libupsclient="no (upsclient.h not found)"]
5437 CPPFLAGS="$SAVE_CPPFLAGS"
5440 if test "x$with_libupsclient" = "xyes"; then
5441 SAVE_LDFLAGS="$LDFLAGS"
5442 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
5444 AC_CHECK_LIB([upsclient], [upscli_connect],
5445 [with_libupsclient="yes"],
5446 [with_libupsclient="no (symbol upscli_connect not found)"]
5449 AC_CHECK_LIB([upsclient], [upscli_init],
5450 [AC_DEFINE([HAVE_UPSCLI_INIT], [1], [Define when upscli_init() (since version 2-7) is available.])]
5453 AC_CHECK_LIB([upsclient], [upscli_tryconnect],
5454 [AC_DEFINE([HAVE_UPSCLI_TRYCONNECT], [1], [Define when upscli_tryconnect() (since version 2.6.2) is available.])]
5457 LDFLAGS="$SAVE_LDFLAGS"
5460 if test "x$with_libupsclient" = "xyes"; then
5461 SAVE_CPPFLAGS="$CPPFLAGS"
5462 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
5464 AC_CHECK_TYPES([UPSCONN_t, UPSCONN],
5470 #include <upsclient.h>
5474 CPPFLAGS="$SAVE_CPPFLAGS"
5477 if test "x$with_libupsclient" = "xyes"; then
5478 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
5479 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
5482 AC_SUBST([BUILD_WITH_LIBUPSCLIENT_CFLAGS])
5483 AC_SUBST([BUILD_WITH_LIBUPSCLIENT_LIBS])
5486 # --with-libxenctrl {{{
5487 AC_ARG_WITH([libxenctrl],
5488 [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
5490 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5491 with_libxenctrl_cppflags="-I$withval/include"
5492 with_libxenctrl_ldflags="-L$withval/lib"
5493 with_libxenctrl="yes"
5495 with_libxenctrl="$withval"
5498 [with_libxenctrl="yes"]
5501 if test "x$with_libxenctrl" = "xyes"; then
5502 SAVE_CPPFLAGS="$CPPFLAGS"
5503 CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
5505 AC_CHECK_HEADERS([xenctrl.h],
5506 [with_libxenctrl="yes"],
5507 [with_libxenctrl="no (xenctrl.h not found)"]
5510 CPPFLAGS="$SAVE_CPPFLAGS"
5513 if test "x$with_libxenctrl" = "xyes"; then
5514 SAVE_LDFLAGS="$LDFLAGS"
5515 LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
5517 #Xen versions older than 3.4 has no xc_getcpuinfo()
5518 AC_CHECK_LIB([xenctrl], [xc_getcpuinfo],
5519 [with_libxenctrl="yes"],
5520 [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"]
5523 LDFLAGS="$SAVE_LDFLAGS"
5526 LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
5527 LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
5528 AC_SUBST([LIBXENCTL_CPPFLAGS])
5529 AC_SUBST([LIBXENCTL_LDFLAGS])
5532 # --with-libxmms {{{
5533 with_xmms_config="xmms-config"
5534 AC_ARG_WITH([libxmms],
5535 [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
5537 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5538 with_libxmms="$withval"
5540 if test -f "$withval" && test -x "$withval"; then
5541 with_xmms_config="$withval"
5542 else if test -x "$withval/bin/xmms-config"; then
5543 with_xmms_config="$withval/bin/xmms-config"
5548 [with_libxmms="yes"]
5551 if test "x$with_libxmms" = "xyes"; then
5552 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
5553 if test $? -ne 0; then
5558 if test "x$with_libxmms" = "xyes"; then
5559 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
5560 if test $? -ne 0; then
5565 if test "x$with_libxmms" = "xyes"; then
5566 SAVE_CFLAGS="$CFLAGS"
5567 CFLAGS="$with_xmms_cflags"
5569 AC_CHECK_HEADER([xmmsctrl.h],
5570 [with_libxmms="yes"],
5571 [with_libxmms="no"],
5574 CFLAGS="$SAVE_CFLAGS"
5577 if test "x$with_libxmms" = "xyes"; then
5579 LIBS="$with_xmms_libs"
5581 AC_CHECK_LIB([xmms], [xmms_remote_get_info],
5582 [with_libxmss="yes"],
5583 [with_libxmms="no"],
5591 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
5592 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
5594 AC_SUBST([BUILD_WITH_LIBXMMS_CFLAGS])
5595 AC_SUBST([BUILD_WITH_LIBXMMS_LIBS])
5598 # --with-libyajl {{{
5599 AC_ARG_WITH([libyajl],
5600 [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
5602 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5603 with_libyajl_cppflags="-I$withval/include"
5604 with_libyajl_ldflags="-L$withval/lib"
5607 with_libyajl="$withval"
5610 [with_libyajl="yes"]
5613 if test "x$with_libyajl" = "xyes"; then
5614 SAVE_CPPFLAGS="$CPPFLAGS"
5615 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
5617 AC_CHECK_HEADERS([yajl/yajl_parse.h],
5618 [with_libyajl="yes"],
5619 [with_libyajl="no (yajl/yajl_parse.h not found)"]
5622 AC_CHECK_HEADERS([yajl/yajl_tree.h],
5623 [with_libyajl2="yes"],
5624 [with_libyajl2="no (yajl/yajl_tree.h not found)"]
5627 AC_CHECK_HEADERS([yajl/yajl_version.h])
5629 CPPFLAGS="$SAVE_CPPFLAGS"
5632 if test "x$with_libyajl" = "xyes"; then
5633 SAVE_LDFLAGS="$LDFLAGS"
5634 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
5636 AC_CHECK_LIB([yajl], [yajl_alloc],
5637 [with_libyajl="yes"],
5638 [with_libyajl="no (Symbol 'yajl_alloc' not found)"]
5641 AC_CHECK_LIB([yajl], [yajl_tree_parse],
5642 [with_libyajl2="yes"],
5643 [with_libyajl2="no (Symbol 'yajl_tree_parse' not found)"]
5646 LDFLAGS="$SAVE_LDFLAGS"
5649 if test "x$with_libyajl" = "xyes"; then
5650 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
5651 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
5652 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
5653 AC_DEFINE([HAVE_LIBYAJL], [1], [Define if libyajl is present and usable.])
5656 AC_SUBST([BUILD_WITH_LIBYAJL_CPPFLAGS])
5657 AC_SUBST([BUILD_WITH_LIBYAJL_LDFLAGS])
5658 AC_SUBST([BUILD_WITH_LIBYAJL_LIBS])
5660 AM_CONDITIONAL([BUILD_WITH_LIBYAJL], [test "x$with_libyajl" = "xyes"])
5664 with_mic_cppflags="-I/opt/intel/mic/sysmgmt/sdk/include"
5665 with_mic_ldflags="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
5666 with_mic_libs="-lMicAccessSDK -scif"
5668 [AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
5670 if test "x$withval" = "xno" || test "x$withval" = "xyes"; then
5672 else if test -d "$with_mic/lib"; then
5673 with_mic_cppflags="-I$withval/include"
5674 with_mic_ldflags="-L$withval/lib/Linux"
5681 if test "x$with_mic" = "xyes"; then
5682 SAVE_CPPFLAGS="$CPPFLAGS"
5683 CPPFLAGS="$CPPFLAGS $with_mic_cppflags"
5685 AC_CHECK_HEADERS([MicAccessApi.h],
5687 [with_mic="no (MicAccessApi not found)"]
5690 CPPFLAGS="$SAVE_CPPFLAGS"
5693 if test "x$with_mic" = "xyes"; then
5694 SAVE_LDFLAGS="$LDFLAGS"
5695 LDFLAGS="$LDFLAGS $with_mic_ldflags"
5697 AC_CHECK_LIB([MicAccessSDK], [MicInitAPI],
5699 [with_mic="no (symbol MicInitAPI not found)"],
5700 [$PTHREAD_LIBS -lscif]
5703 LDFLAGS="$SAVE_LDFLAGS"
5706 if test "x$with_mic" = "xyes"; then
5707 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cppflags"
5708 BUILD_WITH_MIC_LDFLAGS="$with_mic_ldflags"
5709 BUILD_WITH_MIC_LIBS="$with_mic_libs"
5711 AC_SUBST([BUILD_WITH_MIC_CPPFLAGS])
5712 AC_SUBST([BUILD_WITH_MIC_LDFLAGS])
5713 AC_SUBST([BUILD_WITH_MIC_LIBS])
5716 # --with-libvarnish {{{
5717 AC_ARG_WITH([libvarnish],
5718 [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
5720 if test "x$withval" = "xno"; then
5721 with_libvarnish="no"
5722 else if test "x$withval" = "xyes"; then
5723 with_libvarnish="use_pkgconfig"
5724 else if test -d "$with_libvarnish/lib"; then
5725 with_libvarnish_cflags="-I$withval/include"
5726 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
5727 with_libvarnish="yes"
5730 [with_libvarnish="use_pkgconfig"]
5733 # configure using pkg-config
5734 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
5735 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
5736 if test $? -ne 0; then
5737 with_libvarnish="no (pkg-config doesn't know varnishapi)"
5741 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
5742 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
5743 if test $? -ne 0; then
5744 with_libvarnish="no ($PKG_CONFIG failed)"
5747 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
5748 if test $? -ne 0; then
5749 with_libvarnish="no ($PKG_CONFIG failed)"
5752 if test "x$with_libvarnish" = "xuse_pkgconfig"; then
5753 with_libvarnish="yes"
5756 if test "x$with_libvarnish" = "xyes"; then
5757 SAVE_CPPFLAGS="$CPPFLAGS"
5758 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
5760 $PKG_CONFIG --atleast-version=5.2 'varnishapi' 2>/dev/null
5761 if test $? -eq 0; then
5762 AC_DEFINE([HAVE_VARNISH_V5], [1], [Varnish 5 API support])
5764 AC_CHECK_HEADERS([vapi/vsc.h],
5765 [AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
5767 AC_CHECK_HEADERS([vsc.h],
5768 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support]) ],
5770 AC_CHECK_HEADERS([varnishapi.h],
5771 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
5772 [with_libvarnish="no (found none of the varnish header files)"]
5780 CPPFLAGS="$SAVE_CPPFLAGS"
5783 if test "x$with_libvarnish" = "xyes"; then
5784 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
5785 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
5788 AC_SUBST([BUILD_WITH_LIBVARNISH_CFLAGS])
5789 AC_SUBST([BUILD_WITH_LIBVARNISH_LIBS])
5792 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
5793 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
5794 if test $? -eq 0; then
5797 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
5800 $PKG_CONFIG --exists libvirt 2>/dev/null
5801 if test $? = 0; then
5804 with_libvirt="no (pkg-config doesn't know libvirt)"
5807 if test "x$with_libxml2" = "xyes"; then
5808 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
5809 if test $? -ne 0; then
5813 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
5814 if test $? -ne 0; then
5819 if test "x$with_libxml2" = "xyes"; then
5820 SAVE_CPPFLAGS="$CPPFLAGS"
5821 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
5823 AC_CHECK_HEADERS([libxml/parser.h],
5824 [with_libxml2="yes"],
5825 [with_libxml2="no (libxml/parser.h not found)"]
5828 CPPFLAGS="$SAVE_CPPFLAGS"
5831 if test "x$with_libxml2" = "xyes"; then
5832 SAVE_LDFLAGS="$LDFLAGS"
5833 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
5835 AC_CHECK_LIB([xml2], [xmlXPathEval],
5836 [with_libxml2="yes"],
5837 [with_libxml2="no (symbol xmlXPathEval not found)"]
5840 LDFLAGS="$SAVE_LDFLAGS"
5843 if test "x$with_libxml2" = "xyes"; then
5844 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
5845 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
5848 AC_SUBST([BUILD_WITH_LIBXML2_CFLAGS])
5849 AC_SUBST([BUILD_WITH_LIBXML2_LIBS])
5851 if test "x$with_libvirt" = "xyes"; then
5852 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
5853 if test $? -ne 0; then
5857 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
5858 if test $? -ne 0; then
5863 if test "x$with_libvirt" = "xyes"; then
5864 SAVE_CPPFLAGS="$CPPFLAGS"
5865 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
5867 AC_CHECK_HEADERS([libvirt/libvirt.h],
5868 [with_libvirt="yes"],
5869 [with_libvirt="no (libvirt/libvirt.h not found)"]
5872 CPPFLAGS="$SAVE_CPPFLAGS"
5875 if test "x$with_libvirt" = "xyes"; then
5876 SAVE_LDFLAGS="$LDFLAGS"
5877 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
5879 AC_CHECK_LIB([virt], [virDomainBlockStats],
5880 [with_libvirt="yes"],
5881 [with_libvirt="no (symbol virDomainBlockStats not found)"]
5884 LDFLAGS="$SAVE_LDFLAGS"
5887 if test "x$with_libvirt" = "xyes"; then
5888 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
5889 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
5892 AC_SUBST([BUILD_WITH_LIBVIRT_CFLAGS])
5893 AC_SUBST([BUILD_WITH_LIBVIRT_LIBS])
5896 # $PKG_CONFIG --exists OpenIPMIpthread {{{
5897 with_libopenipmipthread="yes"
5898 AC_MSG_CHECKING([for libOpenIPMIpthread])
5899 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
5900 if test $? -ne 0; then
5901 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
5903 AC_MSG_RESULT([$with_libopenipmipthread])
5905 if test "x$with_libopenipmipthread" = "xyes"; then
5906 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
5907 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
5908 if test $? -eq 0; then
5909 with_libopenipmipthread_cflags="$temp_result"
5911 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
5912 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
5914 AC_MSG_RESULT([$temp_result])
5917 if test "x$with_libopenipmipthread" = "xyes"; then
5918 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
5919 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
5920 if test $? -eq 0; then
5921 with_libopenipmipthread_ldflags="$temp_result"
5923 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
5924 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
5926 AC_MSG_RESULT([$temp_result])
5929 if test "x$with_libopenipmipthread" = "xyes"; then
5930 SAVE_CPPFLAGS="$CPPFLAGS"
5931 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
5933 AC_CHECK_HEADERS([OpenIPMI/ipmi_smi.h],
5934 [with_libopenipmipthread="yes"],
5935 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
5937 #include <OpenIPMI/ipmiif.h>
5938 #include <OpenIPMI/ipmi_err.h>
5939 #include <OpenIPMI/ipmi_posix.h>
5940 #include <OpenIPMI/ipmi_conn.h>
5944 CPPFLAGS="$SAVE_CPPFLAGS"
5947 if test "x$with_libopenipmipthread" = "xyes"; then
5948 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
5949 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
5952 AC_SUBST([BUILD_WITH_OPENIPMI_CFLAGS])
5953 AC_SUBST([BUILD_WITH_OPENIPMI_LIBS])
5956 # --with-libatasmart {{{
5957 AC_ARG_WITH([libatasmart],
5958 [AS_HELP_STRING([--with-libatasmart@<:@=PREFIX@:>@], [Path to libatasmart.])],
5960 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
5961 with_libatasmart_cppflags="-I$withval/include"
5962 with_libatasmart_ldflags="-L$withval/lib"
5963 with_libatasmart="yes"
5965 with_libatasmart="$withval"
5969 if test "x$ac_system" = "xLinux"; then
5970 with_libatasmart="yes"
5972 with_libatasmart="no (Linux only library)"
5977 if test "x$with_libatasmart" = "xyes"; then
5978 SAVE_CPPFLAGS="$CPPFLAGS"
5979 CPPFLAGS="$CPPFLAGS $with_libatasmart_cppflags"
5981 AC_CHECK_HEADERS([atasmart.h],
5982 [with_libatasmart="yes"],
5983 [with_libatasmart="no (atasmart.h not found)"])
5985 CPPFLAGS="$SAVE_CPPFLAGS"
5988 if test "x$with_libatasmart" = "xyes"; then
5989 SAVE_LDFLAGS="$LDFLAGS"
5990 LDFLAGS="$LDFLAGS $with_libatasmart_ldflags"
5992 AC_CHECK_LIB([atasmart], [sk_disk_open],
5993 [with_libatasmart="yes"],
5994 [with_libatasmart="no (Symbol 'sk_disk_open' not found)"]
5997 LDFLAGS="$SAVE_LDFLAGS"
6000 if test "x$with_libatasmart" = "xyes"; then
6001 BUILD_WITH_LIBATASMART_CPPFLAGS="$with_libatasmart_cppflags"
6002 BUILD_WITH_LIBATASMART_LDFLAGS="$with_libatasmart_ldflags"
6003 BUILD_WITH_LIBATASMART_LIBS="-latasmart"
6006 AC_SUBST([BUILD_WITH_LIBATASMART_CPPFLAGS])
6007 AC_SUBST([BUILD_WITH_LIBATASMART_LDFLAGS])
6008 AC_SUBST([BUILD_WITH_LIBATASMART_LIBS])
6011 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
6012 [with_libnotify="yes"],
6013 [with_libnotify="no (pkg-config doesn't know libnotify)"]
6016 PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
6017 [with_libriemann_client="yes"],
6018 [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"]
6021 # Check for enabled/disabled features
6024 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
6025 # ------------------------------------------------------------
6027 m4_define([my_toupper],[m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
6032 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
6037 m4_define([EnDis],[disabled])dnl
6038 m4_define([YesNo],[no])dnl
6044 m4_define([EnDis],[enabled])dnl
6045 m4_define([YesNo],[yes])dnl
6048 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
6052 m4_if([$3], [feature], [],
6056 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
6062 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
6064 enable_$1='[YesNo]'dnl
6066 if test "x$enable_$1" = "xno"; then
6069 if test "x$enable_$1" = "xyes"; then
6072 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
6077 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [whether or not to enable $3 $4])
6078 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
6080 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
6082 # AC_PLUGIN(name, default, info)
6083 # ------------------------------------------------------------
6091 [AS_HELP_STRING([--enable-$1],[$3])],
6093 if test "x$enableval" = "xyes"; then
6095 else if test "x$enableval" = "xforce"; then
6099 enable_plugin="no (disabled on command line)"
6103 if test "x$enable_all_plugins" = "xauto"; then
6104 if test "x$2" = "xyes"; then
6110 enable_plugin="$enable_all_plugins"
6114 if test "x$enable_plugin" = "xyes"; then
6115 if test "x$2" = "xyes" || test "x$force" = "xyes"; then
6116 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
6117 if test "x$2" != "xyes"; then
6118 dependency_warning="yes"
6120 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
6121 dependency_error="yes"
6122 enable_plugin="$2 (dependency error)"
6125 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), [test "x$enable_plugin" = "xyes"])
6126 enable_$1="$enable_plugin"
6128 )# AC_PLUGIN(name, default, info)
6130 m4_divert_once([HELP_ENABLE], [
6131 collectd features:])
6132 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
6133 AC_COLLECTD([debug], [enable], [feature], [debugging])
6134 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
6135 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
6136 AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
6138 dependency_warning="no"
6139 dependency_error="no"
6142 plugin_barometer="no"
6147 plugin_conntrack="no"
6148 plugin_contextswitch="no"
6151 plugin_cpusleep="no"
6152 plugin_curl_json="no"
6153 plugin_curl_xml="no"
6157 plugin_dpdkevents="no"
6158 plugin_dpdkstat="no"
6165 plugin_hugepages="no"
6166 plugin_intel_pmu="no"
6167 plugin_intel_rdt="no"
6168 plugin_interface="no"
6174 plugin_log_logstash="no"
6177 plugin_multimeter="no"
6180 plugin_ovs_events="no"
6181 plugin_ovs_stats="no"
6184 plugin_processes="no"
6185 plugin_protocols="no"
6190 plugin_synproxy="no"
6192 plugin_tcpconns="no"
6195 plugin_turbostat="no"
6201 plugin_wireless="no"
6202 plugin_write_prometheus="no"
6206 plugin_zookeeper="no"
6209 if test "x$ac_system" = "xLinux"; then
6210 plugin_battery="yes"
6211 plugin_cgroups="yes"
6212 plugin_conntrack="yes"
6213 plugin_contextswitch="yes"
6215 plugin_cpufreq="yes"
6218 plugin_entropy="yes"
6219 plugin_fhcount="yes"
6220 plugin_fscache="yes"
6221 plugin_hugepages="yes"
6222 plugin_interface="yes"
6231 plugin_processes="yes"
6232 plugin_protocols="yes"
6235 plugin_synproxy="yes"
6236 plugin_tcpconns="yes"
6237 plugin_thermal="yes"
6240 plugin_vserver="yes"
6241 plugin_wireless="yes"
6242 plugin_zfs_arc="yes"
6244 if test "x$ac_cv_header_linux_ip_vs_h" = "xyes"; then
6248 if test "x$have_cpuid_h" = "xyes"; then
6249 plugin_turbostat="yes"
6252 if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"; then
6253 plugin_cpusleep="yes"
6256 if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
6257 plugin_ovs_events="yes"
6258 plugin_ovs_stats="yes"
6262 if test "x$ac_system" = "xOpenBSD"; then
6263 plugin_tcpconns="yes"
6266 if test "x$ac_system" = "xNetBSD"; then
6268 plugin_entropy="yes"
6270 plugin_processes="yes"
6274 if test "x$with_libiokit" = "xyes"; then
6275 plugin_battery="yes"
6281 if test "x$ac_system" = "xAIX"; then
6283 plugin_tcpconns="yes"
6288 if test "x$ac_system" = "xFreeBSD"; then
6290 plugin_zfs_arc="yes"
6294 if test "x$with_perfstat" = "xyes"; then
6295 plugin_contextswitch="yes"
6298 plugin_interface="yes"
6305 if test "x$with_procinfo" = "xyes"; then
6306 plugin_processes="yes"
6310 if test "x$with_kstat" = "xyes"; then
6312 plugin_processes="yes"
6314 plugin_zfs_arc="yes"
6318 if test "x$with_devinfo" = "xyes" && test "x$with_kstat" = "xyes"; then
6321 plugin_interface="yes"
6326 if test "x$with_libi2c" = "xyes"; then
6327 plugin_barometer="yes"
6332 if test "x$with_libstatgrab" = "xyes"; then
6335 plugin_interface="yes"
6342 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
6344 if test "x$have_strptime" = "xyes"; then
6349 if test "x$with_libopenipmipthread" = "xyes"; then
6353 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"; then
6354 plugin_curl_json="yes"
6357 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
6358 plugin_curl_xml="yes"
6361 if test "x$with_libyajl" = "xyes"; then
6365 if test "x$have_processor_info" = "xyes"; then
6369 if test "x$have_sysctl" = "xyes"; then
6373 if test "x$ac_system" = "xDarwin"; then
6378 if test "x$have_sysctlbyname" = "xyes"; then
6379 plugin_contextswitch="yes"
6382 plugin_tcpconns="yes"
6385 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"; then
6389 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"; then
6393 if test "x$c_cv_have_one_getmntent" = "xyes"; then
6397 if test "x$c_cv_have_getmntent_r" = "xyes"; then
6401 if test "x$plugin_df" = "xyes"; then
6403 if test "x$have_statfs" = "xyes"; then
6407 if test "x$have_statvfs" = "xyes"; then
6412 if test "x$have_linux_sockios_h" = "xyes" && test "x$have_linux_ethtool_h" = "xyes"; then
6413 plugin_ethstat="yes"
6416 if test "x$with_libgps" = "xyes"; then
6421 if test "x$GRPC_CPP_PLUGIN" = "x"; then
6422 plugin_grpc="no (grpc_cpp_plugin not found)"
6424 if test "x$have_protoc3" != "xyes"; then
6425 plugin_grpc="no (protoc3 not found)"
6427 if test "x$with_libprotobuf" != "xyes"; then
6428 plugin_grpc="no (libprotobuf not found)"
6430 if test "x$with_libgrpcpp" != "xyes"; then
6431 plugin_grpc="no (libgrpc++ not found)"
6434 if test "x$have_getifaddrs" = "xyes"; then
6435 plugin_interface="yes"
6438 if test "x$have_getloadavg" = "xyes"; then
6442 if test "x$with_libyajl" = "xyes"; then
6443 plugin_log_logstash="yes"
6446 if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then
6450 if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"; then
6452 if test "x$with_libmicrohttpd" = "xyes"; then
6453 plugin_write_prometheus="yes"
6457 # Mac OS X memory interface
6458 if test "x$have_host_statistics" = "xyes"; then
6462 if test "x$have_termios_h" = "xyes"; then
6463 if test "x$ac_system" != "xAIX"; then
6464 plugin_multimeter="yes"
6469 if test "x$have_thread_info" = "xyes"; then
6470 plugin_processes="yes"
6473 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"; then
6474 plugin_processes="yes"
6477 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"; then
6478 plugin_processes="yes"
6481 if test "x$with_libpython" != "xno"; then
6485 if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"; then
6489 if test "x$with_kvm_getswapinfo" = "xyes"; then
6493 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"; then
6497 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"; then
6501 if test "x$with_kvm_openfiles = "xyes" && $with_kvm_nlist" = "xyes"; then
6502 plugin_tcpconns="yes"
6505 if test "x$have_getutent" = "xyes"; then
6509 if test "x$have_getutxent" = "xyes"; then
6513 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"; then
6517 if test "x$with_libxenctrl" = "xyes"; then
6521 if test "x$with_libdpdk" = "xyes"; then
6522 plugin_dpdkevents="$dpdk_keepalive"
6523 plugin_dpdkstat="yes"
6526 m4_divert_once([HELP_ENABLE], [
6529 AC_ARG_ENABLE([all-plugins],
6530 [AS_HELP_STRING([--enable-all-plugins], [enable all plugins @<:@default=yes@:>@])],
6532 if test "x$enableval" = "xyes"; then
6533 enable_all_plugins="yes"
6534 else if test "x$enableval" = "xauto"; then
6535 enable_all_plugins="auto"
6537 enable_all_plugins="no"
6540 [enable_all_plugins="auto"]
6543 m4_divert_once([HELP_ENABLE], [])
6545 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
6546 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
6547 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
6548 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
6549 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple hardware sensors])
6550 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero hardware sensors])
6551 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
6552 AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor on I2C])
6553 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
6554 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
6555 AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
6556 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
6557 AC_PLUGIN([chrony], [yes], [Chrony statistics])
6558 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
6559 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
6560 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
6561 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
6562 AC_PLUGIN([cpusleep], [$plugin_cpusleep], [CPU sleep statistics])
6563 AC_PLUGIN([csv], [yes], [CSV output plugin])
6564 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
6565 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
6566 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
6567 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
6568 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
6569 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
6570 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
6571 AC_PLUGIN([dpdkevents], [$plugin_dpdkevents], [Events from DPDK])
6572 AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats from DPDK])
6573 AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
6574 AC_PLUGIN([email], [yes], [EMail statistics])
6575 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
6576 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
6577 AC_PLUGIN([exec], [yes], [Execution of external programs])
6578 AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
6579 AC_PLUGIN([filecount], [yes], [Count files in directories])
6580 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
6581 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
6582 AC_PLUGIN([gps], [$plugin_gps], [GPS plugin])
6583 AC_PLUGIN([grpc], [$plugin_grpc], [gRPC plugin])
6584 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
6585 AC_PLUGIN([hugepages], [$plugin_hugepages], [Hugepages statistics])
6586 AC_PLUGIN([intel_pmu], [$with_libjevents], [Intel performance monitor plugin])
6587 AC_PLUGIN([intel_rdt], [$with_libpqos], [Intel RDT monitor plugin])
6588 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
6589 AC_PLUGIN([ipc], [$plugin_ipc], [IPC statistics])
6590 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
6591 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
6592 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
6593 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
6594 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
6595 AC_PLUGIN([load], [$plugin_load], [System load])
6596 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
6597 AC_PLUGIN([logfile], [yes], [File logging plugin])
6598 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
6599 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
6600 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
6601 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
6602 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
6603 AC_PLUGIN([match_hashed], [yes], [The hashed match])
6604 AC_PLUGIN([match_regex], [yes], [The regex match])
6605 AC_PLUGIN([match_timediff], [yes], [The timediff match])
6606 AC_PLUGIN([match_value], [yes], [The value match])
6607 AC_PLUGIN([mbmon], [yes], [Query mbmond])
6608 AC_PLUGIN([mcelog], [$plugin_mcelog], [Machine Check Exceptions notifications])
6609 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
6610 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
6611 AC_PLUGIN([memcached], [yes], [memcached statistics])
6612 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
6613 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
6614 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
6615 AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
6616 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
6617 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
6618 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
6619 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
6620 AC_PLUGIN([network], [yes], [Network communication plugin])
6621 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
6622 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
6623 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
6624 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
6625 AC_PLUGIN([notify_nagios], [yes], [Nagios notification plugin])
6626 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
6627 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
6628 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
6629 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
6630 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
6631 AC_PLUGIN([openldap], [$with_libldap], [OpenLDAP statistics])
6632 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
6633 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
6634 AC_PLUGIN([ovs_events], [$plugin_ovs_events], [OVS events plugin])
6635 AC_PLUGIN([ovs_stats], [$plugin_ovs_stats], [OVS statistics plugin])
6636 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
6637 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
6638 # FIXME: Check for libevent, too.
6639 AC_PLUGIN([pinba], [$plugin_pinba], [Pinba statistics])
6640 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
6641 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
6642 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
6643 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
6644 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
6645 AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
6646 AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
6647 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
6648 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
6649 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
6650 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
6651 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
6652 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
6653 AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
6654 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
6655 AC_PLUGIN([snmp_agent], [$with_libnetsnmpagent], [SNMP agent plugin])
6656 AC_PLUGIN([statsd], [yes], [StatsD plugin])
6657 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
6658 AC_PLUGIN([synproxy], [$plugin_synproxy], [Synproxy stats plugin])
6659 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
6660 AC_PLUGIN([table], [yes], [Parsing of tabular data])
6661 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
6662 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
6663 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
6664 AC_PLUGIN([target_notification], [yes], [The notification target])
6665 AC_PLUGIN([target_replace], [yes], [The replace target])
6666 AC_PLUGIN([target_scale], [yes], [The scale target])
6667 AC_PLUGIN([target_set], [yes], [The set target])
6668 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
6669 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
6670 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
6671 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
6672 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
6673 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
6674 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
6675 AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
6676 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
6677 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
6678 AC_PLUGIN([users], [$plugin_users], [User statistics])
6679 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
6680 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
6681 AC_PLUGIN([virt], [$plugin_virt], [Virtual machine statistics])
6682 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
6683 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
6684 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
6685 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
6686 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
6687 AC_PLUGIN([write_kafka], [$with_librdkafka], [Kafka output plugin])
6688 AC_PLUGIN([write_log], [yes], [Log output plugin])
6689 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
6690 AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write plugin])
6691 AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
6692 AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
6693 AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
6694 AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
6695 AC_PLUGIN([xencpu], [$plugin_xencpu], [Xen Host CPU usage])
6696 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
6697 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
6698 AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
6699 AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
6701 dnl Default configuration file
6702 # Load either syslog or logfile
6703 LOAD_PLUGIN_SYSLOG=""
6704 LOAD_PLUGIN_LOGFILE=""
6705 LOAD_PLUGIN_LOG_LOGSTASH=""
6707 AC_MSG_CHECKING([which default log plugin to load])
6708 default_log_plugin="none"
6709 if test "x$enable_syslog" = "xyes"; then
6710 default_log_plugin="syslog"
6712 LOAD_PLUGIN_SYSLOG="##"
6715 if test "x$enable_logfile" = "xyes"; then
6716 if test "x$default_log_plugin" = "xnone"; then
6717 default_log_plugin="logfile"
6719 LOAD_PLUGIN_LOGFILE="#"
6722 LOAD_PLUGIN_LOGFILE="##"
6725 if test "x$enable_log_logstash" = "xyes"; then
6726 LOAD_PLUGIN_LOG_LOGSTASH="#"
6728 LOAD_PLUGIN_LOG_LOGSTASH="##"
6731 AC_MSG_RESULT([$default_log_plugin])
6733 AC_SUBST([LOAD_PLUGIN_SYSLOG])
6734 AC_SUBST([LOAD_PLUGIN_LOGFILE])
6735 AC_SUBST([LOAD_PLUGIN_LOG_LOGSTASH])
6737 if test "x$enable_debug" = "xyes"; then
6738 DEFAULT_LOG_LEVEL="debug"
6740 DEFAULT_LOG_LEVEL="info"
6742 AC_SUBST([DEFAULT_LOG_LEVEL])
6744 # Load only one of rrdtool, network, csv in the default config.
6745 LOAD_PLUGIN_RRDTOOL=""
6746 LOAD_PLUGIN_NETWORK=""
6749 AC_MSG_CHECKING([which default write plugin to load])
6750 default_write_plugin="none"
6751 if test "x$enable_rrdtool" = "xyes"; then
6752 default_write_plugin="rrdtool"
6754 LOAD_PLUGIN_RRDTOOL="##"
6757 if test "x$enable_network" = "xyes"; then
6758 if test "x$default_write_plugin" = "xnone"; then
6759 default_write_plugin="network"
6761 LOAD_PLUGIN_NETWORK="#"
6764 LOAD_PLUGIN_NETWORK="##"
6767 if test "x$enable_csv" = "xyes"; then
6768 if test "x$default_write_plugin" = "xnone"; then
6769 default_write_plugin="csv"
6774 LOAD_PLUGIN_CSV="##"
6776 AC_MSG_RESULT([$default_write_plugin])
6778 AC_SUBST([LOAD_PLUGIN_RRDTOOL])
6779 AC_SUBST([LOAD_PLUGIN_NETWORK])
6780 AC_SUBST([LOAD_PLUGIN_CSV])
6783 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
6784 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
6786 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
6787 PERL_BINDINGS_OPTIONS="$withval"
6788 with_perl_bindings="yes"
6790 with_perl_bindings="$withval"
6794 if test "x$PERL" != "x"; then
6795 with_perl_bindings="yes"
6797 with_perl_bindings="no (no perl interpreter found)"
6801 if test "x$with_perl_bindings" = "xyes"; then
6802 AC_MSG_CHECKING([for the ExtUtils::MakeMaker module])
6803 if $PERL -MExtUtils::MakeMaker -e '' 2>/dev/null; then
6804 AC_MSG_RESULT([yes])
6807 with_perl_bindings="no (ExtUtils::MakeMaker not found)"
6811 if test "x$with_perl_bindings" = "xyes"; then
6812 PERL_BINDINGS="perl"
6817 AC_SUBST([PERL_BINDINGS])
6818 AC_SUBST([PERL_BINDINGS_OPTIONS])
6820 dnl libcollectdclient
6821 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
6822 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
6823 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
6825 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
6827 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
6829 AC_SUBST([LCC_VERSION_MAJOR])
6830 AC_SUBST([LCC_VERSION_MINOR])
6831 AC_SUBST([LCC_VERSION_PATCH])
6832 AC_SUBST([LCC_VERSION_EXTRA])
6833 AC_SUBST([LCC_VERSION_STRING])
6835 AC_CONFIG_FILES([src/libcollectdclient/collectd/lcc_features.h])
6839 if test "x$enable_werror" != "xno"; then
6840 AM_CFLAGS="$AM_CFLAGS -Werror"
6841 AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
6844 AC_SUBST([AM_CFLAGS])
6845 AC_SUBST([AM_CXXFLAGS])
6850 src/libcollectdclient/libcollectdclient.pc \
6855 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" != "xyes"; then
6856 with_librrd="yes (warning: librrd is not thread-safe)"
6859 if test "x$with_libperl" = "xyes"; then
6860 with_libperl="yes (version `$PERL -MConfig -e 'print $Config{version};'`)"
6862 enable_perl="no (needs libperl)"
6865 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"; then
6866 enable_perl="no (libperl doesn't support ithreads)"
6869 if test "x$with_perl_bindings" = "xyes" && test "x$PERL_BINDINGS_OPTIONS" != "x"; then
6870 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
6874 AC_MSG_RESULT([Configuration:])
6875 AC_MSG_RESULT([ Build:])
6876 AC_MSG_RESULT([ Platform . . . . . . $ac_system])
6877 AC_MSG_RESULT([ Compiler vendor . . . $ax_cv_c_compiler_vendor])
6878 AC_MSG_RESULT([ CC . . . . . . . . . $CC])
6879 AC_MSG_RESULT([ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS])
6880 AC_MSG_RESULT([ CXXFLAGS . . . . . . $AM_CXXFLAGS $CXXFLAGS])
6881 AC_MSG_RESULT([ CPP . . . . . . . . . $CPP])
6882 AC_MSG_RESULT([ CPPFLAGS . . . . . . $CPPFLAGS])
6883 AC_MSG_RESULT([ GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
6884 AC_MSG_RESULT([ LD . . . . . . . . . $LD])
6885 AC_MSG_RESULT([ LDFLAGS . . . . . . . $LDFLAGS])
6886 AC_MSG_RESULT([ PROTOC . . . . . . . $PROTOC])
6887 AC_MSG_RESULT([ YACC . . . . . . . . $YACC])
6888 AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS])
6890 AC_MSG_RESULT([ Libraries:])
6891 AC_MSG_RESULT([ intel mic . . . . . . $with_mic])
6892 AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5])
6893 AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart])
6894 AC_MSG_RESULT([ libcurl . . . . . . . $with_libcurl])
6895 AC_MSG_RESULT([ libdbi . . . . . . . $with_libdbi])
6896 AC_MSG_RESULT([ libdpdk . . . . . . . $with_libdpdk])
6897 AC_MSG_RESULT([ libesmtp . . . . . . $with_libesmtp])
6898 AC_MSG_RESULT([ libganglia . . . . . $with_libganglia])
6899 AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
6900 AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
6901 AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
6902 AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
6903 AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
6904 AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
6905 AC_MSG_RESULT([ libiptc . . . . . . . $with_libiptc])
6906 AC_MSG_RESULT([ libjevents . . . . . $with_libjevents])
6907 AC_MSG_RESULT([ libjvm . . . . . . . $with_java])
6908 AC_MSG_RESULT([ libkstat . . . . . . $with_kstat])
6909 AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
6910 AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
6911 AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
6912 AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
6913 AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
6914 AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
6915 AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
6916 AC_MSG_RESULT([ libmodbus . . . . . . $with_libmodbus])
6917 AC_MSG_RESULT([ libmongoc . . . . . . $with_libmongoc])
6918 AC_MSG_RESULT([ libmosquitto . . . . $with_libmosquitto])
6919 AC_MSG_RESULT([ libmysql . . . . . . $with_libmysql])
6920 AC_MSG_RESULT([ libnetapp . . . . . . $with_libnetapp])
6921 AC_MSG_RESULT([ libnetsnmp . . . . . $with_libnetsnmp])
6922 AC_MSG_RESULT([ libnetsnmpagent . . . $with_libnetsnmpagent])
6923 AC_MSG_RESULT([ libnotify . . . . . . $with_libnotify])
6924 AC_MSG_RESULT([ libopenipmi . . . . . $with_libopenipmipthread])
6925 AC_MSG_RESULT([ liboping . . . . . . $with_liboping])
6926 AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi])
6927 AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap])
6928 AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat])
6929 AC_MSG_RESULT([ libperl . . . . . . . $with_libperl])
6930 AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq])
6931 AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos])
6932 AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf])
6933 AC_MSG_RESULT([ libprotobuf-c . . . . $with_libprotobuf_c])
6934 AC_MSG_RESULT([ libpython . . . . . . $with_libpython])
6935 AC_MSG_RESULT([ librabbitmq . . . . . $with_librabbitmq])
6936 AC_MSG_RESULT([ libriemann-client . . $with_libriemann_client])
6937 AC_MSG_RESULT([ librdkafka . . . . . $with_librdkafka])
6938 AC_MSG_RESULT([ librouteros . . . . . $with_librouteros])
6939 AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
6940 AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
6941 AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
6942 AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
6943 AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
6944 AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
6945 AC_MSG_RESULT([ libupsclient . . . . $with_libupsclient])
6946 AC_MSG_RESULT([ libvarnish . . . . . $with_libvarnish])
6947 AC_MSG_RESULT([ libvirt . . . . . . . $with_libvirt])
6948 AC_MSG_RESULT([ libxenctrl . . . . . $with_libxenctrl])
6949 AC_MSG_RESULT([ libxml2 . . . . . . . $with_libxml2])
6950 AC_MSG_RESULT([ libxmms . . . . . . . $with_libxmms])
6951 AC_MSG_RESULT([ libyajl . . . . . . . $with_libyajl])
6952 AC_MSG_RESULT([ oracle . . . . . . . $with_oracle])
6953 AC_MSG_RESULT([ protobuf-c . . . . . $have_protoc_c])
6954 AC_MSG_RESULT([ protoc 3 . . . . . . $have_protoc3])
6956 AC_MSG_RESULT([ Features:])
6957 AC_MSG_RESULT([ daemon mode . . . . . $enable_daemon])
6958 AC_MSG_RESULT([ debug . . . . . . . . $enable_debug])
6960 AC_MSG_RESULT([ Bindings:])
6961 AC_MSG_RESULT([ perl . . . . . . . . $with_perl_bindings])
6963 AC_MSG_RESULT([ Modules:])
6964 AC_MSG_RESULT([ aggregation . . . . . $enable_aggregation])
6965 AC_MSG_RESULT([ amqp . . . . . . . $enable_amqp])
6966 AC_MSG_RESULT([ apache . . . . . . . $enable_apache])
6967 AC_MSG_RESULT([ apcups . . . . . . . $enable_apcups])
6968 AC_MSG_RESULT([ apple_sensors . . . . $enable_apple_sensors])
6969 AC_MSG_RESULT([ aquaero . . . . . . . $enable_aquaero])
6970 AC_MSG_RESULT([ ascent . . . . . . . $enable_ascent])
6971 AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
6972 AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
6973 AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
6974 AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
6975 AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
6976 AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
6977 AC_MSG_RESULT([ conntrack . . . . . . $enable_conntrack])
6978 AC_MSG_RESULT([ contextswitch . . . . $enable_contextswitch])
6979 AC_MSG_RESULT([ cpu . . . . . . . . . $enable_cpu])
6980 AC_MSG_RESULT([ cpufreq . . . . . . . $enable_cpufreq])
6981 AC_MSG_RESULT([ cpusleep . . . . . . $enable_cpusleep])
6982 AC_MSG_RESULT([ csv . . . . . . . . . $enable_csv])
6983 AC_MSG_RESULT([ curl . . . . . . . . $enable_curl])
6984 AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json])
6985 AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml])
6986 AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
6987 AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
6988 AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
6989 AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
6990 AC_MSG_RESULT([ dpdkevents. . . . . . $enable_dpdkevents])
6991 AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
6992 AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
6993 AC_MSG_RESULT([ email . . . . . . . . $enable_email])
6994 AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy])
6995 AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat])
6996 AC_MSG_RESULT([ exec . . . . . . . . $enable_exec])
6997 AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount])
6998 AC_MSG_RESULT([ filecount . . . . . . $enable_filecount])
6999 AC_MSG_RESULT([ fscache . . . . . . . $enable_fscache])
7000 AC_MSG_RESULT([ gmond . . . . . . . . $enable_gmond])
7001 AC_MSG_RESULT([ gps . . . . . . . . . $enable_gps])
7002 AC_MSG_RESULT([ grpc . . . . . . . . $enable_grpc])
7003 AC_MSG_RESULT([ hddtemp . . . . . . . $enable_hddtemp])
7004 AC_MSG_RESULT([ hugepages . . . . . . $enable_hugepages])
7005 AC_MSG_RESULT([ intel_pmu . . . . . . $enable_intel_pmu])
7006 AC_MSG_RESULT([ intel_rdt . . . . . . $enable_intel_rdt])
7007 AC_MSG_RESULT([ interface . . . . . . $enable_interface])
7008 AC_MSG_RESULT([ ipc . . . . . . . . . $enable_ipc])
7009 AC_MSG_RESULT([ ipmi . . . . . . . . $enable_ipmi])
7010 AC_MSG_RESULT([ iptables . . . . . . $enable_iptables])
7011 AC_MSG_RESULT([ ipvs . . . . . . . . $enable_ipvs])
7012 AC_MSG_RESULT([ irq . . . . . . . . . $enable_irq])
7013 AC_MSG_RESULT([ java . . . . . . . . $enable_java])
7014 AC_MSG_RESULT([ load . . . . . . . . $enable_load])
7015 AC_MSG_RESULT([ logfile . . . . . . . $enable_logfile])
7016 AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
7017 AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
7018 AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
7019 AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
7020 AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
7021 AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
7022 AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
7023 AC_MSG_RESULT([ match_regex . . . . . $enable_match_regex])
7024 AC_MSG_RESULT([ match_timediff . . . $enable_match_timediff])
7025 AC_MSG_RESULT([ match_value . . . . . $enable_match_value])
7026 AC_MSG_RESULT([ mbmon . . . . . . . . $enable_mbmon])
7027 AC_MSG_RESULT([ mcelog . . . . . . . $enable_mcelog])
7028 AC_MSG_RESULT([ md . . . . . . . . . $enable_md])
7029 AC_MSG_RESULT([ memcachec . . . . . . $enable_memcachec])
7030 AC_MSG_RESULT([ memcached . . . . . . $enable_memcached])
7031 AC_MSG_RESULT([ memory . . . . . . . $enable_memory])
7032 AC_MSG_RESULT([ mic . . . . . . . . . $enable_mic])
7033 AC_MSG_RESULT([ modbus . . . . . . . $enable_modbus])
7034 AC_MSG_RESULT([ mqtt . . . . . . . . $enable_mqtt])
7035 AC_MSG_RESULT([ multimeter . . . . . $enable_multimeter])
7036 AC_MSG_RESULT([ mysql . . . . . . . . $enable_mysql])
7037 AC_MSG_RESULT([ netapp . . . . . . . $enable_netapp])
7038 AC_MSG_RESULT([ netlink . . . . . . . $enable_netlink])
7039 AC_MSG_RESULT([ network . . . . . . . $enable_network])
7040 AC_MSG_RESULT([ nfs . . . . . . . . . $enable_nfs])
7041 AC_MSG_RESULT([ nginx . . . . . . . . $enable_nginx])
7042 AC_MSG_RESULT([ notify_desktop . . . $enable_notify_desktop])
7043 AC_MSG_RESULT([ notify_email . . . . $enable_notify_email])
7044 AC_MSG_RESULT([ notify_nagios . . . . $enable_notify_nagios])
7045 AC_MSG_RESULT([ ntpd . . . . . . . . $enable_ntpd])
7046 AC_MSG_RESULT([ numa . . . . . . . . $enable_numa])
7047 AC_MSG_RESULT([ nut . . . . . . . . . $enable_nut])
7048 AC_MSG_RESULT([ olsrd . . . . . . . . $enable_olsrd])
7049 AC_MSG_RESULT([ onewire . . . . . . . $enable_onewire])
7050 AC_MSG_RESULT([ openldap . . . . . . $enable_openldap])
7051 AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
7052 AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
7053 AC_MSG_RESULT([ ovs_events . . . . . $enable_ovs_events])
7054 AC_MSG_RESULT([ ovs_stats . . . . . . $enable_ovs_stats])
7055 AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
7056 AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
7057 AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
7058 AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
7059 AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
7060 AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
7061 AC_MSG_RESULT([ processes . . . . . . $enable_processes])
7062 AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
7063 AC_MSG_RESULT([ python . . . . . . . $enable_python])
7064 AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
7065 AC_MSG_RESULT([ routeros . . . . . . $enable_routeros])
7066 AC_MSG_RESULT([ rrdcached . . . . . . $enable_rrdcached])
7067 AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
7068 AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
7069 AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
7070 AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
7071 AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
7072 AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
7073 AC_MSG_RESULT([ snmp_agent . . . . . $enable_snmp_agent])
7074 AC_MSG_RESULT([ statsd . . . . . . . $enable_statsd])
7075 AC_MSG_RESULT([ swap . . . . . . . . $enable_swap])
7076 AC_MSG_RESULT([ synproxy . . . . . . $enable_synproxy])
7077 AC_MSG_RESULT([ syslog . . . . . . . $enable_syslog])
7078 AC_MSG_RESULT([ table . . . . . . . . $enable_table])
7079 AC_MSG_RESULT([ tail_csv . . . . . . $enable_tail_csv])
7080 AC_MSG_RESULT([ tail . . . . . . . . $enable_tail])
7081 AC_MSG_RESULT([ tape . . . . . . . . $enable_tape])
7082 AC_MSG_RESULT([ target_notification . $enable_target_notification])
7083 AC_MSG_RESULT([ target_replace . . . $enable_target_replace])
7084 AC_MSG_RESULT([ target_scale . . . . $enable_target_scale])
7085 AC_MSG_RESULT([ target_set . . . . . $enable_target_set])
7086 AC_MSG_RESULT([ target_v5upgrade . . $enable_target_v5upgrade])
7087 AC_MSG_RESULT([ tcpconns . . . . . . $enable_tcpconns])
7088 AC_MSG_RESULT([ teamspeak2 . . . . . $enable_teamspeak2])
7089 AC_MSG_RESULT([ ted . . . . . . . . . $enable_ted])
7090 AC_MSG_RESULT([ thermal . . . . . . . $enable_thermal])
7091 AC_MSG_RESULT([ threshold . . . . . . $enable_threshold])
7092 AC_MSG_RESULT([ tokyotyrant . . . . . $enable_tokyotyrant])
7093 AC_MSG_RESULT([ turbostat . . . . . . $enable_turbostat])
7094 AC_MSG_RESULT([ unixsock . . . . . . $enable_unixsock])
7095 AC_MSG_RESULT([ uptime . . . . . . . $enable_uptime])
7096 AC_MSG_RESULT([ users . . . . . . . . $enable_users])
7097 AC_MSG_RESULT([ uuid . . . . . . . . $enable_uuid])
7098 AC_MSG_RESULT([ varnish . . . . . . . $enable_varnish])
7099 AC_MSG_RESULT([ virt . . . . . . . . $enable_virt])
7100 AC_MSG_RESULT([ vmem . . . . . . . . $enable_vmem])
7101 AC_MSG_RESULT([ vserver . . . . . . . $enable_vserver])
7102 AC_MSG_RESULT([ wireless . . . . . . $enable_wireless])
7103 AC_MSG_RESULT([ write_graphite . . . $enable_write_graphite])
7104 AC_MSG_RESULT([ write_http . . . . . $enable_write_http])
7105 AC_MSG_RESULT([ write_kafka . . . . . $enable_write_kafka])
7106 AC_MSG_RESULT([ write_log . . . . . . $enable_write_log])
7107 AC_MSG_RESULT([ write_mongodb . . . . $enable_write_mongodb])
7108 AC_MSG_RESULT([ write_prometheus. . . $enable_write_prometheus])
7109 AC_MSG_RESULT([ write_redis . . . . . $enable_write_redis])
7110 AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
7111 AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
7112 AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
7113 AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
7114 AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
7115 AC_MSG_RESULT([ zfs_arc . . . . . . . $enable_zfs_arc])
7116 AC_MSG_RESULT([ zone . . . . . . . . $enable_zone])
7117 AC_MSG_RESULT([ zookeeper . . . . . . $enable_zookeeper])
7120 if test "x$dependency_error" = "xyes"; then
7121 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
7124 if test "x$dependency_warning" = "xyes"; then
7125 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
7128 # vim: set fdm=marker sw=2 sts=2 ts=2 et :