1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 m4_ifdef([LT_PACKAGE_VERSION],
10 LT_CONFIG_LTDL_DIR([libltdl])
12 LTDL_INIT([convenience])
13 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
18 AC_LIBLTDL_CONVENIENCE
22 AC_CONFIG_SUBDIRS(libltdl)
23 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
27 AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
28 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 AC_PREFIX_DEFAULT("/opt/collectd")
36 # Checks for programs.
44 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
52 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
53 AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
54 [have_protobuf_c_h="yes"],
55 [have_protobuf_c_h="no"])
56 if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
58 have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
60 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
62 AC_MSG_CHECKING([for kernel type ($host_os)])
65 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
69 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
79 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
83 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
89 AC_MSG_RESULT([$ac_system])
91 if test "x$ac_system" = "xLinux"
93 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
94 if test -z "$KERNEL_DIR"
96 KERNEL_DIR="/lib/modules/`uname -r`/source"
99 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
100 AC_SUBST(KERNEL_CFLAGS)
103 if test "x$ac_system" = "xSolaris"
105 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
106 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
108 if test "x$ac_system" = "xAIX"
110 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
113 # Where to install .pc files.
114 pkgconfigdir="${libdir}/pkgconfig"
115 AC_SUBST(pkgconfigdir)
117 # Check for standards compliance mode
118 AC_ARG_ENABLE(standards,
119 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
120 [enable_standards="$enableval"],
121 [enable_standards="no"])
122 if test "x$enable_standards" = "xyes"
124 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
125 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
126 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
127 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
128 if test "x$GCC" = "xyes"
130 CFLAGS="$CFLAGS -std=c99"
133 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
136 # Checks for header files.
143 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h)
146 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
151 # include <sys/types.h>
154 AC_CHECK_HEADERS(netinet/in.h, [], [],
159 # include <sys/types.h>
161 #if HAVE_NETINET_IN_SYSTM_H
162 # include <netinet/in_systm.h>
165 AC_CHECK_HEADERS(netinet/ip.h, [], [],
170 # include <sys/types.h>
172 #if HAVE_NETINET_IN_SYSTM_H
173 # include <netinet/in_systm.h>
175 #if HAVE_NETINET_IN_H
176 # include <netinet/in.h>
179 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
184 # include <sys/types.h>
186 #if HAVE_NETINET_IN_SYSTM_H
187 # include <netinet/in_systm.h>
189 #if HAVE_NETINET_IN_H
190 # include <netinet/in.h>
192 #if HAVE_NETINET_IP_H
193 # include <netinet/ip.h>
196 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
201 # include <sys/types.h>
203 #if HAVE_NETINET_IN_SYSTM_H
204 # include <netinet/in_systm.h>
206 #if HAVE_NETINET_IN_H
207 # include <netinet/in.h>
209 #if HAVE_NETINET_IP_H
210 # include <netinet/ip.h>
213 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
218 # include <sys/types.h>
220 #if HAVE_NETINET_IN_SYSTM_H
221 # include <netinet/in_systm.h>
223 #if HAVE_NETINET_IN_H
224 # include <netinet/in.h>
227 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
232 # include <sys/types.h>
234 #if HAVE_NETINET_IN_SYSTM_H
235 # include <netinet/in_systm.h>
237 #if HAVE_NETINET_IN_H
238 # include <netinet/in.h>
240 #if HAVE_NETINET_IP6_H
241 # include <netinet/ip6.h>
244 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
249 # include <sys/types.h>
251 #if HAVE_NETINET_IN_SYSTM_H
252 # include <netinet/in_systm.h>
254 #if HAVE_NETINET_IN_H
255 # include <netinet/in.h>
257 #if HAVE_NETINET_IP_H
258 # include <netinet/ip.h>
261 AC_CHECK_HEADERS(netinet/udp.h, [], [],
266 # include <sys/types.h>
268 #if HAVE_NETINET_IN_SYSTM_H
269 # include <netinet/in_systm.h>
271 #if HAVE_NETINET_IN_H
272 # include <netinet/in.h>
274 #if HAVE_NETINET_IP_H
275 # include <netinet/ip.h>
279 AC_CHECK_TYPES([struct ip6_ext], [], [],
284 # include <sys/types.h>
286 #if HAVE_NETINET_IN_SYSTM_H
287 # include <netinet/in_systm.h>
289 #if HAVE_NETINET_IN_H
290 # include <netinet/in.h>
292 #if HAVE_NETINET_IP6_H
293 # include <netinet/ip6.h>
298 AC_CHECK_HEADERS(sys/dkstat.h)
299 if test "x$ac_system" = "xDarwin"
301 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
302 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
303 # For the battery plugin
304 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
306 #if HAVE_IOKIT_IOKITLIB_H
307 # include <IOKit/IOKitLib.h>
309 #if HAVE_IOKIT_IOTYPES_H
310 # include <IOKit/IOTypes.h>
316 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
319 # include <sys/types.h>
322 # include <sys/param.h>
326 AC_MSG_CHECKING([for sysctl kern.cp_times])
327 if test -x /sbin/sysctl
329 /sbin/sysctl kern.cp_times 2>/dev/null
333 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
334 [Define if sysctl supports kern.cp_times])
343 AC_CHECK_HEADERS(linux/major.h)
345 # For md module (Linux only)
346 if test "x$ac_system" = "xLinux"
348 AC_CHECK_HEADERS(linux/raid/md_u.h,
349 [have_linux_raid_md_u_h="yes"],
350 [have_linux_raid_md_u_h="no"],
352 #include <sys/ioctl.h>
353 #include <linux/major.h>
354 #include <linux/types.h>
357 have_linux_raid_md_u_h="no"
360 # For the swap module
361 have_linux_wireless_h="no"
362 if test "x$ac_system" = "xLinux"
364 AC_CHECK_HEADERS(linux/wireless.h,
365 [have_linux_wireless_h="yes"],
366 [have_linux_wireless_h="no"],
369 #include <sys/ioctl.h>
370 #include <sys/socket.h>
374 # For the swap module
375 have_sys_swap_h="yes"
376 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
378 #undef _FILE_OFFSET_BITS
379 #undef _LARGEFILE64_SOURCE
381 # include <sys/types.h>
384 # include <sys/param.h>
388 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
391 if test "x$GCC" = "xyes"
393 hint_64="CFLAGS='-m64'"
395 hint_64="CFLAGS='-xarch=v9'"
397 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
401 # For the processes plugin
403 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
405 # For interface plugin
406 AC_CHECK_HEADERS(ifaddrs.h)
407 AC_CHECK_HEADERS(net/if.h, [], [],
410 # include <sys/types.h>
412 #if HAVE_SYS_SOCKET_H
413 # include <sys/socket.h>
416 AC_CHECK_HEADERS(linux/if.h, [], [],
419 # include <sys/types.h>
421 #if HAVE_SYS_SOCKET_H
422 # include <sys/socket.h>
425 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
428 # include <sys/types.h>
430 #if HAVE_SYS_SOCKET_H
431 # include <sys/socket.h>
433 #if HAVE_LINUX_INET_DIAG_H
434 # include <linux/inet_diag.h>
437 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
440 # include <sys/types.h>
442 #if HAVE_SYS_SOCKET_H
443 # include <sys/socket.h>
446 # include <linux/if.h>
451 AC_CHECK_HEADERS(linux/sockios.h,
452 [have_linux_sockios_h="yes"],
453 [have_linux_sockios_h="no"],
456 # include <sys/ioctl.h>
462 AC_CHECK_HEADERS(linux/ethtool.h,
463 [have_linux_ethtool_h="yes"],
464 [have_linux_ethtool_h="no"],
467 # include <sys/ioctl.h>
472 #if HAVE_LINUX_SOCKIOS_H
473 # include <linux/sockios.h>
478 have_linux_ip_vs_h="no"
479 have_net_ip_vs_h="no"
481 ip_vs_h_needs_kernel_cflags="no"
482 if test "x$ac_system" = "xLinux"
484 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
485 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
486 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
488 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
490 SAVE_CFLAGS="$CFLAGS"
491 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
493 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
495 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
496 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
497 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
499 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
501 ip_vs_h_needs_kernel_cflags="yes"
504 CFLAGS="$SAVE_CFLAGS"
507 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
510 AC_CHECK_HEADERS(sys/ucred.h, [], [],
513 # include <sys/types.h>
516 # include <sys/param.h>
520 # For mount interface
521 AC_CHECK_HEADERS(sys/mount.h, [], [],
524 # include <sys/types.h>
527 # include <sys/param.h>
531 # For the email plugin
532 AC_CHECK_HEADERS(linux/un.h, [], [],
534 #if HAVE_SYS_SOCKET_H
535 # include <sys/socket.h>
539 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
542 AC_CHECK_HEADERS(arpa/nameser.h)
543 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
545 #if HAVE_ARPA_NAMESER_H
546 # include <arpa/nameser.h>
550 AC_CHECK_HEADERS(net/if_arp.h, [], [],
551 [#if HAVE_SYS_SOCKET_H
552 # include <sys/socket.h>
555 AC_CHECK_HEADERS(net/ppp_defs.h)
556 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
557 [#if HAVE_NET_PPP_DEFS_H
558 # include <net/ppp_defs.h>
561 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
566 # include <sys/types.h>
568 #if HAVE_SYS_SOCKET_H
569 # include <sys/socket.h>
574 #if HAVE_NETINET_IN_H
575 # include <netinet/in.h>
579 AC_CHECK_HEADERS(netinet/ip_compat.h)
581 have_net_pfvar_h="no"
582 AC_CHECK_HEADERS(net/pfvar.h,
583 [have_net_pfvar_h="yes"],
584 [have_net_pfvar_h="no"],
587 # include <sys/ioctl.h>
589 #if HAVE_SYS_SOCKET_H
590 # include <sys/socket.h>
597 # For the multimeter plugin
599 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
602 # Checks for typedefs, structures, and compiler characteristics.
611 # Checks for library functions.
613 AC_PROG_GCC_TRADITIONAL
614 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
618 SAVE_CFLAGS="$CFLAGS"
619 # Emulate behavior of src/Makefile.am
620 if test "x$GCC" = "xyes"
622 CFLAGS="$CFLAGS -Wall -Werror"
625 AC_CACHE_CHECK([for strtok_r],
626 [c_cv_have_strtok_r_default],
635 char buffer[] = "foo,bar,baz";
642 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
645 printf ("token = %s;\n", token);
649 [c_cv_have_strtok_r_default="yes"],
650 [c_cv_have_strtok_r_default="no"]
654 if test "x$c_cv_have_strtok_r_default" = "xno"
656 CFLAGS="$CFLAGS -D_REENTRANT=1"
658 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
659 [c_cv_have_strtok_r_reentrant],
668 char buffer[] = "foo,bar,baz";
675 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
678 printf ("token = %s;\n", token);
682 [c_cv_have_strtok_r_reentrant="yes"],
683 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
688 CFLAGS="$SAVE_CFLAGS"
689 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
691 CFLAGS="$CFLAGS -D_REENTRANT=1"
694 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
696 socket_needs_socket="no"
697 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
698 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
700 clock_gettime_needs_rt="no"
701 clock_gettime_needs_posix4="no"
702 have_clock_gettime="no"
703 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
704 if test "x$have_clock_gettime" = "xno"
706 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
707 have_clock_gettime="yes"])
709 if test "x$have_clock_gettime" = "xno"
711 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
712 have_clock_gettime="yes"])
714 if test "x$have_clock_gettime" = "xyes"
716 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
718 AC_MSG_WARN(cannot find clock_gettime)
721 nanosleep_needs_rt="no"
722 nanosleep_needs_posix4="no"
723 AC_CHECK_FUNCS(nanosleep,
725 AC_CHECK_LIB(rt, nanosleep,
726 [nanosleep_needs_rt="yes"],
727 AC_CHECK_LIB(posix4, nanosleep,
728 [nanosleep_needs_posix4="yes"],
729 AC_MSG_ERROR(cannot find nanosleep))))
731 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
732 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
734 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
735 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
736 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
737 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
738 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
739 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
740 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
741 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
742 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
743 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
744 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
745 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
747 # Check for strptime {{{
748 if test "x$GCC" = "xyes"
750 SAVE_CFLAGS="$CFLAGS"
751 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
754 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
755 if test "x$have_strptime" = "xyes"
757 AC_CACHE_CHECK([whether strptime is exported by default],
758 [c_cv_have_strptime_default],
759 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
765 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
768 [c_cv_have_strptime_default="yes"],
769 [c_cv_have_strptime_default="no"]))
771 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
773 AC_CACHE_CHECK([whether strptime needs standards mode],
774 [c_cv_have_strptime_standards],
775 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
777 #ifndef _ISOC99_SOURCE
778 # define _ISOC99_SOURCE 1
780 #ifndef _POSIX_C_SOURCE
781 # define _POSIX_C_SOURCE 200112L
783 #ifndef _XOPEN_SOURCE
784 # define _XOPEN_SOURCE 500
790 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
793 [c_cv_have_strptime_standards="yes"],
794 [c_cv_have_strptime_standards="no"]))
796 if test "x$c_cv_have_strptime_standards" = "xyes"
798 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
804 if test "x$GCC" = "xyes"
806 CFLAGS="$SAVE_CFLAGS"
808 # }}} Check for strptime
810 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
811 if test "x$have_swapctl" = "xyes"; then
812 AC_CACHE_CHECK([whether swapctl takes two arguments],
813 [c_cv_have_swapctl_two_args],
814 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
816 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
817 # undef _FILE_OFFSET_BITS
818 # undef _LARGEFILE64_SOURCE
820 #include <sys/stat.h>
821 #include <sys/swap.h>
824 int num = swapctl(0, NULL);
827 [c_cv_have_swapctl_two_args="yes"],
828 [c_cv_have_swapctl_two_args="no"]
831 AC_CACHE_CHECK([whether swapctl takes three arguments],
832 [c_cv_have_swapctl_three_args],
836 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
837 # undef _FILE_OFFSET_BITS
838 # undef _LARGEFILE64_SOURCE
840 #include <sys/stat.h>
841 #include <sys/swap.h>
844 int num = swapctl(0, NULL, 0);
847 [c_cv_have_swapctl_three_args="yes"],
848 [c_cv_have_swapctl_three_args="no"]
852 # Check for different versions of `swapctl' here..
853 if test "x$have_swapctl" = "xyes"; then
854 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
855 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
856 [Define if the function swapctl exists and takes two arguments.])
858 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
859 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
860 [Define if the function swapctl exists and takes three arguments.])
865 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
867 if test "x$withval" = "xno"; then
869 else if test "x$withval" = "xyes"; then
876 if test "x$nan_type" = "xnone"; then
877 AC_CACHE_CHECK([whether NAN is defined by default],
878 [c_cv_have_nan_default],
879 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
883 static double foo = NAN;
892 [c_cv_have_nan_default="yes"],
893 [c_cv_have_nan_default="no"]
896 if test "x$c_cv_have_nan_default" = "xyes"
901 if test "x$nan_type" = "xnone"; then
902 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
903 [c_cv_have_nan_isoc],
904 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
907 #define __USE_ISOC99 1
909 static double foo = NAN;
918 [c_cv_have_nan_isoc="yes"],
919 [c_cv_have_nan_isoc="no"]
922 if test "x$c_cv_have_nan_isoc" = "xyes"
927 if test "x$nan_type" = "xnone"; then
928 SAVE_LDFLAGS=$LDFLAGS
929 LDFLAGS="$LDFLAGS -lm"
930 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
931 [c_cv_have_nan_zero],
932 AC_RUN_IFELSE([AC_LANG_PROGRAM(
939 #define NAN (0.0 / 0.0)
941 # define isnan(f) ((f) != (f))
943 static double foo = NAN;
952 [c_cv_have_nan_zero="yes"],
953 [c_cv_have_nan_zero="no"]
956 LDFLAGS=$SAVE_LDFLAGS
957 if test "x$c_cv_have_nan_zero" = "xyes"
963 if test "x$nan_type" = "xdefault"; then
964 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
965 [Define if NAN is defined by default and can initialize static variables.])
966 else if test "x$nan_type" = "xisoc99"; then
967 AC_DEFINE(NAN_STATIC_ISOC, 1,
968 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
969 else if test "x$nan_type" = "xzero"; then
970 AC_DEFINE(NAN_ZERO_ZERO, 1,
971 [Define if NAN can be defined as (0.0 / 0.0)])
973 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
976 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
978 if test "x$withval" = "xnothing"; then
979 fp_layout_type="nothing"
980 else if test "x$withval" = "xendianflip"; then
981 fp_layout_type="endianflip"
982 else if test "x$withval" = "xintswap"; then
983 fp_layout_type="intswap"
985 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
988 [fp_layout_type="unknown"])
990 if test "x$fp_layout_type" = "xunknown"; then
991 AC_CACHE_CHECK([if doubles are stored in x86 representation],
992 [c_cv_fp_layout_need_nothing],
993 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1002 # include <inttypes.h>
1005 # include <stdbool.h>
1015 memcpy ((void *) &i0, (void *) &d, 8);
1018 memcpy ((void *) c, (void *) &i1, 8);
1020 if ((c[0] == 0x2f) && (c[1] == 0x25)
1021 && (c[2] == 0xc0) && (c[3] == 0xc7)
1022 && (c[4] == 0x43) && (c[5] == 0x2b)
1023 && (c[6] == 0x1f) && (c[7] == 0x5b))
1029 [c_cv_fp_layout_need_nothing="yes"],
1030 [c_cv_fp_layout_need_nothing="no"]
1033 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1034 fp_layout_type="nothing"
1037 if test "x$fp_layout_type" = "xunknown"; then
1038 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1039 [c_cv_fp_layout_need_endianflip],
1040 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1046 # include <stdint.h>
1049 # include <inttypes.h>
1052 # include <stdbool.h>
1054 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1055 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1056 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1057 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1058 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1059 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1060 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1061 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1070 memcpy ((void *) &i0, (void *) &d, 8);
1072 i1 = endianflip (i0);
1073 memcpy ((void *) c, (void *) &i1, 8);
1075 if ((c[0] == 0x2f) && (c[1] == 0x25)
1076 && (c[2] == 0xc0) && (c[3] == 0xc7)
1077 && (c[4] == 0x43) && (c[5] == 0x2b)
1078 && (c[6] == 0x1f) && (c[7] == 0x5b))
1084 [c_cv_fp_layout_need_endianflip="yes"],
1085 [c_cv_fp_layout_need_endianflip="no"]
1088 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1089 fp_layout_type="endianflip"
1092 if test "x$fp_layout_type" = "xunknown"; then
1093 AC_CACHE_CHECK([if intswap converts to x86 representation],
1094 [c_cv_fp_layout_need_intswap],
1095 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1101 # include <stdint.h>
1104 # include <inttypes.h>
1107 # include <stdbool.h>
1109 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1110 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1119 memcpy ((void *) &i0, (void *) &d, 8);
1122 memcpy ((void *) c, (void *) &i1, 8);
1124 if ((c[0] == 0x2f) && (c[1] == 0x25)
1125 && (c[2] == 0xc0) && (c[3] == 0xc7)
1126 && (c[4] == 0x43) && (c[5] == 0x2b)
1127 && (c[6] == 0x1f) && (c[7] == 0x5b))
1133 [c_cv_fp_layout_need_intswap="yes"],
1134 [c_cv_fp_layout_need_intswap="no"]
1137 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1138 fp_layout_type="intswap"
1142 if test "x$fp_layout_type" = "xnothing"; then
1143 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1144 [Define if doubles are stored in x86 representation.])
1145 else if test "x$fp_layout_type" = "xendianflip"; then
1146 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1147 [Define if endianflip is needed to convert to x86 representation.])
1148 else if test "x$fp_layout_type" = "xintswap"; then
1149 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1150 [Define if intswap is needed to convert to x86 representation.])
1152 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1156 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1157 have_getvfsstat="no"
1158 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1159 have_listmntent="no"
1160 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1163 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1164 if test "x$have_getmntent" = "xno"; then
1165 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1167 if test "x$have_getmntent" = "xno"; then
1168 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1170 if test "x$have_getmntent" = "xno"; then
1171 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1174 if test "x$have_getmntent" = "xc"; then
1175 AC_CACHE_CHECK([whether getmntent takes one argument],
1176 [c_cv_have_one_getmntent],
1180 #include "$srcdir/src/utils_mount.h"
1185 fh = setmntent ("/etc/mtab", "r");
1186 me = getmntent (fh);
1187 return(me->mnt_passno);
1190 [c_cv_have_one_getmntent="yes"],
1191 [c_cv_have_one_getmntent="no"]
1194 AC_CACHE_CHECK([whether getmntent takes two arguments],
1195 [c_cv_have_two_getmntent],
1199 #include "$srcdir/src/utils_mount.h"
1205 fh = fopen ("/etc/mnttab", "r");
1206 status = getmntent (fh, &mt);
1210 [c_cv_have_two_getmntent="yes"],
1211 [c_cv_have_two_getmntent="no"]
1216 # Check for different versions of `getmntent' here..
1218 if test "x$have_getmntent" = "xc"; then
1219 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1220 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1221 [Define if the function getmntent exists and takes one argument.])
1223 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1224 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1225 [Define if the function getmntent exists and takes two arguments.])
1228 if test "x$have_getmntent" = "xsun"; then
1229 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1230 [Define if the function getmntent exists. It's the version from libsun.])
1232 if test "x$have_getmntent" = "xseq"; then
1233 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1234 [Define if the function getmntent exists. It's the version from libseq.])
1236 if test "x$have_getmntent" = "xgen"; then
1237 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1238 [Define if the function getmntent exists. It's the version from libgen.])
1242 AC_CACHE_CHECK([if have htonll defined],
1244 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1246 #include <sys/types.h>
1247 #include <netinet/in.h>
1249 # include <inttypes.h>
1256 [c_cv_have_htonll="yes"],
1257 [c_cv_have_htonll="no"]
1260 if test "x$c_cv_have_htonll" = "xyes"
1262 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1265 # Check for structures
1266 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1267 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1270 #include <sys/types.h>
1271 #include <sys/socket.h>
1274 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1275 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1278 #include <sys/types.h>
1279 #include <sys/socket.h>
1280 #include <linux/if.h>
1281 #include <linux/netdevice.h>
1283 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1284 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1287 #include <linux/inet_diag.h>
1291 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1294 #include <netinet/in.h>
1298 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1300 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1301 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1302 have_struct_kinfo_proc_freebsd="yes"
1305 have_struct_kinfo_proc_freebsd="no"
1309 #include <sys/param.h>
1310 #include <sys/sysctl.h>
1311 #include <sys/user.h>
1314 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1316 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1317 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1318 have_struct_kinfo_proc_openbsd="yes"
1321 have_struct_kinfo_proc_openbsd="no"
1324 #include <sys/param.h>
1325 #include <sys/sysctl.h>
1329 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1330 [#define _BSD_SOURCE
1332 # include <stdint.h>
1334 #if HAVE_SYS_TYPES_H
1335 # include <sys/types.h>
1337 #if HAVE_NETINET_IN_SYSTM_H
1338 # include <netinet/in_systm.h>
1340 #if HAVE_NETINET_IN_H
1341 # include <netinet/in.h>
1343 #if HAVE_NETINET_IP_H
1344 # include <netinet/ip.h>
1346 #if HAVE_NETINET_UDP_H
1347 # include <netinet/udp.h>
1350 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1351 [#define _BSD_SOURCE
1353 # include <stdint.h>
1355 #if HAVE_SYS_TYPES_H
1356 # include <sys/types.h>
1358 #if HAVE_NETINET_IN_SYSTM_H
1359 # include <netinet/in_systm.h>
1361 #if HAVE_NETINET_IN_H
1362 # include <netinet/in.h>
1364 #if HAVE_NETINET_IP_H
1365 # include <netinet/ip.h>
1367 #if HAVE_NETINET_UDP_H
1368 # include <netinet/udp.h>
1372 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1382 # Checks for libraries begin here
1385 with_libresolv="yes"
1386 AC_CHECK_LIB(resolv, res_search,
1388 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1390 [with_libresolv="no"])
1391 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1393 dnl Check for HAL (hardware abstraction library)
1395 AC_CHECK_LIB(hal,libhal_device_property_exists,
1396 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1398 if test "x$with_libhal" = "xyes"; then
1399 if test "x$PKG_CONFIG" != "x"; then
1400 BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
1401 BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
1402 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1403 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1407 m4_divert_once([HELP_WITH], [
1408 collectd additional packages:])
1410 AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
1412 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1414 if test "x$ac_system" = "xAIX"
1419 with_perfstat="no (AIX only)"
1420 with_procinfo="no (AIX only)"
1423 if test "x$with_perfstat" = "xyes"
1425 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1426 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1428 if test "x$with_perfstat" = "xyes"
1430 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1431 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1432 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1433 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1435 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1438 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1440 # Processes plugin under AIX.
1441 if test "x$with_procinfo" = "xyes"
1443 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1445 if test "x$with_procinfo" = "xyes"
1447 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1450 if test "x$ac_system" = "xSolaris"
1455 with_kstat="no (Solaris only)"
1456 with_devinfo="no (Solaris only)"
1459 if test "x$with_kstat" = "xyes"
1461 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1463 if test "x$with_kstat" = "xyes"
1465 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1466 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1468 if test "x$with_kstat" = "xyes"
1470 AC_DEFINE(HAVE_LIBKSTAT, 1,
1471 [Define to 1 if you have the 'kstat' library (-lkstat)])
1473 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1474 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1477 if test "x$ac_system" = "xDarwin"
1483 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1486 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1487 if test "x$with_kvm_getprocs" = "xyes"
1489 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1490 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1493 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1495 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1496 if test "x$with_kvm_getswapinfo" = "xyes"
1498 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1499 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1502 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1504 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1505 if test "x$with_kvm_nlist" = "xyes"
1507 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1508 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1509 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1512 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1514 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1515 if test "x$with_kvm_openfiles" = "xyes"
1517 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1518 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1521 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1523 # --with-libaquaero5 {{{
1524 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1526 if test "x$withval" = "xyes"
1528 with_libaquaero5="yes"
1529 else if test "x$withval" = "xno"
1531 with_libaquaero5="no"
1533 with_libaquaero5="yes"
1534 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1535 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1538 [with_libaquaero5="yes"])
1540 SAVE_CPPFLAGS="$CPPFLAGS"
1541 SAVE_LDFLAGS="$LDFLAGS"
1543 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1544 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1546 if test "x$with_libaquaero5" = "xyes"
1548 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1550 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1552 AC_CHECK_HEADERS(libaquaero5.h,
1553 [with_libaquaero5="yes"],
1554 [with_libaquaero5="no (libaquaero5.h not found)"])
1556 if test "x$with_libaquaero5" = "xyes"
1558 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1560 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1562 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1563 [with_libaquaero5="yes"],
1564 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1567 CPPFLAGS="$SAVE_CPPFLAGS"
1568 LDFLAGS="$SAVE_LDFLAGS"
1570 if test "x$with_libaquaero5" = "xyes"
1572 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1573 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1574 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1575 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1577 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1580 # --with-libcredis {{{
1581 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1583 if test "x$withval" = "xyes"
1585 with_libcredis="yes"
1586 else if test "x$withval" = "xno"
1590 with_libcredis="yes"
1591 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1592 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1595 [with_libcredis="yes"])
1597 SAVE_CPPFLAGS="$CPPFLAGS"
1598 SAVE_LDFLAGS="$LDFLAGS"
1600 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1601 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1603 if test "x$with_libcredis" = "xyes"
1605 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1607 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1609 AC_CHECK_HEADERS(credis.h,
1610 [with_libcredis="yes"],
1611 [with_libcredis="no (credis.h not found)"])
1613 if test "x$with_libcredis" = "xyes"
1615 if test "x$LIBCREDIS_LDFLAGS" != "x"
1617 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1619 AC_CHECK_LIB(credis, credis_info,
1620 [with_libcredis="yes"],
1621 [with_libcredis="no (symbol 'credis_info' not found)"])
1625 CPPFLAGS="$SAVE_CPPFLAGS"
1626 LDFLAGS="$SAVE_LDFLAGS"
1628 if test "x$with_libcredis" = "xyes"
1630 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1631 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1632 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1633 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1635 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1638 # --with-libcurl {{{
1639 with_curl_config="curl-config"
1642 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1644 if test "x$withval" = "xno"
1647 else if test "x$withval" = "xyes"
1651 if test -f "$withval" && test -x "$withval"
1653 with_curl_config="$withval"
1655 else if test -x "$withval/bin/curl-config"
1657 with_curl_config="$withval/bin/curl-config"
1666 if test "x$with_libcurl" = "xyes"
1668 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1669 curl_config_status=$?
1671 if test $curl_config_status -ne 0
1673 with_libcurl="no ($with_curl_config failed)"
1675 SAVE_CPPFLAGS="$CPPFLAGS"
1676 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1678 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1680 CPPFLAGS="$SAVE_CPPFLAGS"
1683 if test "x$with_libcurl" = "xyes"
1685 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1686 curl_config_status=$?
1688 if test $curl_config_status -ne 0
1690 with_libcurl="no ($with_curl_config failed)"
1692 AC_CHECK_LIB(curl, curl_easy_init,
1693 [with_libcurl="yes"],
1694 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1698 if test "x$with_libcurl" = "xyes"
1700 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1701 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1702 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1703 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1705 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1709 with_libdbi_cppflags=""
1710 with_libdbi_ldflags=""
1711 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1713 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1715 with_libdbi_cppflags="-I$withval/include"
1716 with_libdbi_ldflags="-L$withval/lib"
1719 with_libdbi="$withval"
1725 if test "x$with_libdbi" = "xyes"
1727 SAVE_CPPFLAGS="$CPPFLAGS"
1728 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1730 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1732 CPPFLAGS="$SAVE_CPPFLAGS"
1734 if test "x$with_libdbi" = "xyes"
1736 SAVE_CPPFLAGS="$CPPFLAGS"
1737 SAVE_LDFLAGS="$LDFLAGS"
1738 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1739 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1741 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1743 CPPFLAGS="$SAVE_CPPFLAGS"
1744 LDFLAGS="$SAVE_LDFLAGS"
1746 if test "x$with_libdbi" = "xyes"
1748 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1749 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1750 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1751 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1752 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1753 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1755 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1758 # --with-libesmtp {{{
1759 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1761 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1763 LDFLAGS="$LDFLAGS -L$withval/lib"
1764 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1767 with_libesmtp="$withval"
1773 if test "x$with_libesmtp" = "xyes"
1775 AC_CHECK_LIB(esmtp, smtp_create_session,
1777 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1778 ], [with_libesmtp="no (libesmtp not found)"])
1780 if test "x$with_libesmtp" = "xyes"
1782 AC_CHECK_HEADERS(libesmtp.h,
1784 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1785 ], [with_libesmtp="no (libesmtp.h not found)"])
1787 if test "x$with_libesmtp" = "xyes"
1793 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1794 [Wether or not to use the esmtp library])
1795 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1798 # --with-libganglia {{{
1799 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1801 if test -f "$withval" && test -x "$withval"
1803 with_libganglia_config="$withval"
1804 with_libganglia="yes"
1805 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1807 with_libganglia_config="$withval/bin/ganglia-config"
1808 with_libganglia="yes"
1809 else if test -d "$withval"
1811 GANGLIA_CPPFLAGS="-I$withval/include"
1812 GANGLIA_LDFLAGS="-L$withval/lib"
1813 with_libganglia="yes"
1815 with_libganglia_config="ganglia-config"
1816 with_libganglia="$withval"
1820 with_libganglia_config="ganglia-config"
1821 with_libganglia="yes"
1824 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1826 if test "x$GANGLIA_CPPFLAGS" = "x"
1828 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1831 if test "x$GANGLIA_LDFLAGS" = "x"
1833 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1836 if test "x$GANGLIA_LIBS" = "x"
1838 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1842 SAVE_CPPFLAGS="$CPPFLAGS"
1843 SAVE_LDFLAGS="$LDFLAGS"
1844 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1845 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1847 if test "x$with_libganglia" = "xyes"
1849 AC_CHECK_HEADERS(gm_protocol.h,
1851 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1852 [Define to 1 if you have the <gm_protocol.h> header file.])
1853 ], [with_libganglia="no (gm_protocol.h not found)"])
1856 if test "x$with_libganglia" = "xyes"
1858 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1860 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1861 [Define to 1 if you have the ganglia library (-lganglia).])
1862 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1865 CPPFLAGS="$SAVE_CPPFLAGS"
1866 LDFLAGS="$SAVE_LDFLAGS"
1868 AC_SUBST(GANGLIA_CPPFLAGS)
1869 AC_SUBST(GANGLIA_LDFLAGS)
1870 AC_SUBST(GANGLIA_LIBS)
1871 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1874 # --with-libgcrypt {{{
1875 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1876 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1877 GCRYPT_LIBS="$GCRYPT_LIBS"
1878 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1880 if test -f "$withval" && test -x "$withval"
1882 with_libgcrypt_config="$withval"
1883 with_libgcrypt="yes"
1884 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1886 with_libgcrypt_config="$withval/bin/gcrypt-config"
1887 with_libgcrypt="yes"
1888 else if test -d "$withval"
1890 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1891 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1892 with_libgcrypt="yes"
1894 with_libgcrypt_config="gcrypt-config"
1895 with_libgcrypt="$withval"
1899 with_libgcrypt_config="libgcrypt-config"
1900 with_libgcrypt="yes"
1903 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1905 if test "x$GCRYPT_CPPFLAGS" = "x"
1907 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1910 if test "x$GCRYPT_LDFLAGS" = "x"
1912 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1913 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1916 if test "x$GCRYPT_LIBS" = "x"
1918 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1922 SAVE_CPPFLAGS="$CPPFLAGS"
1923 SAVE_LDFLAGS="$LDFLAGS"
1924 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1925 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1927 if test "x$with_libgcrypt" = "xyes"
1929 if test "x$GCRYPT_CPPFLAGS" != "x"
1931 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1933 AC_CHECK_HEADERS(gcrypt.h,
1934 [with_libgcrypt="yes"],
1935 [with_libgcrypt="no (gcrypt.h not found)"])
1938 if test "x$with_libgcrypt" = "xyes"
1940 if test "x$GCRYPT_LDFLAGS" != "x"
1942 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1944 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1945 [with_libgcrypt="yes"],
1946 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1948 if test "$with_libgcrypt" != "no"; then
1949 m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
1950 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
1951 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
1955 CPPFLAGS="$SAVE_CPPFLAGS"
1956 LDFLAGS="$SAVE_LDFLAGS"
1958 if test "x$with_libgcrypt" = "xyes"
1960 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1963 AC_SUBST(GCRYPT_CPPFLAGS)
1964 AC_SUBST(GCRYPT_LDFLAGS)
1965 AC_SUBST(GCRYPT_LIBS)
1966 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1969 # --with-libiptc {{{
1970 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1972 if test "x$withval" = "xshipped"
1975 else if test "x$withval" = "xyes"
1977 with_libiptc="pkgconfig"
1978 else if test "x$withval" = "xno"
1983 with_libiptc_cflags="-I$withval/include"
1984 with_libiptc_libs="-L$withval/lib"
1988 if test "x$ac_system" = "xLinux"
1990 with_libiptc="pkgconfig"
1992 with_libiptc="no (Linux only)"
1996 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1998 with_libiptc="no (Don't have pkg-config)"
2001 if test "x$with_libiptc" = "xpkgconfig"
2003 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2006 with_libiptc="no (pkg-config doesn't know libiptc)"
2009 if test "x$with_libiptc" = "xpkgconfig"
2011 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2014 with_libiptc="no ($PKG_CONFIG failed)"
2016 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2019 with_libiptc="no ($PKG_CONFIG failed)"
2023 SAVE_CPPFLAGS="$CPPFLAGS"
2024 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2026 # check whether the header file for libiptc is available.
2027 if test "x$with_libiptc" = "xpkgconfig"
2029 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2030 [with_libiptc="no (header file missing)"])
2032 # If the header file is available, check for the required type declaractions.
2033 # They may be missing in old versions of libiptc. In that case, they will be
2034 # declared in the iptables plugin.
2035 if test "x$with_libiptc" = "xpkgconfig"
2037 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2039 # Check for the iptc_init symbol in the library.
2040 # This could be in iptc or ip4tc
2041 if test "x$with_libiptc" = "xpkgconfig"
2044 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2045 [with_libiptc="pkgconfig"],
2046 [with_libiptc="no"],
2047 [$with_libiptc_libs])
2050 if test "x$with_libiptc" = "xpkgconfig"
2055 CPPFLAGS="$SAVE_CPPFLAGS"
2057 if test "x$with_libiptc" = "xown"
2059 with_libiptc_cflags=""
2060 with_libiptc_libs=""
2062 if test "x$with_libiptc" = "xown"
2064 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
2066 with_libiptc="no (Linux iptables headers not found)"
2069 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
2072 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
2073 if test "x$with_libiptc" = "xown"
2075 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
2079 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2080 if test "x$with_libiptc" = "xyes"
2082 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2083 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2084 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2085 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2090 with_java_home="$JAVA_HOME"
2091 if test "x$with_java_home" = "x"
2093 with_java_home="/usr/lib/jvm"
2095 with_java_vmtype="client"
2100 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2102 if test "x$withval" = "xno"
2105 else if test "x$withval" = "xyes"
2109 with_java_home="$withval"
2114 if test "x$with_java" = "xyes"
2116 if test -d "$with_java_home"
2118 AC_MSG_CHECKING([for jni.h])
2119 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2120 if test "x$TMPVAR" != "x"
2122 AC_MSG_RESULT([found in $TMPVAR])
2123 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2125 AC_MSG_RESULT([not found])
2128 AC_MSG_CHECKING([for jni_md.h])
2129 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2130 if test "x$TMPVAR" != "x"
2132 AC_MSG_RESULT([found in $TMPVAR])
2133 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2135 AC_MSG_RESULT([not found])
2138 AC_MSG_CHECKING([for libjvm.so])
2139 TMPVAR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2140 if test "x$TMPVAR" != "x"
2142 AC_MSG_RESULT([found in $TMPVAR])
2143 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2145 AC_MSG_RESULT([not found])
2148 if test "x$JAVAC" = "x"
2150 AC_MSG_CHECKING([for javac])
2151 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2152 if test "x$TMPVAR" != "x"
2155 AC_MSG_RESULT([$JAVAC])
2157 AC_MSG_RESULT([not found])
2160 if test "x$JAR" = "x"
2162 AC_MSG_CHECKING([for jar])
2163 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2164 if test "x$TMPVAR" != "x"
2167 AC_MSG_RESULT([$JAR])
2169 AC_MSG_RESULT([not found])
2172 else if test "x$with_java_home" != "x"
2174 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2178 if test "x$JAVA_CPPFLAGS" != "x"
2180 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2182 if test "x$JAVA_CFLAGS" != "x"
2184 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2186 if test "x$JAVA_LDFLAGS" != "x"
2188 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2190 if test "x$JAVAC" = "x"
2192 with_javac_path="$PATH"
2193 if test "x$with_java_home" != "x"
2195 with_javac_path="$with_java_home:with_javac_path"
2196 if test -d "$with_java_home/bin"
2198 with_javac_path="$with_java_home/bin:with_javac_path"
2202 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2204 if test "x$JAVAC" = "x"
2206 with_java="no (javac not found)"
2208 if test "x$JAR" = "x"
2210 with_jar_path="$PATH"
2211 if test "x$with_java_home" != "x"
2213 with_jar_path="$with_java_home:$with_jar_path"
2214 if test -d "$with_java_home/bin"
2216 with_jar_path="$with_java_home/bin:$with_jar_path"
2220 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2222 if test "x$JAR" = "x"
2224 with_java="no (jar not found)"
2227 SAVE_CPPFLAGS="$CPPFLAGS"
2228 SAVE_CFLAGS="$CFLAGS"
2229 SAVE_LDFLAGS="$LDFLAGS"
2230 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2231 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2232 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2234 if test "x$with_java" = "xyes"
2236 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2238 if test "x$with_java" = "xyes"
2240 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2242 [with_java="no (libjvm not found)"],
2245 if test "x$with_java" = "xyes"
2247 JAVA_LIBS="$JAVA_LIBS -ljvm"
2248 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2251 CPPFLAGS="$SAVE_CPPFLAGS"
2252 CFLAGS="$SAVE_CFLAGS"
2253 LDFLAGS="$SAVE_LDFLAGS"
2255 AC_SUBST(JAVA_CPPFLAGS)
2256 AC_SUBST(JAVA_CFLAGS)
2257 AC_SUBST(JAVA_LDFLAGS)
2259 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2262 # --with-liblvm2app {{{
2263 with_liblvm2app_cppflags=""
2264 with_liblvm2app_ldflags=""
2265 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2267 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2269 with_liblvm2app_cppflags="-I$withval/include"
2270 with_liblvm2app_ldflags="-L$withval/lib"
2271 with_liblvm2app="yes"
2273 with_liblvm2app="$withval"
2277 with_liblvm2app="yes"
2279 if test "x$with_liblvm2app" = "xyes"
2281 SAVE_CPPFLAGS="$CPPFLAGS"
2282 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2284 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2286 CPPFLAGS="$SAVE_CPPFLAGS"
2289 if test "x$with_liblvm2app" = "xyes"
2291 SAVE_CPPFLAGS="$CPPFLAGS"
2292 SAVE_LDFLAGS="$LDFLAGS"
2293 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2294 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2296 AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2298 CPPFLAGS="$SAVE_CPPFLAGS"
2299 LDFLAGS="$SAVE_LDFLAGS"
2301 if test "x$with_liblvm2app" = "xyes"
2303 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2304 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2305 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2306 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2307 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2308 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2309 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2311 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2314 # --with-libmemcached {{{
2315 with_libmemcached_cppflags=""
2316 with_libmemcached_ldflags=""
2317 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2319 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2321 with_libmemcached_cppflags="-I$withval/include"
2322 with_libmemcached_ldflags="-L$withval/lib"
2323 with_libmemcached="yes"
2325 with_libmemcached="$withval"
2329 with_libmemcached="yes"
2331 if test "x$with_libmemcached" = "xyes"
2333 SAVE_CPPFLAGS="$CPPFLAGS"
2334 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2336 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2338 CPPFLAGS="$SAVE_CPPFLAGS"
2340 if test "x$with_libmemcached" = "xyes"
2342 SAVE_CPPFLAGS="$CPPFLAGS"
2343 SAVE_LDFLAGS="$LDFLAGS"
2344 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2345 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2347 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2349 CPPFLAGS="$SAVE_CPPFLAGS"
2350 LDFLAGS="$SAVE_LDFLAGS"
2352 if test "x$with_libmemcached" = "xyes"
2354 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2355 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2356 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2357 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2358 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2359 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2360 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2362 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2365 # --with-libmodbus {{{
2366 with_libmodbus_config=""
2367 with_libmodbus_cflags=""
2368 with_libmodbus_libs=""
2369 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2371 if test "x$withval" = "xno"
2374 else if test "x$withval" = "xyes"
2376 with_libmodbus="use_pkgconfig"
2377 else if test -d "$with_libmodbus/lib"
2379 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2380 with_libmodbus_cflags="-I$withval/include"
2381 with_libmodbus_libs="-L$withval/lib -lmodbus"
2382 with_libmodbus="yes"
2385 [with_libmodbus="use_pkgconfig"])
2387 # configure using pkg-config
2388 if test "x$with_libmodbus" = "xuse_pkgconfig"
2390 if test "x$PKG_CONFIG" = "x"
2392 with_libmodbus="no (Don't have pkg-config)"
2395 if test "x$with_libmodbus" = "xuse_pkgconfig"
2397 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2398 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2401 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2404 if test "x$with_libmodbus" = "xuse_pkgconfig"
2406 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2409 with_libmodbus="no ($PKG_CONFIG failed)"
2411 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2414 with_libmodbus="no ($PKG_CONFIG failed)"
2417 if test "x$with_libmodbus" = "xuse_pkgconfig"
2419 with_libmodbus="yes"
2422 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2423 # the actual checks.
2424 if test "x$with_libmodbus" = "xyes"
2426 SAVE_CPPFLAGS="$CPPFLAGS"
2427 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2429 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2431 CPPFLAGS="$SAVE_CPPFLAGS"
2433 if test "x$with_libmodbus" = "xyes"
2435 SAVE_CPPFLAGS="$CPPFLAGS"
2436 SAVE_LDFLAGS="$LDFLAGS"
2438 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2439 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2441 AC_CHECK_LIB(modbus, modbus_connect,
2442 [with_libmodbus="yes"],
2443 [with_libmodbus="no (symbol modbus_connect not found)"])
2445 CPPFLAGS="$SAVE_CPPFLAGS"
2446 LDFLAGS="$SAVE_LDFLAGS"
2448 if test "x$with_libmodbus" = "xyes"
2450 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2451 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2452 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2453 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2457 # --with-libmongoc {{{
2458 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2460 if test "x$withval" = "xyes"
2462 with_libmongoc="yes"
2463 else if test "x$withval" = "xno"
2467 with_libmongoc="yes"
2468 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2469 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2472 [with_libmongoc="yes"])
2474 SAVE_CPPFLAGS="$CPPFLAGS"
2475 SAVE_LDFLAGS="$LDFLAGS"
2477 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2478 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2480 if test "x$with_libmongoc" = "xyes"
2482 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2484 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2486 AC_CHECK_HEADERS(mongo.h,
2487 [with_libmongoc="yes"],
2488 [with_libmongoc="no ('mongo.h' not found)"],
2490 # define MONGO_HAVE_STDINT 1
2492 # define MONGO_USE_LONG_LONG_INT 1
2496 if test "x$with_libmongoc" = "xyes"
2498 if test "x$LIBMONGOC_LDFLAGS" != "x"
2500 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2502 AC_CHECK_LIB(mongoc, mongo_run_command,
2503 [with_libmongoc="yes"],
2504 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2507 CPPFLAGS="$SAVE_CPPFLAGS"
2508 LDFLAGS="$SAVE_LDFLAGS"
2510 if test "x$with_libmongoc" = "xyes"
2512 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2513 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2514 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2515 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2517 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2520 # --with-libmysql {{{
2521 with_mysql_config="mysql_config"
2522 with_mysql_cflags=""
2524 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2526 if test "x$withval" = "xno"
2529 else if test "x$withval" = "xyes"
2533 if test -f "$withval" && test -x "$withval";
2535 with_mysql_config="$withval"
2536 else if test -x "$withval/bin/mysql_config"
2538 with_mysql_config="$withval/bin/mysql_config"
2546 if test "x$with_libmysql" = "xyes"
2548 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2549 mysql_config_status=$?
2551 if test $mysql_config_status -ne 0
2553 with_libmysql="no ($with_mysql_config failed)"
2555 SAVE_CPPFLAGS="$CPPFLAGS"
2556 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2559 have_mysql_mysql_h="no"
2560 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2562 if test "x$have_mysql_h" = "xno"
2564 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2567 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2569 with_libmysql="no (mysql.h not found)"
2572 CPPFLAGS="$SAVE_CPPFLAGS"
2575 if test "x$with_libmysql" = "xyes"
2577 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2578 mysql_config_status=$?
2580 if test $mysql_config_status -ne 0
2582 with_libmysql="no ($with_mysql_config failed)"
2584 AC_CHECK_LIB(mysqlclient, mysql_init,
2585 [with_libmysql="yes"],
2586 [with_libmysql="no (symbol 'mysql_init' not found)"],
2589 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2590 [with_libmysql="yes"],
2591 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2595 if test "x$with_libmysql" = "xyes"
2597 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2598 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2599 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2600 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2602 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2606 with_libmnl_cflags=""
2608 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
2610 echo "libmnl: withval = $withval"
2611 if test "x$withval" = "xyes"
2614 else if test "x$withval" = "xno"
2618 if test -d "$withval/include"
2620 with_libmnl_cflags="-I$withval/include"
2621 with_libmnl_libs="-L$withval/lib -lmnl"
2624 AC_MSG_ERROR("no such directory: $withval/include")
2629 if test "x$ac_system" = "xLinux"
2633 with_libmnl="no (Linux only library)"
2636 if test "x$PKG_CONFIG" = "x"
2638 with_libmnl="no (Don't have pkg-config)"
2640 if test "x$with_libmnl" = "xyes"
2642 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
2643 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
2644 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
2647 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
2653 #include <sys/types.h>
2654 #include <asm/types.h>
2655 #include <sys/socket.h>
2656 #include <linux/netlink.h>
2657 #include <linux/rtnetlink.h>])
2658 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2660 #include <sys/types.h>
2661 #include <asm/types.h>
2662 #include <sys/socket.h>])
2664 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2667 #include <sys/types.h>
2668 #include <asm/types.h>
2669 #include <sys/socket.h>
2670 #include <linux/netlink.h>
2671 #include <linux/rtnetlink.h>
2674 int retval = TCA_STATS2;
2678 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2680 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2683 #include <sys/types.h>
2684 #include <asm/types.h>
2685 #include <sys/socket.h>
2686 #include <linux/netlink.h>
2687 #include <linux/rtnetlink.h>
2690 int retval = TCA_STATS;
2694 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2696 if test "x$with_libmnl" = "xyes"
2698 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
2699 [with_libmnl="yes"],
2700 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
2701 [$with_libmnl_libs])
2703 if test "x$with_libmnl" = "xyes"
2705 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
2706 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
2707 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
2708 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
2709 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
2711 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
2714 # --with-libnetapp {{{
2715 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2716 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2717 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2718 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2719 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2720 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2721 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2723 if test -d "$withval"
2725 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2726 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2727 with_libnetapp="yes"
2729 with_libnetapp="$withval"
2733 with_libnetapp="yes"
2736 SAVE_CPPFLAGS="$CPPFLAGS"
2737 SAVE_LDFLAGS="$LDFLAGS"
2738 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2739 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2741 if test "x$with_libnetapp" = "xyes"
2743 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2745 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2747 AC_CHECK_HEADERS(netapp_api.h,
2748 [with_libnetapp="yes"],
2749 [with_libnetapp="no (netapp_api.h not found)"])
2752 if test "x$with_libnetapp" = "xyes"
2754 if test "x$LIBNETAPP_LDFLAGS" != "x"
2756 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2759 if test "x$LIBNETAPP_LIBS" = "x"
2761 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2763 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2765 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2766 [with_libnetapp="yes"],
2767 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2769 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2772 CPPFLAGS="$SAVE_CPPFLAGS"
2773 LDFLAGS="$SAVE_LDFLAGS"
2775 if test "x$with_libnetapp" = "xyes"
2777 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2780 AC_SUBST(LIBNETAPP_CPPFLAGS)
2781 AC_SUBST(LIBNETAPP_LDFLAGS)
2782 AC_SUBST(LIBNETAPP_LIBS)
2783 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2786 # --with-libnetsnmp {{{
2787 with_snmp_config="net-snmp-config"
2790 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2792 if test "x$withval" = "xno"
2794 with_libnetsnmp="no"
2795 else if test "x$withval" = "xyes"
2797 with_libnetsnmp="yes"
2799 if test -x "$withval"
2801 with_snmp_config="$withval"
2802 with_libnetsnmp="yes"
2804 with_snmp_config="$withval/bin/net-snmp-config"
2805 with_libnetsnmp="yes"
2809 [with_libnetsnmp="yes"])
2810 if test "x$with_libnetsnmp" = "xyes"
2812 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2813 snmp_config_status=$?
2815 if test $snmp_config_status -ne 0
2817 with_libnetsnmp="no ($with_snmp_config failed)"
2819 SAVE_CPPFLAGS="$CPPFLAGS"
2820 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2822 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2824 CPPFLAGS="$SAVE_CPPFLAGS"
2827 if test "x$with_libnetsnmp" = "xyes"
2829 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2830 snmp_config_status=$?
2832 if test $snmp_config_status -ne 0
2834 with_libnetsnmp="no ($with_snmp_config failed)"
2836 AC_CHECK_LIB(netsnmp, init_snmp,
2837 [with_libnetsnmp="yes"],
2838 [with_libnetsnmp="no (libnetsnmp not found)"],
2842 if test "x$with_libnetsnmp" = "xyes"
2844 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2845 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2846 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2847 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2849 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2852 # --with-liboconfig {{{
2853 with_own_liboconfig="no"
2854 liboconfig_LDFLAGS="$LDFLAGS"
2855 liboconfig_CPPFLAGS="$CPPFLAGS"
2856 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2858 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2860 if test -d "$withval/lib"
2862 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2864 if test -d "$withval/include"
2866 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2869 if test "x$withval" = "xno"
2871 AC_MSG_ERROR("liboconfig is required")
2875 with_liboconfig="yes"
2878 save_LDFLAGS="$LDFLAGS"
2879 save_CPPFLAGS="$CPPFLAGS"
2880 LDFLAGS="$liboconfig_LDFLAGS"
2881 CPPFLAGS="$liboconfig_CPPFLAGS"
2882 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2884 with_liboconfig="yes"
2885 with_own_liboconfig="no"
2888 with_liboconfig="yes"
2889 with_own_liboconfig="yes"
2890 LDFLAGS="$save_LDFLAGS"
2891 CPPFLAGS="$save_CPPFLAGS"
2894 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2895 if test "x$with_own_liboconfig" = "xyes"
2897 with_liboconfig="yes (shipped version)"
2901 # --with-liboping {{{
2902 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2904 if test "x$withval" = "xyes"
2907 else if test "x$withval" = "xno"
2912 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2913 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2916 [with_liboping="yes"])
2918 SAVE_CPPFLAGS="$CPPFLAGS"
2919 SAVE_LDFLAGS="$LDFLAGS"
2921 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2922 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2924 if test "x$with_liboping" = "xyes"
2926 if test "x$LIBOPING_CPPFLAGS" != "x"
2928 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2930 AC_CHECK_HEADERS(oping.h,
2931 [with_liboping="yes"],
2932 [with_liboping="no (oping.h not found)"])
2934 if test "x$with_liboping" = "xyes"
2936 if test "x$LIBOPING_LDFLAGS" != "x"
2938 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2940 AC_CHECK_LIB(oping, ping_construct,
2941 [with_liboping="yes"],
2942 [with_liboping="no (symbol 'ping_construct' not found)"])
2945 CPPFLAGS="$SAVE_CPPFLAGS"
2946 LDFLAGS="$SAVE_LDFLAGS"
2948 if test "x$with_liboping" = "xyes"
2950 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2951 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2952 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2953 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2955 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2959 with_oracle_cppflags=""
2961 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2963 if test "x$withval" = "xyes"
2965 if test "x$ORACLE_HOME" = "x"
2967 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2970 else if test "x$withval" = "xno"
2975 ORACLE_HOME="$withval"
2979 if test "x$ORACLE_HOME" = "x"
2981 with_oracle="no (ORACLE_HOME is not set)"
2986 if test "x$ORACLE_HOME" != "x"
2988 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2990 if test -e "$ORACLE_HOME/lib/ldflags"
2992 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2994 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2995 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2997 if test "x$with_oracle" = "xyes"
2999 SAVE_CPPFLAGS="$CPPFLAGS"
3000 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3002 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3004 CPPFLAGS="$SAVE_CPPFLAGS"
3006 if test "x$with_oracle" = "xyes"
3008 SAVE_CPPFLAGS="$CPPFLAGS"
3010 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3011 LIBS="$LIBS $with_oracle_libs"
3013 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3015 CPPFLAGS="$SAVE_CPPFLAGS"
3018 if test "x$with_oracle" = "xyes"
3020 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
3021 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3022 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
3023 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3027 # --with-libowcapi {{{
3028 with_libowcapi_cppflags=""
3029 with_libowcapi_libs="-lowcapi"
3030 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3032 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3034 with_libowcapi_cppflags="-I$withval/include"
3035 with_libowcapi_libs="-L$withval/lib -lowcapi"
3036 with_libowcapi="yes"
3038 with_libowcapi="$withval"
3042 with_libowcapi="yes"
3044 if test "x$with_libowcapi" = "xyes"
3046 SAVE_CPPFLAGS="$CPPFLAGS"
3047 CPPFLAGS="$with_libowcapi_cppflags"
3049 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3051 CPPFLAGS="$SAVE_CPPFLAGS"
3053 if test "x$with_libowcapi" = "xyes"
3055 SAVE_LDFLAGS="$LDFLAGS"
3056 SAVE_CPPFLAGS="$CPPFLAGS"
3057 LDFLAGS="$with_libowcapi_libs"
3058 CPPFLAGS="$with_libowcapi_cppflags"
3060 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3062 LDFLAGS="$SAVE_LDFLAGS"
3063 CPPFLAGS="$SAVE_CPPFLAGS"
3065 if test "x$with_libowcapi" = "xyes"
3067 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3068 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3069 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3070 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3074 # --with-libpcap {{{
3075 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3077 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3079 LDFLAGS="$LDFLAGS -L$withval/lib"
3080 CPPFLAGS="$CPPFLAGS -I$withval/include"
3083 with_libpcap="$withval"
3089 if test "x$with_libpcap" = "xyes"
3091 AC_CHECK_LIB(pcap, pcap_open_live,
3093 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3094 ], [with_libpcap="no (libpcap not found)"])
3096 if test "x$with_libpcap" = "xyes"
3098 AC_CHECK_HEADERS(pcap.h,,
3099 [with_libpcap="no (pcap.h not found)"])
3101 if test "x$with_libpcap" = "xyes"
3103 AC_CHECK_HEADERS(pcap-bpf.h,,
3104 [with_libpcap="no (pcap-bpf.h not found)"])
3106 if test "x$with_libpcap" = "xyes"
3108 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3109 [c_cv_libpcap_have_pcap_error_iface_not_up],
3110 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3115 int val = PCAP_ERROR_IFACE_NOT_UP;
3119 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3120 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3122 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3124 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3126 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3129 # --with-libperl {{{
3130 perl_interpreter="perl"
3131 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3133 if test -f "$withval" && test -x "$withval"
3135 perl_interpreter="$withval"
3137 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3139 LDFLAGS="$LDFLAGS -L$withval/lib"
3140 CPPFLAGS="$CPPFLAGS -I$withval/include"
3141 perl_interpreter="$withval/bin/perl"
3144 with_libperl="$withval"
3151 AC_MSG_CHECKING([for perl])
3152 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3153 if test -x "$perl_interpreter"
3155 AC_MSG_RESULT([yes ($perl_interpreter)])
3161 AC_SUBST(PERL, "$perl_interpreter")
3163 if test "x$with_libperl" = "xyes" \
3164 && test -n "$perl_interpreter"
3166 SAVE_CFLAGS="$CFLAGS"
3168 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3169 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3170 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3171 CFLAGS="$CFLAGS $PERL_CFLAGS"
3172 LIBS="$LIBS $PERL_LIBS"
3174 AC_CACHE_CHECK([for libperl],
3175 [c_cv_have_libperl],
3176 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3178 #define PERL_NO_GET_CONTEXT
3185 load_module (PERL_LOADMOD_NOIMPORT,
3186 newSVpv ("Collectd::Plugin::FooBar", 24),
3190 [c_cv_have_libperl="yes"],
3191 [c_cv_have_libperl="no"]
3195 if test "x$c_cv_have_libperl" = "xyes"
3197 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3198 AC_SUBST(PERL_CFLAGS)
3204 CFLAGS="$SAVE_CFLAGS"
3206 else if test -z "$perl_interpreter"; then
3207 with_libperl="no (no perl interpreter found)"
3208 c_cv_have_libperl="no"
3210 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3212 if test "x$with_libperl" = "xyes"
3214 SAVE_CFLAGS="$CFLAGS"
3216 CFLAGS="$CFLAGS $PERL_CFLAGS"
3217 LIBS="$LIBS $PERL_LIBS"
3219 AC_CACHE_CHECK([if perl supports ithreads],
3220 [c_cv_have_perl_ithreads],
3221 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3227 #if !defined(USE_ITHREADS)
3228 # error "Perl does not support ithreads!"
3229 #endif /* !defined(USE_ITHREADS) */
3233 [c_cv_have_perl_ithreads="yes"],
3234 [c_cv_have_perl_ithreads="no"]
3238 if test "x$c_cv_have_perl_ithreads" = "xyes"
3240 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3243 CFLAGS="$SAVE_CFLAGS"
3247 if test "x$with_libperl" = "xyes"
3249 SAVE_CFLAGS="$CFLAGS"
3251 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3252 # (see issues #41 and #42)
3253 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3254 LIBS="$LIBS $PERL_LIBS"
3256 AC_CACHE_CHECK([for broken Perl_load_module()],
3257 [c_cv_have_broken_perl_load_module],
3258 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3260 #define PERL_NO_GET_CONTEXT
3267 load_module (PERL_LOADMOD_NOIMPORT,
3268 newSVpv ("Collectd::Plugin::FooBar", 24),
3272 [c_cv_have_broken_perl_load_module="no"],
3273 [c_cv_have_broken_perl_load_module="yes"]
3277 CFLAGS="$SAVE_CFLAGS"
3280 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3281 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3283 if test "x$with_libperl" = "xyes"
3285 SAVE_CFLAGS="$CFLAGS"
3287 CFLAGS="$CFLAGS $PERL_CFLAGS"
3288 LIBS="$LIBS $PERL_LIBS"
3291 [struct mgvtbl.svt_local],
3292 [have_struct_mgvtbl_svt_local="yes"],
3293 [have_struct_mgvtbl_svt_local="no"],
3300 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3302 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3303 [Define if Perl's struct mgvtbl has member svt_local.])
3306 CFLAGS="$SAVE_CFLAGS"
3312 with_pg_config="pg_config"
3313 with_libpq_includedir=""
3314 with_libpq_libdir=""
3315 with_libpq_cppflags=""
3316 with_libpq_ldflags=""
3317 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3320 if test "x$withval" = "xno"
3323 else if test "x$withval" = "xyes"
3327 if test -f "$withval" && test -x "$withval";
3329 with_pg_config="$withval"
3330 else if test -x "$withval/bin/pg_config"
3332 with_pg_config="$withval/bin/pg_config"
3340 if test "x$with_libpq" = "xyes"
3342 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3345 if test $pg_config_status -eq 0
3347 if test -n "$with_libpq_includedir"; then
3348 for dir in $with_libpq_includedir; do
3349 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3353 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3356 SAVE_CPPFLAGS="$CPPFLAGS"
3357 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3359 AC_CHECK_HEADERS(libpq-fe.h, [],
3360 [with_libpq="no (libpq-fe.h not found)"], [])
3362 CPPFLAGS="$SAVE_CPPFLAGS"
3364 if test "x$with_libpq" = "xyes"
3366 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3369 if test $pg_config_status -eq 0
3371 if test -n "$with_libpq_libdir"; then
3372 for dir in $with_libpq_libdir; do
3373 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3377 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3380 SAVE_LDFLAGS="$LDFLAGS"
3381 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3383 AC_CHECK_LIB(pq, PQconnectdb,
3385 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3387 AC_CHECK_LIB(pq, PQserverVersion,
3389 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3391 LDFLAGS="$SAVE_LDFLAGS"
3393 if test "x$with_libpq" = "xyes"
3395 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3396 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3397 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3398 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3400 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3403 # --with-libpthread {{{
3404 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3405 [ if test "x$withval" != "xno" \
3406 && test "x$withval" != "xyes"
3408 LDFLAGS="$LDFLAGS -L$withval/lib"
3409 CPPFLAGS="$CPPFLAGS -I$withval/include"
3410 with_libpthread="yes"
3412 if test "x$withval" = "xno"
3414 with_libpthread="no (disabled)"
3417 ], [with_libpthread="yes"])
3418 if test "x$with_libpthread" = "xyes"
3420 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3423 if test "x$with_libpthread" = "xyes"
3425 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3427 if test "x$with_libpthread" = "xyes"
3433 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3434 [Wether or not to use pthread (POSIX threads) library])
3435 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3440 with_python_path="$PATH"
3441 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3443 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3445 with_python="$withval"
3446 else if test -x "$withval"
3448 with_python_prog="$withval"
3449 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3451 else if test -d "$withval"
3453 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3456 AC_MSG_WARN([Argument not recognized: $withval])
3458 ], [with_python="yes"])
3461 SAVE_CPPFLAGS="$CPPFLAGS"
3462 SAVE_LDFLAGS="$LDFLAGS"
3465 PATH="$with_python_path"
3467 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3469 AC_MSG_CHECKING([for python])
3470 with_python_prog="`which python 2>/dev/null`"
3471 if test "x$with_python_prog" = "x"
3473 AC_MSG_RESULT([not found])
3474 with_python="no (interpreter not found)"
3476 AC_MSG_RESULT([$with_python_prog])
3480 if test "x$with_python" = "xyes"
3482 AC_MSG_CHECKING([for Python CPPFLAGS])
3483 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3484 python_config_status=$?
3486 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3488 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3491 AC_MSG_RESULT([$python_include_path])
3495 if test "x$with_python" = "xyes"
3497 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3498 AC_CHECK_HEADERS(Python.h,
3499 [with_python="yes"],
3500 [with_python="no ('Python.h' not found)"])
3503 if test "x$with_python" = "xyes"
3505 AC_MSG_CHECKING([for Python LDFLAGS])
3506 python_library_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0))" | "$with_python_prog" 2>&1`
3507 python_config_status=$?
3509 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3511 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3514 AC_MSG_RESULT([$python_library_path])
3518 if test "x$with_python" = "xyes"
3520 AC_MSG_CHECKING([for Python LIBS])
3521 python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>&1`
3522 python_config_status=$?
3524 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3526 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3529 AC_MSG_RESULT([$python_library_flags])
3533 if test "x$with_python" = "xyes"
3535 LDFLAGS="-L$python_library_path $LDFLAGS"
3536 LIBS="$python_library_flags $LIBS"
3538 AC_CHECK_FUNC(PyObject_CallFunction,
3539 [with_python="yes"],
3540 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3544 CPPFLAGS="$SAVE_CPPFLAGS"
3545 LDFLAGS="$SAVE_LDFLAGS"
3548 if test "x$with_python" = "xyes"
3550 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3551 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3552 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3553 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3554 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3555 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3559 # --with-librabbitmq {{{
3560 with_librabbitmq_cppflags=""
3561 with_librabbitmq_ldflags=""
3562 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3564 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3566 with_librabbitmq_cppflags="-I$withval/include"
3567 with_librabbitmq_ldflags="-L$withval/lib"
3568 with_librabbitmq="yes"
3570 with_librabbitmq="$withval"
3574 with_librabbitmq="yes"
3576 SAVE_CPPFLAGS="$CPPFLAGS"
3577 SAVE_LDFLAGS="$LDFLAGS"
3578 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3579 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3580 if test "x$with_librabbitmq" = "xyes"
3582 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3584 if test "x$with_librabbitmq" = "xyes"
3586 # librabbitmq up to version 0.9.1 provides "library_errno", later
3587 # versions use "library_error". The library does not provide a version
3588 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3589 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3592 # include <stdlib.h>
3598 # include <stdint.h>
3601 # include <inttypes.h>
3606 if test "x$with_librabbitmq" = "xyes"
3608 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3610 if test "x$with_librabbitmq" = "xyes"
3612 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3613 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3614 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3615 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3616 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3617 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3618 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3620 CPPFLAGS="$SAVE_CPPFLAGS"
3621 LDFLAGS="$SAVE_LDFLAGS"
3622 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3624 with_amqp_tcp_socket="no"
3625 if test "x$with_librabbitmq" = "xyes"
3627 SAVE_CPPFLAGS="$CPPFLAGS"
3628 SAVE_LDFLAGS="$LDFLAGS"
3630 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3631 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3634 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
3635 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
3636 if test "x$with_amqp_tcp_socket" = "xyes"
3638 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
3639 [Define if librabbitmq provides the new TCP socket interface.])
3642 AC_CHECK_DECLS(amqp_socket_close,
3643 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
3646 #ifdef HAVE_AMQP_TCP_SOCKET_H
3647 # include <amqp_tcp_socket.h>
3649 #ifdef HAVE_AMQP_SOCKET_H
3650 # include <amqp_socket.h>
3654 CPPFLAGS="$SAVE_CPPFLAGS"
3655 LDFLAGS="$SAVE_LDFLAGS"
3660 # --with-librouteros {{{
3661 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3663 if test "x$withval" = "xyes"
3665 with_librouteros="yes"
3666 else if test "x$withval" = "xno"
3668 with_librouteros="no"
3670 with_librouteros="yes"
3671 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3672 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3675 [with_librouteros="yes"])
3677 SAVE_CPPFLAGS="$CPPFLAGS"
3678 SAVE_LDFLAGS="$LDFLAGS"
3680 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3681 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3683 if test "x$with_librouteros" = "xyes"
3685 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3687 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3689 AC_CHECK_HEADERS(routeros_api.h,
3690 [with_librouteros="yes"],
3691 [with_librouteros="no (routeros_api.h not found)"])
3693 if test "x$with_librouteros" = "xyes"
3695 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3697 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3699 AC_CHECK_LIB(routeros, ros_interface,
3700 [with_librouteros="yes"],
3701 [with_librouteros="no (symbol 'ros_interface' not found)"])
3704 CPPFLAGS="$SAVE_CPPFLAGS"
3705 LDFLAGS="$SAVE_LDFLAGS"
3707 if test "x$with_librouteros" = "xyes"
3709 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3710 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3711 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3712 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3714 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3718 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3721 librrd_threadsafe="yes"
3722 librrd_rrdc_update="no"
3723 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3724 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3726 librrd_cflags="-I$withval/include"
3727 librrd_ldflags="-L$withval/lib"
3730 with_librrd="$withval"
3732 ], [with_librrd="yes"])
3733 if test "x$with_librrd" = "xyes"
3735 SAVE_CPPFLAGS="$CPPFLAGS"
3736 SAVE_LDFLAGS="$LDFLAGS"
3738 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3739 LDFLAGS="$LDFLAGS $librrd_ldflags"
3741 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3743 CPPFLAGS="$SAVE_CPPFLAGS"
3744 LDFLAGS="$SAVE_LDFLAGS"
3746 if test "x$with_librrd" = "xyes"
3748 SAVE_CPPFLAGS="$CPPFLAGS"
3749 SAVE_LDFLAGS="$LDFLAGS"
3751 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3752 LDFLAGS="$LDFLAGS $librrd_ldflags"
3754 AC_CHECK_LIB(rrd_th, rrd_update_r,
3756 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3758 [librrd_threadsafe="no"
3759 AC_CHECK_LIB(rrd, rrd_update,
3761 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3763 [with_librrd="no (symbol 'rrd_update' not found)"],
3768 if test "x$librrd_threadsafe" = "xyes"
3770 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3772 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3775 CPPFLAGS="$SAVE_CPPFLAGS"
3776 LDFLAGS="$SAVE_LDFLAGS"
3778 if test "x$with_librrd" = "xyes"
3780 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3781 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3782 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3783 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3785 if test "x$librrd_threadsafe" = "xyes"
3787 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3791 # --with-libsensors {{{
3792 with_sensors_cflags=""
3793 with_sensors_ldflags=""
3794 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3796 if test "x$withval" = "xno"
3798 with_libsensors="no"
3800 with_libsensors="yes"
3801 if test "x$withval" != "xyes"
3803 with_sensors_cflags="-I$withval/include"
3804 with_sensors_ldflags="-L$withval/lib"
3805 with_libsensors="yes"
3810 if test "x$ac_system" = "xLinux"
3812 with_libsensors="yes"
3814 with_libsensors="no (Linux only library)"
3817 if test "x$with_libsensors" = "xyes"
3819 SAVE_CPPFLAGS="$CPPFLAGS"
3820 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3822 # AC_CHECK_HEADERS(sensors/sensors.h,
3824 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3826 # [with_libsensors="no (sensors/sensors.h not found)"])
3827 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3829 CPPFLAGS="$SAVE_CPPFLAGS"
3831 if test "x$with_libsensors" = "xyes"
3833 SAVE_CPPFLAGS="$CPPFLAGS"
3834 SAVE_LDFLAGS="$LDFLAGS"
3835 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3836 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3838 AC_CHECK_LIB(sensors, sensors_init,
3840 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3842 [with_libsensors="no (libsensors not found)"])
3844 CPPFLAGS="$SAVE_CPPFLAGS"
3845 LDFLAGS="$SAVE_LDFLAGS"
3847 if test "x$with_libsensors" = "xyes"
3849 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3850 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3851 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3852 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3854 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3857 # --with-libsigrok {{{
3858 with_libsigrok_cflags=""
3859 with_libsigrok_ldflags=""
3860 AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
3862 if test "x$withval" = "xno"
3866 with_libsigrok="yes"
3867 if test "x$withval" != "xyes"
3869 with_libsigrok_cflags="-I$withval/include"
3870 with_libsigrok_ldflags="-L$withval/lib"
3873 ],[with_libsigrok="yes"])
3875 # libsigrok has a glib dependency
3876 if test "x$with_libsigrok" = "xyes"
3878 m4_ifdef([AM_PATH_GLIB_2_0],
3880 AM_PATH_GLIB_2_0([2.28.0],
3881 [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
3884 with_libsigrok="no (glib not available)"
3890 if test "x$with_libsigrok" = "xyes"
3892 SAVE_CPPFLAGS="$CPPFLAGS"
3893 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3895 AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
3897 CPPFLAGS="$SAVE_CPPFLAGS"
3901 if test "x$with_libsigrok" = "xyes"
3903 SAVE_CPPFLAGS="$CPPFLAGS"
3904 SAVE_LDFLAGS="$LDFLAGS"
3905 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3906 LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
3908 AC_CHECK_LIB(sigrok, sr_init,
3910 AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
3912 [with_libsigrok="no (libsigrok not found)"])
3914 CPPFLAGS="$SAVE_CPPFLAGS"
3915 LDFLAGS="$SAVE_LDFLAGS"
3917 if test "x$with_libsigrok" = "xyes"
3919 BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
3920 BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
3921 AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
3922 AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
3924 AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
3927 # --with-libstatgrab {{{
3928 with_libstatgrab_cflags=""
3929 with_libstatgrab_ldflags=""
3930 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3932 if test "x$withval" != "xno" \
3933 && test "x$withval" != "xyes"
3935 with_libstatgrab_cflags="-I$withval/include"
3936 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3937 with_libstatgrab="yes"
3938 with_libstatgrab_pkg_config="no"
3940 with_libstatgrab="$withval"
3941 with_libstatgrab_pkg_config="yes"
3945 with_libstatgrab="yes"
3946 with_libstatgrab_pkg_config="yes"
3949 if test "x$with_libstatgrab" = "xyes" \
3950 && test "x$with_libstatgrab_pkg_config" = "xyes"
3952 if test "x$PKG_CONFIG" != "x"
3954 AC_MSG_CHECKING([pkg-config for libstatgrab])
3956 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3959 with_libstatgrab_pkg_config="no"
3960 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3961 temp_result="not found"
3963 AC_MSG_RESULT([$temp_result])
3965 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3966 with_libstatgrab_pkg_config="no"
3967 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3971 if test "x$with_libstatgrab" = "xyes" \
3972 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3973 && test "x$with_libstatgrab_cflags" = "x"
3975 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3976 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3979 with_libstatgrab_cflags="$temp_result"
3981 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3982 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3984 AC_MSG_RESULT([$temp_result])
3987 if test "x$with_libstatgrab" = "xyes" \
3988 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3989 && test "x$with_libstatgrab_ldflags" = "x"
3991 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3992 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3995 with_libstatgrab_ldflags="$temp_result"
3997 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3998 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4000 AC_MSG_RESULT([$temp_result])
4003 if test "x$with_libstatgrab" = "xyes"
4005 SAVE_CPPFLAGS="$CPPFLAGS"
4006 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4008 AC_CHECK_HEADERS(statgrab.h,
4009 [with_libstatgrab="yes"],
4010 [with_libstatgrab="no (statgrab.h not found)"])
4012 CPPFLAGS="$SAVE_CPPFLAGS"
4015 if test "x$with_libstatgrab" = "xyes"
4017 SAVE_CFLAGS="$CFLAGS"
4018 SAVE_LDFLAGS="$LDFLAGS"
4020 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4021 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4023 AC_CHECK_LIB(statgrab, sg_init,
4024 [with_libstatgrab="yes"],
4025 [with_libstatgrab="no (symbol sg_init not found)"])
4027 CFLAGS="$SAVE_CFLAGS"
4028 LDFLAGS="$SAVE_LDFLAGS"
4031 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4032 if test "x$with_libstatgrab" = "xyes"
4034 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4035 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4036 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4037 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4038 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4042 # --with-libtokyotyrant {{{
4043 with_libtokyotyrant_cppflags=""
4044 with_libtokyotyrant_ldflags=""
4045 with_libtokyotyrant_libs=""
4046 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4048 if test "x$withval" = "xno"
4050 with_libtokyotyrant="no"
4051 else if test "x$withval" = "xyes"
4053 with_libtokyotyrant="yes"
4055 with_libtokyotyrant_cppflags="-I$withval/include"
4056 with_libtokyotyrant_ldflags="-L$withval/include"
4057 with_libtokyotyrant_libs="-ltokyotyrant"
4058 with_libtokyotyrant="yes"
4062 with_libtokyotyrant="yes"
4065 if test "x$with_libtokyotyrant" = "xyes"
4067 if $PKG_CONFIG --exists tokyotyrant
4069 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4070 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4071 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4075 SAVE_CPPFLAGS="$CPPFLAGS"
4076 SAVE_LDFLAGS="$LDFLAGS"
4077 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4078 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4080 if test "x$with_libtokyotyrant" = "xyes"
4082 AC_CHECK_HEADERS(tcrdb.h,
4084 AC_DEFINE(HAVE_TCRDB_H, 1,
4085 [Define to 1 if you have the <tcrdb.h> header file.])
4086 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
4089 if test "x$with_libtokyotyrant" = "xyes"
4091 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
4093 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
4094 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
4096 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
4097 [$with_libtokyotyrant_libs])
4100 CPPFLAGS="$SAVE_CPPFLAGS"
4101 LDFLAGS="$SAVE_LDFLAGS"
4103 if test "x$with_libtokyotyrant" = "xyes"
4105 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
4106 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
4107 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
4108 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
4109 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
4110 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
4112 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
4115 # --with-libupsclient {{{
4116 with_libupsclient_config=""
4117 with_libupsclient_cflags=""
4118 with_libupsclient_libs=""
4119 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
4121 if test "x$withval" = "xno"
4123 with_libupsclient="no"
4124 else if test "x$withval" = "xyes"
4126 with_libupsclient="use_pkgconfig"
4128 if test -x "$withval"
4130 with_libupsclient_config="$withval"
4131 with_libupsclient="use_libupsclient_config"
4132 else if test -x "$withval/bin/libupsclient-config"
4134 with_libupsclient_config="$withval/bin/libupsclient-config"
4135 with_libupsclient="use_libupsclient_config"
4137 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
4138 with_libupsclient_cflags="-I$withval/include"
4139 with_libupsclient_libs="-L$withval/lib -lupsclient"
4140 with_libupsclient="yes"
4144 [with_libupsclient="use_pkgconfig"])
4146 # configure using libupsclient-config
4147 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4149 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
4150 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
4153 with_libupsclient="no ($with_libupsclient_config failed)"
4155 with_libupsclient_libs="`$with_libupsclient_config --libs`"
4158 with_libupsclient="no ($with_libupsclient_config failed)"
4161 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4163 with_libupsclient="yes"
4166 # configure using pkg-config
4167 if test "x$with_libupsclient" = "xuse_pkgconfig"
4169 if test "x$PKG_CONFIG" = "x"
4171 with_libupsclient="no (Don't have pkg-config)"
4174 if test "x$with_libupsclient" = "xuse_pkgconfig"
4176 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4177 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4180 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4183 if test "x$with_libupsclient" = "xuse_pkgconfig"
4185 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4188 with_libupsclient="no ($PKG_CONFIG failed)"
4190 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4193 with_libupsclient="no ($PKG_CONFIG failed)"
4196 if test "x$with_libupsclient" = "xuse_pkgconfig"
4198 with_libupsclient="yes"
4201 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4202 # the actual checks.
4203 if test "x$with_libupsclient" = "xyes"
4205 SAVE_CPPFLAGS="$CPPFLAGS"
4206 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4208 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4210 CPPFLAGS="$SAVE_CPPFLAGS"
4212 if test "x$with_libupsclient" = "xyes"
4214 SAVE_CPPFLAGS="$CPPFLAGS"
4215 SAVE_LDFLAGS="$LDFLAGS"
4217 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4218 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4220 AC_CHECK_LIB(upsclient, upscli_connect,
4221 [with_libupsclient="yes"],
4222 [with_libupsclient="no (symbol upscli_connect not found)"])
4224 CPPFLAGS="$SAVE_CPPFLAGS"
4225 LDFLAGS="$SAVE_LDFLAGS"
4227 if test "x$with_libupsclient" = "xyes"
4229 SAVE_CPPFLAGS="$CPPFLAGS"
4230 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4232 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4233 [#include <stdlib.h>
4235 #include <upsclient.h>])
4237 CPPFLAGS="$SAVE_CPPFLAGS"
4239 if test "x$with_libupsclient" = "xyes"
4241 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4242 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4243 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4244 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4248 # --with-libxmms {{{
4249 with_xmms_config="xmms-config"
4252 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4254 if test "x$withval" != "xno" \
4255 && test "x$withval" != "xyes"
4257 if test -f "$withval" && test -x "$withval";
4259 with_xmms_config="$withval"
4260 else if test -x "$withval/bin/xmms-config"
4262 with_xmms_config="$withval/bin/xmms-config"
4265 else if test "x$withval" = "xno"
4275 if test "x$with_libxmms" = "xyes"
4277 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4278 xmms_config_status=$?
4280 if test $xmms_config_status -ne 0
4285 if test "x$with_libxmms" = "xyes"
4287 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4288 xmms_config_status=$?
4290 if test $xmms_config_status -ne 0
4295 if test "x$with_libxmms" = "xyes"
4297 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4299 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4300 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4301 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4302 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4309 with_libxmms_numeric=0
4310 if test "x$with_libxmms" = "xyes"
4312 with_libxmms_numeric=1
4314 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4315 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4318 # --with-libyajl {{{
4319 with_libyajl_cppflags=""
4320 with_libyajl_ldflags=""
4321 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4323 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4325 with_libyajl_cppflags="-I$withval/include"
4326 with_libyajl_ldflags="-L$withval/lib"
4329 with_libyajl="$withval"
4335 if test "x$with_libyajl" = "xyes"
4337 SAVE_CPPFLAGS="$CPPFLAGS"
4338 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4340 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4341 AC_CHECK_HEADERS(yajl/yajl_version.h)
4343 CPPFLAGS="$SAVE_CPPFLAGS"
4345 if test "x$with_libyajl" = "xyes"
4347 SAVE_CPPFLAGS="$CPPFLAGS"
4348 SAVE_LDFLAGS="$LDFLAGS"
4349 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4350 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4352 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4354 CPPFLAGS="$SAVE_CPPFLAGS"
4355 LDFLAGS="$SAVE_LDFLAGS"
4357 if test "x$with_libyajl" = "xyes"
4359 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4360 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4361 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4362 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4363 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4364 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4365 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4367 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4371 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
4372 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
4374 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
4376 if test "x$withval" = "xno"
4379 else if test "x$withval" = "xyes"
4382 else if test -d "$with_mic/lib"
4384 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
4385 with_mic_cflags="-I$withval/include"
4386 with_mic_ldpath="-L$withval/lib/Linux"
4387 with_mic_libs="-lMicAccessSDK -lscif -lpthread"
4392 if test "x$with_mic" = "xyes"
4394 SAVE_CPPFLAGS="$CPPFLAGS"
4395 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4396 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
4397 CPPFLAGS="$SAVE_CPPFLAGS"
4399 if test "x$with_mic" = "xyes"
4401 SAVE_CPPFLAGS="$CPPFLAGS"
4402 SAVE_LDFLAGS="$LDFLAGS"
4404 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4405 LDFLAGS="$LDFLAGS $with_mic_ldpath"
4407 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
4408 [with_mic_ldpath="$with_mic_ldpath"
4409 with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
4410 [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
4412 CPPFLAGS="$SAVE_CPPFLAGS"
4413 LDFLAGS="$SAVE_LDFLAGS"
4416 if test "x$with_mic" = "xyes"
4418 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
4419 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
4420 BUILD_WITH_MIC_LDADD="$with_mic_libs"
4421 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
4422 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
4423 AC_SUBST(BUILD_WITH_MIC_LDADD)
4427 # --with-libvarnish {{{
4428 with_libvarnish_cppflags=""
4429 with_libvarnish_cflags=""
4430 with_libvarnish_libs=""
4431 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4433 if test "x$withval" = "xno"
4435 with_libvarnish="no"
4436 else if test "x$withval" = "xyes"
4438 with_libvarnish="use_pkgconfig"
4439 else if test -d "$with_libvarnish/lib"
4441 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4442 with_libvarnish_cflags="-I$withval/include"
4443 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4444 with_libvarnish="yes"
4447 [with_libvarnish="use_pkgconfig"])
4449 # configure using pkg-config
4450 if test "x$with_libvarnish" = "xuse_pkgconfig"
4452 if test "x$PKG_CONFIG" = "x"
4454 with_libvarnish="no (Don't have pkg-config)"
4457 if test "x$with_libvarnish" = "xuse_pkgconfig"
4459 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4460 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4463 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4466 if test "x$with_libvarnish" = "xuse_pkgconfig"
4468 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4471 with_libvarnish="no ($PKG_CONFIG failed)"
4473 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4476 with_libvarnish="no ($PKG_CONFIG failed)"
4479 if test "x$with_libvarnish" = "xuse_pkgconfig"
4481 with_libvarnish="yes"
4484 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4485 # the actual checks.
4486 if test "x$with_libvarnish" = "xyes"
4488 SAVE_CPPFLAGS="$CPPFLAGS"
4489 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4490 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4492 CPPFLAGS="$SAVE_CPPFLAGS"
4494 if test "x$with_libvarnish" = "xyes"
4496 SAVE_CPPFLAGS="$CPPFLAGS"
4497 #SAVE_LDFLAGS="$LDFLAGS"
4499 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4500 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4502 AC_CHECK_HEADERS(varnish/vsc.h,
4503 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4504 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4506 CPPFLAGS="$SAVE_CPPFLAGS"
4507 #LDFLAGS="$SAVE_LDFLAGS"
4509 if test "x$with_libvarnish" = "xyes"
4511 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4512 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4513 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4514 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4518 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4519 with_libxml2="no (pkg-config isn't available)"
4520 with_libxml2_cflags=""
4521 with_libxml2_ldflags=""
4522 with_libvirt="no (pkg-config isn't available)"
4523 with_libvirt_cflags=""
4524 with_libvirt_ldflags=""
4525 if test "x$PKG_CONFIG" != "x"
4527 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
4532 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4535 $PKG_CONFIG --exists libvirt 2>/dev/null
4540 with_libvirt="no (pkg-config doesn't know libvirt)"
4543 if test "x$with_libxml2" = "xyes"
4545 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
4550 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
4556 if test "x$with_libxml2" = "xyes"
4558 SAVE_CPPFLAGS="$CPPFLAGS"
4559 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4561 AC_CHECK_HEADERS(libxml/parser.h, [],
4562 [with_libxml2="no (libxml/parser.h not found)"])
4564 CPPFLAGS="$SAVE_CPPFLAGS"
4566 if test "x$with_libxml2" = "xyes"
4568 SAVE_CFLAGS="$CFLAGS"
4569 SAVE_LDFLAGS="$LDFLAGS"
4571 CFLAGS="$CFLAGS $with_libxml2_cflags"
4572 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4574 AC_CHECK_LIB(xml2, xmlXPathEval,
4575 [with_libxml2="yes"],
4576 [with_libxml2="no (symbol xmlXPathEval not found)"])
4578 CFLAGS="$SAVE_CFLAGS"
4579 LDFLAGS="$SAVE_LDFLAGS"
4581 dnl Add the right compiler flags and libraries.
4582 if test "x$with_libxml2" = "xyes"; then
4583 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4584 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4585 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4586 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4588 if test "x$with_libvirt" = "xyes"
4590 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
4595 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
4601 if test "x$with_libvirt" = "xyes"
4603 SAVE_CPPFLAGS="$CPPFLAGS"
4604 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4606 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4607 [with_libvirt="no (libvirt/libvirt.h not found)"])
4609 CPPFLAGS="$SAVE_CPPFLAGS"
4611 if test "x$with_libvirt" = "xyes"
4613 SAVE_CFLAGS="$CFLAGS"
4614 SAVE_LDFLAGS="$LDFLAGS"
4616 CFLAGS="$CFLAGS $with_libvirt_cflags"
4617 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4619 AC_CHECK_LIB(virt, virDomainBlockStats,
4620 [with_libvirt="yes"],
4621 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4623 CFLAGS="$SAVE_CFLAGS"
4624 LDFLAGS="$SAVE_LDFLAGS"
4626 dnl Add the right compiler flags and libraries.
4627 if test "x$with_libvirt" = "xyes"; then
4628 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4629 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4630 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4631 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4635 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4636 with_libopenipmipthread="yes"
4637 with_libopenipmipthread_cflags=""
4638 with_libopenipmipthread_libs=""
4640 AC_MSG_CHECKING([for pkg-config])
4642 if test "x$PKG_CONFIG" = "x"
4644 with_libopenipmipthread="no"
4647 temp_result="$PKG_CONFIG"
4649 AC_MSG_RESULT([$temp_result])
4651 if test "x$with_libopenipmipthread" = "xyes"
4653 AC_MSG_CHECKING([for libOpenIPMIpthread])
4654 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4657 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4659 AC_MSG_RESULT([$with_libopenipmipthread])
4662 if test "x$with_libopenipmipthread" = "xyes"
4664 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4665 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4668 with_libopenipmipthread_cflags="$temp_result"
4670 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4671 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4673 AC_MSG_RESULT([$temp_result])
4676 if test "x$with_libopenipmipthread" = "xyes"
4678 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4679 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4682 with_libopenipmipthread_ldflags="$temp_result"
4684 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4685 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4687 AC_MSG_RESULT([$temp_result])
4690 if test "x$with_libopenipmipthread" = "xyes"
4692 SAVE_CPPFLAGS="$CPPFLAGS"
4693 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4695 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4696 [with_libopenipmipthread="yes"],
4697 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4698 [#include <OpenIPMI/ipmiif.h>
4699 #include <OpenIPMI/ipmi_err.h>
4700 #include <OpenIPMI/ipmi_posix.h>
4701 #include <OpenIPMI/ipmi_conn.h>
4704 CPPFLAGS="$SAVE_CPPFLAGS"
4707 if test "x$with_libopenipmipthread" = "xyes"
4709 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4710 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4711 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4712 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4716 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4717 [with_libnotify="yes"],
4718 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4721 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4724 # Check for enabled/disabled features
4727 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4728 # ------------------------------------------------------------
4730 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4735 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4740 m4_define([EnDis],[disabled])dnl
4741 m4_define([YesNo],[no])dnl
4747 m4_define([EnDis],[enabled])dnl
4748 m4_define([YesNo],[yes])dnl
4751 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4755 m4_if([$3], [feature], [],
4759 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4765 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4767 enable_$1='[YesNo]'dnl
4769 if test "x$enable_$1" = "xno"
4773 if test "x$enable_$1" = "xyes"
4777 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4782 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4783 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4785 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4787 # AC_PLUGIN(name, default, info)
4788 # ------------------------------------------------------------
4795 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
4797 if test "x$enableval" = "xyes"
4800 else if test "x$enableval" = "xforce"
4805 enable_plugin="no (disabled on command line)"
4809 if test "x$enable_all_plugins" = "xauto"
4811 if test "x$2" = "xyes"
4818 enable_plugin="$enable_all_plugins"
4821 if test "x$enable_plugin" = "xyes"
4823 if test "x$2" = "xyes" || test "x$force" = "xyes"
4825 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4826 if test "x$2" != "xyes"
4828 dependency_warning="yes"
4830 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4831 dependency_error="yes"
4832 enable_plugin="no (dependency error)"
4835 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4836 enable_$1="$enable_plugin"
4838 )# AC_PLUGIN(name, default, info)
4840 m4_divert_once([HELP_ENABLE], [
4841 collectd features:])
4842 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4843 AC_COLLECTD([debug], [enable], [feature], [debugging])
4844 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4845 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4847 dependency_warning="no"
4848 dependency_error="no"
4854 plugin_conntrack="no"
4855 plugin_contextswitch="no"
4858 plugin_curl_json="no"
4859 plugin_curl_xml="no"
4865 plugin_interface="no"
4872 plugin_multimeter="no"
4876 plugin_processes="no"
4877 plugin_protocols="no"
4881 plugin_tcpconns="no"
4888 plugin_wireless="no"
4892 if test "x$ac_system" = "xLinux"
4894 plugin_battery="yes"
4895 plugin_conntrack="yes"
4896 plugin_contextswitch="yes"
4897 plugin_cgroups="yes"
4899 plugin_cpufreq="yes"
4901 plugin_entropy="yes"
4902 plugin_fscache="yes"
4903 plugin_interface="yes"
4910 plugin_processes="yes"
4911 plugin_protocols="yes"
4914 plugin_tcpconns="yes"
4915 plugin_thermal="yes"
4918 plugin_vserver="yes"
4919 plugin_wireless="yes"
4921 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4927 if test "x$ac_system" = "xOpenBSD"
4929 plugin_tcpconns="yes"
4933 if test "x$with_libiokit" = "xyes"
4935 plugin_battery="yes"
4941 if test "x$ac_system" = "xAIX"
4943 plugin_tcpconns="yes"
4948 if test "x$ac_system" = "xFreeBSD"
4950 plugin_zfs_arc="yes"
4954 if test "x$with_perfstat" = "xyes"
4957 plugin_contextswitch="yes"
4961 plugin_interface="yes"
4966 if test "x$with_procinfo" = "xyes"
4968 plugin_processes="yes"
4972 if test "x$with_kstat" = "xyes"
4975 plugin_processes="yes"
4977 plugin_zfs_arc="yes"
4980 if test "x$with_devinfo$with_kstat" = "xyesyes"
4984 plugin_interface="yes"
4990 if test "x$with_libstatgrab" = "xyes"
4994 plugin_interface="yes"
5001 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5004 if test "x$have_strptime" = "xyes"
5010 if test "x$with_libopenipmipthread" = "xyes"
5015 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
5017 plugin_curl_json="yes"
5020 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5022 plugin_curl_xml="yes"
5025 if test "x$have_processor_info" = "xyes"
5029 if test "x$have_sysctl" = "xyes"
5034 if test "x$ac_system" = "xDarwin"
5039 if test "x$have_sysctlbyname" = "xyes"
5041 plugin_contextswitch="yes"
5044 plugin_tcpconns="yes"
5047 # Df plugin: Check if we know how to determine mount points first.
5048 #if test "x$have_listmntent" = "xyes"; then
5051 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
5055 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
5059 #if test "x$have_getmntent" = "xseq"
5063 if test "x$c_cv_have_one_getmntent" = "xyes"
5068 # Df plugin: Check if we have either `statfs' or `statvfs' second.
5069 if test "x$plugin_df" = "xyes"
5072 if test "x$have_statfs" = "xyes"
5076 if test "x$have_statvfs" = "xyes"
5082 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
5084 plugin_ethstat="yes"
5087 if test "x$have_getifaddrs" = "xyes"
5089 plugin_interface="yes"
5092 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
5094 plugin_libvirt="yes"
5097 if test "x$have_getloadavg" = "xyes"
5102 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
5107 # Mac OS X memory interface
5108 if test "x$have_host_statistics" = "xyes"
5113 if test "x$have_termios_h" = "xyes"
5115 plugin_multimeter="yes"
5119 if test "x$have_thread_info" = "xyes"
5121 plugin_processes="yes"
5124 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
5126 plugin_processes="yes"
5129 if test "x$with_kvm_getswapinfo" = "xyes"
5134 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
5139 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
5141 plugin_tcpconns="yes"
5144 if test "x$have_getutent" = "xyes"
5148 if test "x$have_getutxent" = "xyes"
5153 m4_divert_once([HELP_ENABLE], [
5156 AC_ARG_ENABLE([all-plugins],
5157 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
5159 if test "x$enableval" = "xyes"
5161 enable_all_plugins="yes"
5162 else if test "x$enableval" = "xauto"
5164 enable_all_plugins="auto"
5166 enable_all_plugins="no"
5169 [enable_all_plugins="auto"])
5171 m4_divert_once([HELP_ENABLE], [])
5173 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
5174 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
5175 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
5176 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
5177 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
5178 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero's hardware sensors])
5179 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
5180 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
5181 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
5182 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
5183 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
5184 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
5185 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
5186 AC_PLUGIN([csv], [yes], [CSV output plugin])
5187 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
5188 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
5189 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
5190 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
5191 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
5192 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
5193 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
5194 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
5195 AC_PLUGIN([email], [yes], [EMail statistics])
5196 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
5197 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
5198 AC_PLUGIN([exec], [yes], [Execution of external programs])
5199 AC_PLUGIN([filecount], [yes], [Count files in directories])
5200 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
5201 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
5202 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
5203 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
5204 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
5205 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
5206 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
5207 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
5208 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
5209 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
5210 AC_PLUGIN([load], [$plugin_load], [System load])
5211 AC_PLUGIN([logfile], [yes], [File logging plugin])
5212 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
5213 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
5214 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
5215 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
5216 AC_PLUGIN([match_hashed], [yes], [The hashed match])
5217 AC_PLUGIN([match_regex], [yes], [The regex match])
5218 AC_PLUGIN([match_timediff], [yes], [The timediff match])
5219 AC_PLUGIN([match_value], [yes], [The value match])
5220 AC_PLUGIN([mbmon], [yes], [Query mbmond])
5221 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
5222 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
5223 AC_PLUGIN([memcached], [yes], [memcached statistics])
5224 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
5225 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
5226 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
5227 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
5228 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
5229 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
5230 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
5231 AC_PLUGIN([network], [yes], [Network communication plugin])
5232 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5233 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5234 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5235 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5236 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5237 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5238 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5239 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5240 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5241 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5242 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5243 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5244 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5245 # FIXME: Check for libevent, too.
5246 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5247 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5248 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5249 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5250 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5251 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5252 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5253 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5254 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5255 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5256 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5257 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5258 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5259 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
5260 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5261 AC_PLUGIN([statsd], [yes], [StatsD plugin])
5262 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5263 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5264 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5265 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5266 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5267 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5268 AC_PLUGIN([target_notification], [yes], [The notification target])
5269 AC_PLUGIN([target_replace], [yes], [The replace target])
5270 AC_PLUGIN([target_scale],[yes], [The scale target])
5271 AC_PLUGIN([target_set], [yes], [The set target])
5272 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5273 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5274 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5275 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5276 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5277 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5278 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5279 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5280 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5281 AC_PLUGIN([users], [$plugin_users], [User statistics])
5282 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5283 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5284 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5285 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5286 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5287 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5288 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5289 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5290 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5291 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5292 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5293 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5295 dnl Default configuration file
5296 # Load either syslog or logfile
5297 LOAD_PLUGIN_SYSLOG=""
5298 LOAD_PLUGIN_LOGFILE=""
5300 AC_MSG_CHECKING([which default log plugin to load])
5301 default_log_plugin="none"
5302 if test "x$enable_syslog" = "xyes"
5304 default_log_plugin="syslog"
5306 LOAD_PLUGIN_SYSLOG="##"
5309 if test "x$enable_logfile" = "xyes"
5311 if test "x$default_log_plugin" = "xnone"
5313 default_log_plugin="logfile"
5315 LOAD_PLUGIN_LOGFILE="#"
5318 LOAD_PLUGIN_LOGFILE="##"
5320 AC_MSG_RESULT([$default_log_plugin])
5322 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5323 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5325 DEFAULT_LOG_LEVEL="info"
5326 if test "x$enable_debug" = "xyes"
5328 DEFAULT_LOG_LEVEL="debug"
5330 AC_SUBST(DEFAULT_LOG_LEVEL)
5332 # Load only one of rrdtool, network, csv in the default config.
5333 LOAD_PLUGIN_RRDTOOL=""
5334 LOAD_PLUGIN_NETWORK=""
5337 AC_MSG_CHECKING([which default write plugin to load])
5338 default_write_plugin="none"
5339 if test "x$enable_rrdtool" = "xyes"
5341 default_write_plugin="rrdtool"
5343 LOAD_PLUGIN_RRDTOOL="##"
5346 if test "x$enable_network" = "xyes"
5348 if test "x$default_write_plugin" = "xnone"
5350 default_write_plugin="network"
5352 LOAD_PLUGIN_NETWORK="#"
5355 LOAD_PLUGIN_NETWORK="##"
5358 if test "x$enable_csv" = "xyes"
5360 if test "x$default_write_plugin" = "xnone"
5362 default_write_plugin="csv"
5367 LOAD_PLUGIN_CSV="##"
5369 AC_MSG_RESULT([$default_write_plugin])
5371 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5372 AC_SUBST(LOAD_PLUGIN_NETWORK)
5373 AC_SUBST(LOAD_PLUGIN_CSV)
5376 if test "x$ac_system" = "xLinux" \
5377 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5379 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5382 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5384 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5388 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
5389 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5391 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5393 PERL_BINDINGS_OPTIONS="$withval"
5394 with_perl_bindings="yes"
5396 with_perl_bindings="$withval"
5400 if test -n "$perl_interpreter"
5402 with_perl_bindings="yes"
5404 with_perl_bindings="no (no perl interpreter found)"
5407 if test "x$with_perl_bindings" = "xyes"
5409 PERL_BINDINGS="perl"
5413 AC_SUBST(PERL_BINDINGS)
5414 AC_SUBST(PERL_BINDINGS_OPTIONS)
5416 dnl libcollectdclient
5417 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5418 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5419 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5421 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5423 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5425 AC_SUBST(LCC_VERSION_MAJOR)
5426 AC_SUBST(LCC_VERSION_MINOR)
5427 AC_SUBST(LCC_VERSION_PATCH)
5428 AC_SUBST(LCC_VERSION_EXTRA)
5429 AC_SUBST(LCC_VERSION_STRING)
5431 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5433 AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
5436 if test "x$with_librrd" = "xyes" \
5437 && test "x$librrd_threadsafe" != "xyes"
5439 with_librrd="yes (warning: librrd is not thread-safe)"
5442 if test "x$with_libperl" = "xyes"
5444 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5446 enable_perl="no (needs libperl)"
5449 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5451 enable_perl="no (libperl doesn't support ithreads)"
5454 if test "x$with_perl_bindings" = "xyes" \
5455 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5457 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5464 intel mic . . . . . . $with_mic
5465 libaquaero5 . . . . . $with_libaquaero5
5466 libcredis . . . . . . $with_libcredis
5467 libcurl . . . . . . . $with_libcurl
5468 libdbi . . . . . . . $with_libdbi
5469 libesmtp . . . . . . $with_libesmtp
5470 libganglia . . . . . $with_libganglia
5471 libgcrypt . . . . . . $with_libgcrypt
5472 libhal . . . . . . . $with_libhal
5473 libiokit . . . . . . $with_libiokit
5474 libiptc . . . . . . . $with_libiptc
5475 libjvm . . . . . . . $with_java
5476 libkstat . . . . . . $with_kstat
5477 libkvm . . . . . . . $with_libkvm
5478 liblvm2app . . . . . $with_liblvm2app
5479 libmemcached . . . . $with_libmemcached
5480 libmnl . . . . . . . $with_libmnl
5481 libmodbus . . . . . . $with_libmodbus
5482 libmongoc . . . . . . $with_libmongoc
5483 libmysql . . . . . . $with_libmysql
5484 libnetapp . . . . . . $with_libnetapp
5485 libnetsnmp . . . . . $with_libnetsnmp
5486 libnotify . . . . . . $with_libnotify
5487 liboconfig . . . . . $with_liboconfig
5488 libopenipmi . . . . . $with_libopenipmipthread
5489 liboping . . . . . . $with_liboping
5490 libowcapi . . . . . . $with_libowcapi
5491 libpcap . . . . . . . $with_libpcap
5492 libperfstat . . . . . $with_perfstat
5493 libperl . . . . . . . $with_libperl
5494 libpq . . . . . . . . $with_libpq
5495 libpthread . . . . . $with_libpthread
5496 librabbitmq . . . . . $with_librabbitmq
5497 librouteros . . . . . $with_librouteros
5498 librrd . . . . . . . $with_librrd
5499 libsensors . . . . . $with_libsensors
5500 libsigrok . . . . . $with_libsigrok
5501 libstatgrab . . . . . $with_libstatgrab
5502 libtokyotyrant . . . $with_libtokyotyrant
5503 libupsclient . . . . $with_libupsclient
5504 libvarnish . . . . . $with_libvarnish
5505 libvirt . . . . . . . $with_libvirt
5506 libxml2 . . . . . . . $with_libxml2
5507 libxmms . . . . . . . $with_libxmms
5508 libyajl . . . . . . . $with_libyajl
5509 oracle . . . . . . . $with_oracle
5510 protobuf-c . . . . . $have_protoc_c
5511 python . . . . . . . $with_python
5514 daemon mode . . . . . $enable_daemon
5515 debug . . . . . . . . $enable_debug
5518 perl . . . . . . . . $with_perl_bindings
5521 aggregation . . . . . $enable_aggregation
5522 amqp . . . . . . . $enable_amqp
5523 apache . . . . . . . $enable_apache
5524 apcups . . . . . . . $enable_apcups
5525 aquaero . . . . . . . $enable_aquaero
5526 apple_sensors . . . . $enable_apple_sensors
5527 ascent . . . . . . . $enable_ascent
5528 battery . . . . . . . $enable_battery
5529 bind . . . . . . . . $enable_bind
5530 conntrack . . . . . . $enable_conntrack
5531 contextswitch . . . . $enable_contextswitch
5532 cgroups . . . . . . . $enable_cgroups
5533 cpu . . . . . . . . . $enable_cpu
5534 cpufreq . . . . . . . $enable_cpufreq
5535 csv . . . . . . . . . $enable_csv
5536 curl . . . . . . . . $enable_curl
5537 curl_json . . . . . . $enable_curl_json
5538 curl_xml . . . . . . $enable_curl_xml
5539 dbi . . . . . . . . . $enable_dbi
5540 df . . . . . . . . . $enable_df
5541 disk . . . . . . . . $enable_disk
5542 dns . . . . . . . . . $enable_dns
5543 email . . . . . . . . $enable_email
5544 entropy . . . . . . . $enable_entropy
5545 ethstat . . . . . . . $enable_ethstat
5546 exec . . . . . . . . $enable_exec
5547 filecount . . . . . . $enable_filecount
5548 fscache . . . . . . . $enable_fscache
5549 gmond . . . . . . . . $enable_gmond
5550 hddtemp . . . . . . . $enable_hddtemp
5551 interface . . . . . . $enable_interface
5552 ipmi . . . . . . . . $enable_ipmi
5553 iptables . . . . . . $enable_iptables
5554 ipvs . . . . . . . . $enable_ipvs
5555 irq . . . . . . . . . $enable_irq
5556 java . . . . . . . . $enable_java
5557 libvirt . . . . . . . $enable_libvirt
5558 load . . . . . . . . $enable_load
5559 logfile . . . . . . . $enable_logfile
5560 lpar . . . . . . . . $enable_lpar
5561 lvm . . . . . . . . . $enable_lvm
5562 madwifi . . . . . . . $enable_madwifi
5563 match_empty_counter . $enable_match_empty_counter
5564 match_hashed . . . . $enable_match_hashed
5565 match_regex . . . . . $enable_match_regex
5566 match_timediff . . . $enable_match_timediff
5567 match_value . . . . . $enable_match_value
5568 mbmon . . . . . . . . $enable_mbmon
5569 md . . . . . . . . . $enable_md
5570 memcachec . . . . . . $enable_memcachec
5571 memcached . . . . . . $enable_memcached
5572 memory . . . . . . . $enable_memory
5573 mic . . . . . . . . . $enable_mic
5574 modbus . . . . . . . $enable_modbus
5575 multimeter . . . . . $enable_multimeter
5576 mysql . . . . . . . . $enable_mysql
5577 netapp . . . . . . . $enable_netapp
5578 netlink . . . . . . . $enable_netlink
5579 network . . . . . . . $enable_network
5580 nfs . . . . . . . . . $enable_nfs
5581 nginx . . . . . . . . $enable_nginx
5582 notify_desktop . . . $enable_notify_desktop
5583 notify_email . . . . $enable_notify_email
5584 ntpd . . . . . . . . $enable_ntpd
5585 numa . . . . . . . . $enable_numa
5586 nut . . . . . . . . . $enable_nut
5587 olsrd . . . . . . . . $enable_olsrd
5588 onewire . . . . . . . $enable_onewire
5589 openvpn . . . . . . . $enable_openvpn
5590 oracle . . . . . . . $enable_oracle
5591 perl . . . . . . . . $enable_perl
5592 pf . . . . . . . . . $enable_pf
5593 pinba . . . . . . . . $enable_pinba
5594 ping . . . . . . . . $enable_ping
5595 postgresql . . . . . $enable_postgresql
5596 powerdns . . . . . . $enable_powerdns
5597 processes . . . . . . $enable_processes
5598 protocols . . . . . . $enable_protocols
5599 python . . . . . . . $enable_python
5600 redis . . . . . . . . $enable_redis
5601 routeros . . . . . . $enable_routeros
5602 rrdcached . . . . . . $enable_rrdcached
5603 rrdtool . . . . . . . $enable_rrdtool
5604 sensors . . . . . . . $enable_sensors
5605 serial . . . . . . . $enable_serial
5606 sigrok . . . . . . . $enable_sigrok
5607 snmp . . . . . . . . $enable_snmp
5608 statsd . . . . . . . $enable_statsd
5609 swap . . . . . . . . $enable_swap
5610 syslog . . . . . . . $enable_syslog
5611 table . . . . . . . . $enable_table
5612 tail . . . . . . . . $enable_tail
5613 tail_csv . . . . . . $enable_tail_csv
5614 tape . . . . . . . . $enable_tape
5615 target_notification . $enable_target_notification
5616 target_replace . . . $enable_target_replace
5617 target_scale . . . . $enable_target_scale
5618 target_set . . . . . $enable_target_set
5619 target_v5upgrade . . $enable_target_v5upgrade
5620 tcpconns . . . . . . $enable_tcpconns
5621 teamspeak2 . . . . . $enable_teamspeak2
5622 ted . . . . . . . . . $enable_ted
5623 thermal . . . . . . . $enable_thermal
5624 threshold . . . . . . $enable_threshold
5625 tokyotyrant . . . . . $enable_tokyotyrant
5626 unixsock . . . . . . $enable_unixsock
5627 uptime . . . . . . . $enable_uptime
5628 users . . . . . . . . $enable_users
5629 uuid . . . . . . . . $enable_uuid
5630 varnish . . . . . . . $enable_varnish
5631 vmem . . . . . . . . $enable_vmem
5632 vserver . . . . . . . $enable_vserver
5633 wireless . . . . . . $enable_wireless
5634 write_graphite . . . $enable_write_graphite
5635 write_http . . . . . $enable_write_http
5636 write_mongodb . . . . $enable_write_mongodb
5637 write_redis . . . . . $enable_write_redis
5638 write_riemann . . . . $enable_write_riemann
5639 xmms . . . . . . . . $enable_xmms
5640 zfs_arc . . . . . . . $enable_zfs_arc
5644 if test "x$dependency_error" = "xyes"; then
5645 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5648 if test "x$dependency_warning" = "xyes"; then
5649 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5652 # vim: set fdm=marker :