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 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
8 dnl we don't really need the 'u' even in older toolchains. Then there is
9 dnl older libtool, which spelled it AR_FLAGS
10 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
12 m4_ifdef([LT_PACKAGE_VERSION],
15 LT_CONFIG_LTDL_DIR([libltdl])
17 LTDL_INIT([convenience])
18 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
23 AC_LIBLTDL_CONVENIENCE
27 AC_CONFIG_SUBDIRS(libltdl)
28 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
32 AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
34 AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
35 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
38 AC_PREFIX_DEFAULT("/opt/collectd")
43 # Checks for programs.
51 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
58 # Warn when pkg.m4 is missing
59 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
63 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
64 if test "x$have_protoc_c" = "xno"
66 have_protoc_c="no (protoc-c compiler not found)"
69 if test "x$have_protoc_c" = "xyes"
71 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
72 [have_protoc_c="yes"; break],
73 [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
75 if test "x$have_protoc_c" = "xyes"
77 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
78 [have_protoc_c="yes"],
79 [have_protoc_c="no (libprotobuf-c not found)"])
82 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
84 AC_MSG_CHECKING([for kernel type ($host_os)])
87 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
91 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
101 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
105 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
111 AC_MSG_RESULT([$ac_system])
113 if test "x$ac_system" = "xLinux"
115 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
116 if test -z "$KERNEL_DIR"
118 KERNEL_DIR="/lib/modules/`uname -r`/source"
121 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
122 AC_SUBST(KERNEL_CFLAGS)
125 if test "x$ac_system" = "xSolaris"
127 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
128 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
130 if test "x$ac_system" = "xAIX"
132 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
135 # Where to install .pc files.
136 pkgconfigdir="${libdir}/pkgconfig"
137 AC_SUBST(pkgconfigdir)
139 # Check for standards compliance mode
140 AC_ARG_ENABLE(standards,
141 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
142 [enable_standards="$enableval"],
143 [enable_standards="no"])
144 if test "x$enable_standards" = "xyes"
146 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
147 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
148 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
149 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
150 if test "x$GCC" = "xyes"
152 CFLAGS="$CFLAGS -std=c99"
155 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
158 # Checks for header files.
165 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)
168 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
173 # include <sys/types.h>
176 AC_CHECK_HEADERS(netinet/in.h, [], [],
181 # include <sys/types.h>
183 #if HAVE_NETINET_IN_SYSTM_H
184 # include <netinet/in_systm.h>
187 AC_CHECK_HEADERS(netinet/ip.h, [], [],
192 # include <sys/types.h>
194 #if HAVE_NETINET_IN_SYSTM_H
195 # include <netinet/in_systm.h>
197 #if HAVE_NETINET_IN_H
198 # include <netinet/in.h>
201 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
206 # include <sys/types.h>
208 #if HAVE_NETINET_IN_SYSTM_H
209 # include <netinet/in_systm.h>
211 #if HAVE_NETINET_IN_H
212 # include <netinet/in.h>
214 #if HAVE_NETINET_IP_H
215 # include <netinet/ip.h>
218 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
223 # include <sys/types.h>
225 #if HAVE_NETINET_IN_SYSTM_H
226 # include <netinet/in_systm.h>
228 #if HAVE_NETINET_IN_H
229 # include <netinet/in.h>
231 #if HAVE_NETINET_IP_H
232 # include <netinet/ip.h>
235 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
240 # include <sys/types.h>
242 #if HAVE_NETINET_IN_SYSTM_H
243 # include <netinet/in_systm.h>
245 #if HAVE_NETINET_IN_H
246 # include <netinet/in.h>
249 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
254 # include <sys/types.h>
256 #if HAVE_NETINET_IN_SYSTM_H
257 # include <netinet/in_systm.h>
259 #if HAVE_NETINET_IN_H
260 # include <netinet/in.h>
262 #if HAVE_NETINET_IP6_H
263 # include <netinet/ip6.h>
266 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
271 # include <sys/types.h>
273 #if HAVE_NETINET_IN_SYSTM_H
274 # include <netinet/in_systm.h>
276 #if HAVE_NETINET_IN_H
277 # include <netinet/in.h>
279 #if HAVE_NETINET_IP_H
280 # include <netinet/ip.h>
283 AC_CHECK_HEADERS(netinet/udp.h, [], [],
288 # include <sys/types.h>
290 #if HAVE_NETINET_IN_SYSTM_H
291 # include <netinet/in_systm.h>
293 #if HAVE_NETINET_IN_H
294 # include <netinet/in.h>
296 #if HAVE_NETINET_IP_H
297 # include <netinet/ip.h>
302 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
307 # include <sys/types.h>
309 #if HAVE_NETINET_IN_SYSTM_H
310 # include <netinet/in_systm.h>
312 #if HAVE_NETINET_IN_H
313 # include <netinet/in.h>
315 #if HAVE_NETINET_IP6_H
316 # include <netinet/ip6.h>
320 if test "x$have_ip6_ext" = "xno"; then
321 SAVE_CFLAGS="$CFLAGS"
322 CFLAGS="$CFLAGS -DSOLARIS2=8"
324 AC_CHECK_TYPES([struct ip6_ext],
325 [have_ip6_ext="yes, with -DSOLARIS2=8"],
331 # include <sys/types.h>
333 #if HAVE_NETINET_IN_SYSTM_H
334 # include <netinet/in_systm.h>
336 #if HAVE_NETINET_IN_H
337 # include <netinet/in.h>
339 #if HAVE_NETINET_IP6_H
340 # include <netinet/ip6.h>
344 if test "x$have_ip6_ext" = "xno"; then
345 CFLAGS="$SAVE_CFLAGS"
350 AC_CHECK_HEADERS(sys/dkstat.h)
351 if test "x$ac_system" = "xDarwin"
353 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)
354 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
355 # For the battery plugin
356 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
358 #if HAVE_IOKIT_IOKITLIB_H
359 # include <IOKit/IOKitLib.h>
361 #if HAVE_IOKIT_IOTYPES_H
362 # include <IOKit/IOTypes.h>
368 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
371 # include <sys/types.h>
374 # include <sys/param.h>
378 AC_MSG_CHECKING([for sysctl kern.cp_times])
379 if test -x /sbin/sysctl
381 /sbin/sysctl kern.cp_times 2>/dev/null
385 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
386 [Define if sysctl supports kern.cp_times])
395 AC_CHECK_HEADERS(linux/major.h)
397 # For md module (Linux only)
398 if test "x$ac_system" = "xLinux"
400 AC_CHECK_HEADERS(linux/raid/md_u.h,
401 [have_linux_raid_md_u_h="yes"],
402 [have_linux_raid_md_u_h="no"],
404 #include <sys/ioctl.h>
405 #include <linux/major.h>
406 #include <linux/types.h>
409 have_linux_raid_md_u_h="no"
412 # For the swap module
413 have_linux_wireless_h="no"
414 if test "x$ac_system" = "xLinux"
416 AC_CHECK_HEADERS(linux/wireless.h,
417 [have_linux_wireless_h="yes"],
418 [have_linux_wireless_h="no"],
421 #include <sys/ioctl.h>
422 #include <sys/socket.h>
426 # For the swap module
427 have_sys_swap_h="yes"
428 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
430 #undef _FILE_OFFSET_BITS
431 #undef _LARGEFILE64_SOURCE
433 # include <sys/types.h>
436 # include <sys/param.h>
440 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
443 if test "x$GCC" = "xyes"
445 hint_64="CFLAGS='-m64'"
447 hint_64="CFLAGS='-xarch=v9'"
449 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
453 # For the processes plugin
455 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
457 # For interface plugin
458 AC_CHECK_HEADERS(ifaddrs.h)
459 AC_CHECK_HEADERS(net/if.h, [], [],
462 # include <sys/types.h>
464 #if HAVE_SYS_SOCKET_H
465 # include <sys/socket.h>
468 AC_CHECK_HEADERS(linux/if.h, [], [],
471 # include <sys/types.h>
473 #if HAVE_SYS_SOCKET_H
474 # include <sys/socket.h>
477 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
480 # include <sys/types.h>
482 #if HAVE_SYS_SOCKET_H
483 # include <sys/socket.h>
485 #if HAVE_LINUX_INET_DIAG_H
486 # include <linux/inet_diag.h>
489 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
492 # include <sys/types.h>
494 #if HAVE_SYS_SOCKET_H
495 # include <sys/socket.h>
498 # include <linux/if.h>
503 AC_CHECK_HEADERS(linux/sockios.h,
504 [have_linux_sockios_h="yes"],
505 [have_linux_sockios_h="no"],
508 # include <sys/ioctl.h>
514 AC_CHECK_HEADERS(linux/ethtool.h,
515 [have_linux_ethtool_h="yes"],
516 [have_linux_ethtool_h="no"],
519 # include <sys/ioctl.h>
524 #if HAVE_LINUX_SOCKIOS_H
525 # include <linux/sockios.h>
530 have_linux_ip_vs_h="no"
531 have_net_ip_vs_h="no"
533 ip_vs_h_needs_kernel_cflags="no"
534 if test "x$ac_system" = "xLinux"
536 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
537 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
538 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
540 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
542 SAVE_CFLAGS="$CFLAGS"
543 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
545 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
547 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
548 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
549 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
551 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
553 ip_vs_h_needs_kernel_cflags="yes"
556 CFLAGS="$SAVE_CFLAGS"
559 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
562 AC_CHECK_HEADERS(sys/ucred.h, [], [],
565 # include <sys/types.h>
568 # include <sys/param.h>
572 # For mount interface
573 AC_CHECK_HEADERS(sys/mount.h, [], [],
576 # include <sys/types.h>
579 # include <sys/param.h>
583 # For the email plugin
584 AC_CHECK_HEADERS(linux/un.h, [], [],
586 #if HAVE_SYS_SOCKET_H
587 # include <sys/socket.h>
591 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)
594 AC_CHECK_HEADERS(arpa/nameser.h)
595 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
597 #if HAVE_ARPA_NAMESER_H
598 # include <arpa/nameser.h>
602 AC_CHECK_HEADERS(net/if_arp.h, [], [],
603 [#if HAVE_SYS_SOCKET_H
604 # include <sys/socket.h>
607 AC_CHECK_HEADERS(net/ppp_defs.h)
608 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
609 [#if HAVE_NET_PPP_DEFS_H
610 # include <net/ppp_defs.h>
613 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
618 # include <sys/types.h>
620 #if HAVE_SYS_SOCKET_H
621 # include <sys/socket.h>
626 #if HAVE_NETINET_IN_H
627 # include <netinet/in.h>
631 AC_CHECK_HEADERS(netinet/ip_compat.h)
633 have_net_pfvar_h="no"
634 AC_CHECK_HEADERS(net/pfvar.h,
635 [have_net_pfvar_h="yes"],
636 [have_net_pfvar_h="no"],
639 # include <sys/ioctl.h>
641 #if HAVE_SYS_SOCKET_H
642 # include <sys/socket.h>
647 #if HAVE_NETINET_IN_H
648 # include <netinet/in.h>
652 # For the multimeter plugin
654 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
657 # Checks for typedefs, structures, and compiler characteristics.
666 # Checks for library functions.
668 AC_PROG_GCC_TRADITIONAL
669 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
673 SAVE_CFLAGS="$CFLAGS"
674 # Emulate behavior of src/Makefile.am
675 if test "x$GCC" = "xyes"
677 CFLAGS="$CFLAGS -Wall -Werror"
680 AC_CACHE_CHECK([for strtok_r],
681 [c_cv_have_strtok_r_default],
690 char buffer[] = "foo,bar,baz";
697 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
700 printf ("token = %s;\n", token);
704 [c_cv_have_strtok_r_default="yes"],
705 [c_cv_have_strtok_r_default="no"]
709 if test "x$c_cv_have_strtok_r_default" = "xno"
711 CFLAGS="$CFLAGS -D_REENTRANT=1"
713 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
714 [c_cv_have_strtok_r_reentrant],
723 char buffer[] = "foo,bar,baz";
730 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
733 printf ("token = %s;\n", token);
737 [c_cv_have_strtok_r_reentrant="yes"],
738 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
743 CFLAGS="$SAVE_CFLAGS"
744 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
746 CFLAGS="$CFLAGS -D_REENTRANT=1"
749 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
751 socket_needs_socket="no"
752 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
753 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
755 clock_gettime_needs_rt="no"
756 clock_gettime_needs_posix4="no"
757 have_clock_gettime="no"
758 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
759 if test "x$have_clock_gettime" = "xno"
761 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
762 have_clock_gettime="yes"])
764 if test "x$have_clock_gettime" = "xno"
766 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
767 have_clock_gettime="yes"])
769 if test "x$have_clock_gettime" = "xyes"
771 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
773 AC_MSG_WARN(cannot find clock_gettime)
776 nanosleep_needs_rt="no"
777 nanosleep_needs_posix4="no"
778 AC_CHECK_FUNCS(nanosleep,
780 AC_CHECK_LIB(rt, nanosleep,
781 [nanosleep_needs_rt="yes"],
782 AC_CHECK_LIB(posix4, nanosleep,
783 [nanosleep_needs_posix4="yes"],
784 AC_MSG_ERROR(cannot find nanosleep))))
786 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
787 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
789 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
790 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
791 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
792 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
793 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
794 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
795 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
796 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
797 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
798 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
799 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
800 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
802 # Check for strptime {{{
803 if test "x$GCC" = "xyes"
805 SAVE_CFLAGS="$CFLAGS"
806 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
809 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
810 if test "x$have_strptime" = "xyes"
812 AC_CACHE_CHECK([whether strptime is exported by default],
813 [c_cv_have_strptime_default],
814 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
820 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
823 [c_cv_have_strptime_default="yes"],
824 [c_cv_have_strptime_default="no"]))
826 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
828 AC_CACHE_CHECK([whether strptime needs standards mode],
829 [c_cv_have_strptime_standards],
830 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
832 #ifndef _ISOC99_SOURCE
833 # define _ISOC99_SOURCE 1
835 #ifndef _POSIX_C_SOURCE
836 # define _POSIX_C_SOURCE 200112L
838 #ifndef _XOPEN_SOURCE
839 # define _XOPEN_SOURCE 500
845 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
848 [c_cv_have_strptime_standards="yes"],
849 [c_cv_have_strptime_standards="no"]))
851 if test "x$c_cv_have_strptime_standards" = "xyes"
853 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
859 if test "x$GCC" = "xyes"
861 CFLAGS="$SAVE_CFLAGS"
863 # }}} Check for strptime
865 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
866 if test "x$have_swapctl" = "xyes"; then
867 AC_CACHE_CHECK([whether swapctl takes two arguments],
868 [c_cv_have_swapctl_two_args],
869 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
871 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
872 # undef _FILE_OFFSET_BITS
873 # undef _LARGEFILE64_SOURCE
875 #include <sys/stat.h>
876 #include <sys/swap.h>
879 int num = swapctl(0, NULL);
882 [c_cv_have_swapctl_two_args="yes"],
883 [c_cv_have_swapctl_two_args="no"]
886 AC_CACHE_CHECK([whether swapctl takes three arguments],
887 [c_cv_have_swapctl_three_args],
891 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
892 # undef _FILE_OFFSET_BITS
893 # undef _LARGEFILE64_SOURCE
895 #include <sys/stat.h>
896 #include <sys/swap.h>
899 int num = swapctl(0, NULL, 0);
902 [c_cv_have_swapctl_three_args="yes"],
903 [c_cv_have_swapctl_three_args="no"]
907 # Check for different versions of `swapctl' here..
908 if test "x$have_swapctl" = "xyes"; then
909 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
910 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
911 [Define if the function swapctl exists and takes two arguments.])
913 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
914 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
915 [Define if the function swapctl exists and takes three arguments.])
920 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
922 if test "x$withval" = "xno"; then
924 else if test "x$withval" = "xyes"; then
931 if test "x$nan_type" = "xnone"; then
932 AC_CACHE_CHECK([whether NAN is defined by default],
933 [c_cv_have_nan_default],
934 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
938 static double foo = NAN;
947 [c_cv_have_nan_default="yes"],
948 [c_cv_have_nan_default="no"]
951 if test "x$c_cv_have_nan_default" = "xyes"
956 if test "x$nan_type" = "xnone"; then
957 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
958 [c_cv_have_nan_isoc],
959 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
962 #define __USE_ISOC99 1
964 static double foo = NAN;
973 [c_cv_have_nan_isoc="yes"],
974 [c_cv_have_nan_isoc="no"]
977 if test "x$c_cv_have_nan_isoc" = "xyes"
982 if test "x$nan_type" = "xnone"; then
983 SAVE_LDFLAGS=$LDFLAGS
984 LDFLAGS="$LDFLAGS -lm"
985 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
986 [c_cv_have_nan_zero],
987 AC_RUN_IFELSE([AC_LANG_PROGRAM(
994 #define NAN (0.0 / 0.0)
996 # define isnan(f) ((f) != (f))
998 static double foo = NAN;
1007 [c_cv_have_nan_zero="yes"],
1008 [c_cv_have_nan_zero="no"]
1011 LDFLAGS=$SAVE_LDFLAGS
1012 if test "x$c_cv_have_nan_zero" = "xyes"
1018 if test "x$nan_type" = "xdefault"; then
1019 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1020 [Define if NAN is defined by default and can initialize static variables.])
1021 else if test "x$nan_type" = "xisoc99"; then
1022 AC_DEFINE(NAN_STATIC_ISOC, 1,
1023 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1024 else if test "x$nan_type" = "xzero"; then
1025 AC_DEFINE(NAN_ZERO_ZERO, 1,
1026 [Define if NAN can be defined as (0.0 / 0.0)])
1028 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1031 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1033 if test "x$withval" = "xnothing"; then
1034 fp_layout_type="nothing"
1035 else if test "x$withval" = "xendianflip"; then
1036 fp_layout_type="endianflip"
1037 else if test "x$withval" = "xintswap"; then
1038 fp_layout_type="intswap"
1040 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1043 [fp_layout_type="unknown"])
1045 if test "x$fp_layout_type" = "xunknown"; then
1046 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1047 [c_cv_fp_layout_need_nothing],
1048 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1054 # include <stdint.h>
1057 # include <inttypes.h>
1060 # include <stdbool.h>
1070 memcpy ((void *) &i0, (void *) &d, 8);
1073 memcpy ((void *) c, (void *) &i1, 8);
1075 if ((c[0] == 0x2f) && (c[1] == 0x25)
1076 && (c[2] == 0xc0) && (c[3] == 0xc7)
1077 && (c[4] == 0x43) && (c[5] == 0x2b)
1078 && (c[6] == 0x1f) && (c[7] == 0x5b))
1084 [c_cv_fp_layout_need_nothing="yes"],
1085 [c_cv_fp_layout_need_nothing="no"]
1088 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1089 fp_layout_type="nothing"
1092 if test "x$fp_layout_type" = "xunknown"; then
1093 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1094 [c_cv_fp_layout_need_endianflip],
1095 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1101 # include <stdint.h>
1104 # include <inttypes.h>
1107 # include <stdbool.h>
1109 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1110 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1111 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1112 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1113 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1114 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1115 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1116 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1125 memcpy ((void *) &i0, (void *) &d, 8);
1127 i1 = endianflip (i0);
1128 memcpy ((void *) c, (void *) &i1, 8);
1130 if ((c[0] == 0x2f) && (c[1] == 0x25)
1131 && (c[2] == 0xc0) && (c[3] == 0xc7)
1132 && (c[4] == 0x43) && (c[5] == 0x2b)
1133 && (c[6] == 0x1f) && (c[7] == 0x5b))
1139 [c_cv_fp_layout_need_endianflip="yes"],
1140 [c_cv_fp_layout_need_endianflip="no"]
1143 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1144 fp_layout_type="endianflip"
1147 if test "x$fp_layout_type" = "xunknown"; then
1148 AC_CACHE_CHECK([if intswap converts to x86 representation],
1149 [c_cv_fp_layout_need_intswap],
1150 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1156 # include <stdint.h>
1159 # include <inttypes.h>
1162 # include <stdbool.h>
1164 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1165 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1174 memcpy ((void *) &i0, (void *) &d, 8);
1177 memcpy ((void *) c, (void *) &i1, 8);
1179 if ((c[0] == 0x2f) && (c[1] == 0x25)
1180 && (c[2] == 0xc0) && (c[3] == 0xc7)
1181 && (c[4] == 0x43) && (c[5] == 0x2b)
1182 && (c[6] == 0x1f) && (c[7] == 0x5b))
1188 [c_cv_fp_layout_need_intswap="yes"],
1189 [c_cv_fp_layout_need_intswap="no"]
1192 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1193 fp_layout_type="intswap"
1197 if test "x$fp_layout_type" = "xnothing"; then
1198 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1199 [Define if doubles are stored in x86 representation.])
1200 else if test "x$fp_layout_type" = "xendianflip"; then
1201 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1202 [Define if endianflip is needed to convert to x86 representation.])
1203 else if test "x$fp_layout_type" = "xintswap"; then
1204 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1205 [Define if intswap is needed to convert to x86 representation.])
1207 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1211 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1212 have_getvfsstat="no"
1213 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1214 have_listmntent="no"
1215 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1216 have_getmntent_r="no"
1217 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1220 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1221 if test "x$have_getmntent" = "xno"; then
1222 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1224 if test "x$have_getmntent" = "xno"; then
1225 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1227 if test "x$have_getmntent" = "xno"; then
1228 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1231 if test "x$have_getmntent" = "xc"; then
1232 AC_CACHE_CHECK([whether getmntent takes one argument],
1233 [c_cv_have_one_getmntent],
1237 #include "$srcdir/src/utils_mount.h"
1242 fh = setmntent ("/etc/mtab", "r");
1243 me = getmntent (fh);
1244 return(me->mnt_passno);
1247 [c_cv_have_one_getmntent="yes"],
1248 [c_cv_have_one_getmntent="no"]
1251 AC_CACHE_CHECK([whether getmntent takes two arguments],
1252 [c_cv_have_two_getmntent],
1256 #include "$srcdir/src/utils_mount.h"
1262 fh = fopen ("/etc/mnttab", "r");
1263 status = getmntent (fh, &mt);
1267 [c_cv_have_two_getmntent="yes"],
1268 [c_cv_have_two_getmntent="no"]
1273 # Check for different versions of `getmntent' here..
1275 if test "x$have_getmntent" = "xc"; then
1276 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1277 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1278 [Define if the function getmntent exists and takes one argument.])
1280 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1281 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1282 [Define if the function getmntent exists and takes two arguments.])
1285 if test "x$have_getmntent" = "xsun"; then
1286 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1287 [Define if the function getmntent exists. It's the version from libsun.])
1289 if test "x$have_getmntent" = "xseq"; then
1290 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1291 [Define if the function getmntent exists. It's the version from libseq.])
1293 if test "x$have_getmntent" = "xgen"; then
1294 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1295 [Define if the function getmntent exists. It's the version from libgen.])
1299 AC_CACHE_CHECK([if have htonll defined],
1301 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1303 #include <sys/types.h>
1304 #include <netinet/in.h>
1306 # include <inttypes.h>
1313 [c_cv_have_htonll="yes"],
1314 [c_cv_have_htonll="no"]
1317 if test "x$c_cv_have_htonll" = "xyes"
1319 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1322 # Check for structures
1323 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1324 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1327 #include <sys/types.h>
1328 #include <sys/socket.h>
1331 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1332 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1335 #include <sys/types.h>
1336 #include <sys/socket.h>
1337 #include <linux/if.h>
1338 #include <linux/netdevice.h>
1340 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1341 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1344 #include <linux/inet_diag.h>
1348 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1351 #include <netinet/in.h>
1355 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1357 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1358 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1359 have_struct_kinfo_proc_freebsd="yes"
1362 have_struct_kinfo_proc_freebsd="no"
1366 #include <sys/param.h>
1367 #include <sys/sysctl.h>
1368 #include <sys/user.h>
1371 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1373 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1374 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1375 have_struct_kinfo_proc_openbsd="yes"
1378 have_struct_kinfo_proc_openbsd="no"
1381 #include <sys/param.h>
1382 #include <sys/sysctl.h>
1386 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1387 [#define _BSD_SOURCE
1389 # include <stdint.h>
1391 #if HAVE_SYS_TYPES_H
1392 # include <sys/types.h>
1394 #if HAVE_NETINET_IN_SYSTM_H
1395 # include <netinet/in_systm.h>
1397 #if HAVE_NETINET_IN_H
1398 # include <netinet/in.h>
1400 #if HAVE_NETINET_IP_H
1401 # include <netinet/ip.h>
1403 #if HAVE_NETINET_UDP_H
1404 # include <netinet/udp.h>
1407 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1408 [#define _BSD_SOURCE
1410 # include <stdint.h>
1412 #if HAVE_SYS_TYPES_H
1413 # include <sys/types.h>
1415 #if HAVE_NETINET_IN_SYSTM_H
1416 # include <netinet/in_systm.h>
1418 #if HAVE_NETINET_IN_H
1419 # include <netinet/in.h>
1421 #if HAVE_NETINET_IP_H
1422 # include <netinet/ip.h>
1424 #if HAVE_NETINET_UDP_H
1425 # include <netinet/udp.h>
1429 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1439 # Checks for libraries begin here
1442 with_libresolv="yes"
1443 AC_CHECK_LIB(resolv, res_search,
1445 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1447 [with_libresolv="no"])
1448 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1450 dnl Check for HAL (hardware abstraction library)
1452 AC_CHECK_LIB(hal,libhal_device_property_exists,
1453 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1455 if test "x$with_libhal" = "xyes"; then
1456 if test "x$PKG_CONFIG" != "x"; then
1457 BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
1458 BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
1459 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1460 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1464 m4_divert_once([HELP_WITH], [
1465 collectd additional packages:])
1467 AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
1469 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1471 if test "x$ac_system" = "xAIX"
1476 with_perfstat="no (AIX only)"
1477 with_procinfo="no (AIX only)"
1480 if test "x$with_perfstat" = "xyes"
1482 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1483 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1485 if test "x$with_perfstat" = "xyes"
1487 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1488 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1489 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1490 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1492 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1495 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1497 # Processes plugin under AIX.
1498 if test "x$with_procinfo" = "xyes"
1500 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1502 if test "x$with_procinfo" = "xyes"
1504 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1507 if test "x$ac_system" = "xSolaris"
1512 with_kstat="no (Solaris only)"
1513 with_devinfo="no (Solaris only)"
1516 if test "x$with_kstat" = "xyes"
1518 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1520 if test "x$with_kstat" = "xyes"
1522 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1523 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1525 if test "x$with_kstat" = "xyes"
1527 AC_DEFINE(HAVE_LIBKSTAT, 1,
1528 [Define to 1 if you have the 'kstat' library (-lkstat)])
1530 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1531 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1534 if test "x$ac_system" = "xDarwin"
1540 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1543 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1544 if test "x$with_kvm_getprocs" = "xyes"
1546 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1547 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1550 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1552 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1553 if test "x$with_kvm_getswapinfo" = "xyes"
1555 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1556 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1559 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1561 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1562 if test "x$with_kvm_nlist" = "xyes"
1564 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1565 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1566 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1569 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1571 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1572 if test "x$with_kvm_openfiles" = "xyes"
1574 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1575 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1578 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1580 # --with-libaquaero5 {{{
1581 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1583 if test "x$withval" = "xyes"
1585 with_libaquaero5="yes"
1586 else if test "x$withval" = "xno"
1588 with_libaquaero5="no"
1590 with_libaquaero5="yes"
1591 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1592 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1595 [with_libaquaero5="yes"])
1597 SAVE_CPPFLAGS="$CPPFLAGS"
1598 SAVE_LDFLAGS="$LDFLAGS"
1600 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1601 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1603 if test "x$with_libaquaero5" = "xyes"
1605 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1607 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1609 AC_CHECK_HEADERS(libaquaero5.h,
1610 [with_libaquaero5="yes"],
1611 [with_libaquaero5="no (libaquaero5.h not found)"])
1613 if test "x$with_libaquaero5" = "xyes"
1615 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1617 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1619 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1620 [with_libaquaero5="yes"],
1621 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1624 CPPFLAGS="$SAVE_CPPFLAGS"
1625 LDFLAGS="$SAVE_LDFLAGS"
1627 if test "x$with_libaquaero5" = "xyes"
1629 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1630 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1631 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1632 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1634 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1637 # --with-libcredis {{{
1638 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1640 if test "x$withval" = "xyes"
1642 with_libcredis="yes"
1643 else if test "x$withval" = "xno"
1647 with_libcredis="yes"
1648 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1649 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1652 [with_libcredis="yes"])
1654 SAVE_CPPFLAGS="$CPPFLAGS"
1655 SAVE_LDFLAGS="$LDFLAGS"
1657 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1658 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1660 if test "x$with_libcredis" = "xyes"
1662 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1664 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1666 AC_CHECK_HEADERS(credis.h,
1667 [with_libcredis="yes"],
1668 [with_libcredis="no (credis.h not found)"])
1670 if test "x$with_libcredis" = "xyes"
1672 if test "x$LIBCREDIS_LDFLAGS" != "x"
1674 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1676 AC_CHECK_LIB(credis, credis_info,
1677 [with_libcredis="yes"],
1678 [with_libcredis="no (symbol 'credis_info' not found)"])
1682 CPPFLAGS="$SAVE_CPPFLAGS"
1683 LDFLAGS="$SAVE_LDFLAGS"
1685 if test "x$with_libcredis" = "xyes"
1687 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1688 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1689 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1690 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1692 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1695 # --with-libcurl {{{
1696 with_curl_config="curl-config"
1699 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1701 if test "x$withval" = "xno"
1704 else if test "x$withval" = "xyes"
1708 if test -f "$withval" && test -x "$withval"
1710 with_curl_config="$withval"
1712 else if test -x "$withval/bin/curl-config"
1714 with_curl_config="$withval/bin/curl-config"
1723 if test "x$with_libcurl" = "xyes"
1725 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1726 curl_config_status=$?
1728 if test $curl_config_status -ne 0
1730 with_libcurl="no ($with_curl_config failed)"
1732 SAVE_CPPFLAGS="$CPPFLAGS"
1733 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1735 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1737 CPPFLAGS="$SAVE_CPPFLAGS"
1740 if test "x$with_libcurl" = "xyes"
1742 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1743 curl_config_status=$?
1745 if test $curl_config_status -ne 0
1747 with_libcurl="no ($with_curl_config failed)"
1749 AC_CHECK_LIB(curl, curl_easy_init,
1750 [with_libcurl="yes"],
1751 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1755 if test "x$with_libcurl" = "xyes"
1757 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1758 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1759 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1760 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1762 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1766 with_libdbi_cppflags=""
1767 with_libdbi_ldflags=""
1768 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1770 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1772 with_libdbi_cppflags="-I$withval/include"
1773 with_libdbi_ldflags="-L$withval/lib"
1776 with_libdbi="$withval"
1782 if test "x$with_libdbi" = "xyes"
1784 SAVE_CPPFLAGS="$CPPFLAGS"
1785 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1787 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1789 CPPFLAGS="$SAVE_CPPFLAGS"
1791 if test "x$with_libdbi" = "xyes"
1793 SAVE_CPPFLAGS="$CPPFLAGS"
1794 SAVE_LDFLAGS="$LDFLAGS"
1795 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1796 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1798 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1800 CPPFLAGS="$SAVE_CPPFLAGS"
1801 LDFLAGS="$SAVE_LDFLAGS"
1803 if test "x$with_libdbi" = "xyes"
1805 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1806 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1807 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1808 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1809 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1810 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1812 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1815 # --with-libesmtp {{{
1816 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1818 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1820 LDFLAGS="$LDFLAGS -L$withval/lib"
1821 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1824 with_libesmtp="$withval"
1830 if test "x$with_libesmtp" = "xyes"
1832 AC_CHECK_LIB(esmtp, smtp_create_session,
1834 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1835 ], [with_libesmtp="no (libesmtp not found)"])
1837 if test "x$with_libesmtp" = "xyes"
1839 AC_CHECK_HEADERS(libesmtp.h,
1841 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1842 ], [with_libesmtp="no (libesmtp.h not found)"])
1844 if test "x$with_libesmtp" = "xyes"
1850 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1851 [Wether or not to use the esmtp library])
1852 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1855 # --with-libganglia {{{
1856 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1858 if test -f "$withval" && test -x "$withval"
1860 with_libganglia_config="$withval"
1861 with_libganglia="yes"
1862 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1864 with_libganglia_config="$withval/bin/ganglia-config"
1865 with_libganglia="yes"
1866 else if test -d "$withval"
1868 GANGLIA_CPPFLAGS="-I$withval/include"
1869 GANGLIA_LDFLAGS="-L$withval/lib"
1870 with_libganglia="yes"
1872 with_libganglia="$withval"
1876 with_libganglia="yes"
1879 if test "x$with_libganglia" = "xyes"
1881 if test "x$with_libganglia_config" != "x"
1883 if test "x$GANGLIA_CPPFLAGS" = "x"
1885 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1888 if test "x$GANGLIA_LDFLAGS" = "x"
1890 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1893 if test "x$GANGLIA_LIBS" = "x"
1895 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1898 GANGLIA_LIBS="-lganglia"
1902 SAVE_CPPFLAGS="$CPPFLAGS"
1903 SAVE_LDFLAGS="$LDFLAGS"
1904 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1905 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1907 if test "x$with_libganglia" = "xyes"
1909 AC_CHECK_HEADERS(gm_protocol.h,
1911 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1912 [Define to 1 if you have the <gm_protocol.h> header file.])
1913 ], [with_libganglia="no (gm_protocol.h not found)"])
1916 if test "x$with_libganglia" = "xyes"
1918 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1920 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1921 [Define to 1 if you have the ganglia library (-lganglia).])
1922 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1925 CPPFLAGS="$SAVE_CPPFLAGS"
1926 LDFLAGS="$SAVE_LDFLAGS"
1928 AC_SUBST(GANGLIA_CPPFLAGS)
1929 AC_SUBST(GANGLIA_LDFLAGS)
1930 AC_SUBST(GANGLIA_LIBS)
1931 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1934 # --with-libgcrypt {{{
1935 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1936 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1937 GCRYPT_LIBS="$GCRYPT_LIBS"
1938 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1940 if test -f "$withval" && test -x "$withval"
1942 with_libgcrypt_config="$withval"
1943 with_libgcrypt="yes"
1944 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1946 with_libgcrypt_config="$withval/bin/gcrypt-config"
1947 with_libgcrypt="yes"
1948 else if test -d "$withval"
1950 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1951 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1952 with_libgcrypt="yes"
1954 with_libgcrypt_config="gcrypt-config"
1955 with_libgcrypt="$withval"
1959 with_libgcrypt_config="libgcrypt-config"
1960 with_libgcrypt="yes"
1963 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1965 if test "x$GCRYPT_CPPFLAGS" = "x"
1967 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1970 if test "x$GCRYPT_LIBS" = "x"
1972 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1976 SAVE_CPPFLAGS="$CPPFLAGS"
1977 SAVE_LDFLAGS="$LDFLAGS"
1979 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1980 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1981 LIBS="$LIBS $GCRYPT_LIBS"
1983 if test "x$with_libgcrypt" = "xyes"
1985 if test "x$GCRYPT_CPPFLAGS" != "x"
1987 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1989 AC_CHECK_HEADERS(gcrypt.h,
1990 [with_libgcrypt="yes"],
1991 [with_libgcrypt="no (gcrypt.h not found)"])
1994 if test "x$with_libgcrypt" = "xyes"
1996 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1997 [with_libgcrypt="yes"],
1998 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2000 if test "$with_libgcrypt" != "no"; then
2001 m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
2002 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
2003 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
2007 CPPFLAGS="$SAVE_CPPFLAGS"
2008 LDFLAGS="$SAVE_LDFLAGS"
2011 if test "x$with_libgcrypt" = "xyes"
2013 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2016 AC_SUBST(GCRYPT_CPPFLAGS)
2017 AC_SUBST(GCRYPT_LDFLAGS)
2018 AC_SUBST(GCRYPT_LIBS)
2019 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2022 # --with-libiptc {{{
2023 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2025 if test "x$withval" = "xshipped"
2028 else if test "x$withval" = "xyes"
2030 with_libiptc="pkgconfig"
2031 else if test "x$withval" = "xno"
2036 with_libiptc_cflags="-I$withval/include"
2037 with_libiptc_libs="-L$withval/lib"
2041 if test "x$ac_system" = "xLinux"
2043 with_libiptc="pkgconfig"
2045 with_libiptc="no (Linux only)"
2049 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
2051 with_libiptc="no (Don't have pkg-config)"
2054 if test "x$with_libiptc" = "xpkgconfig"
2056 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2059 with_libiptc="no (pkg-config doesn't know libiptc)"
2062 if test "x$with_libiptc" = "xpkgconfig"
2064 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2067 with_libiptc="no ($PKG_CONFIG failed)"
2069 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2072 with_libiptc="no ($PKG_CONFIG failed)"
2076 SAVE_CPPFLAGS="$CPPFLAGS"
2077 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2079 # check whether the header file for libiptc is available.
2080 if test "x$with_libiptc" = "xpkgconfig"
2082 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2083 [with_libiptc="no (header file missing)"])
2085 # If the header file is available, check for the required type declaractions.
2086 # They may be missing in old versions of libiptc. In that case, they will be
2087 # declared in the iptables plugin.
2088 if test "x$with_libiptc" = "xpkgconfig"
2090 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2092 # Check for the iptc_init symbol in the library.
2093 # This could be in iptc or ip4tc
2094 if test "x$with_libiptc" = "xpkgconfig"
2097 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2098 [with_libiptc="pkgconfig"],
2099 [with_libiptc="no"],
2100 [$with_libiptc_libs])
2103 if test "x$with_libiptc" = "xpkgconfig"
2108 CPPFLAGS="$SAVE_CPPFLAGS"
2110 if test "x$with_libiptc" = "xown"
2112 with_libiptc_cflags=""
2113 with_libiptc_libs=""
2115 if test "x$with_libiptc" = "xown"
2117 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
2119 with_libiptc="no (Linux iptables headers not found)"
2122 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
2125 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
2126 if test "x$with_libiptc" = "xown"
2128 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
2132 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2133 if test "x$with_libiptc" = "xyes"
2135 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2136 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2137 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2138 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2143 with_java_home="$JAVA_HOME"
2144 if test "x$with_java_home" = "x"
2146 with_java_home="/usr/lib/jvm"
2148 with_java_vmtype="client"
2153 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2155 if test "x$withval" = "xno"
2158 else if test "x$withval" = "xyes"
2162 with_java_home="$withval"
2167 if test "x$with_java" = "xyes"
2169 if test -d "$with_java_home"
2171 AC_MSG_CHECKING([for jni.h])
2172 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2173 if test "x$TMPVAR" != "x"
2175 AC_MSG_RESULT([found in $TMPVAR])
2176 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2178 AC_MSG_RESULT([not found])
2181 AC_MSG_CHECKING([for jni_md.h])
2182 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2183 if test "x$TMPVAR" != "x"
2185 AC_MSG_RESULT([found in $TMPVAR])
2186 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2188 AC_MSG_RESULT([not found])
2191 AC_MSG_CHECKING([for libjvm.so])
2192 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2193 if test "x$TMPVAR" != "x"
2195 AC_MSG_RESULT([found in $TMPVAR])
2196 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2198 AC_MSG_RESULT([not found])
2201 if test "x$JAVAC" = "x"
2203 AC_MSG_CHECKING([for javac])
2204 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2205 if test "x$TMPVAR" != "x"
2208 AC_MSG_RESULT([$JAVAC])
2210 AC_MSG_RESULT([not found])
2213 if test "x$JAR" = "x"
2215 AC_MSG_CHECKING([for jar])
2216 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2217 if test "x$TMPVAR" != "x"
2220 AC_MSG_RESULT([$JAR])
2222 AC_MSG_RESULT([not found])
2225 else if test "x$with_java_home" != "x"
2227 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2231 if test "x$JAVA_CPPFLAGS" != "x"
2233 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2235 if test "x$JAVA_CFLAGS" != "x"
2237 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2239 if test "x$JAVA_LDFLAGS" != "x"
2241 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2243 if test "x$JAVAC" = "x"
2245 with_javac_path="$PATH"
2246 if test "x$with_java_home" != "x"
2248 with_javac_path="$with_java_home:with_javac_path"
2249 if test -d "$with_java_home/bin"
2251 with_javac_path="$with_java_home/bin:with_javac_path"
2255 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2257 if test "x$JAVAC" = "x"
2259 with_java="no (javac not found)"
2261 if test "x$JAR" = "x"
2263 with_jar_path="$PATH"
2264 if test "x$with_java_home" != "x"
2266 with_jar_path="$with_java_home:$with_jar_path"
2267 if test -d "$with_java_home/bin"
2269 with_jar_path="$with_java_home/bin:$with_jar_path"
2273 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2275 if test "x$JAR" = "x"
2277 with_java="no (jar not found)"
2280 SAVE_CPPFLAGS="$CPPFLAGS"
2281 SAVE_CFLAGS="$CFLAGS"
2282 SAVE_LDFLAGS="$LDFLAGS"
2283 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2284 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2285 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2287 if test "x$with_java" = "xyes"
2289 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2291 if test "x$with_java" = "xyes"
2293 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2295 [with_java="no (libjvm not found)"],
2298 if test "x$with_java" = "xyes"
2300 JAVA_LIBS="$JAVA_LIBS -ljvm"
2301 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2304 CPPFLAGS="$SAVE_CPPFLAGS"
2305 CFLAGS="$SAVE_CFLAGS"
2306 LDFLAGS="$SAVE_LDFLAGS"
2308 AC_SUBST(JAVA_CPPFLAGS)
2309 AC_SUBST(JAVA_CFLAGS)
2310 AC_SUBST(JAVA_LDFLAGS)
2312 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2315 # --with-liblvm2app {{{
2316 with_liblvm2app_cppflags=""
2317 with_liblvm2app_ldflags=""
2318 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2320 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2322 with_liblvm2app_cppflags="-I$withval/include"
2323 with_liblvm2app_ldflags="-L$withval/lib"
2324 with_liblvm2app="yes"
2326 with_liblvm2app="$withval"
2330 with_liblvm2app="yes"
2332 if test "x$with_liblvm2app" = "xyes"
2334 SAVE_CPPFLAGS="$CPPFLAGS"
2335 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2337 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2339 CPPFLAGS="$SAVE_CPPFLAGS"
2342 if test "x$with_liblvm2app" = "xyes"
2344 SAVE_CPPFLAGS="$CPPFLAGS"
2345 SAVE_LDFLAGS="$LDFLAGS"
2346 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2347 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2349 AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2351 CPPFLAGS="$SAVE_CPPFLAGS"
2352 LDFLAGS="$SAVE_LDFLAGS"
2354 if test "x$with_liblvm2app" = "xyes"
2356 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2357 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2358 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2359 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2360 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2361 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2362 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2364 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2367 # --with-libmemcached {{{
2368 with_libmemcached_cppflags=""
2369 with_libmemcached_ldflags=""
2370 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2372 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2374 with_libmemcached_cppflags="-I$withval/include"
2375 with_libmemcached_ldflags="-L$withval/lib"
2376 with_libmemcached="yes"
2378 with_libmemcached="$withval"
2382 with_libmemcached="yes"
2384 if test "x$with_libmemcached" = "xyes"
2386 SAVE_CPPFLAGS="$CPPFLAGS"
2387 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2389 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2391 CPPFLAGS="$SAVE_CPPFLAGS"
2393 if test "x$with_libmemcached" = "xyes"
2395 SAVE_CPPFLAGS="$CPPFLAGS"
2396 SAVE_LDFLAGS="$LDFLAGS"
2397 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2398 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2400 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2402 CPPFLAGS="$SAVE_CPPFLAGS"
2403 LDFLAGS="$SAVE_LDFLAGS"
2405 if test "x$with_libmemcached" = "xyes"
2407 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2408 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2409 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2410 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2411 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2412 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2413 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2415 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2418 # --with-libmodbus {{{
2419 with_libmodbus_config=""
2420 with_libmodbus_cflags=""
2421 with_libmodbus_libs=""
2422 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2424 if test "x$withval" = "xno"
2427 else if test "x$withval" = "xyes"
2429 with_libmodbus="use_pkgconfig"
2430 else if test -d "$with_libmodbus/lib"
2432 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2433 with_libmodbus_cflags="-I$withval/include"
2434 with_libmodbus_libs="-L$withval/lib -lmodbus"
2435 with_libmodbus="yes"
2438 [with_libmodbus="use_pkgconfig"])
2440 # configure using pkg-config
2441 if test "x$with_libmodbus" = "xuse_pkgconfig"
2443 if test "x$PKG_CONFIG" = "x"
2445 with_libmodbus="no (Don't have pkg-config)"
2448 if test "x$with_libmodbus" = "xuse_pkgconfig"
2450 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2451 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2454 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2457 if test "x$with_libmodbus" = "xuse_pkgconfig"
2459 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2462 with_libmodbus="no ($PKG_CONFIG failed)"
2464 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2467 with_libmodbus="no ($PKG_CONFIG failed)"
2470 if test "x$with_libmodbus" = "xuse_pkgconfig"
2472 with_libmodbus="yes"
2475 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2476 # the actual checks.
2477 if test "x$with_libmodbus" = "xyes"
2479 SAVE_CPPFLAGS="$CPPFLAGS"
2480 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2482 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
2484 CPPFLAGS="$SAVE_CPPFLAGS"
2486 if test "x$with_libmodbus" = "xyes"
2488 SAVE_CPPFLAGS="$CPPFLAGS"
2489 SAVE_LDFLAGS="$LDFLAGS"
2491 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2492 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2494 AC_CHECK_LIB(modbus, modbus_connect,
2495 [with_libmodbus="yes"],
2496 [with_libmodbus="no (symbol modbus_connect not found)"])
2498 CPPFLAGS="$SAVE_CPPFLAGS"
2499 LDFLAGS="$SAVE_LDFLAGS"
2501 if test "x$with_libmodbus" = "xyes"
2503 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2504 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2505 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2506 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2510 # --with-libmongoc {{{
2511 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2513 if test "x$withval" = "xyes"
2515 with_libmongoc="yes"
2516 else if test "x$withval" = "xno"
2520 with_libmongoc="yes"
2521 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2522 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2525 [with_libmongoc="yes"])
2527 SAVE_CPPFLAGS="$CPPFLAGS"
2528 SAVE_LDFLAGS="$LDFLAGS"
2530 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2531 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2533 if test "x$with_libmongoc" = "xyes"
2535 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2537 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2539 AC_CHECK_HEADERS(mongo.h,
2540 [with_libmongoc="yes"],
2541 [with_libmongoc="no ('mongo.h' not found)"],
2543 # define MONGO_HAVE_STDINT 1
2545 # define MONGO_USE_LONG_LONG_INT 1
2549 if test "x$with_libmongoc" = "xyes"
2551 if test "x$LIBMONGOC_LDFLAGS" != "x"
2553 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2555 AC_CHECK_LIB(mongoc, mongo_run_command,
2556 [with_libmongoc="yes"],
2557 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2560 CPPFLAGS="$SAVE_CPPFLAGS"
2561 LDFLAGS="$SAVE_LDFLAGS"
2563 if test "x$with_libmongoc" = "xyes"
2565 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2566 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2567 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2568 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2570 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2573 # --with-libmysql {{{
2574 with_mysql_config="mysql_config"
2575 with_mysql_cflags=""
2577 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2579 if test "x$withval" = "xno"
2582 else if test "x$withval" = "xyes"
2586 if test -f "$withval" && test -x "$withval";
2588 with_mysql_config="$withval"
2589 else if test -x "$withval/bin/mysql_config"
2591 with_mysql_config="$withval/bin/mysql_config"
2599 if test "x$with_libmysql" = "xyes"
2601 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
2602 mysql_config_status=$?
2604 if test $mysql_config_status -ne 0
2606 with_libmysql="no ($with_mysql_config failed)"
2608 SAVE_CPPFLAGS="$CPPFLAGS"
2609 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2612 have_mysql_mysql_h="no"
2613 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2615 if test "x$have_mysql_h" = "xno"
2617 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2620 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2622 with_libmysql="no (mysql.h not found)"
2625 CPPFLAGS="$SAVE_CPPFLAGS"
2628 if test "x$with_libmysql" = "xyes"
2630 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2631 mysql_config_status=$?
2633 if test $mysql_config_status -ne 0
2635 with_libmysql="no ($with_mysql_config failed)"
2637 SAVE_CPPFLAGS="$CPPFLAGS"
2638 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2640 LIBS="$with_mysql_libs"
2641 AC_SEARCH_LIBS([mysql_get_server_version],
2643 [with_libmysql="yes"],
2644 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2646 CPPFLAGS="$SAVE_CPPFLAGS"
2650 if test "x$with_libmysql" = "xyes"
2652 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2653 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2654 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2655 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2657 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2661 with_libmnl_cflags=""
2663 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
2665 echo "libmnl: withval = $withval"
2666 if test "x$withval" = "xyes"
2669 else if test "x$withval" = "xno"
2673 if test -d "$withval/include"
2675 with_libmnl_cflags="-I$withval/include"
2676 with_libmnl_libs="-L$withval/lib -lmnl"
2679 AC_MSG_ERROR("no such directory: $withval/include")
2684 if test "x$ac_system" = "xLinux"
2688 with_libmnl="no (Linux only library)"
2691 if test "x$PKG_CONFIG" = "x"
2693 with_libmnl="no (Don't have pkg-config)"
2695 if test "x$with_libmnl" = "xyes"
2697 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
2698 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
2699 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
2702 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
2708 #include <sys/types.h>
2709 #include <asm/types.h>
2710 #include <sys/socket.h>
2711 #include <linux/netlink.h>
2712 #include <linux/rtnetlink.h>])
2713 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2715 #include <sys/types.h>
2716 #include <asm/types.h>
2717 #include <sys/socket.h>])
2719 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2722 #include <sys/types.h>
2723 #include <asm/types.h>
2724 #include <sys/socket.h>
2725 #include <linux/netlink.h>
2726 #include <linux/rtnetlink.h>
2729 int retval = TCA_STATS2;
2733 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2735 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2738 #include <sys/types.h>
2739 #include <asm/types.h>
2740 #include <sys/socket.h>
2741 #include <linux/netlink.h>
2742 #include <linux/rtnetlink.h>
2745 int retval = TCA_STATS;
2749 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2751 if test "x$with_libmnl" = "xyes"
2753 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
2754 [with_libmnl="yes"],
2755 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
2756 [$with_libmnl_libs])
2758 if test "x$with_libmnl" = "xyes"
2760 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
2761 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
2762 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
2763 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
2764 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
2766 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
2769 # --with-libnetapp {{{
2770 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2771 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2772 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2773 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2774 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2775 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2776 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2778 if test -d "$withval"
2780 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2781 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2782 with_libnetapp="yes"
2784 with_libnetapp="$withval"
2788 with_libnetapp="yes"
2791 SAVE_CPPFLAGS="$CPPFLAGS"
2792 SAVE_LDFLAGS="$LDFLAGS"
2793 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2794 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2796 if test "x$with_libnetapp" = "xyes"
2798 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2800 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2802 AC_CHECK_HEADERS(netapp_api.h,
2803 [with_libnetapp="yes"],
2804 [with_libnetapp="no (netapp_api.h not found)"])
2807 if test "x$with_libnetapp" = "xyes"
2809 if test "x$LIBNETAPP_LDFLAGS" != "x"
2811 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2814 if test "x$LIBNETAPP_LIBS" = "x"
2816 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2818 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2820 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2821 [with_libnetapp="yes"],
2822 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2824 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2827 CPPFLAGS="$SAVE_CPPFLAGS"
2828 LDFLAGS="$SAVE_LDFLAGS"
2830 if test "x$with_libnetapp" = "xyes"
2832 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2835 AC_SUBST(LIBNETAPP_CPPFLAGS)
2836 AC_SUBST(LIBNETAPP_LDFLAGS)
2837 AC_SUBST(LIBNETAPP_LIBS)
2838 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2841 # --with-libnetsnmp {{{
2842 with_snmp_config="net-snmp-config"
2845 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2847 if test "x$withval" = "xno"
2849 with_libnetsnmp="no"
2850 else if test "x$withval" = "xyes"
2852 with_libnetsnmp="yes"
2854 if test -x "$withval"
2856 with_snmp_config="$withval"
2857 with_libnetsnmp="yes"
2859 with_snmp_config="$withval/bin/net-snmp-config"
2860 with_libnetsnmp="yes"
2864 [with_libnetsnmp="yes"])
2865 if test "x$with_libnetsnmp" = "xyes"
2867 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2868 snmp_config_status=$?
2870 if test $snmp_config_status -ne 0
2872 with_libnetsnmp="no ($with_snmp_config failed)"
2874 SAVE_CPPFLAGS="$CPPFLAGS"
2875 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2877 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2879 CPPFLAGS="$SAVE_CPPFLAGS"
2882 if test "x$with_libnetsnmp" = "xyes"
2884 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2885 snmp_config_status=$?
2887 if test $snmp_config_status -ne 0
2889 with_libnetsnmp="no ($with_snmp_config failed)"
2891 AC_CHECK_LIB(netsnmp, init_snmp,
2892 [with_libnetsnmp="yes"],
2893 [with_libnetsnmp="no (libnetsnmp not found)"],
2897 if test "x$with_libnetsnmp" = "xyes"
2899 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2900 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2901 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2902 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2904 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2907 # --with-liboconfig {{{
2908 with_own_liboconfig="no"
2909 liboconfig_LDFLAGS="$LDFLAGS"
2910 liboconfig_CPPFLAGS="$CPPFLAGS"
2911 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2913 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2915 if test -d "$withval/lib"
2917 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2919 if test -d "$withval/include"
2921 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2924 if test "x$withval" = "xno"
2926 AC_MSG_ERROR("liboconfig is required")
2930 with_liboconfig="yes"
2933 save_LDFLAGS="$LDFLAGS"
2934 save_CPPFLAGS="$CPPFLAGS"
2935 LDFLAGS="$liboconfig_LDFLAGS"
2936 CPPFLAGS="$liboconfig_CPPFLAGS"
2937 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2939 with_liboconfig="yes"
2940 with_own_liboconfig="no"
2943 with_liboconfig="yes"
2944 with_own_liboconfig="yes"
2945 LDFLAGS="$save_LDFLAGS"
2946 CPPFLAGS="$save_CPPFLAGS"
2949 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2950 if test "x$with_own_liboconfig" = "xyes"
2952 with_liboconfig="yes (shipped version)"
2956 # --with-liboping {{{
2957 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2959 if test "x$withval" = "xyes"
2962 else if test "x$withval" = "xno"
2967 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2968 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2971 [with_liboping="yes"])
2973 SAVE_CPPFLAGS="$CPPFLAGS"
2974 SAVE_LDFLAGS="$LDFLAGS"
2976 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2977 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2979 if test "x$with_liboping" = "xyes"
2981 if test "x$LIBOPING_CPPFLAGS" != "x"
2983 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2985 AC_CHECK_HEADERS(oping.h,
2986 [with_liboping="yes"],
2987 [with_liboping="no (oping.h not found)"])
2989 if test "x$with_liboping" = "xyes"
2991 if test "x$LIBOPING_LDFLAGS" != "x"
2993 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2995 AC_CHECK_LIB(oping, ping_construct,
2996 [with_liboping="yes"],
2997 [with_liboping="no (symbol 'ping_construct' not found)"])
3000 CPPFLAGS="$SAVE_CPPFLAGS"
3001 LDFLAGS="$SAVE_LDFLAGS"
3003 if test "x$with_liboping" = "xyes"
3005 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3006 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3007 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3008 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3010 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3014 with_oracle_cppflags=""
3016 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3018 if test "x$withval" = "xyes"
3020 if test "x$ORACLE_HOME" = "x"
3022 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3025 else if test "x$withval" = "xno"
3030 ORACLE_HOME="$withval"
3034 if test "x$ORACLE_HOME" = "x"
3036 with_oracle="no (ORACLE_HOME is not set)"
3041 if test "x$ORACLE_HOME" != "x"
3043 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3045 if test -e "$ORACLE_HOME/lib/ldflags"
3047 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3049 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3050 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3052 if test "x$with_oracle" = "xyes"
3054 SAVE_CPPFLAGS="$CPPFLAGS"
3055 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3057 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3059 CPPFLAGS="$SAVE_CPPFLAGS"
3061 if test "x$with_oracle" = "xyes"
3063 SAVE_CPPFLAGS="$CPPFLAGS"
3065 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3066 LIBS="$LIBS $with_oracle_libs"
3068 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3070 CPPFLAGS="$SAVE_CPPFLAGS"
3073 if test "x$with_oracle" = "xyes"
3075 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
3076 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3077 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
3078 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3082 # --with-libowcapi {{{
3083 with_libowcapi_cppflags=""
3084 with_libowcapi_libs="-lowcapi"
3085 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3087 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3089 with_libowcapi_cppflags="-I$withval/include"
3090 with_libowcapi_libs="-L$withval/lib -lowcapi"
3091 with_libowcapi="yes"
3093 with_libowcapi="$withval"
3097 with_libowcapi="yes"
3099 if test "x$with_libowcapi" = "xyes"
3101 SAVE_CPPFLAGS="$CPPFLAGS"
3102 CPPFLAGS="$with_libowcapi_cppflags"
3104 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3106 CPPFLAGS="$SAVE_CPPFLAGS"
3108 if test "x$with_libowcapi" = "xyes"
3110 SAVE_LDFLAGS="$LDFLAGS"
3111 SAVE_CPPFLAGS="$CPPFLAGS"
3112 LDFLAGS="$with_libowcapi_libs"
3113 CPPFLAGS="$with_libowcapi_cppflags"
3115 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3117 LDFLAGS="$SAVE_LDFLAGS"
3118 CPPFLAGS="$SAVE_CPPFLAGS"
3120 if test "x$with_libowcapi" = "xyes"
3122 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3123 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3124 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3125 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3129 # --with-libpcap {{{
3130 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3132 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3134 LDFLAGS="$LDFLAGS -L$withval/lib"
3135 CPPFLAGS="$CPPFLAGS -I$withval/include"
3138 with_libpcap="$withval"
3144 if test "x$with_libpcap" = "xyes"
3146 AC_CHECK_LIB(pcap, pcap_open_live,
3148 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3149 ], [with_libpcap="no (libpcap not found)"])
3151 if test "x$with_libpcap" = "xyes"
3153 AC_CHECK_HEADERS(pcap.h,,
3154 [with_libpcap="no (pcap.h not found)"])
3156 if test "x$with_libpcap" = "xyes"
3158 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3159 [c_cv_libpcap_have_pcap_error_iface_not_up],
3160 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3165 int val = PCAP_ERROR_IFACE_NOT_UP;
3169 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3170 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3172 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3174 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3176 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3179 # --with-libperl {{{
3180 perl_interpreter="perl"
3181 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3183 if test -f "$withval" && test -x "$withval"
3185 perl_interpreter="$withval"
3187 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3189 LDFLAGS="$LDFLAGS -L$withval/lib"
3190 CPPFLAGS="$CPPFLAGS -I$withval/include"
3191 perl_interpreter="$withval/bin/perl"
3194 with_libperl="$withval"
3201 AC_MSG_CHECKING([for perl])
3202 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3203 if test -x "$perl_interpreter"
3205 AC_MSG_RESULT([yes ($perl_interpreter)])
3211 AC_SUBST(PERL, "$perl_interpreter")
3213 if test "x$with_libperl" = "xyes" \
3214 && test -n "$perl_interpreter"
3216 SAVE_CFLAGS="$CFLAGS"
3218 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3219 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3220 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3221 CFLAGS="$CFLAGS $PERL_CFLAGS"
3222 LIBS="$LIBS $PERL_LIBS"
3224 AC_CACHE_CHECK([for libperl],
3225 [c_cv_have_libperl],
3226 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3228 #define PERL_NO_GET_CONTEXT
3235 load_module (PERL_LOADMOD_NOIMPORT,
3236 newSVpv ("Collectd::Plugin::FooBar", 24),
3240 [c_cv_have_libperl="yes"],
3241 [c_cv_have_libperl="no"]
3245 if test "x$c_cv_have_libperl" = "xyes"
3247 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3248 AC_SUBST(PERL_CFLAGS)
3254 CFLAGS="$SAVE_CFLAGS"
3256 else if test -z "$perl_interpreter"; then
3257 with_libperl="no (no perl interpreter found)"
3258 c_cv_have_libperl="no"
3260 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3262 if test "x$with_libperl" = "xyes"
3264 SAVE_CFLAGS="$CFLAGS"
3266 CFLAGS="$CFLAGS $PERL_CFLAGS"
3267 LIBS="$LIBS $PERL_LIBS"
3269 AC_CACHE_CHECK([if perl supports ithreads],
3270 [c_cv_have_perl_ithreads],
3271 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3277 #if !defined(USE_ITHREADS)
3278 # error "Perl does not support ithreads!"
3279 #endif /* !defined(USE_ITHREADS) */
3283 [c_cv_have_perl_ithreads="yes"],
3284 [c_cv_have_perl_ithreads="no"]
3288 if test "x$c_cv_have_perl_ithreads" = "xyes"
3290 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3293 CFLAGS="$SAVE_CFLAGS"
3297 if test "x$with_libperl" = "xyes"
3299 SAVE_CFLAGS="$CFLAGS"
3301 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3302 # (see issues #41 and #42)
3303 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3304 LIBS="$LIBS $PERL_LIBS"
3306 AC_CACHE_CHECK([for broken Perl_load_module()],
3307 [c_cv_have_broken_perl_load_module],
3308 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3310 #define PERL_NO_GET_CONTEXT
3317 load_module (PERL_LOADMOD_NOIMPORT,
3318 newSVpv ("Collectd::Plugin::FooBar", 24),
3322 [c_cv_have_broken_perl_load_module="no"],
3323 [c_cv_have_broken_perl_load_module="yes"]
3327 CFLAGS="$SAVE_CFLAGS"
3330 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3331 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3333 if test "x$with_libperl" = "xyes"
3335 SAVE_CFLAGS="$CFLAGS"
3337 CFLAGS="$CFLAGS $PERL_CFLAGS"
3338 LIBS="$LIBS $PERL_LIBS"
3341 [struct mgvtbl.svt_local],
3342 [have_struct_mgvtbl_svt_local="yes"],
3343 [have_struct_mgvtbl_svt_local="no"],
3350 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3352 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3353 [Define if Perl's struct mgvtbl has member svt_local.])
3356 CFLAGS="$SAVE_CFLAGS"
3362 with_pg_config="pg_config"
3363 with_libpq_includedir=""
3364 with_libpq_libdir=""
3365 with_libpq_cppflags=""
3366 with_libpq_ldflags=""
3367 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3370 if test "x$withval" = "xno"
3373 else if test "x$withval" = "xyes"
3377 if test -f "$withval" && test -x "$withval";
3379 with_pg_config="$withval"
3380 else if test -x "$withval/bin/pg_config"
3382 with_pg_config="$withval/bin/pg_config"
3390 if test "x$with_libpq" = "xyes"
3392 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3395 if test $pg_config_status -eq 0
3397 if test -n "$with_libpq_includedir"; then
3398 for dir in $with_libpq_includedir; do
3399 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3403 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3406 SAVE_CPPFLAGS="$CPPFLAGS"
3407 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3409 AC_CHECK_HEADERS(libpq-fe.h, [],
3410 [with_libpq="no (libpq-fe.h not found)"], [])
3412 CPPFLAGS="$SAVE_CPPFLAGS"
3414 if test "x$with_libpq" = "xyes"
3416 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3419 if test $pg_config_status -eq 0
3421 if test -n "$with_libpq_libdir"; then
3422 for dir in $with_libpq_libdir; do
3423 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3427 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3430 SAVE_LDFLAGS="$LDFLAGS"
3431 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3433 AC_CHECK_LIB(pq, PQconnectdb,
3435 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3437 AC_CHECK_LIB(pq, PQserverVersion,
3439 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3441 LDFLAGS="$SAVE_LDFLAGS"
3443 if test "x$with_libpq" = "xyes"
3445 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3446 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3447 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3448 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3450 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3453 # --with-libpthread {{{
3454 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3455 [ if test "x$withval" != "xno" \
3456 && test "x$withval" != "xyes"
3458 LDFLAGS="$LDFLAGS -L$withval/lib"
3459 CPPFLAGS="$CPPFLAGS -I$withval/include"
3460 with_libpthread="yes"
3462 if test "x$withval" = "xno"
3464 with_libpthread="no (disabled)"
3467 ], [with_libpthread="yes"])
3468 if test "x$with_libpthread" = "xyes"
3470 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3473 if test "x$with_libpthread" = "xyes"
3475 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3477 if test "x$with_libpthread" = "xyes"
3483 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3484 [Wether or not to use pthread (POSIX threads) library])
3485 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3490 with_python_path="$PATH"
3491 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3493 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3495 with_python="$withval"
3496 else if test -x "$withval"
3498 with_python_prog="$withval"
3499 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3501 else if test -d "$withval"
3503 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3506 AC_MSG_WARN([Argument not recognized: $withval])
3508 ], [with_python="yes"])
3511 SAVE_CPPFLAGS="$CPPFLAGS"
3512 SAVE_LDFLAGS="$LDFLAGS"
3515 PATH="$with_python_path"
3517 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3519 AC_MSG_CHECKING([for python])
3520 with_python_prog="`which python 2>/dev/null`"
3521 if test "x$with_python_prog" = "x"
3523 AC_MSG_RESULT([not found])
3524 with_python="no (interpreter not found)"
3526 AC_MSG_RESULT([$with_python_prog])
3530 if test "x$with_python" = "xyes"
3532 AC_MSG_CHECKING([for Python CPPFLAGS])
3533 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3534 python_config_status=$?
3536 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3538 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3541 AC_MSG_RESULT([$python_include_path])
3545 if test "x$with_python" = "xyes"
3547 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3548 AC_CHECK_HEADERS(Python.h,
3549 [with_python="yes"],
3550 [with_python="no ('Python.h' not found)"])
3553 if test "x$with_python" = "xyes"
3555 AC_MSG_CHECKING([for Python LDFLAGS])
3556 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`
3557 python_config_status=$?
3559 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3561 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3564 AC_MSG_RESULT([$python_library_path])
3568 if test "x$with_python" = "xyes"
3570 AC_MSG_CHECKING([for Python LIBS])
3571 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`
3572 python_config_status=$?
3574 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3576 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3579 AC_MSG_RESULT([$python_library_flags])
3583 if test "x$with_python" = "xyes"
3585 LDFLAGS="-L$python_library_path $LDFLAGS"
3586 LIBS="$python_library_flags $LIBS"
3588 AC_CHECK_FUNC(PyObject_CallFunction,
3589 [with_python="yes"],
3590 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3594 CPPFLAGS="$SAVE_CPPFLAGS"
3595 LDFLAGS="$SAVE_LDFLAGS"
3598 if test "x$with_python" = "xyes"
3600 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3601 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3602 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3603 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3604 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3605 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3609 # --with-librabbitmq {{{
3610 with_librabbitmq_cppflags=""
3611 with_librabbitmq_ldflags=""
3612 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3614 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3616 with_librabbitmq_cppflags="-I$withval/include"
3617 with_librabbitmq_ldflags="-L$withval/lib"
3618 with_librabbitmq="yes"
3620 with_librabbitmq="$withval"
3624 with_librabbitmq="yes"
3626 SAVE_CPPFLAGS="$CPPFLAGS"
3627 SAVE_LDFLAGS="$LDFLAGS"
3628 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3629 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3630 if test "x$with_librabbitmq" = "xyes"
3632 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3634 if test "x$with_librabbitmq" = "xyes"
3636 # librabbitmq up to version 0.9.1 provides "library_errno", later
3637 # versions use "library_error". The library does not provide a version
3638 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3639 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3642 # include <stdlib.h>
3648 # include <stdint.h>
3651 # include <inttypes.h>
3656 if test "x$with_librabbitmq" = "xyes"
3658 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3660 if test "x$with_librabbitmq" = "xyes"
3662 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3663 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3664 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3665 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3666 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3667 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3668 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3670 CPPFLAGS="$SAVE_CPPFLAGS"
3671 LDFLAGS="$SAVE_LDFLAGS"
3672 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3674 with_amqp_tcp_socket="no"
3675 if test "x$with_librabbitmq" = "xyes"
3677 SAVE_CPPFLAGS="$CPPFLAGS"
3678 SAVE_LDFLAGS="$LDFLAGS"
3680 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3681 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3684 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
3685 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
3686 if test "x$with_amqp_tcp_socket" = "xyes"
3688 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
3689 [Define if librabbitmq provides the new TCP socket interface.])
3692 AC_CHECK_DECLS(amqp_socket_close,
3693 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
3696 #ifdef HAVE_AMQP_TCP_SOCKET_H
3697 # include <amqp_tcp_socket.h>
3699 #ifdef HAVE_AMQP_SOCKET_H
3700 # include <amqp_socket.h>
3704 CPPFLAGS="$SAVE_CPPFLAGS"
3705 LDFLAGS="$SAVE_LDFLAGS"
3710 # --with-librouteros {{{
3711 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3713 if test "x$withval" = "xyes"
3715 with_librouteros="yes"
3716 else if test "x$withval" = "xno"
3718 with_librouteros="no"
3720 with_librouteros="yes"
3721 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3722 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3725 [with_librouteros="yes"])
3727 SAVE_CPPFLAGS="$CPPFLAGS"
3728 SAVE_LDFLAGS="$LDFLAGS"
3730 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3731 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3733 if test "x$with_librouteros" = "xyes"
3735 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3737 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3739 AC_CHECK_HEADERS(routeros_api.h,
3740 [with_librouteros="yes"],
3741 [with_librouteros="no (routeros_api.h not found)"])
3743 if test "x$with_librouteros" = "xyes"
3745 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3747 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3749 AC_CHECK_LIB(routeros, ros_interface,
3750 [with_librouteros="yes"],
3751 [with_librouteros="no (symbol 'ros_interface' not found)"])
3754 CPPFLAGS="$SAVE_CPPFLAGS"
3755 LDFLAGS="$SAVE_LDFLAGS"
3757 if test "x$with_librouteros" = "xyes"
3759 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3760 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3761 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3762 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3764 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3768 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3771 librrd_threadsafe="yes"
3772 librrd_rrdc_update="no"
3773 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3774 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3776 librrd_cflags="-I$withval/include"
3777 librrd_ldflags="-L$withval/lib"
3780 with_librrd="$withval"
3782 ], [with_librrd="yes"])
3783 if test "x$with_librrd" = "xyes"
3785 SAVE_CPPFLAGS="$CPPFLAGS"
3786 SAVE_LDFLAGS="$LDFLAGS"
3788 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3789 LDFLAGS="$LDFLAGS $librrd_ldflags"
3791 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3793 CPPFLAGS="$SAVE_CPPFLAGS"
3794 LDFLAGS="$SAVE_LDFLAGS"
3796 if test "x$with_librrd" = "xyes"
3798 SAVE_CPPFLAGS="$CPPFLAGS"
3799 SAVE_LDFLAGS="$LDFLAGS"
3801 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3802 LDFLAGS="$LDFLAGS $librrd_ldflags"
3804 AC_CHECK_LIB(rrd_th, rrd_update_r,
3806 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3808 [librrd_threadsafe="no"
3809 AC_CHECK_LIB(rrd, rrd_update,
3811 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3813 [with_librrd="no (symbol 'rrd_update' not found)"],
3818 if test "x$librrd_threadsafe" = "xyes"
3820 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3822 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3825 CPPFLAGS="$SAVE_CPPFLAGS"
3826 LDFLAGS="$SAVE_LDFLAGS"
3828 if test "x$with_librrd" = "xyes"
3830 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3831 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3832 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3833 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3835 if test "x$librrd_threadsafe" = "xyes"
3837 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3841 # --with-libsensors {{{
3842 with_sensors_cflags=""
3843 with_sensors_ldflags=""
3844 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3846 if test "x$withval" = "xno"
3848 with_libsensors="no"
3850 with_libsensors="yes"
3851 if test "x$withval" != "xyes"
3853 with_sensors_cflags="-I$withval/include"
3854 with_sensors_ldflags="-L$withval/lib"
3855 with_libsensors="yes"
3860 if test "x$ac_system" = "xLinux"
3862 with_libsensors="yes"
3864 with_libsensors="no (Linux only library)"
3867 if test "x$with_libsensors" = "xyes"
3869 SAVE_CPPFLAGS="$CPPFLAGS"
3870 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3872 # AC_CHECK_HEADERS(sensors/sensors.h,
3874 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3876 # [with_libsensors="no (sensors/sensors.h not found)"])
3877 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3879 CPPFLAGS="$SAVE_CPPFLAGS"
3881 if test "x$with_libsensors" = "xyes"
3883 SAVE_CPPFLAGS="$CPPFLAGS"
3884 SAVE_LDFLAGS="$LDFLAGS"
3885 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3886 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3888 AC_CHECK_LIB(sensors, sensors_init,
3890 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3892 [with_libsensors="no (libsensors not found)"])
3894 CPPFLAGS="$SAVE_CPPFLAGS"
3895 LDFLAGS="$SAVE_LDFLAGS"
3897 if test "x$with_libsensors" = "xyes"
3899 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3900 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3901 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3902 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3904 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3907 # --with-libsigrok {{{
3908 with_libsigrok_cflags=""
3909 with_libsigrok_ldflags=""
3910 AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
3912 if test "x$withval" = "xno"
3916 with_libsigrok="yes"
3917 if test "x$withval" != "xyes"
3919 with_libsigrok_cflags="-I$withval/include"
3920 with_libsigrok_ldflags="-L$withval/lib"
3923 ],[with_libsigrok="yes"])
3925 # libsigrok has a glib dependency
3926 if test "x$with_libsigrok" = "xyes"
3928 m4_ifdef([AM_PATH_GLIB_2_0],
3930 AM_PATH_GLIB_2_0([2.28.0],
3931 [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
3934 with_libsigrok="no (glib not available)"
3940 if test "x$with_libsigrok" = "xyes"
3942 SAVE_CPPFLAGS="$CPPFLAGS"
3943 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3945 AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
3947 CPPFLAGS="$SAVE_CPPFLAGS"
3951 if test "x$with_libsigrok" = "xyes"
3953 SAVE_CPPFLAGS="$CPPFLAGS"
3954 SAVE_LDFLAGS="$LDFLAGS"
3955 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3956 LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
3958 AC_CHECK_LIB(sigrok, sr_init,
3960 AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
3962 [with_libsigrok="no (libsigrok not found)"])
3964 CPPFLAGS="$SAVE_CPPFLAGS"
3965 LDFLAGS="$SAVE_LDFLAGS"
3967 if test "x$with_libsigrok" = "xyes"
3969 BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
3970 BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
3971 AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
3972 AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
3974 AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
3977 # --with-libstatgrab {{{
3978 with_libstatgrab_cflags=""
3979 with_libstatgrab_ldflags=""
3980 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3982 if test "x$withval" != "xno" \
3983 && test "x$withval" != "xyes"
3985 with_libstatgrab_cflags="-I$withval/include"
3986 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3987 with_libstatgrab="yes"
3988 with_libstatgrab_pkg_config="no"
3990 with_libstatgrab="$withval"
3991 with_libstatgrab_pkg_config="yes"
3995 with_libstatgrab="yes"
3996 with_libstatgrab_pkg_config="yes"
3999 if test "x$with_libstatgrab" = "xyes" \
4000 && test "x$with_libstatgrab_pkg_config" = "xyes"
4002 if test "x$PKG_CONFIG" != "x"
4004 AC_MSG_CHECKING([pkg-config for libstatgrab])
4006 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4009 with_libstatgrab_pkg_config="no"
4010 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4011 temp_result="not found"
4013 AC_MSG_RESULT([$temp_result])
4015 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
4016 with_libstatgrab_pkg_config="no"
4017 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
4021 if test "x$with_libstatgrab" = "xyes" \
4022 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4023 && test "x$with_libstatgrab_cflags" = "x"
4025 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4026 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4029 with_libstatgrab_cflags="$temp_result"
4031 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4032 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4034 AC_MSG_RESULT([$temp_result])
4037 if test "x$with_libstatgrab" = "xyes" \
4038 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4039 && test "x$with_libstatgrab_ldflags" = "x"
4041 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4042 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4045 with_libstatgrab_ldflags="$temp_result"
4047 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4048 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4050 AC_MSG_RESULT([$temp_result])
4053 if test "x$with_libstatgrab" = "xyes"
4055 SAVE_CPPFLAGS="$CPPFLAGS"
4056 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4058 AC_CHECK_HEADERS(statgrab.h,
4059 [with_libstatgrab="yes"],
4060 [with_libstatgrab="no (statgrab.h not found)"])
4062 CPPFLAGS="$SAVE_CPPFLAGS"
4065 if test "x$with_libstatgrab" = "xyes"
4067 SAVE_CFLAGS="$CFLAGS"
4068 SAVE_LDFLAGS="$LDFLAGS"
4070 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4071 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4073 AC_CHECK_LIB(statgrab, sg_init,
4074 [with_libstatgrab="yes"],
4075 [with_libstatgrab="no (symbol sg_init not found)"])
4077 CFLAGS="$SAVE_CFLAGS"
4078 LDFLAGS="$SAVE_LDFLAGS"
4081 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4082 if test "x$with_libstatgrab" = "xyes"
4084 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4085 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4086 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4087 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4088 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4092 # --with-libtokyotyrant {{{
4093 with_libtokyotyrant_cppflags=""
4094 with_libtokyotyrant_ldflags=""
4095 with_libtokyotyrant_libs=""
4096 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4098 if test "x$withval" = "xno"
4100 with_libtokyotyrant="no"
4101 else if test "x$withval" = "xyes"
4103 with_libtokyotyrant="yes"
4105 with_libtokyotyrant_cppflags="-I$withval/include"
4106 with_libtokyotyrant_ldflags="-L$withval/include"
4107 with_libtokyotyrant_libs="-ltokyotyrant"
4108 with_libtokyotyrant="yes"
4112 with_libtokyotyrant="yes"
4115 if test "x$with_libtokyotyrant" = "xyes"
4117 if $PKG_CONFIG --exists tokyotyrant
4119 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4120 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4121 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4125 SAVE_CPPFLAGS="$CPPFLAGS"
4126 SAVE_LDFLAGS="$LDFLAGS"
4127 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4128 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4130 if test "x$with_libtokyotyrant" = "xyes"
4132 AC_CHECK_HEADERS(tcrdb.h,
4134 AC_DEFINE(HAVE_TCRDB_H, 1,
4135 [Define to 1 if you have the <tcrdb.h> header file.])
4136 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
4139 if test "x$with_libtokyotyrant" = "xyes"
4141 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
4143 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
4144 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
4146 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
4147 [$with_libtokyotyrant_libs])
4150 CPPFLAGS="$SAVE_CPPFLAGS"
4151 LDFLAGS="$SAVE_LDFLAGS"
4153 if test "x$with_libtokyotyrant" = "xyes"
4155 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
4156 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
4157 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
4158 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
4159 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
4160 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
4162 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
4165 # --with-libupsclient {{{
4166 with_libupsclient_config=""
4167 with_libupsclient_cflags=""
4168 with_libupsclient_libs=""
4169 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
4171 if test "x$withval" = "xno"
4173 with_libupsclient="no"
4174 else if test "x$withval" = "xyes"
4176 with_libupsclient="use_pkgconfig"
4178 if test -x "$withval"
4180 with_libupsclient_config="$withval"
4181 with_libupsclient="use_libupsclient_config"
4182 else if test -x "$withval/bin/libupsclient-config"
4184 with_libupsclient_config="$withval/bin/libupsclient-config"
4185 with_libupsclient="use_libupsclient_config"
4187 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
4188 with_libupsclient_cflags="-I$withval/include"
4189 with_libupsclient_libs="-L$withval/lib -lupsclient"
4190 with_libupsclient="yes"
4194 [with_libupsclient="use_pkgconfig"])
4196 # configure using libupsclient-config
4197 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4199 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
4200 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
4203 with_libupsclient="no ($with_libupsclient_config failed)"
4205 with_libupsclient_libs="`$with_libupsclient_config --libs`"
4208 with_libupsclient="no ($with_libupsclient_config failed)"
4211 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4213 with_libupsclient="yes"
4216 # configure using pkg-config
4217 if test "x$with_libupsclient" = "xuse_pkgconfig"
4219 if test "x$PKG_CONFIG" = "x"
4221 with_libupsclient="no (Don't have pkg-config)"
4224 if test "x$with_libupsclient" = "xuse_pkgconfig"
4226 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4227 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4230 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4233 if test "x$with_libupsclient" = "xuse_pkgconfig"
4235 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4238 with_libupsclient="no ($PKG_CONFIG failed)"
4240 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4243 with_libupsclient="no ($PKG_CONFIG failed)"
4246 if test "x$with_libupsclient" = "xuse_pkgconfig"
4248 with_libupsclient="yes"
4251 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4252 # the actual checks.
4253 if test "x$with_libupsclient" = "xyes"
4255 SAVE_CPPFLAGS="$CPPFLAGS"
4256 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4258 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4260 CPPFLAGS="$SAVE_CPPFLAGS"
4262 if test "x$with_libupsclient" = "xyes"
4264 SAVE_CPPFLAGS="$CPPFLAGS"
4265 SAVE_LDFLAGS="$LDFLAGS"
4267 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4268 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4270 AC_CHECK_LIB(upsclient, upscli_connect,
4271 [with_libupsclient="yes"],
4272 [with_libupsclient="no (symbol upscli_connect not found)"])
4274 CPPFLAGS="$SAVE_CPPFLAGS"
4275 LDFLAGS="$SAVE_LDFLAGS"
4277 if test "x$with_libupsclient" = "xyes"
4279 SAVE_CPPFLAGS="$CPPFLAGS"
4280 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4282 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4283 [#include <stdlib.h>
4285 #include <upsclient.h>])
4287 CPPFLAGS="$SAVE_CPPFLAGS"
4289 if test "x$with_libupsclient" = "xyes"
4291 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4292 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4293 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4294 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4298 # --with-libxmms {{{
4299 with_xmms_config="xmms-config"
4302 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4304 if test "x$withval" != "xno" \
4305 && test "x$withval" != "xyes"
4307 if test -f "$withval" && test -x "$withval";
4309 with_xmms_config="$withval"
4310 else if test -x "$withval/bin/xmms-config"
4312 with_xmms_config="$withval/bin/xmms-config"
4315 else if test "x$withval" = "xno"
4325 if test "x$with_libxmms" = "xyes"
4327 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4328 xmms_config_status=$?
4330 if test $xmms_config_status -ne 0
4335 if test "x$with_libxmms" = "xyes"
4337 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4338 xmms_config_status=$?
4340 if test $xmms_config_status -ne 0
4345 if test "x$with_libxmms" = "xyes"
4347 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4349 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4350 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4351 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4352 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4359 with_libxmms_numeric=0
4360 if test "x$with_libxmms" = "xyes"
4362 with_libxmms_numeric=1
4364 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4365 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4368 # --with-libyajl {{{
4369 with_libyajl_cppflags=""
4370 with_libyajl_ldflags=""
4371 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4373 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4375 with_libyajl_cppflags="-I$withval/include"
4376 with_libyajl_ldflags="-L$withval/lib"
4379 with_libyajl="$withval"
4385 if test "x$with_libyajl" = "xyes"
4387 SAVE_CPPFLAGS="$CPPFLAGS"
4388 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4390 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4391 AC_CHECK_HEADERS(yajl/yajl_version.h)
4393 CPPFLAGS="$SAVE_CPPFLAGS"
4395 if test "x$with_libyajl" = "xyes"
4397 SAVE_CPPFLAGS="$CPPFLAGS"
4398 SAVE_LDFLAGS="$LDFLAGS"
4399 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4400 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4402 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4404 CPPFLAGS="$SAVE_CPPFLAGS"
4405 LDFLAGS="$SAVE_LDFLAGS"
4407 if test "x$with_libyajl" = "xyes"
4409 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4410 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4411 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4412 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4413 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4414 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4415 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4417 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4421 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
4422 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
4424 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
4426 if test "x$withval" = "xno"
4429 else if test "x$withval" = "xyes"
4432 else if test -d "$with_mic/lib"
4434 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
4435 with_mic_cflags="-I$withval/include"
4436 with_mic_ldpath="-L$withval/lib/Linux"
4437 with_mic_libs="-lMicAccessSDK -lscif -lpthread"
4442 if test "x$with_mic" = "xyes"
4444 SAVE_CPPFLAGS="$CPPFLAGS"
4445 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4446 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
4447 CPPFLAGS="$SAVE_CPPFLAGS"
4449 if test "x$with_mic" = "xyes"
4451 SAVE_CPPFLAGS="$CPPFLAGS"
4452 SAVE_LDFLAGS="$LDFLAGS"
4454 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4455 LDFLAGS="$LDFLAGS $with_mic_ldpath"
4457 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
4458 [with_mic_ldpath="$with_mic_ldpath"
4459 with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
4460 [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
4462 CPPFLAGS="$SAVE_CPPFLAGS"
4463 LDFLAGS="$SAVE_LDFLAGS"
4466 if test "x$with_mic" = "xyes"
4468 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
4469 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
4470 BUILD_WITH_MIC_LDADD="$with_mic_libs"
4471 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
4472 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
4473 AC_SUBST(BUILD_WITH_MIC_LDADD)
4477 # --with-libvarnish {{{
4478 with_libvarnish_cppflags=""
4479 with_libvarnish_cflags=""
4480 with_libvarnish_libs=""
4481 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4483 if test "x$withval" = "xno"
4485 with_libvarnish="no"
4486 else if test "x$withval" = "xyes"
4488 with_libvarnish="use_pkgconfig"
4489 else if test -d "$with_libvarnish/lib"
4491 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4492 with_libvarnish_cflags="-I$withval/include"
4493 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4494 with_libvarnish="yes"
4497 [with_libvarnish="use_pkgconfig"])
4499 # configure using pkg-config
4500 if test "x$with_libvarnish" = "xuse_pkgconfig"
4502 if test "x$PKG_CONFIG" = "x"
4504 with_libvarnish="no (Don't have pkg-config)"
4507 if test "x$with_libvarnish" = "xuse_pkgconfig"
4509 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4510 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4513 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4516 if test "x$with_libvarnish" = "xuse_pkgconfig"
4518 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4521 with_libvarnish="no ($PKG_CONFIG failed)"
4523 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4526 with_libvarnish="no ($PKG_CONFIG failed)"
4529 if test "x$with_libvarnish" = "xuse_pkgconfig"
4531 with_libvarnish="yes"
4534 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4535 # the actual checks.
4536 if test "x$with_libvarnish" = "xyes"
4538 SAVE_CPPFLAGS="$CPPFLAGS"
4539 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4540 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4542 CPPFLAGS="$SAVE_CPPFLAGS"
4544 if test "x$with_libvarnish" = "xyes"
4546 SAVE_CPPFLAGS="$CPPFLAGS"
4547 #SAVE_LDFLAGS="$LDFLAGS"
4549 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4550 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4552 AC_CHECK_HEADERS(varnish/vsc.h,
4553 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4554 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4556 CPPFLAGS="$SAVE_CPPFLAGS"
4557 #LDFLAGS="$SAVE_LDFLAGS"
4559 if test "x$with_libvarnish" = "xyes"
4561 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4562 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4563 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4564 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4568 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4569 with_libxml2="no (pkg-config isn't available)"
4570 with_libxml2_cflags=""
4571 with_libxml2_ldflags=""
4572 with_libvirt="no (pkg-config isn't available)"
4573 with_libvirt_cflags=""
4574 with_libvirt_ldflags=""
4575 if test "x$PKG_CONFIG" != "x"
4577 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
4582 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4585 $PKG_CONFIG --exists libvirt 2>/dev/null
4590 with_libvirt="no (pkg-config doesn't know libvirt)"
4593 if test "x$with_libxml2" = "xyes"
4595 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
4600 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
4606 if test "x$with_libxml2" = "xyes"
4608 SAVE_CPPFLAGS="$CPPFLAGS"
4609 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4611 AC_CHECK_HEADERS(libxml/parser.h, [],
4612 [with_libxml2="no (libxml/parser.h not found)"])
4614 CPPFLAGS="$SAVE_CPPFLAGS"
4616 if test "x$with_libxml2" = "xyes"
4618 SAVE_CFLAGS="$CFLAGS"
4619 SAVE_LDFLAGS="$LDFLAGS"
4621 CFLAGS="$CFLAGS $with_libxml2_cflags"
4622 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4624 AC_CHECK_LIB(xml2, xmlXPathEval,
4625 [with_libxml2="yes"],
4626 [with_libxml2="no (symbol xmlXPathEval not found)"])
4628 CFLAGS="$SAVE_CFLAGS"
4629 LDFLAGS="$SAVE_LDFLAGS"
4631 dnl Add the right compiler flags and libraries.
4632 if test "x$with_libxml2" = "xyes"; then
4633 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4634 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4635 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4636 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4638 if test "x$with_libvirt" = "xyes"
4640 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
4645 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
4651 if test "x$with_libvirt" = "xyes"
4653 SAVE_CPPFLAGS="$CPPFLAGS"
4654 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4656 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4657 [with_libvirt="no (libvirt/libvirt.h not found)"])
4659 CPPFLAGS="$SAVE_CPPFLAGS"
4661 if test "x$with_libvirt" = "xyes"
4663 SAVE_CFLAGS="$CFLAGS"
4664 SAVE_LDFLAGS="$LDFLAGS"
4666 CFLAGS="$CFLAGS $with_libvirt_cflags"
4667 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4669 AC_CHECK_LIB(virt, virDomainBlockStats,
4670 [with_libvirt="yes"],
4671 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4673 CFLAGS="$SAVE_CFLAGS"
4674 LDFLAGS="$SAVE_LDFLAGS"
4676 dnl Add the right compiler flags and libraries.
4677 if test "x$with_libvirt" = "xyes"; then
4678 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4679 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4680 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4681 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4685 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4686 with_libopenipmipthread="yes"
4687 with_libopenipmipthread_cflags=""
4688 with_libopenipmipthread_libs=""
4690 AC_MSG_CHECKING([for pkg-config])
4692 if test "x$PKG_CONFIG" = "x"
4694 with_libopenipmipthread="no"
4697 temp_result="$PKG_CONFIG"
4699 AC_MSG_RESULT([$temp_result])
4701 if test "x$with_libopenipmipthread" = "xyes"
4703 AC_MSG_CHECKING([for libOpenIPMIpthread])
4704 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4707 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4709 AC_MSG_RESULT([$with_libopenipmipthread])
4712 if test "x$with_libopenipmipthread" = "xyes"
4714 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4715 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4718 with_libopenipmipthread_cflags="$temp_result"
4720 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4721 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4723 AC_MSG_RESULT([$temp_result])
4726 if test "x$with_libopenipmipthread" = "xyes"
4728 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4729 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4732 with_libopenipmipthread_ldflags="$temp_result"
4734 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4735 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4737 AC_MSG_RESULT([$temp_result])
4740 if test "x$with_libopenipmipthread" = "xyes"
4742 SAVE_CPPFLAGS="$CPPFLAGS"
4743 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4745 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4746 [with_libopenipmipthread="yes"],
4747 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4748 [#include <OpenIPMI/ipmiif.h>
4749 #include <OpenIPMI/ipmi_err.h>
4750 #include <OpenIPMI/ipmi_posix.h>
4751 #include <OpenIPMI/ipmi_conn.h>
4754 CPPFLAGS="$SAVE_CPPFLAGS"
4757 if test "x$with_libopenipmipthread" = "xyes"
4759 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4760 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4761 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4762 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4766 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4767 [with_libnotify="yes"],
4768 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4771 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4774 # Check for enabled/disabled features
4777 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4778 # ------------------------------------------------------------
4780 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4785 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4790 m4_define([EnDis],[disabled])dnl
4791 m4_define([YesNo],[no])dnl
4797 m4_define([EnDis],[enabled])dnl
4798 m4_define([YesNo],[yes])dnl
4801 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4805 m4_if([$3], [feature], [],
4809 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4815 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4817 enable_$1='[YesNo]'dnl
4819 if test "x$enable_$1" = "xno"
4823 if test "x$enable_$1" = "xyes"
4827 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4832 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4833 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4835 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4837 # AC_PLUGIN(name, default, info)
4838 # ------------------------------------------------------------
4845 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
4847 if test "x$enableval" = "xyes"
4850 else if test "x$enableval" = "xforce"
4855 enable_plugin="no (disabled on command line)"
4859 if test "x$enable_all_plugins" = "xauto"
4861 if test "x$2" = "xyes"
4868 enable_plugin="$enable_all_plugins"
4871 if test "x$enable_plugin" = "xyes"
4873 if test "x$2" = "xyes" || test "x$force" = "xyes"
4875 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4876 if test "x$2" != "xyes"
4878 dependency_warning="yes"
4880 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4881 dependency_error="yes"
4882 enable_plugin="no (dependency error)"
4885 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4886 enable_$1="$enable_plugin"
4888 )# AC_PLUGIN(name, default, info)
4890 m4_divert_once([HELP_ENABLE], [
4891 collectd features:])
4892 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4893 AC_COLLECTD([debug], [enable], [feature], [debugging])
4894 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4895 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4897 dependency_warning="no"
4898 dependency_error="no"
4904 plugin_conntrack="no"
4905 plugin_contextswitch="no"
4908 plugin_curl_json="no"
4909 plugin_curl_xml="no"
4915 plugin_interface="no"
4922 plugin_multimeter="no"
4926 plugin_processes="no"
4927 plugin_protocols="no"
4931 plugin_tcpconns="no"
4938 plugin_wireless="no"
4942 if test "x$ac_system" = "xLinux"
4944 plugin_battery="yes"
4945 plugin_conntrack="yes"
4946 plugin_contextswitch="yes"
4947 plugin_cgroups="yes"
4949 plugin_cpufreq="yes"
4951 plugin_entropy="yes"
4952 plugin_fscache="yes"
4953 plugin_interface="yes"
4960 plugin_processes="yes"
4961 plugin_protocols="yes"
4964 plugin_tcpconns="yes"
4965 plugin_thermal="yes"
4968 plugin_vserver="yes"
4969 plugin_wireless="yes"
4971 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4977 if test "x$ac_system" = "xOpenBSD"
4979 plugin_tcpconns="yes"
4983 if test "x$with_libiokit" = "xyes"
4985 plugin_battery="yes"
4991 if test "x$ac_system" = "xAIX"
4993 plugin_tcpconns="yes"
4998 if test "x$ac_system" = "xFreeBSD"
5000 plugin_zfs_arc="yes"
5004 if test "x$with_perfstat" = "xyes"
5007 plugin_contextswitch="yes"
5011 plugin_interface="yes"
5016 if test "x$with_procinfo" = "xyes"
5018 plugin_processes="yes"
5022 if test "x$with_kstat" = "xyes"
5025 plugin_processes="yes"
5027 plugin_zfs_arc="yes"
5030 if test "x$with_devinfo$with_kstat" = "xyesyes"
5034 plugin_interface="yes"
5040 if test "x$with_libstatgrab" = "xyes"
5044 plugin_interface="yes"
5051 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5054 if test "x$have_strptime" = "xyes"
5060 if test "x$with_libopenipmipthread" = "xyes"
5065 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
5067 plugin_curl_json="yes"
5070 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5072 plugin_curl_xml="yes"
5075 if test "x$have_processor_info" = "xyes"
5079 if test "x$have_sysctl" = "xyes"
5084 if test "x$ac_system" = "xDarwin"
5089 if test "x$have_sysctlbyname" = "xyes"
5091 plugin_contextswitch="yes"
5094 plugin_tcpconns="yes"
5097 # Df plugin: Check if we know how to determine mount points first.
5098 #if test "x$have_listmntent" = "xyes"; then
5101 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
5105 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
5109 #if test "x$have_getmntent" = "xseq"
5113 if test "x$c_cv_have_one_getmntent" = "xyes"
5118 if test "x$c_cv_have_getmntent_r" = "xyes"
5123 # Df plugin: Check if we have either `statfs' or `statvfs' second.
5124 if test "x$plugin_df" = "xyes"
5127 if test "x$have_statfs" = "xyes"
5131 if test "x$have_statvfs" = "xyes"
5137 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
5139 plugin_ethstat="yes"
5142 if test "x$have_getifaddrs" = "xyes"
5144 plugin_interface="yes"
5147 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
5149 plugin_libvirt="yes"
5152 if test "x$have_getloadavg" = "xyes"
5157 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
5162 # Mac OS X memory interface
5163 if test "x$have_host_statistics" = "xyes"
5168 if test "x$have_termios_h" = "xyes"
5170 plugin_multimeter="yes"
5174 if test "x$have_thread_info" = "xyes"
5176 plugin_processes="yes"
5179 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
5181 plugin_processes="yes"
5184 if test "x$with_kvm_getswapinfo" = "xyes"
5189 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
5194 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
5196 plugin_tcpconns="yes"
5199 if test "x$have_getutent" = "xyes"
5203 if test "x$have_getutxent" = "xyes"
5208 m4_divert_once([HELP_ENABLE], [
5211 AC_ARG_ENABLE([all-plugins],
5212 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
5214 if test "x$enableval" = "xyes"
5216 enable_all_plugins="yes"
5217 else if test "x$enableval" = "xauto"
5219 enable_all_plugins="auto"
5221 enable_all_plugins="no"
5224 [enable_all_plugins="auto"])
5226 m4_divert_once([HELP_ENABLE], [])
5228 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
5229 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
5230 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
5231 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
5232 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
5233 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero's hardware sensors])
5234 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
5235 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
5236 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
5237 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
5238 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
5239 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
5240 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
5241 AC_PLUGIN([csv], [yes], [CSV output plugin])
5242 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
5243 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
5244 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
5245 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
5246 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
5247 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
5248 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
5249 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
5250 AC_PLUGIN([email], [yes], [EMail statistics])
5251 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
5252 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
5253 AC_PLUGIN([exec], [yes], [Execution of external programs])
5254 AC_PLUGIN([filecount], [yes], [Count files in directories])
5255 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
5256 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
5257 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
5258 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
5259 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
5260 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
5261 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
5262 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
5263 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
5264 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
5265 AC_PLUGIN([load], [$plugin_load], [System load])
5266 AC_PLUGIN([logfile], [yes], [File logging plugin])
5267 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
5268 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
5269 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
5270 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
5271 AC_PLUGIN([match_hashed], [yes], [The hashed match])
5272 AC_PLUGIN([match_regex], [yes], [The regex match])
5273 AC_PLUGIN([match_timediff], [yes], [The timediff match])
5274 AC_PLUGIN([match_value], [yes], [The value match])
5275 AC_PLUGIN([mbmon], [yes], [Query mbmond])
5276 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
5277 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
5278 AC_PLUGIN([memcached], [yes], [memcached statistics])
5279 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
5280 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
5281 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
5282 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
5283 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
5284 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
5285 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
5286 AC_PLUGIN([network], [yes], [Network communication plugin])
5287 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5288 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5289 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5290 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5291 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5292 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5293 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5294 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5295 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5296 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5297 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5298 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5299 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5300 # FIXME: Check for libevent, too.
5301 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5302 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5303 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5304 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5305 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5306 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5307 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5308 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5309 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5310 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5311 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5312 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5313 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5314 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
5315 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5316 AC_PLUGIN([statsd], [yes], [StatsD plugin])
5317 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5318 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5319 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5320 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5321 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5322 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5323 AC_PLUGIN([target_notification], [yes], [The notification target])
5324 AC_PLUGIN([target_replace], [yes], [The replace target])
5325 AC_PLUGIN([target_scale],[yes], [The scale target])
5326 AC_PLUGIN([target_set], [yes], [The set target])
5327 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5328 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5329 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5330 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5331 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5332 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5333 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5334 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5335 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5336 AC_PLUGIN([users], [$plugin_users], [User statistics])
5337 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5338 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5339 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5340 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5341 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5342 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5343 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5344 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5345 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5346 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5347 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5348 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5350 dnl Default configuration file
5351 # Load either syslog or logfile
5352 LOAD_PLUGIN_SYSLOG=""
5353 LOAD_PLUGIN_LOGFILE=""
5355 AC_MSG_CHECKING([which default log plugin to load])
5356 default_log_plugin="none"
5357 if test "x$enable_syslog" = "xyes"
5359 default_log_plugin="syslog"
5361 LOAD_PLUGIN_SYSLOG="##"
5364 if test "x$enable_logfile" = "xyes"
5366 if test "x$default_log_plugin" = "xnone"
5368 default_log_plugin="logfile"
5370 LOAD_PLUGIN_LOGFILE="#"
5373 LOAD_PLUGIN_LOGFILE="##"
5375 AC_MSG_RESULT([$default_log_plugin])
5377 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5378 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5380 DEFAULT_LOG_LEVEL="info"
5381 if test "x$enable_debug" = "xyes"
5383 DEFAULT_LOG_LEVEL="debug"
5385 AC_SUBST(DEFAULT_LOG_LEVEL)
5387 # Load only one of rrdtool, network, csv in the default config.
5388 LOAD_PLUGIN_RRDTOOL=""
5389 LOAD_PLUGIN_NETWORK=""
5392 AC_MSG_CHECKING([which default write plugin to load])
5393 default_write_plugin="none"
5394 if test "x$enable_rrdtool" = "xyes"
5396 default_write_plugin="rrdtool"
5398 LOAD_PLUGIN_RRDTOOL="##"
5401 if test "x$enable_network" = "xyes"
5403 if test "x$default_write_plugin" = "xnone"
5405 default_write_plugin="network"
5407 LOAD_PLUGIN_NETWORK="#"
5410 LOAD_PLUGIN_NETWORK="##"
5413 if test "x$enable_csv" = "xyes"
5415 if test "x$default_write_plugin" = "xnone"
5417 default_write_plugin="csv"
5422 LOAD_PLUGIN_CSV="##"
5424 AC_MSG_RESULT([$default_write_plugin])
5426 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5427 AC_SUBST(LOAD_PLUGIN_NETWORK)
5428 AC_SUBST(LOAD_PLUGIN_CSV)
5431 if test "x$ac_system" = "xLinux" \
5432 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5434 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5437 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5439 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5443 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
5444 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5446 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5448 PERL_BINDINGS_OPTIONS="$withval"
5449 with_perl_bindings="yes"
5451 with_perl_bindings="$withval"
5455 if test -n "$perl_interpreter"
5457 with_perl_bindings="yes"
5459 with_perl_bindings="no (no perl interpreter found)"
5462 if test "x$with_perl_bindings" = "xyes"
5464 PERL_BINDINGS="perl"
5468 AC_SUBST(PERL_BINDINGS)
5469 AC_SUBST(PERL_BINDINGS_OPTIONS)
5471 dnl libcollectdclient
5472 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5473 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5474 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5476 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5478 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5480 AC_SUBST(LCC_VERSION_MAJOR)
5481 AC_SUBST(LCC_VERSION_MINOR)
5482 AC_SUBST(LCC_VERSION_PATCH)
5483 AC_SUBST(LCC_VERSION_EXTRA)
5484 AC_SUBST(LCC_VERSION_STRING)
5486 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5488 AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
5491 if test "x$with_librrd" = "xyes" \
5492 && test "x$librrd_threadsafe" != "xyes"
5494 with_librrd="yes (warning: librrd is not thread-safe)"
5497 if test "x$with_libperl" = "xyes"
5499 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5501 enable_perl="no (needs libperl)"
5504 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5506 enable_perl="no (libperl doesn't support ithreads)"
5509 if test "x$with_perl_bindings" = "xyes" \
5510 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5512 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5519 intel mic . . . . . . $with_mic
5520 libaquaero5 . . . . . $with_libaquaero5
5521 libcredis . . . . . . $with_libcredis
5522 libcurl . . . . . . . $with_libcurl
5523 libdbi . . . . . . . $with_libdbi
5524 libesmtp . . . . . . $with_libesmtp
5525 libganglia . . . . . $with_libganglia
5526 libgcrypt . . . . . . $with_libgcrypt
5527 libhal . . . . . . . $with_libhal
5528 libiokit . . . . . . $with_libiokit
5529 libiptc . . . . . . . $with_libiptc
5530 libjvm . . . . . . . $with_java
5531 libkstat . . . . . . $with_kstat
5532 libkvm . . . . . . . $with_libkvm
5533 liblvm2app . . . . . $with_liblvm2app
5534 libmemcached . . . . $with_libmemcached
5535 libmnl . . . . . . . $with_libmnl
5536 libmodbus . . . . . . $with_libmodbus
5537 libmongoc . . . . . . $with_libmongoc
5538 libmysql . . . . . . $with_libmysql
5539 libnetapp . . . . . . $with_libnetapp
5540 libnetsnmp . . . . . $with_libnetsnmp
5541 libnotify . . . . . . $with_libnotify
5542 liboconfig . . . . . $with_liboconfig
5543 libopenipmi . . . . . $with_libopenipmipthread
5544 liboping . . . . . . $with_liboping
5545 libowcapi . . . . . . $with_libowcapi
5546 libpcap . . . . . . . $with_libpcap
5547 libperfstat . . . . . $with_perfstat
5548 libperl . . . . . . . $with_libperl
5549 libpq . . . . . . . . $with_libpq
5550 libpthread . . . . . $with_libpthread
5551 librabbitmq . . . . . $with_librabbitmq
5552 librouteros . . . . . $with_librouteros
5553 librrd . . . . . . . $with_librrd
5554 libsensors . . . . . $with_libsensors
5555 libsigrok . . . . . $with_libsigrok
5556 libstatgrab . . . . . $with_libstatgrab
5557 libtokyotyrant . . . $with_libtokyotyrant
5558 libupsclient . . . . $with_libupsclient
5559 libvarnish . . . . . $with_libvarnish
5560 libvirt . . . . . . . $with_libvirt
5561 libxml2 . . . . . . . $with_libxml2
5562 libxmms . . . . . . . $with_libxmms
5563 libyajl . . . . . . . $with_libyajl
5564 oracle . . . . . . . $with_oracle
5565 protobuf-c . . . . . $have_protoc_c
5566 python . . . . . . . $with_python
5569 daemon mode . . . . . $enable_daemon
5570 debug . . . . . . . . $enable_debug
5573 perl . . . . . . . . $with_perl_bindings
5576 aggregation . . . . . $enable_aggregation
5577 amqp . . . . . . . $enable_amqp
5578 apache . . . . . . . $enable_apache
5579 apcups . . . . . . . $enable_apcups
5580 aquaero . . . . . . . $enable_aquaero
5581 apple_sensors . . . . $enable_apple_sensors
5582 ascent . . . . . . . $enable_ascent
5583 battery . . . . . . . $enable_battery
5584 bind . . . . . . . . $enable_bind
5585 conntrack . . . . . . $enable_conntrack
5586 contextswitch . . . . $enable_contextswitch
5587 cgroups . . . . . . . $enable_cgroups
5588 cpu . . . . . . . . . $enable_cpu
5589 cpufreq . . . . . . . $enable_cpufreq
5590 csv . . . . . . . . . $enable_csv
5591 curl . . . . . . . . $enable_curl
5592 curl_json . . . . . . $enable_curl_json
5593 curl_xml . . . . . . $enable_curl_xml
5594 dbi . . . . . . . . . $enable_dbi
5595 df . . . . . . . . . $enable_df
5596 disk . . . . . . . . $enable_disk
5597 dns . . . . . . . . . $enable_dns
5598 email . . . . . . . . $enable_email
5599 entropy . . . . . . . $enable_entropy
5600 ethstat . . . . . . . $enable_ethstat
5601 exec . . . . . . . . $enable_exec
5602 filecount . . . . . . $enable_filecount
5603 fscache . . . . . . . $enable_fscache
5604 gmond . . . . . . . . $enable_gmond
5605 hddtemp . . . . . . . $enable_hddtemp
5606 interface . . . . . . $enable_interface
5607 ipmi . . . . . . . . $enable_ipmi
5608 iptables . . . . . . $enable_iptables
5609 ipvs . . . . . . . . $enable_ipvs
5610 irq . . . . . . . . . $enable_irq
5611 java . . . . . . . . $enable_java
5612 libvirt . . . . . . . $enable_libvirt
5613 load . . . . . . . . $enable_load
5614 logfile . . . . . . . $enable_logfile
5615 lpar . . . . . . . . $enable_lpar
5616 lvm . . . . . . . . . $enable_lvm
5617 madwifi . . . . . . . $enable_madwifi
5618 match_empty_counter . $enable_match_empty_counter
5619 match_hashed . . . . $enable_match_hashed
5620 match_regex . . . . . $enable_match_regex
5621 match_timediff . . . $enable_match_timediff
5622 match_value . . . . . $enable_match_value
5623 mbmon . . . . . . . . $enable_mbmon
5624 md . . . . . . . . . $enable_md
5625 memcachec . . . . . . $enable_memcachec
5626 memcached . . . . . . $enable_memcached
5627 memory . . . . . . . $enable_memory
5628 mic . . . . . . . . . $enable_mic
5629 modbus . . . . . . . $enable_modbus
5630 multimeter . . . . . $enable_multimeter
5631 mysql . . . . . . . . $enable_mysql
5632 netapp . . . . . . . $enable_netapp
5633 netlink . . . . . . . $enable_netlink
5634 network . . . . . . . $enable_network
5635 nfs . . . . . . . . . $enable_nfs
5636 nginx . . . . . . . . $enable_nginx
5637 notify_desktop . . . $enable_notify_desktop
5638 notify_email . . . . $enable_notify_email
5639 ntpd . . . . . . . . $enable_ntpd
5640 numa . . . . . . . . $enable_numa
5641 nut . . . . . . . . . $enable_nut
5642 olsrd . . . . . . . . $enable_olsrd
5643 onewire . . . . . . . $enable_onewire
5644 openvpn . . . . . . . $enable_openvpn
5645 oracle . . . . . . . $enable_oracle
5646 perl . . . . . . . . $enable_perl
5647 pf . . . . . . . . . $enable_pf
5648 pinba . . . . . . . . $enable_pinba
5649 ping . . . . . . . . $enable_ping
5650 postgresql . . . . . $enable_postgresql
5651 powerdns . . . . . . $enable_powerdns
5652 processes . . . . . . $enable_processes
5653 protocols . . . . . . $enable_protocols
5654 python . . . . . . . $enable_python
5655 redis . . . . . . . . $enable_redis
5656 routeros . . . . . . $enable_routeros
5657 rrdcached . . . . . . $enable_rrdcached
5658 rrdtool . . . . . . . $enable_rrdtool
5659 sensors . . . . . . . $enable_sensors
5660 serial . . . . . . . $enable_serial
5661 sigrok . . . . . . . $enable_sigrok
5662 snmp . . . . . . . . $enable_snmp
5663 statsd . . . . . . . $enable_statsd
5664 swap . . . . . . . . $enable_swap
5665 syslog . . . . . . . $enable_syslog
5666 table . . . . . . . . $enable_table
5667 tail . . . . . . . . $enable_tail
5668 tail_csv . . . . . . $enable_tail_csv
5669 tape . . . . . . . . $enable_tape
5670 target_notification . $enable_target_notification
5671 target_replace . . . $enable_target_replace
5672 target_scale . . . . $enable_target_scale
5673 target_set . . . . . $enable_target_set
5674 target_v5upgrade . . $enable_target_v5upgrade
5675 tcpconns . . . . . . $enable_tcpconns
5676 teamspeak2 . . . . . $enable_teamspeak2
5677 ted . . . . . . . . . $enable_ted
5678 thermal . . . . . . . $enable_thermal
5679 threshold . . . . . . $enable_threshold
5680 tokyotyrant . . . . . $enable_tokyotyrant
5681 unixsock . . . . . . $enable_unixsock
5682 uptime . . . . . . . $enable_uptime
5683 users . . . . . . . . $enable_users
5684 uuid . . . . . . . . $enable_uuid
5685 varnish . . . . . . . $enable_varnish
5686 vmem . . . . . . . . $enable_vmem
5687 vserver . . . . . . . $enable_vserver
5688 wireless . . . . . . $enable_wireless
5689 write_graphite . . . $enable_write_graphite
5690 write_http . . . . . $enable_write_http
5691 write_mongodb . . . . $enable_write_mongodb
5692 write_redis . . . . . $enable_write_redis
5693 write_riemann . . . . $enable_write_riemann
5694 xmms . . . . . . . . $enable_xmms
5695 zfs_arc . . . . . . . $enable_zfs_arc
5699 if test "x$dependency_error" = "xyes"; then
5700 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5703 if test "x$dependency_warning" = "xyes"; then
5704 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5707 # vim: set fdm=marker :