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>
280 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
285 # include <sys/types.h>
287 #if HAVE_NETINET_IN_SYSTM_H
288 # include <netinet/in_systm.h>
290 #if HAVE_NETINET_IN_H
291 # include <netinet/in.h>
293 #if HAVE_NETINET_IP6_H
294 # include <netinet/ip6.h>
298 if test "x$have_ip6_ext" = "xno"; then
299 SAVE_CFLAGS="$CFLAGS"
300 CFLAGS="$CFLAGS -DSOLARIS2=8"
302 AC_CHECK_TYPES([struct ip6_ext],
303 [have_ip6_ext="yes, with -DSOLARIS2=8"],
309 # include <sys/types.h>
311 #if HAVE_NETINET_IN_SYSTM_H
312 # include <netinet/in_systm.h>
314 #if HAVE_NETINET_IN_H
315 # include <netinet/in.h>
317 #if HAVE_NETINET_IP6_H
318 # include <netinet/ip6.h>
322 if test "x$have_ip6_ext" = "xno"; then
323 CFLAGS="$SAVE_CFLAGS"
328 AC_CHECK_HEADERS(sys/dkstat.h)
329 if test "x$ac_system" = "xDarwin"
331 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)
332 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
333 # For the battery plugin
334 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
336 #if HAVE_IOKIT_IOKITLIB_H
337 # include <IOKit/IOKitLib.h>
339 #if HAVE_IOKIT_IOTYPES_H
340 # include <IOKit/IOTypes.h>
346 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
349 # include <sys/types.h>
352 # include <sys/param.h>
356 AC_MSG_CHECKING([for sysctl kern.cp_times])
357 if test -x /sbin/sysctl
359 /sbin/sysctl kern.cp_times 2>/dev/null
363 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
364 [Define if sysctl supports kern.cp_times])
373 AC_CHECK_HEADERS(linux/major.h)
375 # For md module (Linux only)
376 if test "x$ac_system" = "xLinux"
378 AC_CHECK_HEADERS(linux/raid/md_u.h,
379 [have_linux_raid_md_u_h="yes"],
380 [have_linux_raid_md_u_h="no"],
382 #include <sys/ioctl.h>
383 #include <linux/major.h>
384 #include <linux/types.h>
387 have_linux_raid_md_u_h="no"
390 # For the swap module
391 have_linux_wireless_h="no"
392 if test "x$ac_system" = "xLinux"
394 AC_CHECK_HEADERS(linux/wireless.h,
395 [have_linux_wireless_h="yes"],
396 [have_linux_wireless_h="no"],
399 #include <sys/ioctl.h>
400 #include <sys/socket.h>
404 # For the swap module
405 have_sys_swap_h="yes"
406 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
408 #undef _FILE_OFFSET_BITS
409 #undef _LARGEFILE64_SOURCE
411 # include <sys/types.h>
414 # include <sys/param.h>
418 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
421 if test "x$GCC" = "xyes"
423 hint_64="CFLAGS='-m64'"
425 hint_64="CFLAGS='-xarch=v9'"
427 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
431 # For the processes plugin
433 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
435 # For interface plugin
436 AC_CHECK_HEADERS(ifaddrs.h)
437 AC_CHECK_HEADERS(net/if.h, [], [],
440 # include <sys/types.h>
442 #if HAVE_SYS_SOCKET_H
443 # include <sys/socket.h>
446 AC_CHECK_HEADERS(linux/if.h, [], [],
449 # include <sys/types.h>
451 #if HAVE_SYS_SOCKET_H
452 # include <sys/socket.h>
455 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
458 # include <sys/types.h>
460 #if HAVE_SYS_SOCKET_H
461 # include <sys/socket.h>
463 #if HAVE_LINUX_INET_DIAG_H
464 # include <linux/inet_diag.h>
467 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
470 # include <sys/types.h>
472 #if HAVE_SYS_SOCKET_H
473 # include <sys/socket.h>
476 # include <linux/if.h>
481 AC_CHECK_HEADERS(linux/sockios.h,
482 [have_linux_sockios_h="yes"],
483 [have_linux_sockios_h="no"],
486 # include <sys/ioctl.h>
492 AC_CHECK_HEADERS(linux/ethtool.h,
493 [have_linux_ethtool_h="yes"],
494 [have_linux_ethtool_h="no"],
497 # include <sys/ioctl.h>
502 #if HAVE_LINUX_SOCKIOS_H
503 # include <linux/sockios.h>
508 have_linux_ip_vs_h="no"
509 have_net_ip_vs_h="no"
511 ip_vs_h_needs_kernel_cflags="no"
512 if test "x$ac_system" = "xLinux"
514 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
515 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
516 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
518 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
520 SAVE_CFLAGS="$CFLAGS"
521 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
523 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
525 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
526 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
527 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
529 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
531 ip_vs_h_needs_kernel_cflags="yes"
534 CFLAGS="$SAVE_CFLAGS"
537 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
540 AC_CHECK_HEADERS(sys/ucred.h, [], [],
543 # include <sys/types.h>
546 # include <sys/param.h>
550 # For mount interface
551 AC_CHECK_HEADERS(sys/mount.h, [], [],
554 # include <sys/types.h>
557 # include <sys/param.h>
561 # For the email plugin
562 AC_CHECK_HEADERS(linux/un.h, [], [],
564 #if HAVE_SYS_SOCKET_H
565 # include <sys/socket.h>
569 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)
572 AC_CHECK_HEADERS(arpa/nameser.h)
573 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
575 #if HAVE_ARPA_NAMESER_H
576 # include <arpa/nameser.h>
580 AC_CHECK_HEADERS(net/if_arp.h, [], [],
581 [#if HAVE_SYS_SOCKET_H
582 # include <sys/socket.h>
585 AC_CHECK_HEADERS(net/ppp_defs.h)
586 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
587 [#if HAVE_NET_PPP_DEFS_H
588 # include <net/ppp_defs.h>
591 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
596 # include <sys/types.h>
598 #if HAVE_SYS_SOCKET_H
599 # include <sys/socket.h>
604 #if HAVE_NETINET_IN_H
605 # include <netinet/in.h>
609 AC_CHECK_HEADERS(netinet/ip_compat.h)
611 have_net_pfvar_h="no"
612 AC_CHECK_HEADERS(net/pfvar.h,
613 [have_net_pfvar_h="yes"],
614 [have_net_pfvar_h="no"],
617 # include <sys/ioctl.h>
619 #if HAVE_SYS_SOCKET_H
620 # include <sys/socket.h>
627 # For the multimeter plugin
629 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
632 # Checks for typedefs, structures, and compiler characteristics.
641 # Checks for library functions.
643 AC_PROG_GCC_TRADITIONAL
644 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
648 SAVE_CFLAGS="$CFLAGS"
649 # Emulate behavior of src/Makefile.am
650 if test "x$GCC" = "xyes"
652 CFLAGS="$CFLAGS -Wall -Werror"
655 AC_CACHE_CHECK([for strtok_r],
656 [c_cv_have_strtok_r_default],
665 char buffer[] = "foo,bar,baz";
672 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
675 printf ("token = %s;\n", token);
679 [c_cv_have_strtok_r_default="yes"],
680 [c_cv_have_strtok_r_default="no"]
684 if test "x$c_cv_have_strtok_r_default" = "xno"
686 CFLAGS="$CFLAGS -D_REENTRANT=1"
688 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
689 [c_cv_have_strtok_r_reentrant],
698 char buffer[] = "foo,bar,baz";
705 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
708 printf ("token = %s;\n", token);
712 [c_cv_have_strtok_r_reentrant="yes"],
713 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
718 CFLAGS="$SAVE_CFLAGS"
719 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
721 CFLAGS="$CFLAGS -D_REENTRANT=1"
724 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
726 socket_needs_socket="no"
727 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
728 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
730 clock_gettime_needs_rt="no"
731 clock_gettime_needs_posix4="no"
732 have_clock_gettime="no"
733 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
734 if test "x$have_clock_gettime" = "xno"
736 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
737 have_clock_gettime="yes"])
739 if test "x$have_clock_gettime" = "xno"
741 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
742 have_clock_gettime="yes"])
744 if test "x$have_clock_gettime" = "xyes"
746 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
748 AC_MSG_WARN(cannot find clock_gettime)
751 nanosleep_needs_rt="no"
752 nanosleep_needs_posix4="no"
753 AC_CHECK_FUNCS(nanosleep,
755 AC_CHECK_LIB(rt, nanosleep,
756 [nanosleep_needs_rt="yes"],
757 AC_CHECK_LIB(posix4, nanosleep,
758 [nanosleep_needs_posix4="yes"],
759 AC_MSG_ERROR(cannot find nanosleep))))
761 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
762 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
764 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
765 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
766 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
767 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
768 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
769 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
770 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
771 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
772 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
773 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
774 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
775 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
777 # Check for strptime {{{
778 if test "x$GCC" = "xyes"
780 SAVE_CFLAGS="$CFLAGS"
781 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
784 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
785 if test "x$have_strptime" = "xyes"
787 AC_CACHE_CHECK([whether strptime is exported by default],
788 [c_cv_have_strptime_default],
789 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
795 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
798 [c_cv_have_strptime_default="yes"],
799 [c_cv_have_strptime_default="no"]))
801 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
803 AC_CACHE_CHECK([whether strptime needs standards mode],
804 [c_cv_have_strptime_standards],
805 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
807 #ifndef _ISOC99_SOURCE
808 # define _ISOC99_SOURCE 1
810 #ifndef _POSIX_C_SOURCE
811 # define _POSIX_C_SOURCE 200112L
813 #ifndef _XOPEN_SOURCE
814 # define _XOPEN_SOURCE 500
820 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
823 [c_cv_have_strptime_standards="yes"],
824 [c_cv_have_strptime_standards="no"]))
826 if test "x$c_cv_have_strptime_standards" = "xyes"
828 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
834 if test "x$GCC" = "xyes"
836 CFLAGS="$SAVE_CFLAGS"
838 # }}} Check for strptime
840 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
841 if test "x$have_swapctl" = "xyes"; then
842 AC_CACHE_CHECK([whether swapctl takes two arguments],
843 [c_cv_have_swapctl_two_args],
844 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
846 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
847 # undef _FILE_OFFSET_BITS
848 # undef _LARGEFILE64_SOURCE
850 #include <sys/stat.h>
851 #include <sys/swap.h>
854 int num = swapctl(0, NULL);
857 [c_cv_have_swapctl_two_args="yes"],
858 [c_cv_have_swapctl_two_args="no"]
861 AC_CACHE_CHECK([whether swapctl takes three arguments],
862 [c_cv_have_swapctl_three_args],
866 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
867 # undef _FILE_OFFSET_BITS
868 # undef _LARGEFILE64_SOURCE
870 #include <sys/stat.h>
871 #include <sys/swap.h>
874 int num = swapctl(0, NULL, 0);
877 [c_cv_have_swapctl_three_args="yes"],
878 [c_cv_have_swapctl_three_args="no"]
882 # Check for different versions of `swapctl' here..
883 if test "x$have_swapctl" = "xyes"; then
884 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
885 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
886 [Define if the function swapctl exists and takes two arguments.])
888 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
889 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
890 [Define if the function swapctl exists and takes three arguments.])
895 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
897 if test "x$withval" = "xno"; then
899 else if test "x$withval" = "xyes"; then
906 if test "x$nan_type" = "xnone"; then
907 AC_CACHE_CHECK([whether NAN is defined by default],
908 [c_cv_have_nan_default],
909 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
913 static double foo = NAN;
922 [c_cv_have_nan_default="yes"],
923 [c_cv_have_nan_default="no"]
926 if test "x$c_cv_have_nan_default" = "xyes"
931 if test "x$nan_type" = "xnone"; then
932 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
933 [c_cv_have_nan_isoc],
934 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
937 #define __USE_ISOC99 1
939 static double foo = NAN;
948 [c_cv_have_nan_isoc="yes"],
949 [c_cv_have_nan_isoc="no"]
952 if test "x$c_cv_have_nan_isoc" = "xyes"
957 if test "x$nan_type" = "xnone"; then
958 SAVE_LDFLAGS=$LDFLAGS
959 LDFLAGS="$LDFLAGS -lm"
960 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
961 [c_cv_have_nan_zero],
962 AC_RUN_IFELSE([AC_LANG_PROGRAM(
969 #define NAN (0.0 / 0.0)
971 # define isnan(f) ((f) != (f))
973 static double foo = NAN;
982 [c_cv_have_nan_zero="yes"],
983 [c_cv_have_nan_zero="no"]
986 LDFLAGS=$SAVE_LDFLAGS
987 if test "x$c_cv_have_nan_zero" = "xyes"
993 if test "x$nan_type" = "xdefault"; then
994 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
995 [Define if NAN is defined by default and can initialize static variables.])
996 else if test "x$nan_type" = "xisoc99"; then
997 AC_DEFINE(NAN_STATIC_ISOC, 1,
998 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
999 else if test "x$nan_type" = "xzero"; then
1000 AC_DEFINE(NAN_ZERO_ZERO, 1,
1001 [Define if NAN can be defined as (0.0 / 0.0)])
1003 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1006 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1008 if test "x$withval" = "xnothing"; then
1009 fp_layout_type="nothing"
1010 else if test "x$withval" = "xendianflip"; then
1011 fp_layout_type="endianflip"
1012 else if test "x$withval" = "xintswap"; then
1013 fp_layout_type="intswap"
1015 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1018 [fp_layout_type="unknown"])
1020 if test "x$fp_layout_type" = "xunknown"; then
1021 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1022 [c_cv_fp_layout_need_nothing],
1023 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1029 # include <stdint.h>
1032 # include <inttypes.h>
1035 # include <stdbool.h>
1045 memcpy ((void *) &i0, (void *) &d, 8);
1048 memcpy ((void *) c, (void *) &i1, 8);
1050 if ((c[0] == 0x2f) && (c[1] == 0x25)
1051 && (c[2] == 0xc0) && (c[3] == 0xc7)
1052 && (c[4] == 0x43) && (c[5] == 0x2b)
1053 && (c[6] == 0x1f) && (c[7] == 0x5b))
1059 [c_cv_fp_layout_need_nothing="yes"],
1060 [c_cv_fp_layout_need_nothing="no"]
1063 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1064 fp_layout_type="nothing"
1067 if test "x$fp_layout_type" = "xunknown"; then
1068 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1069 [c_cv_fp_layout_need_endianflip],
1070 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1076 # include <stdint.h>
1079 # include <inttypes.h>
1082 # include <stdbool.h>
1084 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1085 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1086 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1087 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1088 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1089 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1090 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1091 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1100 memcpy ((void *) &i0, (void *) &d, 8);
1102 i1 = endianflip (i0);
1103 memcpy ((void *) c, (void *) &i1, 8);
1105 if ((c[0] == 0x2f) && (c[1] == 0x25)
1106 && (c[2] == 0xc0) && (c[3] == 0xc7)
1107 && (c[4] == 0x43) && (c[5] == 0x2b)
1108 && (c[6] == 0x1f) && (c[7] == 0x5b))
1114 [c_cv_fp_layout_need_endianflip="yes"],
1115 [c_cv_fp_layout_need_endianflip="no"]
1118 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1119 fp_layout_type="endianflip"
1122 if test "x$fp_layout_type" = "xunknown"; then
1123 AC_CACHE_CHECK([if intswap converts to x86 representation],
1124 [c_cv_fp_layout_need_intswap],
1125 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1131 # include <stdint.h>
1134 # include <inttypes.h>
1137 # include <stdbool.h>
1139 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1140 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1149 memcpy ((void *) &i0, (void *) &d, 8);
1152 memcpy ((void *) c, (void *) &i1, 8);
1154 if ((c[0] == 0x2f) && (c[1] == 0x25)
1155 && (c[2] == 0xc0) && (c[3] == 0xc7)
1156 && (c[4] == 0x43) && (c[5] == 0x2b)
1157 && (c[6] == 0x1f) && (c[7] == 0x5b))
1163 [c_cv_fp_layout_need_intswap="yes"],
1164 [c_cv_fp_layout_need_intswap="no"]
1167 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1168 fp_layout_type="intswap"
1172 if test "x$fp_layout_type" = "xnothing"; then
1173 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1174 [Define if doubles are stored in x86 representation.])
1175 else if test "x$fp_layout_type" = "xendianflip"; then
1176 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1177 [Define if endianflip is needed to convert to x86 representation.])
1178 else if test "x$fp_layout_type" = "xintswap"; then
1179 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1180 [Define if intswap is needed to convert to x86 representation.])
1182 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1186 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1187 have_getvfsstat="no"
1188 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1189 have_listmntent="no"
1190 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1193 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1194 if test "x$have_getmntent" = "xno"; then
1195 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1197 if test "x$have_getmntent" = "xno"; then
1198 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1200 if test "x$have_getmntent" = "xno"; then
1201 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1204 if test "x$have_getmntent" = "xc"; then
1205 AC_CACHE_CHECK([whether getmntent takes one argument],
1206 [c_cv_have_one_getmntent],
1210 #include "$srcdir/src/utils_mount.h"
1215 fh = setmntent ("/etc/mtab", "r");
1216 me = getmntent (fh);
1217 return(me->mnt_passno);
1220 [c_cv_have_one_getmntent="yes"],
1221 [c_cv_have_one_getmntent="no"]
1224 AC_CACHE_CHECK([whether getmntent takes two arguments],
1225 [c_cv_have_two_getmntent],
1229 #include "$srcdir/src/utils_mount.h"
1235 fh = fopen ("/etc/mnttab", "r");
1236 status = getmntent (fh, &mt);
1240 [c_cv_have_two_getmntent="yes"],
1241 [c_cv_have_two_getmntent="no"]
1246 # Check for different versions of `getmntent' here..
1248 if test "x$have_getmntent" = "xc"; then
1249 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1250 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1251 [Define if the function getmntent exists and takes one argument.])
1253 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1254 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1255 [Define if the function getmntent exists and takes two arguments.])
1258 if test "x$have_getmntent" = "xsun"; then
1259 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1260 [Define if the function getmntent exists. It's the version from libsun.])
1262 if test "x$have_getmntent" = "xseq"; then
1263 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1264 [Define if the function getmntent exists. It's the version from libseq.])
1266 if test "x$have_getmntent" = "xgen"; then
1267 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1268 [Define if the function getmntent exists. It's the version from libgen.])
1272 AC_CACHE_CHECK([if have htonll defined],
1274 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1276 #include <sys/types.h>
1277 #include <netinet/in.h>
1279 # include <inttypes.h>
1286 [c_cv_have_htonll="yes"],
1287 [c_cv_have_htonll="no"]
1290 if test "x$c_cv_have_htonll" = "xyes"
1292 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1295 # Check for structures
1296 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1297 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1300 #include <sys/types.h>
1301 #include <sys/socket.h>
1304 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1305 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1308 #include <sys/types.h>
1309 #include <sys/socket.h>
1310 #include <linux/if.h>
1311 #include <linux/netdevice.h>
1313 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1314 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1317 #include <linux/inet_diag.h>
1321 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1324 #include <netinet/in.h>
1328 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1330 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1331 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1332 have_struct_kinfo_proc_freebsd="yes"
1335 have_struct_kinfo_proc_freebsd="no"
1339 #include <sys/param.h>
1340 #include <sys/sysctl.h>
1341 #include <sys/user.h>
1344 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1346 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1347 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1348 have_struct_kinfo_proc_openbsd="yes"
1351 have_struct_kinfo_proc_openbsd="no"
1354 #include <sys/param.h>
1355 #include <sys/sysctl.h>
1359 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1360 [#define _BSD_SOURCE
1362 # include <stdint.h>
1364 #if HAVE_SYS_TYPES_H
1365 # include <sys/types.h>
1367 #if HAVE_NETINET_IN_SYSTM_H
1368 # include <netinet/in_systm.h>
1370 #if HAVE_NETINET_IN_H
1371 # include <netinet/in.h>
1373 #if HAVE_NETINET_IP_H
1374 # include <netinet/ip.h>
1376 #if HAVE_NETINET_UDP_H
1377 # include <netinet/udp.h>
1380 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1381 [#define _BSD_SOURCE
1383 # include <stdint.h>
1385 #if HAVE_SYS_TYPES_H
1386 # include <sys/types.h>
1388 #if HAVE_NETINET_IN_SYSTM_H
1389 # include <netinet/in_systm.h>
1391 #if HAVE_NETINET_IN_H
1392 # include <netinet/in.h>
1394 #if HAVE_NETINET_IP_H
1395 # include <netinet/ip.h>
1397 #if HAVE_NETINET_UDP_H
1398 # include <netinet/udp.h>
1402 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1412 # Checks for libraries begin here
1415 with_libresolv="yes"
1416 AC_CHECK_LIB(resolv, res_search,
1418 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1420 [with_libresolv="no"])
1421 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1423 dnl Check for HAL (hardware abstraction library)
1425 AC_CHECK_LIB(hal,libhal_device_property_exists,
1426 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1428 if test "x$with_libhal" = "xyes"; then
1429 if test "x$PKG_CONFIG" != "x"; then
1430 BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
1431 BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
1432 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1433 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1437 m4_divert_once([HELP_WITH], [
1438 collectd additional packages:])
1440 AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
1442 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1444 if test "x$ac_system" = "xAIX"
1449 with_perfstat="no (AIX only)"
1450 with_procinfo="no (AIX only)"
1453 if test "x$with_perfstat" = "xyes"
1455 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1456 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1458 if test "x$with_perfstat" = "xyes"
1460 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1461 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1462 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1463 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1465 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1468 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1470 # Processes plugin under AIX.
1471 if test "x$with_procinfo" = "xyes"
1473 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1475 if test "x$with_procinfo" = "xyes"
1477 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1480 if test "x$ac_system" = "xSolaris"
1485 with_kstat="no (Solaris only)"
1486 with_devinfo="no (Solaris only)"
1489 if test "x$with_kstat" = "xyes"
1491 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1493 if test "x$with_kstat" = "xyes"
1495 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1496 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1498 if test "x$with_kstat" = "xyes"
1500 AC_DEFINE(HAVE_LIBKSTAT, 1,
1501 [Define to 1 if you have the 'kstat' library (-lkstat)])
1503 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1504 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1507 if test "x$ac_system" = "xDarwin"
1513 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1516 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1517 if test "x$with_kvm_getprocs" = "xyes"
1519 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1520 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1523 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1525 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1526 if test "x$with_kvm_getswapinfo" = "xyes"
1528 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1529 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1532 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1534 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1535 if test "x$with_kvm_nlist" = "xyes"
1537 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1538 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1539 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1542 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1544 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1545 if test "x$with_kvm_openfiles" = "xyes"
1547 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1548 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1551 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1553 # --with-libaquaero5 {{{
1554 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1556 if test "x$withval" = "xyes"
1558 with_libaquaero5="yes"
1559 else if test "x$withval" = "xno"
1561 with_libaquaero5="no"
1563 with_libaquaero5="yes"
1564 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1565 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1568 [with_libaquaero5="yes"])
1570 SAVE_CPPFLAGS="$CPPFLAGS"
1571 SAVE_LDFLAGS="$LDFLAGS"
1573 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1574 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1576 if test "x$with_libaquaero5" = "xyes"
1578 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1580 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1582 AC_CHECK_HEADERS(libaquaero5.h,
1583 [with_libaquaero5="yes"],
1584 [with_libaquaero5="no (libaquaero5.h not found)"])
1586 if test "x$with_libaquaero5" = "xyes"
1588 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1590 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1592 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1593 [with_libaquaero5="yes"],
1594 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1597 CPPFLAGS="$SAVE_CPPFLAGS"
1598 LDFLAGS="$SAVE_LDFLAGS"
1600 if test "x$with_libaquaero5" = "xyes"
1602 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1603 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1604 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1605 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1607 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1610 # --with-libcredis {{{
1611 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1613 if test "x$withval" = "xyes"
1615 with_libcredis="yes"
1616 else if test "x$withval" = "xno"
1620 with_libcredis="yes"
1621 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1622 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1625 [with_libcredis="yes"])
1627 SAVE_CPPFLAGS="$CPPFLAGS"
1628 SAVE_LDFLAGS="$LDFLAGS"
1630 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1631 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1633 if test "x$with_libcredis" = "xyes"
1635 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1637 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1639 AC_CHECK_HEADERS(credis.h,
1640 [with_libcredis="yes"],
1641 [with_libcredis="no (credis.h not found)"])
1643 if test "x$with_libcredis" = "xyes"
1645 if test "x$LIBCREDIS_LDFLAGS" != "x"
1647 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1649 AC_CHECK_LIB(credis, credis_info,
1650 [with_libcredis="yes"],
1651 [with_libcredis="no (symbol 'credis_info' not found)"])
1655 CPPFLAGS="$SAVE_CPPFLAGS"
1656 LDFLAGS="$SAVE_LDFLAGS"
1658 if test "x$with_libcredis" = "xyes"
1660 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1661 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1662 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1663 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1665 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1668 # --with-libcurl {{{
1669 with_curl_config="curl-config"
1672 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1674 if test "x$withval" = "xno"
1677 else if test "x$withval" = "xyes"
1681 if test -f "$withval" && test -x "$withval"
1683 with_curl_config="$withval"
1685 else if test -x "$withval/bin/curl-config"
1687 with_curl_config="$withval/bin/curl-config"
1696 if test "x$with_libcurl" = "xyes"
1698 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1699 curl_config_status=$?
1701 if test $curl_config_status -ne 0
1703 with_libcurl="no ($with_curl_config failed)"
1705 SAVE_CPPFLAGS="$CPPFLAGS"
1706 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1708 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1710 CPPFLAGS="$SAVE_CPPFLAGS"
1713 if test "x$with_libcurl" = "xyes"
1715 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1716 curl_config_status=$?
1718 if test $curl_config_status -ne 0
1720 with_libcurl="no ($with_curl_config failed)"
1722 AC_CHECK_LIB(curl, curl_easy_init,
1723 [with_libcurl="yes"],
1724 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1728 if test "x$with_libcurl" = "xyes"
1730 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1731 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1732 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1733 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1735 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1739 with_libdbi_cppflags=""
1740 with_libdbi_ldflags=""
1741 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1743 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1745 with_libdbi_cppflags="-I$withval/include"
1746 with_libdbi_ldflags="-L$withval/lib"
1749 with_libdbi="$withval"
1755 if test "x$with_libdbi" = "xyes"
1757 SAVE_CPPFLAGS="$CPPFLAGS"
1758 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1760 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1762 CPPFLAGS="$SAVE_CPPFLAGS"
1764 if test "x$with_libdbi" = "xyes"
1766 SAVE_CPPFLAGS="$CPPFLAGS"
1767 SAVE_LDFLAGS="$LDFLAGS"
1768 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1769 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1771 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1773 CPPFLAGS="$SAVE_CPPFLAGS"
1774 LDFLAGS="$SAVE_LDFLAGS"
1776 if test "x$with_libdbi" = "xyes"
1778 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1779 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1780 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1781 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1782 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1783 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1785 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1788 # --with-libesmtp {{{
1789 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1791 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1793 LDFLAGS="$LDFLAGS -L$withval/lib"
1794 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1797 with_libesmtp="$withval"
1803 if test "x$with_libesmtp" = "xyes"
1805 AC_CHECK_LIB(esmtp, smtp_create_session,
1807 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1808 ], [with_libesmtp="no (libesmtp not found)"])
1810 if test "x$with_libesmtp" = "xyes"
1812 AC_CHECK_HEADERS(libesmtp.h,
1814 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1815 ], [with_libesmtp="no (libesmtp.h not found)"])
1817 if test "x$with_libesmtp" = "xyes"
1823 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1824 [Wether or not to use the esmtp library])
1825 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1828 # --with-libganglia {{{
1829 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1831 if test -f "$withval" && test -x "$withval"
1833 with_libganglia_config="$withval"
1834 with_libganglia="yes"
1835 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1837 with_libganglia_config="$withval/bin/ganglia-config"
1838 with_libganglia="yes"
1839 else if test -d "$withval"
1841 GANGLIA_CPPFLAGS="-I$withval/include"
1842 GANGLIA_LDFLAGS="-L$withval/lib"
1843 with_libganglia="yes"
1845 with_libganglia_config="ganglia-config"
1846 with_libganglia="$withval"
1850 with_libganglia_config="ganglia-config"
1851 with_libganglia="yes"
1854 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1856 if test "x$GANGLIA_CPPFLAGS" = "x"
1858 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1861 if test "x$GANGLIA_LDFLAGS" = "x"
1863 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1866 if test "x$GANGLIA_LIBS" = "x"
1868 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1872 SAVE_CPPFLAGS="$CPPFLAGS"
1873 SAVE_LDFLAGS="$LDFLAGS"
1874 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1875 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1877 if test "x$with_libganglia" = "xyes"
1879 AC_CHECK_HEADERS(gm_protocol.h,
1881 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1882 [Define to 1 if you have the <gm_protocol.h> header file.])
1883 ], [with_libganglia="no (gm_protocol.h not found)"])
1886 if test "x$with_libganglia" = "xyes"
1888 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1890 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1891 [Define to 1 if you have the ganglia library (-lganglia).])
1892 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1895 CPPFLAGS="$SAVE_CPPFLAGS"
1896 LDFLAGS="$SAVE_LDFLAGS"
1898 AC_SUBST(GANGLIA_CPPFLAGS)
1899 AC_SUBST(GANGLIA_LDFLAGS)
1900 AC_SUBST(GANGLIA_LIBS)
1901 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1904 # --with-libgcrypt {{{
1905 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1906 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1907 GCRYPT_LIBS="$GCRYPT_LIBS"
1908 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1910 if test -f "$withval" && test -x "$withval"
1912 with_libgcrypt_config="$withval"
1913 with_libgcrypt="yes"
1914 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1916 with_libgcrypt_config="$withval/bin/gcrypt-config"
1917 with_libgcrypt="yes"
1918 else if test -d "$withval"
1920 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1921 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1922 with_libgcrypt="yes"
1924 with_libgcrypt_config="gcrypt-config"
1925 with_libgcrypt="$withval"
1929 with_libgcrypt_config="libgcrypt-config"
1930 with_libgcrypt="yes"
1933 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1935 if test "x$GCRYPT_CPPFLAGS" = "x"
1937 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1940 if test "x$GCRYPT_LDFLAGS" = "x"
1942 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1943 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1946 if test "x$GCRYPT_LIBS" = "x"
1948 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1952 SAVE_CPPFLAGS="$CPPFLAGS"
1953 SAVE_LDFLAGS="$LDFLAGS"
1954 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1955 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1957 if test "x$with_libgcrypt" = "xyes"
1959 if test "x$GCRYPT_CPPFLAGS" != "x"
1961 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1963 AC_CHECK_HEADERS(gcrypt.h,
1964 [with_libgcrypt="yes"],
1965 [with_libgcrypt="no (gcrypt.h not found)"])
1968 if test "x$with_libgcrypt" = "xyes"
1970 if test "x$GCRYPT_LDFLAGS" != "x"
1972 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1974 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1975 [with_libgcrypt="yes"],
1976 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1978 if test "$with_libgcrypt" != "no"; then
1979 m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
1980 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
1981 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
1985 CPPFLAGS="$SAVE_CPPFLAGS"
1986 LDFLAGS="$SAVE_LDFLAGS"
1988 if test "x$with_libgcrypt" = "xyes"
1990 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1993 AC_SUBST(GCRYPT_CPPFLAGS)
1994 AC_SUBST(GCRYPT_LDFLAGS)
1995 AC_SUBST(GCRYPT_LIBS)
1996 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1999 # --with-libiptc {{{
2000 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2002 if test "x$withval" = "xshipped"
2005 else if test "x$withval" = "xyes"
2007 with_libiptc="pkgconfig"
2008 else if test "x$withval" = "xno"
2013 with_libiptc_cflags="-I$withval/include"
2014 with_libiptc_libs="-L$withval/lib"
2018 if test "x$ac_system" = "xLinux"
2020 with_libiptc="pkgconfig"
2022 with_libiptc="no (Linux only)"
2026 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
2028 with_libiptc="no (Don't have pkg-config)"
2031 if test "x$with_libiptc" = "xpkgconfig"
2033 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2036 with_libiptc="no (pkg-config doesn't know libiptc)"
2039 if test "x$with_libiptc" = "xpkgconfig"
2041 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2044 with_libiptc="no ($PKG_CONFIG failed)"
2046 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2049 with_libiptc="no ($PKG_CONFIG failed)"
2053 SAVE_CPPFLAGS="$CPPFLAGS"
2054 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2056 # check whether the header file for libiptc is available.
2057 if test "x$with_libiptc" = "xpkgconfig"
2059 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2060 [with_libiptc="no (header file missing)"])
2062 # If the header file is available, check for the required type declaractions.
2063 # They may be missing in old versions of libiptc. In that case, they will be
2064 # declared in the iptables plugin.
2065 if test "x$with_libiptc" = "xpkgconfig"
2067 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2069 # Check for the iptc_init symbol in the library.
2070 # This could be in iptc or ip4tc
2071 if test "x$with_libiptc" = "xpkgconfig"
2074 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2075 [with_libiptc="pkgconfig"],
2076 [with_libiptc="no"],
2077 [$with_libiptc_libs])
2080 if test "x$with_libiptc" = "xpkgconfig"
2085 CPPFLAGS="$SAVE_CPPFLAGS"
2087 if test "x$with_libiptc" = "xown"
2089 with_libiptc_cflags=""
2090 with_libiptc_libs=""
2092 if test "x$with_libiptc" = "xown"
2094 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
2096 with_libiptc="no (Linux iptables headers not found)"
2099 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
2102 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
2103 if test "x$with_libiptc" = "xown"
2105 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
2109 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2110 if test "x$with_libiptc" = "xyes"
2112 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2113 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2114 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2115 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2120 with_java_home="$JAVA_HOME"
2121 if test "x$with_java_home" = "x"
2123 with_java_home="/usr/lib/jvm"
2125 with_java_vmtype="client"
2130 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2132 if test "x$withval" = "xno"
2135 else if test "x$withval" = "xyes"
2139 with_java_home="$withval"
2144 if test "x$with_java" = "xyes"
2146 if test -d "$with_java_home"
2148 AC_MSG_CHECKING([for jni.h])
2149 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2150 if test "x$TMPVAR" != "x"
2152 AC_MSG_RESULT([found in $TMPVAR])
2153 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2155 AC_MSG_RESULT([not found])
2158 AC_MSG_CHECKING([for jni_md.h])
2159 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2160 if test "x$TMPVAR" != "x"
2162 AC_MSG_RESULT([found in $TMPVAR])
2163 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2165 AC_MSG_RESULT([not found])
2168 AC_MSG_CHECKING([for libjvm.so])
2169 TMPVAR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2170 if test "x$TMPVAR" != "x"
2172 AC_MSG_RESULT([found in $TMPVAR])
2173 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2175 AC_MSG_RESULT([not found])
2178 if test "x$JAVAC" = "x"
2180 AC_MSG_CHECKING([for javac])
2181 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2182 if test "x$TMPVAR" != "x"
2185 AC_MSG_RESULT([$JAVAC])
2187 AC_MSG_RESULT([not found])
2190 if test "x$JAR" = "x"
2192 AC_MSG_CHECKING([for jar])
2193 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2194 if test "x$TMPVAR" != "x"
2197 AC_MSG_RESULT([$JAR])
2199 AC_MSG_RESULT([not found])
2202 else if test "x$with_java_home" != "x"
2204 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2208 if test "x$JAVA_CPPFLAGS" != "x"
2210 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2212 if test "x$JAVA_CFLAGS" != "x"
2214 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2216 if test "x$JAVA_LDFLAGS" != "x"
2218 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2220 if test "x$JAVAC" = "x"
2222 with_javac_path="$PATH"
2223 if test "x$with_java_home" != "x"
2225 with_javac_path="$with_java_home:with_javac_path"
2226 if test -d "$with_java_home/bin"
2228 with_javac_path="$with_java_home/bin:with_javac_path"
2232 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2234 if test "x$JAVAC" = "x"
2236 with_java="no (javac not found)"
2238 if test "x$JAR" = "x"
2240 with_jar_path="$PATH"
2241 if test "x$with_java_home" != "x"
2243 with_jar_path="$with_java_home:$with_jar_path"
2244 if test -d "$with_java_home/bin"
2246 with_jar_path="$with_java_home/bin:$with_jar_path"
2250 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2252 if test "x$JAR" = "x"
2254 with_java="no (jar not found)"
2257 SAVE_CPPFLAGS="$CPPFLAGS"
2258 SAVE_CFLAGS="$CFLAGS"
2259 SAVE_LDFLAGS="$LDFLAGS"
2260 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2261 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2262 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2264 if test "x$with_java" = "xyes"
2266 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2268 if test "x$with_java" = "xyes"
2270 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2272 [with_java="no (libjvm not found)"],
2275 if test "x$with_java" = "xyes"
2277 JAVA_LIBS="$JAVA_LIBS -ljvm"
2278 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2281 CPPFLAGS="$SAVE_CPPFLAGS"
2282 CFLAGS="$SAVE_CFLAGS"
2283 LDFLAGS="$SAVE_LDFLAGS"
2285 AC_SUBST(JAVA_CPPFLAGS)
2286 AC_SUBST(JAVA_CFLAGS)
2287 AC_SUBST(JAVA_LDFLAGS)
2289 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2292 # --with-liblvm2app {{{
2293 with_liblvm2app_cppflags=""
2294 with_liblvm2app_ldflags=""
2295 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2297 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2299 with_liblvm2app_cppflags="-I$withval/include"
2300 with_liblvm2app_ldflags="-L$withval/lib"
2301 with_liblvm2app="yes"
2303 with_liblvm2app="$withval"
2307 with_liblvm2app="yes"
2309 if test "x$with_liblvm2app" = "xyes"
2311 SAVE_CPPFLAGS="$CPPFLAGS"
2312 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2314 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2316 CPPFLAGS="$SAVE_CPPFLAGS"
2319 if test "x$with_liblvm2app" = "xyes"
2321 SAVE_CPPFLAGS="$CPPFLAGS"
2322 SAVE_LDFLAGS="$LDFLAGS"
2323 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2324 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2326 AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2328 CPPFLAGS="$SAVE_CPPFLAGS"
2329 LDFLAGS="$SAVE_LDFLAGS"
2331 if test "x$with_liblvm2app" = "xyes"
2333 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2334 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2335 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2336 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2337 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2338 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2339 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2341 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2344 # --with-libmemcached {{{
2345 with_libmemcached_cppflags=""
2346 with_libmemcached_ldflags=""
2347 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2349 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2351 with_libmemcached_cppflags="-I$withval/include"
2352 with_libmemcached_ldflags="-L$withval/lib"
2353 with_libmemcached="yes"
2355 with_libmemcached="$withval"
2359 with_libmemcached="yes"
2361 if test "x$with_libmemcached" = "xyes"
2363 SAVE_CPPFLAGS="$CPPFLAGS"
2364 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2366 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2368 CPPFLAGS="$SAVE_CPPFLAGS"
2370 if test "x$with_libmemcached" = "xyes"
2372 SAVE_CPPFLAGS="$CPPFLAGS"
2373 SAVE_LDFLAGS="$LDFLAGS"
2374 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2375 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2377 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2379 CPPFLAGS="$SAVE_CPPFLAGS"
2380 LDFLAGS="$SAVE_LDFLAGS"
2382 if test "x$with_libmemcached" = "xyes"
2384 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2385 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2386 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2387 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2388 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2389 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2390 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2392 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2395 # --with-libmodbus {{{
2396 with_libmodbus_config=""
2397 with_libmodbus_cflags=""
2398 with_libmodbus_libs=""
2399 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2401 if test "x$withval" = "xno"
2404 else if test "x$withval" = "xyes"
2406 with_libmodbus="use_pkgconfig"
2407 else if test -d "$with_libmodbus/lib"
2409 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2410 with_libmodbus_cflags="-I$withval/include"
2411 with_libmodbus_libs="-L$withval/lib -lmodbus"
2412 with_libmodbus="yes"
2415 [with_libmodbus="use_pkgconfig"])
2417 # configure using pkg-config
2418 if test "x$with_libmodbus" = "xuse_pkgconfig"
2420 if test "x$PKG_CONFIG" = "x"
2422 with_libmodbus="no (Don't have pkg-config)"
2425 if test "x$with_libmodbus" = "xuse_pkgconfig"
2427 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2428 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2431 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2434 if test "x$with_libmodbus" = "xuse_pkgconfig"
2436 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2439 with_libmodbus="no ($PKG_CONFIG failed)"
2441 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2444 with_libmodbus="no ($PKG_CONFIG failed)"
2447 if test "x$with_libmodbus" = "xuse_pkgconfig"
2449 with_libmodbus="yes"
2452 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2453 # the actual checks.
2454 if test "x$with_libmodbus" = "xyes"
2456 SAVE_CPPFLAGS="$CPPFLAGS"
2457 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2459 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2461 CPPFLAGS="$SAVE_CPPFLAGS"
2463 if test "x$with_libmodbus" = "xyes"
2465 SAVE_CPPFLAGS="$CPPFLAGS"
2466 SAVE_LDFLAGS="$LDFLAGS"
2468 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2469 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2471 AC_CHECK_LIB(modbus, modbus_connect,
2472 [with_libmodbus="yes"],
2473 [with_libmodbus="no (symbol modbus_connect not found)"])
2475 CPPFLAGS="$SAVE_CPPFLAGS"
2476 LDFLAGS="$SAVE_LDFLAGS"
2478 if test "x$with_libmodbus" = "xyes"
2480 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2481 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2482 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2483 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2487 # --with-libmongoc {{{
2488 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2490 if test "x$withval" = "xyes"
2492 with_libmongoc="yes"
2493 else if test "x$withval" = "xno"
2497 with_libmongoc="yes"
2498 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2499 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2502 [with_libmongoc="yes"])
2504 SAVE_CPPFLAGS="$CPPFLAGS"
2505 SAVE_LDFLAGS="$LDFLAGS"
2507 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2508 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2510 if test "x$with_libmongoc" = "xyes"
2512 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2514 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2516 AC_CHECK_HEADERS(mongo.h,
2517 [with_libmongoc="yes"],
2518 [with_libmongoc="no ('mongo.h' not found)"],
2520 # define MONGO_HAVE_STDINT 1
2522 # define MONGO_USE_LONG_LONG_INT 1
2526 if test "x$with_libmongoc" = "xyes"
2528 if test "x$LIBMONGOC_LDFLAGS" != "x"
2530 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2532 AC_CHECK_LIB(mongoc, mongo_run_command,
2533 [with_libmongoc="yes"],
2534 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2537 CPPFLAGS="$SAVE_CPPFLAGS"
2538 LDFLAGS="$SAVE_LDFLAGS"
2540 if test "x$with_libmongoc" = "xyes"
2542 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2543 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2544 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2545 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2547 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2550 # --with-libmysql {{{
2551 with_mysql_config="mysql_config"
2552 with_mysql_cflags=""
2554 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2556 if test "x$withval" = "xno"
2559 else if test "x$withval" = "xyes"
2563 if test -f "$withval" && test -x "$withval";
2565 with_mysql_config="$withval"
2566 else if test -x "$withval/bin/mysql_config"
2568 with_mysql_config="$withval/bin/mysql_config"
2576 if test "x$with_libmysql" = "xyes"
2578 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2579 mysql_config_status=$?
2581 if test $mysql_config_status -ne 0
2583 with_libmysql="no ($with_mysql_config failed)"
2585 SAVE_CPPFLAGS="$CPPFLAGS"
2586 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2589 have_mysql_mysql_h="no"
2590 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2592 if test "x$have_mysql_h" = "xno"
2594 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2597 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2599 with_libmysql="no (mysql.h not found)"
2602 CPPFLAGS="$SAVE_CPPFLAGS"
2605 if test "x$with_libmysql" = "xyes"
2607 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2608 mysql_config_status=$?
2610 if test $mysql_config_status -ne 0
2612 with_libmysql="no ($with_mysql_config failed)"
2614 AC_CHECK_LIB(mysqlclient, mysql_init,
2615 [with_libmysql="yes"],
2616 [with_libmysql="no (symbol 'mysql_init' not found)"],
2619 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2620 [with_libmysql="yes"],
2621 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2625 if test "x$with_libmysql" = "xyes"
2627 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2628 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2629 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2630 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2632 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2636 with_libmnl_cflags=""
2638 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
2640 echo "libmnl: withval = $withval"
2641 if test "x$withval" = "xyes"
2644 else if test "x$withval" = "xno"
2648 if test -d "$withval/include"
2650 with_libmnl_cflags="-I$withval/include"
2651 with_libmnl_libs="-L$withval/lib -lmnl"
2654 AC_MSG_ERROR("no such directory: $withval/include")
2659 if test "x$ac_system" = "xLinux"
2663 with_libmnl="no (Linux only library)"
2666 if test "x$PKG_CONFIG" = "x"
2668 with_libmnl="no (Don't have pkg-config)"
2670 if test "x$with_libmnl" = "xyes"
2672 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
2673 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
2674 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
2677 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
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>])
2688 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2690 #include <sys/types.h>
2691 #include <asm/types.h>
2692 #include <sys/socket.h>])
2694 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2697 #include <sys/types.h>
2698 #include <asm/types.h>
2699 #include <sys/socket.h>
2700 #include <linux/netlink.h>
2701 #include <linux/rtnetlink.h>
2704 int retval = TCA_STATS2;
2708 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2710 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2713 #include <sys/types.h>
2714 #include <asm/types.h>
2715 #include <sys/socket.h>
2716 #include <linux/netlink.h>
2717 #include <linux/rtnetlink.h>
2720 int retval = TCA_STATS;
2724 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2726 if test "x$with_libmnl" = "xyes"
2728 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
2729 [with_libmnl="yes"],
2730 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
2731 [$with_libmnl_libs])
2733 if test "x$with_libmnl" = "xyes"
2735 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
2736 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
2737 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
2738 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
2739 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
2741 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
2744 # --with-libnetapp {{{
2745 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2746 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2747 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2748 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2749 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2750 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2751 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2753 if test -d "$withval"
2755 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2756 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2757 with_libnetapp="yes"
2759 with_libnetapp="$withval"
2763 with_libnetapp="yes"
2766 SAVE_CPPFLAGS="$CPPFLAGS"
2767 SAVE_LDFLAGS="$LDFLAGS"
2768 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2769 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2771 if test "x$with_libnetapp" = "xyes"
2773 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2775 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2777 AC_CHECK_HEADERS(netapp_api.h,
2778 [with_libnetapp="yes"],
2779 [with_libnetapp="no (netapp_api.h not found)"])
2782 if test "x$with_libnetapp" = "xyes"
2784 if test "x$LIBNETAPP_LDFLAGS" != "x"
2786 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2789 if test "x$LIBNETAPP_LIBS" = "x"
2791 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2793 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2795 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2796 [with_libnetapp="yes"],
2797 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2799 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2802 CPPFLAGS="$SAVE_CPPFLAGS"
2803 LDFLAGS="$SAVE_LDFLAGS"
2805 if test "x$with_libnetapp" = "xyes"
2807 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2810 AC_SUBST(LIBNETAPP_CPPFLAGS)
2811 AC_SUBST(LIBNETAPP_LDFLAGS)
2812 AC_SUBST(LIBNETAPP_LIBS)
2813 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2816 # --with-libnetsnmp {{{
2817 with_snmp_config="net-snmp-config"
2820 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2822 if test "x$withval" = "xno"
2824 with_libnetsnmp="no"
2825 else if test "x$withval" = "xyes"
2827 with_libnetsnmp="yes"
2829 if test -x "$withval"
2831 with_snmp_config="$withval"
2832 with_libnetsnmp="yes"
2834 with_snmp_config="$withval/bin/net-snmp-config"
2835 with_libnetsnmp="yes"
2839 [with_libnetsnmp="yes"])
2840 if test "x$with_libnetsnmp" = "xyes"
2842 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2843 snmp_config_status=$?
2845 if test $snmp_config_status -ne 0
2847 with_libnetsnmp="no ($with_snmp_config failed)"
2849 SAVE_CPPFLAGS="$CPPFLAGS"
2850 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2852 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2854 CPPFLAGS="$SAVE_CPPFLAGS"
2857 if test "x$with_libnetsnmp" = "xyes"
2859 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2860 snmp_config_status=$?
2862 if test $snmp_config_status -ne 0
2864 with_libnetsnmp="no ($with_snmp_config failed)"
2866 AC_CHECK_LIB(netsnmp, init_snmp,
2867 [with_libnetsnmp="yes"],
2868 [with_libnetsnmp="no (libnetsnmp not found)"],
2872 if test "x$with_libnetsnmp" = "xyes"
2874 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2875 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2876 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2877 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2879 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2882 # --with-liboconfig {{{
2883 with_own_liboconfig="no"
2884 liboconfig_LDFLAGS="$LDFLAGS"
2885 liboconfig_CPPFLAGS="$CPPFLAGS"
2886 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2888 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2890 if test -d "$withval/lib"
2892 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2894 if test -d "$withval/include"
2896 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2899 if test "x$withval" = "xno"
2901 AC_MSG_ERROR("liboconfig is required")
2905 with_liboconfig="yes"
2908 save_LDFLAGS="$LDFLAGS"
2909 save_CPPFLAGS="$CPPFLAGS"
2910 LDFLAGS="$liboconfig_LDFLAGS"
2911 CPPFLAGS="$liboconfig_CPPFLAGS"
2912 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2914 with_liboconfig="yes"
2915 with_own_liboconfig="no"
2918 with_liboconfig="yes"
2919 with_own_liboconfig="yes"
2920 LDFLAGS="$save_LDFLAGS"
2921 CPPFLAGS="$save_CPPFLAGS"
2924 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2925 if test "x$with_own_liboconfig" = "xyes"
2927 with_liboconfig="yes (shipped version)"
2931 # --with-liboping {{{
2932 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2934 if test "x$withval" = "xyes"
2937 else if test "x$withval" = "xno"
2942 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2943 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2946 [with_liboping="yes"])
2948 SAVE_CPPFLAGS="$CPPFLAGS"
2949 SAVE_LDFLAGS="$LDFLAGS"
2951 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2952 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2954 if test "x$with_liboping" = "xyes"
2956 if test "x$LIBOPING_CPPFLAGS" != "x"
2958 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2960 AC_CHECK_HEADERS(oping.h,
2961 [with_liboping="yes"],
2962 [with_liboping="no (oping.h not found)"])
2964 if test "x$with_liboping" = "xyes"
2966 if test "x$LIBOPING_LDFLAGS" != "x"
2968 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2970 AC_CHECK_LIB(oping, ping_construct,
2971 [with_liboping="yes"],
2972 [with_liboping="no (symbol 'ping_construct' not found)"])
2975 CPPFLAGS="$SAVE_CPPFLAGS"
2976 LDFLAGS="$SAVE_LDFLAGS"
2978 if test "x$with_liboping" = "xyes"
2980 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2981 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2982 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2983 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2985 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2989 with_oracle_cppflags=""
2991 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2993 if test "x$withval" = "xyes"
2995 if test "x$ORACLE_HOME" = "x"
2997 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3000 else if test "x$withval" = "xno"
3005 ORACLE_HOME="$withval"
3009 if test "x$ORACLE_HOME" = "x"
3011 with_oracle="no (ORACLE_HOME is not set)"
3016 if test "x$ORACLE_HOME" != "x"
3018 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3020 if test -e "$ORACLE_HOME/lib/ldflags"
3022 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3024 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3025 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3027 if test "x$with_oracle" = "xyes"
3029 SAVE_CPPFLAGS="$CPPFLAGS"
3030 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3032 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3034 CPPFLAGS="$SAVE_CPPFLAGS"
3036 if test "x$with_oracle" = "xyes"
3038 SAVE_CPPFLAGS="$CPPFLAGS"
3040 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3041 LIBS="$LIBS $with_oracle_libs"
3043 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3045 CPPFLAGS="$SAVE_CPPFLAGS"
3048 if test "x$with_oracle" = "xyes"
3050 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
3051 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3052 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
3053 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3057 # --with-libowcapi {{{
3058 with_libowcapi_cppflags=""
3059 with_libowcapi_libs="-lowcapi"
3060 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3062 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3064 with_libowcapi_cppflags="-I$withval/include"
3065 with_libowcapi_libs="-L$withval/lib -lowcapi"
3066 with_libowcapi="yes"
3068 with_libowcapi="$withval"
3072 with_libowcapi="yes"
3074 if test "x$with_libowcapi" = "xyes"
3076 SAVE_CPPFLAGS="$CPPFLAGS"
3077 CPPFLAGS="$with_libowcapi_cppflags"
3079 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3081 CPPFLAGS="$SAVE_CPPFLAGS"
3083 if test "x$with_libowcapi" = "xyes"
3085 SAVE_LDFLAGS="$LDFLAGS"
3086 SAVE_CPPFLAGS="$CPPFLAGS"
3087 LDFLAGS="$with_libowcapi_libs"
3088 CPPFLAGS="$with_libowcapi_cppflags"
3090 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3092 LDFLAGS="$SAVE_LDFLAGS"
3093 CPPFLAGS="$SAVE_CPPFLAGS"
3095 if test "x$with_libowcapi" = "xyes"
3097 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3098 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3099 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3100 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3104 # --with-libpcap {{{
3105 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3107 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3109 LDFLAGS="$LDFLAGS -L$withval/lib"
3110 CPPFLAGS="$CPPFLAGS -I$withval/include"
3113 with_libpcap="$withval"
3119 if test "x$with_libpcap" = "xyes"
3121 AC_CHECK_LIB(pcap, pcap_open_live,
3123 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3124 ], [with_libpcap="no (libpcap not found)"])
3126 if test "x$with_libpcap" = "xyes"
3128 AC_CHECK_HEADERS(pcap.h,,
3129 [with_libpcap="no (pcap.h not found)"])
3131 if test "x$with_libpcap" = "xyes"
3133 AC_CHECK_HEADERS(pcap-bpf.h,,
3134 [with_libpcap="no (pcap-bpf.h not found)"])
3136 if test "x$with_libpcap" = "xyes"
3138 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3139 [c_cv_libpcap_have_pcap_error_iface_not_up],
3140 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3145 int val = PCAP_ERROR_IFACE_NOT_UP;
3149 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3150 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3152 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3154 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3156 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3159 # --with-libperl {{{
3160 perl_interpreter="perl"
3161 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3163 if test -f "$withval" && test -x "$withval"
3165 perl_interpreter="$withval"
3167 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3169 LDFLAGS="$LDFLAGS -L$withval/lib"
3170 CPPFLAGS="$CPPFLAGS -I$withval/include"
3171 perl_interpreter="$withval/bin/perl"
3174 with_libperl="$withval"
3181 AC_MSG_CHECKING([for perl])
3182 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3183 if test -x "$perl_interpreter"
3185 AC_MSG_RESULT([yes ($perl_interpreter)])
3191 AC_SUBST(PERL, "$perl_interpreter")
3193 if test "x$with_libperl" = "xyes" \
3194 && test -n "$perl_interpreter"
3196 SAVE_CFLAGS="$CFLAGS"
3198 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3199 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3200 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3201 CFLAGS="$CFLAGS $PERL_CFLAGS"
3202 LIBS="$LIBS $PERL_LIBS"
3204 AC_CACHE_CHECK([for libperl],
3205 [c_cv_have_libperl],
3206 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3208 #define PERL_NO_GET_CONTEXT
3215 load_module (PERL_LOADMOD_NOIMPORT,
3216 newSVpv ("Collectd::Plugin::FooBar", 24),
3220 [c_cv_have_libperl="yes"],
3221 [c_cv_have_libperl="no"]
3225 if test "x$c_cv_have_libperl" = "xyes"
3227 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3228 AC_SUBST(PERL_CFLAGS)
3234 CFLAGS="$SAVE_CFLAGS"
3236 else if test -z "$perl_interpreter"; then
3237 with_libperl="no (no perl interpreter found)"
3238 c_cv_have_libperl="no"
3240 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3242 if test "x$with_libperl" = "xyes"
3244 SAVE_CFLAGS="$CFLAGS"
3246 CFLAGS="$CFLAGS $PERL_CFLAGS"
3247 LIBS="$LIBS $PERL_LIBS"
3249 AC_CACHE_CHECK([if perl supports ithreads],
3250 [c_cv_have_perl_ithreads],
3251 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3257 #if !defined(USE_ITHREADS)
3258 # error "Perl does not support ithreads!"
3259 #endif /* !defined(USE_ITHREADS) */
3263 [c_cv_have_perl_ithreads="yes"],
3264 [c_cv_have_perl_ithreads="no"]
3268 if test "x$c_cv_have_perl_ithreads" = "xyes"
3270 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3273 CFLAGS="$SAVE_CFLAGS"
3277 if test "x$with_libperl" = "xyes"
3279 SAVE_CFLAGS="$CFLAGS"
3281 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3282 # (see issues #41 and #42)
3283 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3284 LIBS="$LIBS $PERL_LIBS"
3286 AC_CACHE_CHECK([for broken Perl_load_module()],
3287 [c_cv_have_broken_perl_load_module],
3288 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3290 #define PERL_NO_GET_CONTEXT
3297 load_module (PERL_LOADMOD_NOIMPORT,
3298 newSVpv ("Collectd::Plugin::FooBar", 24),
3302 [c_cv_have_broken_perl_load_module="no"],
3303 [c_cv_have_broken_perl_load_module="yes"]
3307 CFLAGS="$SAVE_CFLAGS"
3310 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3311 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3313 if test "x$with_libperl" = "xyes"
3315 SAVE_CFLAGS="$CFLAGS"
3317 CFLAGS="$CFLAGS $PERL_CFLAGS"
3318 LIBS="$LIBS $PERL_LIBS"
3321 [struct mgvtbl.svt_local],
3322 [have_struct_mgvtbl_svt_local="yes"],
3323 [have_struct_mgvtbl_svt_local="no"],
3330 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3332 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3333 [Define if Perl's struct mgvtbl has member svt_local.])
3336 CFLAGS="$SAVE_CFLAGS"
3342 with_pg_config="pg_config"
3343 with_libpq_includedir=""
3344 with_libpq_libdir=""
3345 with_libpq_cppflags=""
3346 with_libpq_ldflags=""
3347 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3350 if test "x$withval" = "xno"
3353 else if test "x$withval" = "xyes"
3357 if test -f "$withval" && test -x "$withval";
3359 with_pg_config="$withval"
3360 else if test -x "$withval/bin/pg_config"
3362 with_pg_config="$withval/bin/pg_config"
3370 if test "x$with_libpq" = "xyes"
3372 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3375 if test $pg_config_status -eq 0
3377 if test -n "$with_libpq_includedir"; then
3378 for dir in $with_libpq_includedir; do
3379 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3383 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3386 SAVE_CPPFLAGS="$CPPFLAGS"
3387 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3389 AC_CHECK_HEADERS(libpq-fe.h, [],
3390 [with_libpq="no (libpq-fe.h not found)"], [])
3392 CPPFLAGS="$SAVE_CPPFLAGS"
3394 if test "x$with_libpq" = "xyes"
3396 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3399 if test $pg_config_status -eq 0
3401 if test -n "$with_libpq_libdir"; then
3402 for dir in $with_libpq_libdir; do
3403 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3407 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3410 SAVE_LDFLAGS="$LDFLAGS"
3411 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3413 AC_CHECK_LIB(pq, PQconnectdb,
3415 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3417 AC_CHECK_LIB(pq, PQserverVersion,
3419 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3421 LDFLAGS="$SAVE_LDFLAGS"
3423 if test "x$with_libpq" = "xyes"
3425 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3426 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3427 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3428 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3430 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3433 # --with-libpthread {{{
3434 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3435 [ if test "x$withval" != "xno" \
3436 && test "x$withval" != "xyes"
3438 LDFLAGS="$LDFLAGS -L$withval/lib"
3439 CPPFLAGS="$CPPFLAGS -I$withval/include"
3440 with_libpthread="yes"
3442 if test "x$withval" = "xno"
3444 with_libpthread="no (disabled)"
3447 ], [with_libpthread="yes"])
3448 if test "x$with_libpthread" = "xyes"
3450 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3453 if test "x$with_libpthread" = "xyes"
3455 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3457 if test "x$with_libpthread" = "xyes"
3463 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3464 [Wether or not to use pthread (POSIX threads) library])
3465 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3470 with_python_path="$PATH"
3471 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3473 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3475 with_python="$withval"
3476 else if test -x "$withval"
3478 with_python_prog="$withval"
3479 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3481 else if test -d "$withval"
3483 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3486 AC_MSG_WARN([Argument not recognized: $withval])
3488 ], [with_python="yes"])
3491 SAVE_CPPFLAGS="$CPPFLAGS"
3492 SAVE_LDFLAGS="$LDFLAGS"
3495 PATH="$with_python_path"
3497 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3499 AC_MSG_CHECKING([for python])
3500 with_python_prog="`which python 2>/dev/null`"
3501 if test "x$with_python_prog" = "x"
3503 AC_MSG_RESULT([not found])
3504 with_python="no (interpreter not found)"
3506 AC_MSG_RESULT([$with_python_prog])
3510 if test "x$with_python" = "xyes"
3512 AC_MSG_CHECKING([for Python CPPFLAGS])
3513 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3514 python_config_status=$?
3516 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3518 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3521 AC_MSG_RESULT([$python_include_path])
3525 if test "x$with_python" = "xyes"
3527 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3528 AC_CHECK_HEADERS(Python.h,
3529 [with_python="yes"],
3530 [with_python="no ('Python.h' not found)"])
3533 if test "x$with_python" = "xyes"
3535 AC_MSG_CHECKING([for Python LDFLAGS])
3536 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`
3537 python_config_status=$?
3539 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3541 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3544 AC_MSG_RESULT([$python_library_path])
3548 if test "x$with_python" = "xyes"
3550 AC_MSG_CHECKING([for Python LIBS])
3551 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`
3552 python_config_status=$?
3554 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3556 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3559 AC_MSG_RESULT([$python_library_flags])
3563 if test "x$with_python" = "xyes"
3565 LDFLAGS="-L$python_library_path $LDFLAGS"
3566 LIBS="$python_library_flags $LIBS"
3568 AC_CHECK_FUNC(PyObject_CallFunction,
3569 [with_python="yes"],
3570 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3574 CPPFLAGS="$SAVE_CPPFLAGS"
3575 LDFLAGS="$SAVE_LDFLAGS"
3578 if test "x$with_python" = "xyes"
3580 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3581 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3582 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3583 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3584 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3585 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3589 # --with-librabbitmq {{{
3590 with_librabbitmq_cppflags=""
3591 with_librabbitmq_ldflags=""
3592 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3594 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3596 with_librabbitmq_cppflags="-I$withval/include"
3597 with_librabbitmq_ldflags="-L$withval/lib"
3598 with_librabbitmq="yes"
3600 with_librabbitmq="$withval"
3604 with_librabbitmq="yes"
3606 SAVE_CPPFLAGS="$CPPFLAGS"
3607 SAVE_LDFLAGS="$LDFLAGS"
3608 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3609 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3610 if test "x$with_librabbitmq" = "xyes"
3612 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3614 if test "x$with_librabbitmq" = "xyes"
3616 # librabbitmq up to version 0.9.1 provides "library_errno", later
3617 # versions use "library_error". The library does not provide a version
3618 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3619 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3622 # include <stdlib.h>
3628 # include <stdint.h>
3631 # include <inttypes.h>
3636 if test "x$with_librabbitmq" = "xyes"
3638 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3640 if test "x$with_librabbitmq" = "xyes"
3642 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3643 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3644 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3645 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3646 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3647 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3648 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3650 CPPFLAGS="$SAVE_CPPFLAGS"
3651 LDFLAGS="$SAVE_LDFLAGS"
3652 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3654 with_amqp_tcp_socket="no"
3655 if test "x$with_librabbitmq" = "xyes"
3657 SAVE_CPPFLAGS="$CPPFLAGS"
3658 SAVE_LDFLAGS="$LDFLAGS"
3660 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3661 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3664 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
3665 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
3666 if test "x$with_amqp_tcp_socket" = "xyes"
3668 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
3669 [Define if librabbitmq provides the new TCP socket interface.])
3672 AC_CHECK_DECLS(amqp_socket_close,
3673 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
3676 #ifdef HAVE_AMQP_TCP_SOCKET_H
3677 # include <amqp_tcp_socket.h>
3679 #ifdef HAVE_AMQP_SOCKET_H
3680 # include <amqp_socket.h>
3684 CPPFLAGS="$SAVE_CPPFLAGS"
3685 LDFLAGS="$SAVE_LDFLAGS"
3690 # --with-librouteros {{{
3691 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3693 if test "x$withval" = "xyes"
3695 with_librouteros="yes"
3696 else if test "x$withval" = "xno"
3698 with_librouteros="no"
3700 with_librouteros="yes"
3701 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3702 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3705 [with_librouteros="yes"])
3707 SAVE_CPPFLAGS="$CPPFLAGS"
3708 SAVE_LDFLAGS="$LDFLAGS"
3710 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3711 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3713 if test "x$with_librouteros" = "xyes"
3715 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3717 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3719 AC_CHECK_HEADERS(routeros_api.h,
3720 [with_librouteros="yes"],
3721 [with_librouteros="no (routeros_api.h not found)"])
3723 if test "x$with_librouteros" = "xyes"
3725 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3727 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3729 AC_CHECK_LIB(routeros, ros_interface,
3730 [with_librouteros="yes"],
3731 [with_librouteros="no (symbol 'ros_interface' not found)"])
3734 CPPFLAGS="$SAVE_CPPFLAGS"
3735 LDFLAGS="$SAVE_LDFLAGS"
3737 if test "x$with_librouteros" = "xyes"
3739 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3740 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3741 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3742 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3744 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3748 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3751 librrd_threadsafe="yes"
3752 librrd_rrdc_update="no"
3753 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3754 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3756 librrd_cflags="-I$withval/include"
3757 librrd_ldflags="-L$withval/lib"
3760 with_librrd="$withval"
3762 ], [with_librrd="yes"])
3763 if test "x$with_librrd" = "xyes"
3765 SAVE_CPPFLAGS="$CPPFLAGS"
3766 SAVE_LDFLAGS="$LDFLAGS"
3768 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3769 LDFLAGS="$LDFLAGS $librrd_ldflags"
3771 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3773 CPPFLAGS="$SAVE_CPPFLAGS"
3774 LDFLAGS="$SAVE_LDFLAGS"
3776 if test "x$with_librrd" = "xyes"
3778 SAVE_CPPFLAGS="$CPPFLAGS"
3779 SAVE_LDFLAGS="$LDFLAGS"
3781 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3782 LDFLAGS="$LDFLAGS $librrd_ldflags"
3784 AC_CHECK_LIB(rrd_th, rrd_update_r,
3786 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3788 [librrd_threadsafe="no"
3789 AC_CHECK_LIB(rrd, rrd_update,
3791 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3793 [with_librrd="no (symbol 'rrd_update' not found)"],
3798 if test "x$librrd_threadsafe" = "xyes"
3800 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3802 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3805 CPPFLAGS="$SAVE_CPPFLAGS"
3806 LDFLAGS="$SAVE_LDFLAGS"
3808 if test "x$with_librrd" = "xyes"
3810 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3811 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3812 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3813 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3815 if test "x$librrd_threadsafe" = "xyes"
3817 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3821 # --with-libsensors {{{
3822 with_sensors_cflags=""
3823 with_sensors_ldflags=""
3824 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3826 if test "x$withval" = "xno"
3828 with_libsensors="no"
3830 with_libsensors="yes"
3831 if test "x$withval" != "xyes"
3833 with_sensors_cflags="-I$withval/include"
3834 with_sensors_ldflags="-L$withval/lib"
3835 with_libsensors="yes"
3840 if test "x$ac_system" = "xLinux"
3842 with_libsensors="yes"
3844 with_libsensors="no (Linux only library)"
3847 if test "x$with_libsensors" = "xyes"
3849 SAVE_CPPFLAGS="$CPPFLAGS"
3850 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3852 # AC_CHECK_HEADERS(sensors/sensors.h,
3854 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3856 # [with_libsensors="no (sensors/sensors.h not found)"])
3857 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3859 CPPFLAGS="$SAVE_CPPFLAGS"
3861 if test "x$with_libsensors" = "xyes"
3863 SAVE_CPPFLAGS="$CPPFLAGS"
3864 SAVE_LDFLAGS="$LDFLAGS"
3865 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3866 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3868 AC_CHECK_LIB(sensors, sensors_init,
3870 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3872 [with_libsensors="no (libsensors not found)"])
3874 CPPFLAGS="$SAVE_CPPFLAGS"
3875 LDFLAGS="$SAVE_LDFLAGS"
3877 if test "x$with_libsensors" = "xyes"
3879 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3880 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3881 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3882 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3884 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3887 # --with-libsigrok {{{
3888 with_libsigrok_cflags=""
3889 with_libsigrok_ldflags=""
3890 AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
3892 if test "x$withval" = "xno"
3896 with_libsigrok="yes"
3897 if test "x$withval" != "xyes"
3899 with_libsigrok_cflags="-I$withval/include"
3900 with_libsigrok_ldflags="-L$withval/lib"
3903 ],[with_libsigrok="yes"])
3905 # libsigrok has a glib dependency
3906 if test "x$with_libsigrok" = "xyes"
3908 m4_ifdef([AM_PATH_GLIB_2_0],
3910 AM_PATH_GLIB_2_0([2.28.0],
3911 [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
3914 with_libsigrok="no (glib not available)"
3920 if test "x$with_libsigrok" = "xyes"
3922 SAVE_CPPFLAGS="$CPPFLAGS"
3923 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3925 AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
3927 CPPFLAGS="$SAVE_CPPFLAGS"
3931 if test "x$with_libsigrok" = "xyes"
3933 SAVE_CPPFLAGS="$CPPFLAGS"
3934 SAVE_LDFLAGS="$LDFLAGS"
3935 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3936 LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
3938 AC_CHECK_LIB(sigrok, sr_init,
3940 AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
3942 [with_libsigrok="no (libsigrok not found)"])
3944 CPPFLAGS="$SAVE_CPPFLAGS"
3945 LDFLAGS="$SAVE_LDFLAGS"
3947 if test "x$with_libsigrok" = "xyes"
3949 BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
3950 BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
3951 AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
3952 AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
3954 AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
3957 # --with-libstatgrab {{{
3958 with_libstatgrab_cflags=""
3959 with_libstatgrab_ldflags=""
3960 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3962 if test "x$withval" != "xno" \
3963 && test "x$withval" != "xyes"
3965 with_libstatgrab_cflags="-I$withval/include"
3966 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3967 with_libstatgrab="yes"
3968 with_libstatgrab_pkg_config="no"
3970 with_libstatgrab="$withval"
3971 with_libstatgrab_pkg_config="yes"
3975 with_libstatgrab="yes"
3976 with_libstatgrab_pkg_config="yes"
3979 if test "x$with_libstatgrab" = "xyes" \
3980 && test "x$with_libstatgrab_pkg_config" = "xyes"
3982 if test "x$PKG_CONFIG" != "x"
3984 AC_MSG_CHECKING([pkg-config for libstatgrab])
3986 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3989 with_libstatgrab_pkg_config="no"
3990 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3991 temp_result="not found"
3993 AC_MSG_RESULT([$temp_result])
3995 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3996 with_libstatgrab_pkg_config="no"
3997 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
4001 if test "x$with_libstatgrab" = "xyes" \
4002 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4003 && test "x$with_libstatgrab_cflags" = "x"
4005 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4006 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4009 with_libstatgrab_cflags="$temp_result"
4011 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4012 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4014 AC_MSG_RESULT([$temp_result])
4017 if test "x$with_libstatgrab" = "xyes" \
4018 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4019 && test "x$with_libstatgrab_ldflags" = "x"
4021 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4022 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4025 with_libstatgrab_ldflags="$temp_result"
4027 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4028 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4030 AC_MSG_RESULT([$temp_result])
4033 if test "x$with_libstatgrab" = "xyes"
4035 SAVE_CPPFLAGS="$CPPFLAGS"
4036 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4038 AC_CHECK_HEADERS(statgrab.h,
4039 [with_libstatgrab="yes"],
4040 [with_libstatgrab="no (statgrab.h not found)"])
4042 CPPFLAGS="$SAVE_CPPFLAGS"
4045 if test "x$with_libstatgrab" = "xyes"
4047 SAVE_CFLAGS="$CFLAGS"
4048 SAVE_LDFLAGS="$LDFLAGS"
4050 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4051 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4053 AC_CHECK_LIB(statgrab, sg_init,
4054 [with_libstatgrab="yes"],
4055 [with_libstatgrab="no (symbol sg_init not found)"])
4057 CFLAGS="$SAVE_CFLAGS"
4058 LDFLAGS="$SAVE_LDFLAGS"
4061 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4062 if test "x$with_libstatgrab" = "xyes"
4064 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4065 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4066 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4067 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4068 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4072 # --with-libtokyotyrant {{{
4073 with_libtokyotyrant_cppflags=""
4074 with_libtokyotyrant_ldflags=""
4075 with_libtokyotyrant_libs=""
4076 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4078 if test "x$withval" = "xno"
4080 with_libtokyotyrant="no"
4081 else if test "x$withval" = "xyes"
4083 with_libtokyotyrant="yes"
4085 with_libtokyotyrant_cppflags="-I$withval/include"
4086 with_libtokyotyrant_ldflags="-L$withval/include"
4087 with_libtokyotyrant_libs="-ltokyotyrant"
4088 with_libtokyotyrant="yes"
4092 with_libtokyotyrant="yes"
4095 if test "x$with_libtokyotyrant" = "xyes"
4097 if $PKG_CONFIG --exists tokyotyrant
4099 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4100 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4101 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4105 SAVE_CPPFLAGS="$CPPFLAGS"
4106 SAVE_LDFLAGS="$LDFLAGS"
4107 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4108 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4110 if test "x$with_libtokyotyrant" = "xyes"
4112 AC_CHECK_HEADERS(tcrdb.h,
4114 AC_DEFINE(HAVE_TCRDB_H, 1,
4115 [Define to 1 if you have the <tcrdb.h> header file.])
4116 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
4119 if test "x$with_libtokyotyrant" = "xyes"
4121 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
4123 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
4124 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
4126 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
4127 [$with_libtokyotyrant_libs])
4130 CPPFLAGS="$SAVE_CPPFLAGS"
4131 LDFLAGS="$SAVE_LDFLAGS"
4133 if test "x$with_libtokyotyrant" = "xyes"
4135 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
4136 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
4137 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
4138 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
4139 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
4140 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
4142 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
4145 # --with-libupsclient {{{
4146 with_libupsclient_config=""
4147 with_libupsclient_cflags=""
4148 with_libupsclient_libs=""
4149 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
4151 if test "x$withval" = "xno"
4153 with_libupsclient="no"
4154 else if test "x$withval" = "xyes"
4156 with_libupsclient="use_pkgconfig"
4158 if test -x "$withval"
4160 with_libupsclient_config="$withval"
4161 with_libupsclient="use_libupsclient_config"
4162 else if test -x "$withval/bin/libupsclient-config"
4164 with_libupsclient_config="$withval/bin/libupsclient-config"
4165 with_libupsclient="use_libupsclient_config"
4167 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
4168 with_libupsclient_cflags="-I$withval/include"
4169 with_libupsclient_libs="-L$withval/lib -lupsclient"
4170 with_libupsclient="yes"
4174 [with_libupsclient="use_pkgconfig"])
4176 # configure using libupsclient-config
4177 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4179 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
4180 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
4183 with_libupsclient="no ($with_libupsclient_config failed)"
4185 with_libupsclient_libs="`$with_libupsclient_config --libs`"
4188 with_libupsclient="no ($with_libupsclient_config failed)"
4191 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4193 with_libupsclient="yes"
4196 # configure using pkg-config
4197 if test "x$with_libupsclient" = "xuse_pkgconfig"
4199 if test "x$PKG_CONFIG" = "x"
4201 with_libupsclient="no (Don't have pkg-config)"
4204 if test "x$with_libupsclient" = "xuse_pkgconfig"
4206 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4207 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4210 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4213 if test "x$with_libupsclient" = "xuse_pkgconfig"
4215 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4218 with_libupsclient="no ($PKG_CONFIG failed)"
4220 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4223 with_libupsclient="no ($PKG_CONFIG failed)"
4226 if test "x$with_libupsclient" = "xuse_pkgconfig"
4228 with_libupsclient="yes"
4231 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4232 # the actual checks.
4233 if test "x$with_libupsclient" = "xyes"
4235 SAVE_CPPFLAGS="$CPPFLAGS"
4236 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4238 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4240 CPPFLAGS="$SAVE_CPPFLAGS"
4242 if test "x$with_libupsclient" = "xyes"
4244 SAVE_CPPFLAGS="$CPPFLAGS"
4245 SAVE_LDFLAGS="$LDFLAGS"
4247 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4248 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4250 AC_CHECK_LIB(upsclient, upscli_connect,
4251 [with_libupsclient="yes"],
4252 [with_libupsclient="no (symbol upscli_connect not found)"])
4254 CPPFLAGS="$SAVE_CPPFLAGS"
4255 LDFLAGS="$SAVE_LDFLAGS"
4257 if test "x$with_libupsclient" = "xyes"
4259 SAVE_CPPFLAGS="$CPPFLAGS"
4260 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4262 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4263 [#include <stdlib.h>
4265 #include <upsclient.h>])
4267 CPPFLAGS="$SAVE_CPPFLAGS"
4269 if test "x$with_libupsclient" = "xyes"
4271 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4272 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4273 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4274 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4278 # --with-libxmms {{{
4279 with_xmms_config="xmms-config"
4282 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4284 if test "x$withval" != "xno" \
4285 && test "x$withval" != "xyes"
4287 if test -f "$withval" && test -x "$withval";
4289 with_xmms_config="$withval"
4290 else if test -x "$withval/bin/xmms-config"
4292 with_xmms_config="$withval/bin/xmms-config"
4295 else if test "x$withval" = "xno"
4305 if test "x$with_libxmms" = "xyes"
4307 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4308 xmms_config_status=$?
4310 if test $xmms_config_status -ne 0
4315 if test "x$with_libxmms" = "xyes"
4317 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4318 xmms_config_status=$?
4320 if test $xmms_config_status -ne 0
4325 if test "x$with_libxmms" = "xyes"
4327 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4329 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4330 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4331 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4332 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4339 with_libxmms_numeric=0
4340 if test "x$with_libxmms" = "xyes"
4342 with_libxmms_numeric=1
4344 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4345 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4348 # --with-libyajl {{{
4349 with_libyajl_cppflags=""
4350 with_libyajl_ldflags=""
4351 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4353 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4355 with_libyajl_cppflags="-I$withval/include"
4356 with_libyajl_ldflags="-L$withval/lib"
4359 with_libyajl="$withval"
4365 if test "x$with_libyajl" = "xyes"
4367 SAVE_CPPFLAGS="$CPPFLAGS"
4368 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4370 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4371 AC_CHECK_HEADERS(yajl/yajl_version.h)
4373 CPPFLAGS="$SAVE_CPPFLAGS"
4375 if test "x$with_libyajl" = "xyes"
4377 SAVE_CPPFLAGS="$CPPFLAGS"
4378 SAVE_LDFLAGS="$LDFLAGS"
4379 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4380 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4382 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4384 CPPFLAGS="$SAVE_CPPFLAGS"
4385 LDFLAGS="$SAVE_LDFLAGS"
4387 if test "x$with_libyajl" = "xyes"
4389 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4390 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4391 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4392 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4393 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4394 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4395 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4397 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4401 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
4402 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
4404 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
4406 if test "x$withval" = "xno"
4409 else if test "x$withval" = "xyes"
4412 else if test -d "$with_mic/lib"
4414 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
4415 with_mic_cflags="-I$withval/include"
4416 with_mic_ldpath="-L$withval/lib/Linux"
4417 with_mic_libs="-lMicAccessSDK -lscif -lpthread"
4422 if test "x$with_mic" = "xyes"
4424 SAVE_CPPFLAGS="$CPPFLAGS"
4425 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4426 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
4427 CPPFLAGS="$SAVE_CPPFLAGS"
4429 if test "x$with_mic" = "xyes"
4431 SAVE_CPPFLAGS="$CPPFLAGS"
4432 SAVE_LDFLAGS="$LDFLAGS"
4434 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4435 LDFLAGS="$LDFLAGS $with_mic_ldpath"
4437 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
4438 [with_mic_ldpath="$with_mic_ldpath"
4439 with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
4440 [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
4442 CPPFLAGS="$SAVE_CPPFLAGS"
4443 LDFLAGS="$SAVE_LDFLAGS"
4446 if test "x$with_mic" = "xyes"
4448 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
4449 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
4450 BUILD_WITH_MIC_LDADD="$with_mic_libs"
4451 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
4452 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
4453 AC_SUBST(BUILD_WITH_MIC_LDADD)
4457 # --with-libvarnish {{{
4458 with_libvarnish_cppflags=""
4459 with_libvarnish_cflags=""
4460 with_libvarnish_libs=""
4461 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4463 if test "x$withval" = "xno"
4465 with_libvarnish="no"
4466 else if test "x$withval" = "xyes"
4468 with_libvarnish="use_pkgconfig"
4469 else if test -d "$with_libvarnish/lib"
4471 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4472 with_libvarnish_cflags="-I$withval/include"
4473 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4474 with_libvarnish="yes"
4477 [with_libvarnish="use_pkgconfig"])
4479 # configure using pkg-config
4480 if test "x$with_libvarnish" = "xuse_pkgconfig"
4482 if test "x$PKG_CONFIG" = "x"
4484 with_libvarnish="no (Don't have pkg-config)"
4487 if test "x$with_libvarnish" = "xuse_pkgconfig"
4489 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4490 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4493 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4496 if test "x$with_libvarnish" = "xuse_pkgconfig"
4498 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4501 with_libvarnish="no ($PKG_CONFIG failed)"
4503 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4506 with_libvarnish="no ($PKG_CONFIG failed)"
4509 if test "x$with_libvarnish" = "xuse_pkgconfig"
4511 with_libvarnish="yes"
4514 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4515 # the actual checks.
4516 if test "x$with_libvarnish" = "xyes"
4518 SAVE_CPPFLAGS="$CPPFLAGS"
4519 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4520 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4522 CPPFLAGS="$SAVE_CPPFLAGS"
4524 if test "x$with_libvarnish" = "xyes"
4526 SAVE_CPPFLAGS="$CPPFLAGS"
4527 #SAVE_LDFLAGS="$LDFLAGS"
4529 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4530 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4532 AC_CHECK_HEADERS(varnish/vsc.h,
4533 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4534 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4536 CPPFLAGS="$SAVE_CPPFLAGS"
4537 #LDFLAGS="$SAVE_LDFLAGS"
4539 if test "x$with_libvarnish" = "xyes"
4541 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4542 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4543 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4544 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4548 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4549 with_libxml2="no (pkg-config isn't available)"
4550 with_libxml2_cflags=""
4551 with_libxml2_ldflags=""
4552 with_libvirt="no (pkg-config isn't available)"
4553 with_libvirt_cflags=""
4554 with_libvirt_ldflags=""
4555 if test "x$PKG_CONFIG" != "x"
4557 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
4562 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4565 $PKG_CONFIG --exists libvirt 2>/dev/null
4570 with_libvirt="no (pkg-config doesn't know libvirt)"
4573 if test "x$with_libxml2" = "xyes"
4575 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
4580 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
4586 if test "x$with_libxml2" = "xyes"
4588 SAVE_CPPFLAGS="$CPPFLAGS"
4589 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4591 AC_CHECK_HEADERS(libxml/parser.h, [],
4592 [with_libxml2="no (libxml/parser.h not found)"])
4594 CPPFLAGS="$SAVE_CPPFLAGS"
4596 if test "x$with_libxml2" = "xyes"
4598 SAVE_CFLAGS="$CFLAGS"
4599 SAVE_LDFLAGS="$LDFLAGS"
4601 CFLAGS="$CFLAGS $with_libxml2_cflags"
4602 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4604 AC_CHECK_LIB(xml2, xmlXPathEval,
4605 [with_libxml2="yes"],
4606 [with_libxml2="no (symbol xmlXPathEval not found)"])
4608 CFLAGS="$SAVE_CFLAGS"
4609 LDFLAGS="$SAVE_LDFLAGS"
4611 dnl Add the right compiler flags and libraries.
4612 if test "x$with_libxml2" = "xyes"; then
4613 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4614 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4615 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4616 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4618 if test "x$with_libvirt" = "xyes"
4620 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
4625 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
4631 if test "x$with_libvirt" = "xyes"
4633 SAVE_CPPFLAGS="$CPPFLAGS"
4634 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4636 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4637 [with_libvirt="no (libvirt/libvirt.h not found)"])
4639 CPPFLAGS="$SAVE_CPPFLAGS"
4641 if test "x$with_libvirt" = "xyes"
4643 SAVE_CFLAGS="$CFLAGS"
4644 SAVE_LDFLAGS="$LDFLAGS"
4646 CFLAGS="$CFLAGS $with_libvirt_cflags"
4647 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4649 AC_CHECK_LIB(virt, virDomainBlockStats,
4650 [with_libvirt="yes"],
4651 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4653 CFLAGS="$SAVE_CFLAGS"
4654 LDFLAGS="$SAVE_LDFLAGS"
4656 dnl Add the right compiler flags and libraries.
4657 if test "x$with_libvirt" = "xyes"; then
4658 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4659 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4660 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4661 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4665 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4666 with_libopenipmipthread="yes"
4667 with_libopenipmipthread_cflags=""
4668 with_libopenipmipthread_libs=""
4670 AC_MSG_CHECKING([for pkg-config])
4672 if test "x$PKG_CONFIG" = "x"
4674 with_libopenipmipthread="no"
4677 temp_result="$PKG_CONFIG"
4679 AC_MSG_RESULT([$temp_result])
4681 if test "x$with_libopenipmipthread" = "xyes"
4683 AC_MSG_CHECKING([for libOpenIPMIpthread])
4684 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4687 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4689 AC_MSG_RESULT([$with_libopenipmipthread])
4692 if test "x$with_libopenipmipthread" = "xyes"
4694 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4695 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4698 with_libopenipmipthread_cflags="$temp_result"
4700 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4701 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4703 AC_MSG_RESULT([$temp_result])
4706 if test "x$with_libopenipmipthread" = "xyes"
4708 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4709 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4712 with_libopenipmipthread_ldflags="$temp_result"
4714 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4715 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4717 AC_MSG_RESULT([$temp_result])
4720 if test "x$with_libopenipmipthread" = "xyes"
4722 SAVE_CPPFLAGS="$CPPFLAGS"
4723 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4725 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4726 [with_libopenipmipthread="yes"],
4727 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4728 [#include <OpenIPMI/ipmiif.h>
4729 #include <OpenIPMI/ipmi_err.h>
4730 #include <OpenIPMI/ipmi_posix.h>
4731 #include <OpenIPMI/ipmi_conn.h>
4734 CPPFLAGS="$SAVE_CPPFLAGS"
4737 if test "x$with_libopenipmipthread" = "xyes"
4739 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4740 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4741 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4742 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4746 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4747 [with_libnotify="yes"],
4748 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4751 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4754 # Check for enabled/disabled features
4757 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4758 # ------------------------------------------------------------
4760 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4765 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4770 m4_define([EnDis],[disabled])dnl
4771 m4_define([YesNo],[no])dnl
4777 m4_define([EnDis],[enabled])dnl
4778 m4_define([YesNo],[yes])dnl
4781 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4785 m4_if([$3], [feature], [],
4789 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4795 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4797 enable_$1='[YesNo]'dnl
4799 if test "x$enable_$1" = "xno"
4803 if test "x$enable_$1" = "xyes"
4807 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4812 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4813 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4815 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4817 # AC_PLUGIN(name, default, info)
4818 # ------------------------------------------------------------
4825 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
4827 if test "x$enableval" = "xyes"
4830 else if test "x$enableval" = "xforce"
4835 enable_plugin="no (disabled on command line)"
4839 if test "x$enable_all_plugins" = "xauto"
4841 if test "x$2" = "xyes"
4848 enable_plugin="$enable_all_plugins"
4851 if test "x$enable_plugin" = "xyes"
4853 if test "x$2" = "xyes" || test "x$force" = "xyes"
4855 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4856 if test "x$2" != "xyes"
4858 dependency_warning="yes"
4860 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4861 dependency_error="yes"
4862 enable_plugin="no (dependency error)"
4865 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4866 enable_$1="$enable_plugin"
4868 )# AC_PLUGIN(name, default, info)
4870 m4_divert_once([HELP_ENABLE], [
4871 collectd features:])
4872 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4873 AC_COLLECTD([debug], [enable], [feature], [debugging])
4874 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4875 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4877 dependency_warning="no"
4878 dependency_error="no"
4884 plugin_conntrack="no"
4885 plugin_contextswitch="no"
4888 plugin_curl_json="no"
4889 plugin_curl_xml="no"
4895 plugin_interface="no"
4902 plugin_multimeter="no"
4906 plugin_processes="no"
4907 plugin_protocols="no"
4911 plugin_tcpconns="no"
4918 plugin_wireless="no"
4922 if test "x$ac_system" = "xLinux"
4924 plugin_battery="yes"
4925 plugin_conntrack="yes"
4926 plugin_contextswitch="yes"
4927 plugin_cgroups="yes"
4929 plugin_cpufreq="yes"
4931 plugin_entropy="yes"
4932 plugin_fscache="yes"
4933 plugin_interface="yes"
4940 plugin_processes="yes"
4941 plugin_protocols="yes"
4944 plugin_tcpconns="yes"
4945 plugin_thermal="yes"
4948 plugin_vserver="yes"
4949 plugin_wireless="yes"
4951 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4957 if test "x$ac_system" = "xOpenBSD"
4959 plugin_tcpconns="yes"
4963 if test "x$with_libiokit" = "xyes"
4965 plugin_battery="yes"
4971 if test "x$ac_system" = "xAIX"
4973 plugin_tcpconns="yes"
4978 if test "x$ac_system" = "xFreeBSD"
4980 plugin_zfs_arc="yes"
4984 if test "x$with_perfstat" = "xyes"
4987 plugin_contextswitch="yes"
4991 plugin_interface="yes"
4996 if test "x$with_procinfo" = "xyes"
4998 plugin_processes="yes"
5002 if test "x$with_kstat" = "xyes"
5005 plugin_processes="yes"
5007 plugin_zfs_arc="yes"
5010 if test "x$with_devinfo$with_kstat" = "xyesyes"
5014 plugin_interface="yes"
5020 if test "x$with_libstatgrab" = "xyes"
5024 plugin_interface="yes"
5031 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5034 if test "x$have_strptime" = "xyes"
5040 if test "x$with_libopenipmipthread" = "xyes"
5045 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
5047 plugin_curl_json="yes"
5050 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5052 plugin_curl_xml="yes"
5055 if test "x$have_processor_info" = "xyes"
5059 if test "x$have_sysctl" = "xyes"
5064 if test "x$ac_system" = "xDarwin"
5069 if test "x$have_sysctlbyname" = "xyes"
5071 plugin_contextswitch="yes"
5074 plugin_tcpconns="yes"
5077 # Df plugin: Check if we know how to determine mount points first.
5078 #if test "x$have_listmntent" = "xyes"; then
5081 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
5085 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
5089 #if test "x$have_getmntent" = "xseq"
5093 if test "x$c_cv_have_one_getmntent" = "xyes"
5098 # Df plugin: Check if we have either `statfs' or `statvfs' second.
5099 if test "x$plugin_df" = "xyes"
5102 if test "x$have_statfs" = "xyes"
5106 if test "x$have_statvfs" = "xyes"
5112 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
5114 plugin_ethstat="yes"
5117 if test "x$have_getifaddrs" = "xyes"
5119 plugin_interface="yes"
5122 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
5124 plugin_libvirt="yes"
5127 if test "x$have_getloadavg" = "xyes"
5132 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
5137 # Mac OS X memory interface
5138 if test "x$have_host_statistics" = "xyes"
5143 if test "x$have_termios_h" = "xyes"
5145 plugin_multimeter="yes"
5149 if test "x$have_thread_info" = "xyes"
5151 plugin_processes="yes"
5154 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
5156 plugin_processes="yes"
5159 if test "x$with_kvm_getswapinfo" = "xyes"
5164 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
5169 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
5171 plugin_tcpconns="yes"
5174 if test "x$have_getutent" = "xyes"
5178 if test "x$have_getutxent" = "xyes"
5183 m4_divert_once([HELP_ENABLE], [
5186 AC_ARG_ENABLE([all-plugins],
5187 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
5189 if test "x$enableval" = "xyes"
5191 enable_all_plugins="yes"
5192 else if test "x$enableval" = "xauto"
5194 enable_all_plugins="auto"
5196 enable_all_plugins="no"
5199 [enable_all_plugins="auto"])
5201 m4_divert_once([HELP_ENABLE], [])
5203 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
5204 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
5205 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
5206 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
5207 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
5208 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero's hardware sensors])
5209 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
5210 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
5211 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
5212 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
5213 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
5214 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
5215 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
5216 AC_PLUGIN([csv], [yes], [CSV output plugin])
5217 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
5218 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
5219 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
5220 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
5221 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
5222 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
5223 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
5224 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
5225 AC_PLUGIN([email], [yes], [EMail statistics])
5226 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
5227 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
5228 AC_PLUGIN([exec], [yes], [Execution of external programs])
5229 AC_PLUGIN([filecount], [yes], [Count files in directories])
5230 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
5231 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
5232 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
5233 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
5234 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
5235 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
5236 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
5237 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
5238 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
5239 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
5240 AC_PLUGIN([load], [$plugin_load], [System load])
5241 AC_PLUGIN([logfile], [yes], [File logging plugin])
5242 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
5243 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
5244 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
5245 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
5246 AC_PLUGIN([match_hashed], [yes], [The hashed match])
5247 AC_PLUGIN([match_regex], [yes], [The regex match])
5248 AC_PLUGIN([match_timediff], [yes], [The timediff match])
5249 AC_PLUGIN([match_value], [yes], [The value match])
5250 AC_PLUGIN([mbmon], [yes], [Query mbmond])
5251 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
5252 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
5253 AC_PLUGIN([memcached], [yes], [memcached statistics])
5254 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
5255 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
5256 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
5257 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
5258 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
5259 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
5260 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
5261 AC_PLUGIN([network], [yes], [Network communication plugin])
5262 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5263 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5264 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5265 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5266 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5267 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5268 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5269 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5270 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5271 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5272 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5273 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5274 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5275 # FIXME: Check for libevent, too.
5276 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5277 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5278 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5279 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5280 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5281 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5282 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5283 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5284 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5285 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5286 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5287 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5288 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5289 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
5290 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5291 AC_PLUGIN([statsd], [yes], [StatsD plugin])
5292 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5293 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5294 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5295 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5296 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5297 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5298 AC_PLUGIN([target_notification], [yes], [The notification target])
5299 AC_PLUGIN([target_replace], [yes], [The replace target])
5300 AC_PLUGIN([target_scale],[yes], [The scale target])
5301 AC_PLUGIN([target_set], [yes], [The set target])
5302 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5303 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5304 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5305 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5306 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5307 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5308 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5309 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5310 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5311 AC_PLUGIN([users], [$plugin_users], [User statistics])
5312 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5313 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5314 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5315 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5316 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5317 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5318 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5319 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5320 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5321 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5322 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5323 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5325 dnl Default configuration file
5326 # Load either syslog or logfile
5327 LOAD_PLUGIN_SYSLOG=""
5328 LOAD_PLUGIN_LOGFILE=""
5330 AC_MSG_CHECKING([which default log plugin to load])
5331 default_log_plugin="none"
5332 if test "x$enable_syslog" = "xyes"
5334 default_log_plugin="syslog"
5336 LOAD_PLUGIN_SYSLOG="##"
5339 if test "x$enable_logfile" = "xyes"
5341 if test "x$default_log_plugin" = "xnone"
5343 default_log_plugin="logfile"
5345 LOAD_PLUGIN_LOGFILE="#"
5348 LOAD_PLUGIN_LOGFILE="##"
5350 AC_MSG_RESULT([$default_log_plugin])
5352 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5353 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5355 DEFAULT_LOG_LEVEL="info"
5356 if test "x$enable_debug" = "xyes"
5358 DEFAULT_LOG_LEVEL="debug"
5360 AC_SUBST(DEFAULT_LOG_LEVEL)
5362 # Load only one of rrdtool, network, csv in the default config.
5363 LOAD_PLUGIN_RRDTOOL=""
5364 LOAD_PLUGIN_NETWORK=""
5367 AC_MSG_CHECKING([which default write plugin to load])
5368 default_write_plugin="none"
5369 if test "x$enable_rrdtool" = "xyes"
5371 default_write_plugin="rrdtool"
5373 LOAD_PLUGIN_RRDTOOL="##"
5376 if test "x$enable_network" = "xyes"
5378 if test "x$default_write_plugin" = "xnone"
5380 default_write_plugin="network"
5382 LOAD_PLUGIN_NETWORK="#"
5385 LOAD_PLUGIN_NETWORK="##"
5388 if test "x$enable_csv" = "xyes"
5390 if test "x$default_write_plugin" = "xnone"
5392 default_write_plugin="csv"
5397 LOAD_PLUGIN_CSV="##"
5399 AC_MSG_RESULT([$default_write_plugin])
5401 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5402 AC_SUBST(LOAD_PLUGIN_NETWORK)
5403 AC_SUBST(LOAD_PLUGIN_CSV)
5406 if test "x$ac_system" = "xLinux" \
5407 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5409 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5412 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5414 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5418 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
5419 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5421 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5423 PERL_BINDINGS_OPTIONS="$withval"
5424 with_perl_bindings="yes"
5426 with_perl_bindings="$withval"
5430 if test -n "$perl_interpreter"
5432 with_perl_bindings="yes"
5434 with_perl_bindings="no (no perl interpreter found)"
5437 if test "x$with_perl_bindings" = "xyes"
5439 PERL_BINDINGS="perl"
5443 AC_SUBST(PERL_BINDINGS)
5444 AC_SUBST(PERL_BINDINGS_OPTIONS)
5446 dnl libcollectdclient
5447 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5448 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5449 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5451 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5453 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5455 AC_SUBST(LCC_VERSION_MAJOR)
5456 AC_SUBST(LCC_VERSION_MINOR)
5457 AC_SUBST(LCC_VERSION_PATCH)
5458 AC_SUBST(LCC_VERSION_EXTRA)
5459 AC_SUBST(LCC_VERSION_STRING)
5461 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5463 AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
5466 if test "x$with_librrd" = "xyes" \
5467 && test "x$librrd_threadsafe" != "xyes"
5469 with_librrd="yes (warning: librrd is not thread-safe)"
5472 if test "x$with_libperl" = "xyes"
5474 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5476 enable_perl="no (needs libperl)"
5479 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5481 enable_perl="no (libperl doesn't support ithreads)"
5484 if test "x$with_perl_bindings" = "xyes" \
5485 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5487 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5494 intel mic . . . . . . $with_mic
5495 libaquaero5 . . . . . $with_libaquaero5
5496 libcredis . . . . . . $with_libcredis
5497 libcurl . . . . . . . $with_libcurl
5498 libdbi . . . . . . . $with_libdbi
5499 libesmtp . . . . . . $with_libesmtp
5500 libganglia . . . . . $with_libganglia
5501 libgcrypt . . . . . . $with_libgcrypt
5502 libhal . . . . . . . $with_libhal
5503 libiokit . . . . . . $with_libiokit
5504 libiptc . . . . . . . $with_libiptc
5505 libjvm . . . . . . . $with_java
5506 libkstat . . . . . . $with_kstat
5507 libkvm . . . . . . . $with_libkvm
5508 liblvm2app . . . . . $with_liblvm2app
5509 libmemcached . . . . $with_libmemcached
5510 libmnl . . . . . . . $with_libmnl
5511 libmodbus . . . . . . $with_libmodbus
5512 libmongoc . . . . . . $with_libmongoc
5513 libmysql . . . . . . $with_libmysql
5514 libnetapp . . . . . . $with_libnetapp
5515 libnetsnmp . . . . . $with_libnetsnmp
5516 libnotify . . . . . . $with_libnotify
5517 liboconfig . . . . . $with_liboconfig
5518 libopenipmi . . . . . $with_libopenipmipthread
5519 liboping . . . . . . $with_liboping
5520 libowcapi . . . . . . $with_libowcapi
5521 libpcap . . . . . . . $with_libpcap
5522 libperfstat . . . . . $with_perfstat
5523 libperl . . . . . . . $with_libperl
5524 libpq . . . . . . . . $with_libpq
5525 libpthread . . . . . $with_libpthread
5526 librabbitmq . . . . . $with_librabbitmq
5527 librouteros . . . . . $with_librouteros
5528 librrd . . . . . . . $with_librrd
5529 libsensors . . . . . $with_libsensors
5530 libsigrok . . . . . $with_libsigrok
5531 libstatgrab . . . . . $with_libstatgrab
5532 libtokyotyrant . . . $with_libtokyotyrant
5533 libupsclient . . . . $with_libupsclient
5534 libvarnish . . . . . $with_libvarnish
5535 libvirt . . . . . . . $with_libvirt
5536 libxml2 . . . . . . . $with_libxml2
5537 libxmms . . . . . . . $with_libxmms
5538 libyajl . . . . . . . $with_libyajl
5539 oracle . . . . . . . $with_oracle
5540 protobuf-c . . . . . $have_protoc_c
5541 python . . . . . . . $with_python
5544 daemon mode . . . . . $enable_daemon
5545 debug . . . . . . . . $enable_debug
5548 perl . . . . . . . . $with_perl_bindings
5551 aggregation . . . . . $enable_aggregation
5552 amqp . . . . . . . $enable_amqp
5553 apache . . . . . . . $enable_apache
5554 apcups . . . . . . . $enable_apcups
5555 aquaero . . . . . . . $enable_aquaero
5556 apple_sensors . . . . $enable_apple_sensors
5557 ascent . . . . . . . $enable_ascent
5558 battery . . . . . . . $enable_battery
5559 bind . . . . . . . . $enable_bind
5560 conntrack . . . . . . $enable_conntrack
5561 contextswitch . . . . $enable_contextswitch
5562 cgroups . . . . . . . $enable_cgroups
5563 cpu . . . . . . . . . $enable_cpu
5564 cpufreq . . . . . . . $enable_cpufreq
5565 csv . . . . . . . . . $enable_csv
5566 curl . . . . . . . . $enable_curl
5567 curl_json . . . . . . $enable_curl_json
5568 curl_xml . . . . . . $enable_curl_xml
5569 dbi . . . . . . . . . $enable_dbi
5570 df . . . . . . . . . $enable_df
5571 disk . . . . . . . . $enable_disk
5572 dns . . . . . . . . . $enable_dns
5573 email . . . . . . . . $enable_email
5574 entropy . . . . . . . $enable_entropy
5575 ethstat . . . . . . . $enable_ethstat
5576 exec . . . . . . . . $enable_exec
5577 filecount . . . . . . $enable_filecount
5578 fscache . . . . . . . $enable_fscache
5579 gmond . . . . . . . . $enable_gmond
5580 hddtemp . . . . . . . $enable_hddtemp
5581 interface . . . . . . $enable_interface
5582 ipmi . . . . . . . . $enable_ipmi
5583 iptables . . . . . . $enable_iptables
5584 ipvs . . . . . . . . $enable_ipvs
5585 irq . . . . . . . . . $enable_irq
5586 java . . . . . . . . $enable_java
5587 libvirt . . . . . . . $enable_libvirt
5588 load . . . . . . . . $enable_load
5589 logfile . . . . . . . $enable_logfile
5590 lpar . . . . . . . . $enable_lpar
5591 lvm . . . . . . . . . $enable_lvm
5592 madwifi . . . . . . . $enable_madwifi
5593 match_empty_counter . $enable_match_empty_counter
5594 match_hashed . . . . $enable_match_hashed
5595 match_regex . . . . . $enable_match_regex
5596 match_timediff . . . $enable_match_timediff
5597 match_value . . . . . $enable_match_value
5598 mbmon . . . . . . . . $enable_mbmon
5599 md . . . . . . . . . $enable_md
5600 memcachec . . . . . . $enable_memcachec
5601 memcached . . . . . . $enable_memcached
5602 memory . . . . . . . $enable_memory
5603 mic . . . . . . . . . $enable_mic
5604 modbus . . . . . . . $enable_modbus
5605 multimeter . . . . . $enable_multimeter
5606 mysql . . . . . . . . $enable_mysql
5607 netapp . . . . . . . $enable_netapp
5608 netlink . . . . . . . $enable_netlink
5609 network . . . . . . . $enable_network
5610 nfs . . . . . . . . . $enable_nfs
5611 nginx . . . . . . . . $enable_nginx
5612 notify_desktop . . . $enable_notify_desktop
5613 notify_email . . . . $enable_notify_email
5614 ntpd . . . . . . . . $enable_ntpd
5615 numa . . . . . . . . $enable_numa
5616 nut . . . . . . . . . $enable_nut
5617 olsrd . . . . . . . . $enable_olsrd
5618 onewire . . . . . . . $enable_onewire
5619 openvpn . . . . . . . $enable_openvpn
5620 oracle . . . . . . . $enable_oracle
5621 perl . . . . . . . . $enable_perl
5622 pf . . . . . . . . . $enable_pf
5623 pinba . . . . . . . . $enable_pinba
5624 ping . . . . . . . . $enable_ping
5625 postgresql . . . . . $enable_postgresql
5626 powerdns . . . . . . $enable_powerdns
5627 processes . . . . . . $enable_processes
5628 protocols . . . . . . $enable_protocols
5629 python . . . . . . . $enable_python
5630 redis . . . . . . . . $enable_redis
5631 routeros . . . . . . $enable_routeros
5632 rrdcached . . . . . . $enable_rrdcached
5633 rrdtool . . . . . . . $enable_rrdtool
5634 sensors . . . . . . . $enable_sensors
5635 serial . . . . . . . $enable_serial
5636 sigrok . . . . . . . $enable_sigrok
5637 snmp . . . . . . . . $enable_snmp
5638 statsd . . . . . . . $enable_statsd
5639 swap . . . . . . . . $enable_swap
5640 syslog . . . . . . . $enable_syslog
5641 table . . . . . . . . $enable_table
5642 tail . . . . . . . . $enable_tail
5643 tail_csv . . . . . . $enable_tail_csv
5644 tape . . . . . . . . $enable_tape
5645 target_notification . $enable_target_notification
5646 target_replace . . . $enable_target_replace
5647 target_scale . . . . $enable_target_scale
5648 target_set . . . . . $enable_target_set
5649 target_v5upgrade . . $enable_target_v5upgrade
5650 tcpconns . . . . . . $enable_tcpconns
5651 teamspeak2 . . . . . $enable_teamspeak2
5652 ted . . . . . . . . . $enable_ted
5653 thermal . . . . . . . $enable_thermal
5654 threshold . . . . . . $enable_threshold
5655 tokyotyrant . . . . . $enable_tokyotyrant
5656 unixsock . . . . . . $enable_unixsock
5657 uptime . . . . . . . $enable_uptime
5658 users . . . . . . . . $enable_users
5659 uuid . . . . . . . . $enable_uuid
5660 varnish . . . . . . . $enable_varnish
5661 vmem . . . . . . . . $enable_vmem
5662 vserver . . . . . . . $enable_vserver
5663 wireless . . . . . . $enable_wireless
5664 write_graphite . . . $enable_write_graphite
5665 write_http . . . . . $enable_write_http
5666 write_mongodb . . . . $enable_write_mongodb
5667 write_redis . . . . . $enable_write_redis
5668 write_riemann . . . . $enable_write_riemann
5669 xmms . . . . . . . . $enable_xmms
5670 zfs_arc . . . . . . . $enable_zfs_arc
5674 if test "x$dependency_error" = "xyes"; then
5675 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5678 if test "x$dependency_warning" = "xyes"; then
5679 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5682 # vim: set fdm=marker :