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.
52 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
59 # Warn when pkg.m4 is missing
60 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
64 AC_CACHE_CHECK([if bison is the parser generator],
65 [collectd_cv_prog_bison],
66 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
67 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
71 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
73 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
76 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
77 if test "x$have_protoc_c" = "xno"
79 have_protoc_c="no (protoc-c compiler not found)"
82 if test "x$have_protoc_c" = "xyes"
84 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
85 [have_protoc_c="yes"; break],
86 [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
88 if test "x$have_protoc_c" = "xyes"
90 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
91 [have_protoc_c="yes"],
92 [have_protoc_c="no (libprotobuf-c not found)"])
95 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
97 AC_MSG_CHECKING([for kernel type ($host_os)])
100 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
104 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
114 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
118 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
124 AC_MSG_RESULT([$ac_system])
126 if test "x$ac_system" = "xLinux"
128 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
129 if test -z "$KERNEL_DIR"
131 KERNEL_DIR="/lib/modules/`uname -r`/source"
134 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
135 AC_SUBST(KERNEL_CFLAGS)
138 if test "x$ac_system" = "xSolaris"
140 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
141 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
143 if test "x$ac_system" = "xAIX"
145 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
148 # Where to install .pc files.
149 pkgconfigdir="${libdir}/pkgconfig"
150 AC_SUBST(pkgconfigdir)
152 # Check for standards compliance mode
153 AC_ARG_ENABLE(standards,
154 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
155 [enable_standards="$enableval"],
156 [enable_standards="no"])
157 if test "x$enable_standards" = "xyes"
159 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
160 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
161 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
162 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
163 if test "x$GCC" = "xyes"
165 CFLAGS="$CFLAGS -std=c99"
168 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
171 # Checks for header files.
178 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)
181 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
186 # include <sys/types.h>
189 AC_CHECK_HEADERS(netinet/in.h, [], [],
194 # include <sys/types.h>
196 #if HAVE_NETINET_IN_SYSTM_H
197 # include <netinet/in_systm.h>
200 AC_CHECK_HEADERS(netinet/ip.h, [], [],
205 # include <sys/types.h>
207 #if HAVE_NETINET_IN_SYSTM_H
208 # include <netinet/in_systm.h>
210 #if HAVE_NETINET_IN_H
211 # include <netinet/in.h>
214 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
219 # include <sys/types.h>
221 #if HAVE_NETINET_IN_SYSTM_H
222 # include <netinet/in_systm.h>
224 #if HAVE_NETINET_IN_H
225 # include <netinet/in.h>
227 #if HAVE_NETINET_IP_H
228 # include <netinet/ip.h>
231 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
236 # include <sys/types.h>
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
244 #if HAVE_NETINET_IP_H
245 # include <netinet/ip.h>
248 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
253 # include <sys/types.h>
255 #if HAVE_NETINET_IN_SYSTM_H
256 # include <netinet/in_systm.h>
258 #if HAVE_NETINET_IN_H
259 # include <netinet/in.h>
262 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
267 # include <sys/types.h>
269 #if HAVE_NETINET_IN_SYSTM_H
270 # include <netinet/in_systm.h>
272 #if HAVE_NETINET_IN_H
273 # include <netinet/in.h>
275 #if HAVE_NETINET_IP6_H
276 # include <netinet/ip6.h>
279 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
284 # include <sys/types.h>
286 #if HAVE_NETINET_IN_SYSTM_H
287 # include <netinet/in_systm.h>
289 #if HAVE_NETINET_IN_H
290 # include <netinet/in.h>
292 #if HAVE_NETINET_IP_H
293 # include <netinet/ip.h>
296 AC_CHECK_HEADERS(netinet/udp.h, [], [],
301 # include <sys/types.h>
303 #if HAVE_NETINET_IN_SYSTM_H
304 # include <netinet/in_systm.h>
306 #if HAVE_NETINET_IN_H
307 # include <netinet/in.h>
309 #if HAVE_NETINET_IP_H
310 # include <netinet/ip.h>
315 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
320 # include <sys/types.h>
322 #if HAVE_NETINET_IN_SYSTM_H
323 # include <netinet/in_systm.h>
325 #if HAVE_NETINET_IN_H
326 # include <netinet/in.h>
328 #if HAVE_NETINET_IP6_H
329 # include <netinet/ip6.h>
333 if test "x$have_ip6_ext" = "xno"; then
334 SAVE_CFLAGS="$CFLAGS"
335 CFLAGS="$CFLAGS -DSOLARIS2=8"
337 AC_CHECK_TYPES([struct ip6_ext],
338 [have_ip6_ext="yes, with -DSOLARIS2=8"],
344 # include <sys/types.h>
346 #if HAVE_NETINET_IN_SYSTM_H
347 # include <netinet/in_systm.h>
349 #if HAVE_NETINET_IN_H
350 # include <netinet/in.h>
352 #if HAVE_NETINET_IP6_H
353 # include <netinet/ip6.h>
357 if test "x$have_ip6_ext" = "xno"; then
358 CFLAGS="$SAVE_CFLAGS"
363 AC_CHECK_HEADERS(sys/dkstat.h)
364 if test "x$ac_system" = "xDarwin"
366 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)
367 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
368 # For the battery plugin
369 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
371 #if HAVE_IOKIT_IOKITLIB_H
372 # include <IOKit/IOKitLib.h>
374 #if HAVE_IOKIT_IOTYPES_H
375 # include <IOKit/IOTypes.h>
381 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
384 # include <sys/types.h>
387 # include <sys/param.h>
391 AC_MSG_CHECKING([for sysctl kern.cp_times])
392 if test -x /sbin/sysctl
394 /sbin/sysctl kern.cp_times 2>/dev/null
398 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
399 [Define if sysctl supports kern.cp_times])
408 AC_CHECK_HEADERS(linux/major.h)
410 # For md module (Linux only)
411 if test "x$ac_system" = "xLinux"
413 AC_CHECK_HEADERS(linux/raid/md_u.h,
414 [have_linux_raid_md_u_h="yes"],
415 [have_linux_raid_md_u_h="no"],
417 #include <sys/ioctl.h>
418 #include <linux/major.h>
419 #include <linux/types.h>
422 have_linux_raid_md_u_h="no"
425 # For the swap module
426 have_linux_wireless_h="no"
427 if test "x$ac_system" = "xLinux"
429 AC_CHECK_HEADERS(linux/wireless.h,
430 [have_linux_wireless_h="yes"],
431 [have_linux_wireless_h="no"],
434 #include <sys/ioctl.h>
435 #include <sys/socket.h>
439 # For the swap module
440 have_sys_swap_h="yes"
441 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
443 #undef _FILE_OFFSET_BITS
444 #undef _LARGEFILE64_SOURCE
446 # include <sys/types.h>
449 # include <sys/param.h>
453 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
456 if test "x$GCC" = "xyes"
458 hint_64="CFLAGS='-m64'"
460 hint_64="CFLAGS='-xarch=v9'"
462 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
466 # For the processes plugin
468 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
470 # For interface plugin
471 AC_CHECK_HEADERS(ifaddrs.h)
472 AC_CHECK_HEADERS(net/if.h, [], [],
475 # include <sys/types.h>
477 #if HAVE_SYS_SOCKET_H
478 # include <sys/socket.h>
481 AC_CHECK_HEADERS(linux/if.h, [], [],
484 # include <sys/types.h>
486 #if HAVE_SYS_SOCKET_H
487 # include <sys/socket.h>
490 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
493 # include <sys/types.h>
495 #if HAVE_SYS_SOCKET_H
496 # include <sys/socket.h>
498 #if HAVE_LINUX_INET_DIAG_H
499 # include <linux/inet_diag.h>
502 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
505 # include <sys/types.h>
507 #if HAVE_SYS_SOCKET_H
508 # include <sys/socket.h>
511 # include <linux/if.h>
516 AC_CHECK_HEADERS(linux/sockios.h,
517 [have_linux_sockios_h="yes"],
518 [have_linux_sockios_h="no"],
521 # include <sys/ioctl.h>
527 AC_CHECK_HEADERS(linux/ethtool.h,
528 [have_linux_ethtool_h="yes"],
529 [have_linux_ethtool_h="no"],
532 # include <sys/ioctl.h>
537 #if HAVE_LINUX_SOCKIOS_H
538 # include <linux/sockios.h>
543 have_linux_ip_vs_h="no"
544 have_net_ip_vs_h="no"
546 ip_vs_h_needs_kernel_cflags="no"
547 if test "x$ac_system" = "xLinux"
549 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
550 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
551 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
553 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
555 SAVE_CFLAGS="$CFLAGS"
556 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
558 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
560 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
561 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
562 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
564 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
566 ip_vs_h_needs_kernel_cflags="yes"
569 CFLAGS="$SAVE_CFLAGS"
572 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
575 AC_CHECK_HEADERS(sys/ucred.h, [], [],
578 # include <sys/types.h>
581 # include <sys/param.h>
585 # For mount interface
586 AC_CHECK_HEADERS(sys/mount.h, [], [],
589 # include <sys/types.h>
592 # include <sys/param.h>
596 # For the email plugin
597 AC_CHECK_HEADERS(linux/un.h, [], [],
599 #if HAVE_SYS_SOCKET_H
600 # include <sys/socket.h>
627 AC_CHECK_HEADERS([xfs/xqm.h], [], [],
633 AC_CHECK_HEADERS(arpa/nameser.h)
634 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
636 #if HAVE_ARPA_NAMESER_H
637 # include <arpa/nameser.h>
641 AC_CHECK_HEADERS(net/if_arp.h, [], [],
642 [#if HAVE_SYS_SOCKET_H
643 # include <sys/socket.h>
646 AC_CHECK_HEADERS(net/ppp_defs.h)
647 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
648 [#if HAVE_NET_PPP_DEFS_H
649 # include <net/ppp_defs.h>
652 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
657 # include <sys/types.h>
659 #if HAVE_SYS_SOCKET_H
660 # include <sys/socket.h>
665 #if HAVE_NETINET_IN_H
666 # include <netinet/in.h>
670 AC_CHECK_HEADERS(netinet/ip_compat.h)
672 have_net_pfvar_h="no"
673 AC_CHECK_HEADERS(net/pfvar.h,
674 [have_net_pfvar_h="yes"],
675 [have_net_pfvar_h="no"],
678 # include <sys/ioctl.h>
680 #if HAVE_SYS_SOCKET_H
681 # include <sys/socket.h>
686 #if HAVE_NETINET_IN_H
687 # include <netinet/in.h>
691 # For the multimeter plugin
693 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
696 # Checks for typedefs, structures, and compiler characteristics.
705 # Checks for library functions.
707 AC_PROG_GCC_TRADITIONAL
708 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
712 SAVE_CFLAGS="$CFLAGS"
713 # Emulate behavior of src/Makefile.am
714 if test "x$GCC" = "xyes"
716 CFLAGS="$CFLAGS -Wall -Werror"
719 AC_CACHE_CHECK([for strtok_r],
720 [c_cv_have_strtok_r_default],
729 char buffer[] = "foo,bar,baz";
736 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
739 printf ("token = %s;\n", token);
743 [c_cv_have_strtok_r_default="yes"],
744 [c_cv_have_strtok_r_default="no"]
748 if test "x$c_cv_have_strtok_r_default" = "xno"
750 CFLAGS="$CFLAGS -D_REENTRANT=1"
752 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
753 [c_cv_have_strtok_r_reentrant],
762 char buffer[] = "foo,bar,baz";
769 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
772 printf ("token = %s;\n", token);
776 [c_cv_have_strtok_r_reentrant="yes"],
777 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
782 CFLAGS="$SAVE_CFLAGS"
783 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
785 CFLAGS="$CFLAGS -D_REENTRANT=1"
788 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
790 socket_needs_socket="no"
791 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
792 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
794 clock_gettime_needs_rt="no"
795 clock_gettime_needs_posix4="no"
796 have_clock_gettime="no"
797 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
798 if test "x$have_clock_gettime" = "xno"
800 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
801 have_clock_gettime="yes"])
803 if test "x$have_clock_gettime" = "xno"
805 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
806 have_clock_gettime="yes"])
808 if test "x$have_clock_gettime" = "xyes"
810 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
812 AC_MSG_WARN(cannot find clock_gettime)
815 nanosleep_needs_rt="no"
816 nanosleep_needs_posix4="no"
817 AC_CHECK_FUNCS(nanosleep,
819 AC_CHECK_LIB(rt, nanosleep,
820 [nanosleep_needs_rt="yes"],
821 AC_CHECK_LIB(posix4, nanosleep,
822 [nanosleep_needs_posix4="yes"],
823 AC_MSG_ERROR(cannot find nanosleep))))
825 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
826 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
828 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
829 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
830 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
831 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
832 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
833 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
834 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
835 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
836 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
837 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
838 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
839 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
841 # Check for strptime {{{
842 if test "x$GCC" = "xyes"
844 SAVE_CFLAGS="$CFLAGS"
845 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
848 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
849 if test "x$have_strptime" = "xyes"
851 AC_CACHE_CHECK([whether strptime is exported by default],
852 [c_cv_have_strptime_default],
853 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
859 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
862 [c_cv_have_strptime_default="yes"],
863 [c_cv_have_strptime_default="no"]))
865 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
867 AC_CACHE_CHECK([whether strptime needs standards mode],
868 [c_cv_have_strptime_standards],
869 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
871 #ifndef _ISOC99_SOURCE
872 # define _ISOC99_SOURCE 1
874 #ifndef _POSIX_C_SOURCE
875 # define _POSIX_C_SOURCE 200112L
877 #ifndef _XOPEN_SOURCE
878 # define _XOPEN_SOURCE 500
884 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
887 [c_cv_have_strptime_standards="yes"],
888 [c_cv_have_strptime_standards="no"]))
890 if test "x$c_cv_have_strptime_standards" = "xyes"
892 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
898 if test "x$GCC" = "xyes"
900 CFLAGS="$SAVE_CFLAGS"
902 # }}} Check for strptime
904 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
905 if test "x$have_swapctl" = "xyes"; then
906 AC_CACHE_CHECK([whether swapctl takes two arguments],
907 [c_cv_have_swapctl_two_args],
908 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
910 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
911 # undef _FILE_OFFSET_BITS
912 # undef _LARGEFILE64_SOURCE
914 #include <sys/stat.h>
915 #include <sys/swap.h>
918 int num = swapctl(0, NULL);
921 [c_cv_have_swapctl_two_args="yes"],
922 [c_cv_have_swapctl_two_args="no"]
925 AC_CACHE_CHECK([whether swapctl takes three arguments],
926 [c_cv_have_swapctl_three_args],
930 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
931 # undef _FILE_OFFSET_BITS
932 # undef _LARGEFILE64_SOURCE
934 #include <sys/stat.h>
935 #include <sys/swap.h>
938 int num = swapctl(0, NULL, 0);
941 [c_cv_have_swapctl_three_args="yes"],
942 [c_cv_have_swapctl_three_args="no"]
946 # Check for different versions of `swapctl' here..
947 if test "x$have_swapctl" = "xyes"; then
948 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
949 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
950 [Define if the function swapctl exists and takes two arguments.])
952 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
953 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
954 [Define if the function swapctl exists and takes three arguments.])
959 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
961 if test "x$withval" = "xno"; then
963 else if test "x$withval" = "xyes"; then
970 if test "x$nan_type" = "xnone"; then
971 AC_CACHE_CHECK([whether NAN is defined by default],
972 [c_cv_have_nan_default],
973 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
977 static double foo = NAN;
986 [c_cv_have_nan_default="yes"],
987 [c_cv_have_nan_default="no"]
990 if test "x$c_cv_have_nan_default" = "xyes"
995 if test "x$nan_type" = "xnone"; then
996 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
997 [c_cv_have_nan_isoc],
998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1001 #define __USE_ISOC99 1
1003 static double foo = NAN;
1012 [c_cv_have_nan_isoc="yes"],
1013 [c_cv_have_nan_isoc="no"]
1016 if test "x$c_cv_have_nan_isoc" = "xyes"
1021 if test "x$nan_type" = "xnone"; then
1022 SAVE_LDFLAGS=$LDFLAGS
1023 LDFLAGS="$LDFLAGS -lm"
1024 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1025 [c_cv_have_nan_zero],
1026 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1033 #define NAN (0.0 / 0.0)
1035 # define isnan(f) ((f) != (f))
1037 static double foo = NAN;
1046 [c_cv_have_nan_zero="yes"],
1047 [c_cv_have_nan_zero="no"]
1050 LDFLAGS=$SAVE_LDFLAGS
1051 if test "x$c_cv_have_nan_zero" = "xyes"
1057 if test "x$nan_type" = "xdefault"; then
1058 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1059 [Define if NAN is defined by default and can initialize static variables.])
1060 else if test "x$nan_type" = "xisoc99"; then
1061 AC_DEFINE(NAN_STATIC_ISOC, 1,
1062 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1063 else if test "x$nan_type" = "xzero"; then
1064 AC_DEFINE(NAN_ZERO_ZERO, 1,
1065 [Define if NAN can be defined as (0.0 / 0.0)])
1067 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1070 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1072 if test "x$withval" = "xnothing"; then
1073 fp_layout_type="nothing"
1074 else if test "x$withval" = "xendianflip"; then
1075 fp_layout_type="endianflip"
1076 else if test "x$withval" = "xintswap"; then
1077 fp_layout_type="intswap"
1079 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1082 [fp_layout_type="unknown"])
1084 if test "x$fp_layout_type" = "xunknown"; then
1085 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1086 [c_cv_fp_layout_need_nothing],
1087 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1093 # include <stdint.h>
1096 # include <inttypes.h>
1099 # include <stdbool.h>
1109 memcpy ((void *) &i0, (void *) &d, 8);
1112 memcpy ((void *) c, (void *) &i1, 8);
1114 if ((c[0] == 0x2f) && (c[1] == 0x25)
1115 && (c[2] == 0xc0) && (c[3] == 0xc7)
1116 && (c[4] == 0x43) && (c[5] == 0x2b)
1117 && (c[6] == 0x1f) && (c[7] == 0x5b))
1123 [c_cv_fp_layout_need_nothing="yes"],
1124 [c_cv_fp_layout_need_nothing="no"]
1127 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1128 fp_layout_type="nothing"
1131 if test "x$fp_layout_type" = "xunknown"; then
1132 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1133 [c_cv_fp_layout_need_endianflip],
1134 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1140 # include <stdint.h>
1143 # include <inttypes.h>
1146 # include <stdbool.h>
1148 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1149 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1150 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1151 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1152 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1153 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1154 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1155 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1164 memcpy ((void *) &i0, (void *) &d, 8);
1166 i1 = endianflip (i0);
1167 memcpy ((void *) c, (void *) &i1, 8);
1169 if ((c[0] == 0x2f) && (c[1] == 0x25)
1170 && (c[2] == 0xc0) && (c[3] == 0xc7)
1171 && (c[4] == 0x43) && (c[5] == 0x2b)
1172 && (c[6] == 0x1f) && (c[7] == 0x5b))
1178 [c_cv_fp_layout_need_endianflip="yes"],
1179 [c_cv_fp_layout_need_endianflip="no"]
1182 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1183 fp_layout_type="endianflip"
1186 if test "x$fp_layout_type" = "xunknown"; then
1187 AC_CACHE_CHECK([if intswap converts to x86 representation],
1188 [c_cv_fp_layout_need_intswap],
1189 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1195 # include <stdint.h>
1198 # include <inttypes.h>
1201 # include <stdbool.h>
1203 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1204 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1213 memcpy ((void *) &i0, (void *) &d, 8);
1216 memcpy ((void *) c, (void *) &i1, 8);
1218 if ((c[0] == 0x2f) && (c[1] == 0x25)
1219 && (c[2] == 0xc0) && (c[3] == 0xc7)
1220 && (c[4] == 0x43) && (c[5] == 0x2b)
1221 && (c[6] == 0x1f) && (c[7] == 0x5b))
1227 [c_cv_fp_layout_need_intswap="yes"],
1228 [c_cv_fp_layout_need_intswap="no"]
1231 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1232 fp_layout_type="intswap"
1236 if test "x$fp_layout_type" = "xnothing"; then
1237 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1238 [Define if doubles are stored in x86 representation.])
1239 else if test "x$fp_layout_type" = "xendianflip"; then
1240 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1241 [Define if endianflip is needed to convert to x86 representation.])
1242 else if test "x$fp_layout_type" = "xintswap"; then
1243 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1244 [Define if intswap is needed to convert to x86 representation.])
1246 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1250 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1251 have_getvfsstat="no"
1252 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1253 have_listmntent="no"
1254 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1255 have_getmntent_r="no"
1256 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1259 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1260 if test "x$have_getmntent" = "xno"; then
1261 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1263 if test "x$have_getmntent" = "xno"; then
1264 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1266 if test "x$have_getmntent" = "xno"; then
1267 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1270 if test "x$have_getmntent" = "xc"; then
1271 AC_CACHE_CHECK([whether getmntent takes one argument],
1272 [c_cv_have_one_getmntent],
1276 #include "$srcdir/src/utils_mount.h"
1281 fh = setmntent ("/etc/mtab", "r");
1282 me = getmntent (fh);
1283 return(me->mnt_passno);
1286 [c_cv_have_one_getmntent="yes"],
1287 [c_cv_have_one_getmntent="no"]
1290 AC_CACHE_CHECK([whether getmntent takes two arguments],
1291 [c_cv_have_two_getmntent],
1295 #include "$srcdir/src/utils_mount.h"
1301 fh = fopen ("/etc/mnttab", "r");
1302 status = getmntent (fh, &mt);
1306 [c_cv_have_two_getmntent="yes"],
1307 [c_cv_have_two_getmntent="no"]
1312 # Check for different versions of `getmntent' here..
1314 if test "x$have_getmntent" = "xc"; then
1315 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1316 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1317 [Define if the function getmntent exists and takes one argument.])
1319 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1320 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1321 [Define if the function getmntent exists and takes two arguments.])
1324 if test "x$have_getmntent" = "xsun"; then
1325 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1326 [Define if the function getmntent exists. It's the version from libsun.])
1328 if test "x$have_getmntent" = "xseq"; then
1329 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1330 [Define if the function getmntent exists. It's the version from libseq.])
1332 if test "x$have_getmntent" = "xgen"; then
1333 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1334 [Define if the function getmntent exists. It's the version from libgen.])
1338 AC_CACHE_CHECK([if have htonll defined],
1340 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1342 #include <sys/types.h>
1343 #include <netinet/in.h>
1345 # include <inttypes.h>
1352 [c_cv_have_htonll="yes"],
1353 [c_cv_have_htonll="no"]
1356 if test "x$c_cv_have_htonll" = "xyes"
1358 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1361 # Check for structures
1362 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1363 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1366 #include <sys/types.h>
1367 #include <sys/socket.h>
1370 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1371 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1374 #include <sys/types.h>
1375 #include <sys/socket.h>
1376 #include <linux/if.h>
1377 #include <linux/netdevice.h>
1379 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1380 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1383 #include <linux/inet_diag.h>
1387 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1390 #include <netinet/in.h>
1394 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1396 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1397 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1398 have_struct_kinfo_proc_freebsd="yes"
1401 have_struct_kinfo_proc_freebsd="no"
1405 #include <sys/param.h>
1406 #include <sys/sysctl.h>
1407 #include <sys/user.h>
1410 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1412 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1413 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1414 have_struct_kinfo_proc_openbsd="yes"
1417 have_struct_kinfo_proc_openbsd="no"
1420 #include <sys/param.h>
1421 #include <sys/sysctl.h>
1425 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1426 [#define _BSD_SOURCE
1427 #define _DEFAULT_SOURCE
1429 # include <stdint.h>
1431 #if HAVE_SYS_TYPES_H
1432 # include <sys/types.h>
1434 #if HAVE_NETINET_IN_SYSTM_H
1435 # include <netinet/in_systm.h>
1437 #if HAVE_NETINET_IN_H
1438 # include <netinet/in.h>
1440 #if HAVE_NETINET_IP_H
1441 # include <netinet/ip.h>
1443 #if HAVE_NETINET_UDP_H
1444 # include <netinet/udp.h>
1447 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1448 [#define _BSD_SOURCE
1449 #define _DEFAULT_SOURCE
1451 # include <stdint.h>
1453 #if HAVE_SYS_TYPES_H
1454 # include <sys/types.h>
1456 #if HAVE_NETINET_IN_SYSTM_H
1457 # include <netinet/in_systm.h>
1459 #if HAVE_NETINET_IN_H
1460 # include <netinet/in.h>
1462 #if HAVE_NETINET_IP_H
1463 # include <netinet/ip.h>
1465 #if HAVE_NETINET_UDP_H
1466 # include <netinet/udp.h>
1470 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1480 # Checks for libraries begin here
1483 with_libresolv="yes"
1484 AC_CHECK_LIB(resolv, res_search,
1486 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1488 [with_libresolv="no"])
1489 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1491 dnl Check for HAL (hardware abstraction library)
1493 AC_CHECK_LIB(hal,libhal_device_property_exists,
1494 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1496 if test "x$with_libhal" = "xyes"; then
1497 if test "x$PKG_CONFIG" != "x"; then
1498 BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
1499 BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
1500 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1501 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1505 m4_divert_once([HELP_WITH], [
1506 collectd additional packages:])
1508 AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
1510 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1512 if test "x$ac_system" = "xAIX"
1517 with_perfstat="no (AIX only)"
1518 with_procinfo="no (AIX only)"
1521 if test "x$with_perfstat" = "xyes"
1523 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1524 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1526 if test "x$with_perfstat" = "xyes"
1528 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1529 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1530 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1531 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1533 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1536 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1538 # Processes plugin under AIX.
1539 if test "x$with_procinfo" = "xyes"
1541 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1543 if test "x$with_procinfo" = "xyes"
1545 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1548 if test "x$ac_system" = "xSolaris"
1553 with_kstat="no (Solaris only)"
1554 with_devinfo="no (Solaris only)"
1557 if test "x$with_kstat" = "xyes"
1559 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1561 if test "x$with_kstat" = "xyes"
1563 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1564 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1566 if test "x$with_kstat" = "xyes"
1568 AC_DEFINE(HAVE_LIBKSTAT, 1,
1569 [Define to 1 if you have the 'kstat' library (-lkstat)])
1571 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1572 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1575 if test "x$ac_system" = "xDarwin"
1581 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1584 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1585 if test "x$with_kvm_getprocs" = "xyes"
1587 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1588 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1591 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1593 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1594 if test "x$with_kvm_getswapinfo" = "xyes"
1596 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1597 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1600 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1602 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1603 if test "x$with_kvm_nlist" = "xyes"
1605 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1606 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1607 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1610 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1612 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1613 if test "x$with_kvm_openfiles" = "xyes"
1615 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1616 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1619 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1621 # --with-libaquaero5 {{{
1622 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1624 if test "x$withval" = "xyes"
1626 with_libaquaero5="yes"
1627 else if test "x$withval" = "xno"
1629 with_libaquaero5="no"
1631 with_libaquaero5="yes"
1632 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1633 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1636 [with_libaquaero5="yes"])
1638 SAVE_CPPFLAGS="$CPPFLAGS"
1639 SAVE_LDFLAGS="$LDFLAGS"
1641 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1642 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1644 if test "x$with_libaquaero5" = "xyes"
1646 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1648 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1650 AC_CHECK_HEADERS(libaquaero5.h,
1651 [with_libaquaero5="yes"],
1652 [with_libaquaero5="no (libaquaero5.h not found)"])
1654 if test "x$with_libaquaero5" = "xyes"
1656 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1658 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1660 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1661 [with_libaquaero5="yes"],
1662 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1665 CPPFLAGS="$SAVE_CPPFLAGS"
1666 LDFLAGS="$SAVE_LDFLAGS"
1668 if test "x$with_libaquaero5" = "xyes"
1670 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1671 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1672 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1673 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1675 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1678 # --with-libcredis {{{
1679 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1681 if test "x$withval" = "xyes"
1683 with_libcredis="yes"
1684 else if test "x$withval" = "xno"
1688 with_libcredis="yes"
1689 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1690 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1693 [with_libcredis="yes"])
1695 SAVE_CPPFLAGS="$CPPFLAGS"
1696 SAVE_LDFLAGS="$LDFLAGS"
1698 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1699 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1701 if test "x$with_libcredis" = "xyes"
1703 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1705 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1707 AC_CHECK_HEADERS(credis.h,
1708 [with_libcredis="yes"],
1709 [with_libcredis="no (credis.h not found)"])
1711 if test "x$with_libcredis" = "xyes"
1713 if test "x$LIBCREDIS_LDFLAGS" != "x"
1715 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1717 AC_CHECK_LIB(credis, credis_info,
1718 [with_libcredis="yes"],
1719 [with_libcredis="no (symbol 'credis_info' not found)"])
1723 CPPFLAGS="$SAVE_CPPFLAGS"
1724 LDFLAGS="$SAVE_LDFLAGS"
1726 if test "x$with_libcredis" = "xyes"
1728 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1729 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1730 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1731 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1733 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1736 # --with-libcurl {{{
1737 with_curl_config="curl-config"
1740 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1742 if test "x$withval" = "xno"
1745 else if test "x$withval" = "xyes"
1749 if test -f "$withval" && test -x "$withval"
1751 with_curl_config="$withval"
1753 else if test -x "$withval/bin/curl-config"
1755 with_curl_config="$withval/bin/curl-config"
1764 if test "x$with_libcurl" = "xyes"
1766 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1767 curl_config_status=$?
1769 if test $curl_config_status -ne 0
1771 with_libcurl="no ($with_curl_config failed)"
1773 SAVE_CPPFLAGS="$CPPFLAGS"
1774 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1776 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1778 CPPFLAGS="$SAVE_CPPFLAGS"
1781 if test "x$with_libcurl" = "xyes"
1783 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1784 curl_config_status=$?
1786 if test $curl_config_status -ne 0
1788 with_libcurl="no ($with_curl_config failed)"
1790 AC_CHECK_LIB(curl, curl_easy_init,
1791 [with_libcurl="yes"],
1792 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1796 if test "x$with_libcurl" = "xyes"
1798 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1799 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1800 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1801 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1803 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1807 with_libdbi_cppflags=""
1808 with_libdbi_ldflags=""
1809 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1811 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1813 with_libdbi_cppflags="-I$withval/include"
1814 with_libdbi_ldflags="-L$withval/lib"
1817 with_libdbi="$withval"
1823 if test "x$with_libdbi" = "xyes"
1825 SAVE_CPPFLAGS="$CPPFLAGS"
1826 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1828 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1830 CPPFLAGS="$SAVE_CPPFLAGS"
1832 if test "x$with_libdbi" = "xyes"
1834 SAVE_CPPFLAGS="$CPPFLAGS"
1835 SAVE_LDFLAGS="$LDFLAGS"
1836 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1837 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1839 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1841 CPPFLAGS="$SAVE_CPPFLAGS"
1842 LDFLAGS="$SAVE_LDFLAGS"
1844 if test "x$with_libdbi" = "xyes"
1846 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1847 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1848 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1849 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1850 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1851 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1853 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1856 # --with-libesmtp {{{
1857 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1859 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1861 LDFLAGS="$LDFLAGS -L$withval/lib"
1862 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1865 with_libesmtp="$withval"
1871 if test "x$with_libesmtp" = "xyes"
1873 AC_CHECK_LIB(esmtp, smtp_create_session,
1875 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1876 ], [with_libesmtp="no (libesmtp not found)"])
1878 if test "x$with_libesmtp" = "xyes"
1880 AC_CHECK_HEADERS(libesmtp.h,
1882 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1883 ], [with_libesmtp="no (libesmtp.h not found)"])
1885 if test "x$with_libesmtp" = "xyes"
1891 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1892 [Wether or not to use the esmtp library])
1893 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1896 # --with-libganglia {{{
1897 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1899 if test -f "$withval" && test -x "$withval"
1901 with_libganglia_config="$withval"
1902 with_libganglia="yes"
1903 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1905 with_libganglia_config="$withval/bin/ganglia-config"
1906 with_libganglia="yes"
1907 else if test -d "$withval"
1909 GANGLIA_CPPFLAGS="-I$withval/include"
1910 GANGLIA_LDFLAGS="-L$withval/lib"
1911 with_libganglia="yes"
1913 with_libganglia="$withval"
1917 with_libganglia="yes"
1920 if test "x$with_libganglia" = "xyes"
1922 if test "x$with_libganglia_config" != "x"
1924 if test "x$GANGLIA_CPPFLAGS" = "x"
1926 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1929 if test "x$GANGLIA_LDFLAGS" = "x"
1931 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1934 if test "x$GANGLIA_LIBS" = "x"
1936 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1939 GANGLIA_LIBS="-lganglia"
1943 SAVE_CPPFLAGS="$CPPFLAGS"
1944 SAVE_LDFLAGS="$LDFLAGS"
1945 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1946 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1948 if test "x$with_libganglia" = "xyes"
1950 AC_CHECK_HEADERS(gm_protocol.h,
1952 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1953 [Define to 1 if you have the <gm_protocol.h> header file.])
1954 ], [with_libganglia="no (gm_protocol.h not found)"])
1957 if test "x$with_libganglia" = "xyes"
1959 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1961 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1962 [Define to 1 if you have the ganglia library (-lganglia).])
1963 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1966 CPPFLAGS="$SAVE_CPPFLAGS"
1967 LDFLAGS="$SAVE_LDFLAGS"
1969 AC_SUBST(GANGLIA_CPPFLAGS)
1970 AC_SUBST(GANGLIA_LDFLAGS)
1971 AC_SUBST(GANGLIA_LIBS)
1972 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1975 # --with-libgcrypt {{{
1976 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1977 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1978 GCRYPT_LIBS="$GCRYPT_LIBS"
1979 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1981 if test -f "$withval" && test -x "$withval"
1983 with_libgcrypt_config="$withval"
1984 with_libgcrypt="yes"
1985 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1987 with_libgcrypt_config="$withval/bin/gcrypt-config"
1988 with_libgcrypt="yes"
1989 else if test -d "$withval"
1991 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1992 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1993 with_libgcrypt="yes"
1995 with_libgcrypt_config="gcrypt-config"
1996 with_libgcrypt="$withval"
2000 with_libgcrypt_config="libgcrypt-config"
2001 with_libgcrypt="yes"
2004 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2006 if test "x$GCRYPT_CPPFLAGS" = "x"
2008 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2011 if test "x$GCRYPT_LIBS" = "x"
2013 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2017 SAVE_CPPFLAGS="$CPPFLAGS"
2018 SAVE_LDFLAGS="$LDFLAGS"
2020 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2021 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2022 LIBS="$LIBS $GCRYPT_LIBS"
2024 if test "x$with_libgcrypt" = "xyes"
2026 if test "x$GCRYPT_CPPFLAGS" != "x"
2028 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2030 AC_CHECK_HEADERS(gcrypt.h,
2031 [with_libgcrypt="yes"],
2032 [with_libgcrypt="no (gcrypt.h not found)"])
2035 if test "x$with_libgcrypt" = "xyes"
2037 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2038 [with_libgcrypt="yes"],
2039 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2041 if test "$with_libgcrypt" != "no"; then
2042 m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
2043 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
2044 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
2048 CPPFLAGS="$SAVE_CPPFLAGS"
2049 LDFLAGS="$SAVE_LDFLAGS"
2052 if test "x$with_libgcrypt" = "xyes"
2054 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2057 AC_SUBST(GCRYPT_CPPFLAGS)
2058 AC_SUBST(GCRYPT_LDFLAGS)
2059 AC_SUBST(GCRYPT_LIBS)
2060 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2063 # --with-libiptc {{{
2064 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2066 if test "x$withval" = "xshipped"
2069 else if test "x$withval" = "xyes"
2071 with_libiptc="pkgconfig"
2072 else if test "x$withval" = "xno"
2077 with_libiptc_cflags="-I$withval/include"
2078 with_libiptc_libs="-L$withval/lib"
2082 if test "x$ac_system" = "xLinux"
2084 with_libiptc="pkgconfig"
2086 with_libiptc="no (Linux only)"
2090 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
2092 with_libiptc="no (Don't have pkg-config)"
2095 if test "x$with_libiptc" = "xpkgconfig"
2097 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2100 with_libiptc="no (pkg-config doesn't know libiptc)"
2103 if test "x$with_libiptc" = "xpkgconfig"
2105 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2108 with_libiptc="no ($PKG_CONFIG failed)"
2110 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2113 with_libiptc="no ($PKG_CONFIG failed)"
2117 SAVE_CPPFLAGS="$CPPFLAGS"
2118 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2120 # check whether the header file for libiptc is available.
2121 if test "x$with_libiptc" = "xpkgconfig"
2123 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2124 [with_libiptc="no (header file missing)"])
2126 # If the header file is available, check for the required type declaractions.
2127 # They may be missing in old versions of libiptc. In that case, they will be
2128 # declared in the iptables plugin.
2129 if test "x$with_libiptc" = "xpkgconfig"
2131 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2133 # Check for the iptc_init symbol in the library.
2134 # This could be in iptc or ip4tc
2135 if test "x$with_libiptc" = "xpkgconfig"
2138 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2139 [with_libiptc="pkgconfig"],
2140 [with_libiptc="no"],
2141 [$with_libiptc_libs])
2144 if test "x$with_libiptc" = "xpkgconfig"
2149 CPPFLAGS="$SAVE_CPPFLAGS"
2151 if test "x$with_libiptc" = "xown"
2153 with_libiptc_cflags=""
2154 with_libiptc_libs=""
2156 if test "x$with_libiptc" = "xown"
2158 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
2160 with_libiptc="no (Linux iptables headers not found)"
2163 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
2166 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
2167 if test "x$with_libiptc" = "xown"
2169 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
2173 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2174 if test "x$with_libiptc" = "xyes"
2176 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2177 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2178 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2179 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2184 with_java_home="$JAVA_HOME"
2185 if test "x$with_java_home" = "x"
2187 with_java_home="/usr/lib/jvm"
2189 with_java_vmtype="client"
2194 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2196 if test "x$withval" = "xno"
2199 else if test "x$withval" = "xyes"
2203 with_java_home="$withval"
2208 if test "x$with_java" = "xyes"
2210 if test -d "$with_java_home"
2212 AC_MSG_CHECKING([for jni.h])
2213 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2214 if test "x$TMPVAR" != "x"
2216 AC_MSG_RESULT([found in $TMPVAR])
2217 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2219 AC_MSG_RESULT([not found])
2222 AC_MSG_CHECKING([for jni_md.h])
2223 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2224 if test "x$TMPVAR" != "x"
2226 AC_MSG_RESULT([found in $TMPVAR])
2227 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2229 AC_MSG_RESULT([not found])
2232 AC_MSG_CHECKING([for libjvm.so])
2233 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2234 if test "x$TMPVAR" != "x"
2236 AC_MSG_RESULT([found in $TMPVAR])
2237 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2239 AC_MSG_RESULT([not found])
2242 if test "x$JAVAC" = "x"
2244 AC_MSG_CHECKING([for javac])
2245 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2246 if test "x$TMPVAR" != "x"
2249 AC_MSG_RESULT([$JAVAC])
2251 AC_MSG_RESULT([not found])
2254 if test "x$JAR" = "x"
2256 AC_MSG_CHECKING([for jar])
2257 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2258 if test "x$TMPVAR" != "x"
2261 AC_MSG_RESULT([$JAR])
2263 AC_MSG_RESULT([not found])
2266 else if test "x$with_java_home" != "x"
2268 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2272 if test "x$JAVA_CPPFLAGS" != "x"
2274 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2276 if test "x$JAVA_CFLAGS" != "x"
2278 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2280 if test "x$JAVA_LDFLAGS" != "x"
2282 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2284 if test "x$JAVAC" = "x"
2286 with_javac_path="$PATH"
2287 if test "x$with_java_home" != "x"
2289 with_javac_path="$with_java_home:with_javac_path"
2290 if test -d "$with_java_home/bin"
2292 with_javac_path="$with_java_home/bin:with_javac_path"
2296 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2298 if test "x$JAVAC" = "x"
2300 with_java="no (javac not found)"
2302 if test "x$JAR" = "x"
2304 with_jar_path="$PATH"
2305 if test "x$with_java_home" != "x"
2307 with_jar_path="$with_java_home:$with_jar_path"
2308 if test -d "$with_java_home/bin"
2310 with_jar_path="$with_java_home/bin:$with_jar_path"
2314 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2316 if test "x$JAR" = "x"
2318 with_java="no (jar not found)"
2321 SAVE_CPPFLAGS="$CPPFLAGS"
2322 SAVE_CFLAGS="$CFLAGS"
2323 SAVE_LDFLAGS="$LDFLAGS"
2324 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2325 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2326 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2328 if test "x$with_java" = "xyes"
2330 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2332 if test "x$with_java" = "xyes"
2334 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2336 [with_java="no (libjvm not found)"],
2339 if test "x$with_java" = "xyes"
2341 JAVA_LIBS="$JAVA_LIBS -ljvm"
2342 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2345 CPPFLAGS="$SAVE_CPPFLAGS"
2346 CFLAGS="$SAVE_CFLAGS"
2347 LDFLAGS="$SAVE_LDFLAGS"
2349 AC_SUBST(JAVA_CPPFLAGS)
2350 AC_SUBST(JAVA_CFLAGS)
2351 AC_SUBST(JAVA_LDFLAGS)
2353 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2356 # --with-liblvm2app {{{
2357 with_liblvm2app_cppflags=""
2358 with_liblvm2app_ldflags=""
2359 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2361 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2363 with_liblvm2app_cppflags="-I$withval/include"
2364 with_liblvm2app_ldflags="-L$withval/lib"
2365 with_liblvm2app="yes"
2367 with_liblvm2app="$withval"
2371 with_liblvm2app="yes"
2373 if test "x$with_liblvm2app" = "xyes"
2375 SAVE_CPPFLAGS="$CPPFLAGS"
2376 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2378 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2380 CPPFLAGS="$SAVE_CPPFLAGS"
2383 if test "x$with_liblvm2app" = "xyes"
2385 SAVE_CPPFLAGS="$CPPFLAGS"
2386 SAVE_LDFLAGS="$LDFLAGS"
2387 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2388 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2390 AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2392 CPPFLAGS="$SAVE_CPPFLAGS"
2393 LDFLAGS="$SAVE_LDFLAGS"
2395 if test "x$with_liblvm2app" = "xyes"
2397 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2398 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2399 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2400 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2401 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2402 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2403 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2405 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2408 # --with-libmemcached {{{
2409 with_libmemcached_cppflags=""
2410 with_libmemcached_ldflags=""
2411 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2413 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2415 with_libmemcached_cppflags="-I$withval/include"
2416 with_libmemcached_ldflags="-L$withval/lib"
2417 with_libmemcached="yes"
2419 with_libmemcached="$withval"
2423 with_libmemcached="yes"
2425 if test "x$with_libmemcached" = "xyes"
2427 SAVE_CPPFLAGS="$CPPFLAGS"
2428 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2430 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2432 CPPFLAGS="$SAVE_CPPFLAGS"
2434 if test "x$with_libmemcached" = "xyes"
2436 SAVE_CPPFLAGS="$CPPFLAGS"
2437 SAVE_LDFLAGS="$LDFLAGS"
2438 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2439 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2441 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2443 CPPFLAGS="$SAVE_CPPFLAGS"
2444 LDFLAGS="$SAVE_LDFLAGS"
2446 if test "x$with_libmemcached" = "xyes"
2448 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2449 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2450 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2451 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2452 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2453 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2454 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2456 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2459 # --with-libmodbus {{{
2460 with_libmodbus_config=""
2461 with_libmodbus_cflags=""
2462 with_libmodbus_libs=""
2463 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2465 if test "x$withval" = "xno"
2468 else if test "x$withval" = "xyes"
2470 with_libmodbus="use_pkgconfig"
2471 else if test -d "$with_libmodbus/lib"
2473 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2474 with_libmodbus_cflags="-I$withval/include"
2475 with_libmodbus_libs="-L$withval/lib -lmodbus"
2476 with_libmodbus="yes"
2479 [with_libmodbus="use_pkgconfig"])
2481 # configure using pkg-config
2482 if test "x$with_libmodbus" = "xuse_pkgconfig"
2484 if test "x$PKG_CONFIG" = "x"
2486 with_libmodbus="no (Don't have pkg-config)"
2489 if test "x$with_libmodbus" = "xuse_pkgconfig"
2491 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2492 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2495 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2498 if test "x$with_libmodbus" = "xuse_pkgconfig"
2500 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2503 with_libmodbus="no ($PKG_CONFIG failed)"
2505 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2508 with_libmodbus="no ($PKG_CONFIG failed)"
2511 if test "x$with_libmodbus" = "xuse_pkgconfig"
2513 with_libmodbus="yes"
2516 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2517 # the actual checks.
2518 if test "x$with_libmodbus" = "xyes"
2520 SAVE_CPPFLAGS="$CPPFLAGS"
2521 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2523 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
2525 CPPFLAGS="$SAVE_CPPFLAGS"
2527 if test "x$with_libmodbus" = "xyes"
2529 SAVE_CPPFLAGS="$CPPFLAGS"
2530 SAVE_LDFLAGS="$LDFLAGS"
2532 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2533 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2535 AC_CHECK_LIB(modbus, modbus_connect,
2536 [with_libmodbus="yes"],
2537 [with_libmodbus="no (symbol modbus_connect not found)"])
2539 CPPFLAGS="$SAVE_CPPFLAGS"
2540 LDFLAGS="$SAVE_LDFLAGS"
2542 if test "x$with_libmodbus" = "xyes"
2544 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2545 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2546 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2547 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2551 # --with-libmongoc {{{
2552 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2554 if test "x$withval" = "xyes"
2556 with_libmongoc="yes"
2557 else if test "x$withval" = "xno"
2561 with_libmongoc="yes"
2562 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2563 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2566 [with_libmongoc="yes"])
2568 SAVE_CPPFLAGS="$CPPFLAGS"
2569 SAVE_LDFLAGS="$LDFLAGS"
2571 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2572 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2574 if test "x$with_libmongoc" = "xyes"
2576 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2578 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2580 AC_CHECK_HEADERS(mongo.h,
2581 [with_libmongoc="yes"],
2582 [with_libmongoc="no ('mongo.h' not found)"],
2584 # define MONGO_HAVE_STDINT 1
2586 # define MONGO_USE_LONG_LONG_INT 1
2590 if test "x$with_libmongoc" = "xyes"
2592 if test "x$LIBMONGOC_LDFLAGS" != "x"
2594 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2596 AC_CHECK_LIB(mongoc, mongo_run_command,
2597 [with_libmongoc="yes"],
2598 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2601 CPPFLAGS="$SAVE_CPPFLAGS"
2602 LDFLAGS="$SAVE_LDFLAGS"
2604 if test "x$with_libmongoc" = "xyes"
2606 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2607 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2608 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2609 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2611 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2614 # --with-libmysql {{{
2615 with_mysql_config="mysql_config"
2616 with_mysql_cflags=""
2618 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2620 if test "x$withval" = "xno"
2623 else if test "x$withval" = "xyes"
2627 if test -f "$withval" && test -x "$withval";
2629 with_mysql_config="$withval"
2630 else if test -x "$withval/bin/mysql_config"
2632 with_mysql_config="$withval/bin/mysql_config"
2640 if test "x$with_libmysql" = "xyes"
2642 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
2643 mysql_config_status=$?
2645 if test $mysql_config_status -ne 0
2647 with_libmysql="no ($with_mysql_config failed)"
2649 SAVE_CPPFLAGS="$CPPFLAGS"
2650 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2653 have_mysql_mysql_h="no"
2654 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2656 if test "x$have_mysql_h" = "xno"
2658 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2661 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2663 with_libmysql="no (mysql.h not found)"
2666 CPPFLAGS="$SAVE_CPPFLAGS"
2669 if test "x$with_libmysql" = "xyes"
2671 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2672 mysql_config_status=$?
2674 if test $mysql_config_status -ne 0
2676 with_libmysql="no ($with_mysql_config failed)"
2678 SAVE_CPPFLAGS="$CPPFLAGS"
2679 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2681 LIBS="$with_mysql_libs"
2682 AC_SEARCH_LIBS([mysql_get_server_version],
2684 [with_libmysql="yes"],
2685 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2687 CPPFLAGS="$SAVE_CPPFLAGS"
2691 if test "x$with_libmysql" = "xyes"
2693 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2694 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2695 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2696 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2698 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2702 with_libmnl_cflags=""
2704 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
2706 echo "libmnl: withval = $withval"
2707 if test "x$withval" = "xyes"
2710 else if test "x$withval" = "xno"
2714 if test -d "$withval/include"
2716 with_libmnl_cflags="-I$withval/include"
2717 with_libmnl_libs="-L$withval/lib -lmnl"
2720 AC_MSG_ERROR("no such directory: $withval/include")
2725 if test "x$ac_system" = "xLinux"
2729 with_libmnl="no (Linux only library)"
2732 if test "x$PKG_CONFIG" = "x"
2734 with_libmnl="no (Don't have pkg-config)"
2736 if test "x$with_libmnl" = "xyes"
2738 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
2739 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
2740 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
2743 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
2749 #include <sys/types.h>
2750 #include <asm/types.h>
2751 #include <sys/socket.h>
2752 #include <linux/netlink.h>
2753 #include <linux/rtnetlink.h>])
2754 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2756 #include <sys/types.h>
2757 #include <asm/types.h>
2758 #include <sys/socket.h>])
2760 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2763 #include <sys/types.h>
2764 #include <asm/types.h>
2765 #include <sys/socket.h>
2766 #include <linux/netlink.h>
2767 #include <linux/rtnetlink.h>
2770 int retval = TCA_STATS2;
2774 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2776 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2779 #include <sys/types.h>
2780 #include <asm/types.h>
2781 #include <sys/socket.h>
2782 #include <linux/netlink.h>
2783 #include <linux/rtnetlink.h>
2786 int retval = TCA_STATS;
2790 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2792 if test "x$with_libmnl" = "xyes"
2794 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
2795 [with_libmnl="yes"],
2796 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
2797 [$with_libmnl_libs])
2799 if test "x$with_libmnl" = "xyes"
2801 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
2802 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
2803 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
2804 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
2805 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
2807 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
2810 # --with-libnetapp {{{
2811 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2812 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2813 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2814 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2815 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2816 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2817 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2819 if test -d "$withval"
2821 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2822 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2823 with_libnetapp="yes"
2825 with_libnetapp="$withval"
2829 with_libnetapp="yes"
2832 SAVE_CPPFLAGS="$CPPFLAGS"
2833 SAVE_LDFLAGS="$LDFLAGS"
2834 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2835 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2837 if test "x$with_libnetapp" = "xyes"
2839 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2841 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2843 AC_CHECK_HEADERS(netapp_api.h,
2844 [with_libnetapp="yes"],
2845 [with_libnetapp="no (netapp_api.h not found)"])
2848 if test "x$with_libnetapp" = "xyes"
2850 if test "x$LIBNETAPP_LDFLAGS" != "x"
2852 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2855 if test "x$LIBNETAPP_LIBS" = "x"
2857 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2859 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2861 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2862 [with_libnetapp="yes"],
2863 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2865 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2868 CPPFLAGS="$SAVE_CPPFLAGS"
2869 LDFLAGS="$SAVE_LDFLAGS"
2871 if test "x$with_libnetapp" = "xyes"
2873 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2876 AC_SUBST(LIBNETAPP_CPPFLAGS)
2877 AC_SUBST(LIBNETAPP_LDFLAGS)
2878 AC_SUBST(LIBNETAPP_LIBS)
2879 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2882 # --with-libnetsnmp {{{
2883 with_snmp_config="net-snmp-config"
2886 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2888 if test "x$withval" = "xno"
2890 with_libnetsnmp="no"
2891 else if test "x$withval" = "xyes"
2893 with_libnetsnmp="yes"
2895 if test -x "$withval"
2897 with_snmp_config="$withval"
2898 with_libnetsnmp="yes"
2900 with_snmp_config="$withval/bin/net-snmp-config"
2901 with_libnetsnmp="yes"
2905 [with_libnetsnmp="yes"])
2906 if test "x$with_libnetsnmp" = "xyes"
2908 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2909 snmp_config_status=$?
2911 if test $snmp_config_status -ne 0
2913 with_libnetsnmp="no ($with_snmp_config failed)"
2915 SAVE_CPPFLAGS="$CPPFLAGS"
2916 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2918 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2920 CPPFLAGS="$SAVE_CPPFLAGS"
2923 if test "x$with_libnetsnmp" = "xyes"
2925 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2926 snmp_config_status=$?
2928 if test $snmp_config_status -ne 0
2930 with_libnetsnmp="no ($with_snmp_config failed)"
2932 AC_CHECK_LIB(netsnmp, init_snmp,
2933 [with_libnetsnmp="yes"],
2934 [with_libnetsnmp="no (libnetsnmp not found)"],
2938 if test "x$with_libnetsnmp" = "xyes"
2940 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2941 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2942 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2943 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2945 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2948 # --with-liboconfig {{{
2949 with_own_liboconfig="no"
2950 liboconfig_LDFLAGS="$LDFLAGS"
2951 liboconfig_CPPFLAGS="$CPPFLAGS"
2952 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2954 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2956 if test -d "$withval/lib"
2958 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2960 if test -d "$withval/include"
2962 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2965 if test "x$withval" = "xno"
2967 AC_MSG_ERROR("liboconfig is required")
2971 with_liboconfig="yes"
2974 save_LDFLAGS="$LDFLAGS"
2975 save_CPPFLAGS="$CPPFLAGS"
2976 LDFLAGS="$liboconfig_LDFLAGS"
2977 CPPFLAGS="$liboconfig_CPPFLAGS"
2978 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2980 with_liboconfig="yes"
2981 with_own_liboconfig="no"
2984 with_liboconfig="yes"
2985 with_own_liboconfig="yes"
2986 LDFLAGS="$save_LDFLAGS"
2987 CPPFLAGS="$save_CPPFLAGS"
2990 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2991 if test "x$with_own_liboconfig" = "xyes"
2993 with_liboconfig="yes (shipped version)"
2997 # --with-liboping {{{
2998 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3000 if test "x$withval" = "xyes"
3003 else if test "x$withval" = "xno"
3008 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3009 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3012 [with_liboping="yes"])
3014 SAVE_CPPFLAGS="$CPPFLAGS"
3015 SAVE_LDFLAGS="$LDFLAGS"
3017 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3018 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3020 if test "x$with_liboping" = "xyes"
3022 if test "x$LIBOPING_CPPFLAGS" != "x"
3024 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3026 AC_CHECK_HEADERS(oping.h,
3027 [with_liboping="yes"],
3028 [with_liboping="no (oping.h not found)"])
3030 if test "x$with_liboping" = "xyes"
3032 if test "x$LIBOPING_LDFLAGS" != "x"
3034 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3036 AC_CHECK_LIB(oping, ping_construct,
3037 [with_liboping="yes"],
3038 [with_liboping="no (symbol 'ping_construct' not found)"])
3041 CPPFLAGS="$SAVE_CPPFLAGS"
3042 LDFLAGS="$SAVE_LDFLAGS"
3044 if test "x$with_liboping" = "xyes"
3046 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3047 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3048 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3049 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3051 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3055 with_oracle_cppflags=""
3057 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3059 if test "x$withval" = "xyes"
3061 if test "x$ORACLE_HOME" = "x"
3063 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3066 else if test "x$withval" = "xno"
3071 ORACLE_HOME="$withval"
3075 if test "x$ORACLE_HOME" = "x"
3077 with_oracle="no (ORACLE_HOME is not set)"
3082 if test "x$ORACLE_HOME" != "x"
3084 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3086 if test -e "$ORACLE_HOME/lib/ldflags"
3088 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3090 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3091 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3093 if test "x$with_oracle" = "xyes"
3095 SAVE_CPPFLAGS="$CPPFLAGS"
3096 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3098 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3100 CPPFLAGS="$SAVE_CPPFLAGS"
3102 if test "x$with_oracle" = "xyes"
3104 SAVE_CPPFLAGS="$CPPFLAGS"
3106 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3107 LIBS="$LIBS $with_oracle_libs"
3109 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3111 CPPFLAGS="$SAVE_CPPFLAGS"
3114 if test "x$with_oracle" = "xyes"
3116 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
3117 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3118 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
3119 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3123 # --with-libowcapi {{{
3124 with_libowcapi_cppflags=""
3125 with_libowcapi_libs="-lowcapi"
3126 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3128 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3130 with_libowcapi_cppflags="-I$withval/include"
3131 with_libowcapi_libs="-L$withval/lib -lowcapi"
3132 with_libowcapi="yes"
3134 with_libowcapi="$withval"
3138 with_libowcapi="yes"
3140 if test "x$with_libowcapi" = "xyes"
3142 SAVE_CPPFLAGS="$CPPFLAGS"
3143 CPPFLAGS="$with_libowcapi_cppflags"
3145 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3147 CPPFLAGS="$SAVE_CPPFLAGS"
3149 if test "x$with_libowcapi" = "xyes"
3151 SAVE_LDFLAGS="$LDFLAGS"
3152 SAVE_CPPFLAGS="$CPPFLAGS"
3153 LDFLAGS="$with_libowcapi_libs"
3154 CPPFLAGS="$with_libowcapi_cppflags"
3156 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3158 LDFLAGS="$SAVE_LDFLAGS"
3159 CPPFLAGS="$SAVE_CPPFLAGS"
3161 if test "x$with_libowcapi" = "xyes"
3163 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3164 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3165 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3166 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3170 # --with-libpcap {{{
3171 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3173 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3175 LDFLAGS="$LDFLAGS -L$withval/lib"
3176 CPPFLAGS="$CPPFLAGS -I$withval/include"
3179 with_libpcap="$withval"
3185 if test "x$with_libpcap" = "xyes"
3187 AC_CHECK_LIB(pcap, pcap_open_live,
3189 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3190 ], [with_libpcap="no (libpcap not found)"])
3192 if test "x$with_libpcap" = "xyes"
3194 AC_CHECK_HEADERS(pcap.h,,
3195 [with_libpcap="no (pcap.h not found)"])
3197 if test "x$with_libpcap" = "xyes"
3199 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3200 [c_cv_libpcap_have_pcap_error_iface_not_up],
3201 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3206 int val = PCAP_ERROR_IFACE_NOT_UP;
3210 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3211 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3213 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3215 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3217 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3220 # --with-libperl {{{
3221 perl_interpreter="perl"
3222 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3224 if test -f "$withval" && test -x "$withval"
3226 perl_interpreter="$withval"
3228 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3230 LDFLAGS="$LDFLAGS -L$withval/lib"
3231 CPPFLAGS="$CPPFLAGS -I$withval/include"
3232 perl_interpreter="$withval/bin/perl"
3235 with_libperl="$withval"
3242 AC_MSG_CHECKING([for perl])
3243 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3244 if test -x "$perl_interpreter"
3246 AC_MSG_RESULT([yes ($perl_interpreter)])
3252 AC_SUBST(PERL, "$perl_interpreter")
3254 if test "x$with_libperl" = "xyes" \
3255 && test -n "$perl_interpreter"
3257 SAVE_CFLAGS="$CFLAGS"
3259 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3260 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3261 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3262 CFLAGS="$CFLAGS $PERL_CFLAGS"
3263 LIBS="$LIBS $PERL_LIBS"
3265 AC_CACHE_CHECK([for libperl],
3266 [c_cv_have_libperl],
3267 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3269 #define PERL_NO_GET_CONTEXT
3276 load_module (PERL_LOADMOD_NOIMPORT,
3277 newSVpv ("Collectd::Plugin::FooBar", 24),
3281 [c_cv_have_libperl="yes"],
3282 [c_cv_have_libperl="no"]
3286 if test "x$c_cv_have_libperl" = "xyes"
3288 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3289 AC_SUBST(PERL_CFLAGS)
3295 CFLAGS="$SAVE_CFLAGS"
3297 else if test -z "$perl_interpreter"; then
3298 with_libperl="no (no perl interpreter found)"
3299 c_cv_have_libperl="no"
3301 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3303 if test "x$with_libperl" = "xyes"
3305 SAVE_CFLAGS="$CFLAGS"
3307 CFLAGS="$CFLAGS $PERL_CFLAGS"
3308 LIBS="$LIBS $PERL_LIBS"
3310 AC_CACHE_CHECK([if perl supports ithreads],
3311 [c_cv_have_perl_ithreads],
3312 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3318 #if !defined(USE_ITHREADS)
3319 # error "Perl does not support ithreads!"
3320 #endif /* !defined(USE_ITHREADS) */
3324 [c_cv_have_perl_ithreads="yes"],
3325 [c_cv_have_perl_ithreads="no"]
3329 if test "x$c_cv_have_perl_ithreads" = "xyes"
3331 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3334 CFLAGS="$SAVE_CFLAGS"
3338 if test "x$with_libperl" = "xyes"
3340 SAVE_CFLAGS="$CFLAGS"
3342 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3343 # (see issues #41 and #42)
3344 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3345 LIBS="$LIBS $PERL_LIBS"
3347 AC_CACHE_CHECK([for broken Perl_load_module()],
3348 [c_cv_have_broken_perl_load_module],
3349 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3351 #define PERL_NO_GET_CONTEXT
3358 load_module (PERL_LOADMOD_NOIMPORT,
3359 newSVpv ("Collectd::Plugin::FooBar", 24),
3363 [c_cv_have_broken_perl_load_module="no"],
3364 [c_cv_have_broken_perl_load_module="yes"]
3368 CFLAGS="$SAVE_CFLAGS"
3371 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3372 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3374 if test "x$with_libperl" = "xyes"
3376 SAVE_CFLAGS="$CFLAGS"
3378 CFLAGS="$CFLAGS $PERL_CFLAGS"
3379 LIBS="$LIBS $PERL_LIBS"
3382 [struct mgvtbl.svt_local],
3383 [have_struct_mgvtbl_svt_local="yes"],
3384 [have_struct_mgvtbl_svt_local="no"],
3391 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3393 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3394 [Define if Perl's struct mgvtbl has member svt_local.])
3397 CFLAGS="$SAVE_CFLAGS"
3403 with_pg_config="pg_config"
3404 with_libpq_includedir=""
3405 with_libpq_libdir=""
3406 with_libpq_cppflags=""
3407 with_libpq_ldflags=""
3408 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3411 if test "x$withval" = "xno"
3414 else if test "x$withval" = "xyes"
3418 if test -f "$withval" && test -x "$withval";
3420 with_pg_config="$withval"
3421 else if test -x "$withval/bin/pg_config"
3423 with_pg_config="$withval/bin/pg_config"
3431 if test "x$with_libpq" = "xyes"
3433 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3436 if test $pg_config_status -eq 0
3438 if test -n "$with_libpq_includedir"; then
3439 for dir in $with_libpq_includedir; do
3440 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3444 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3447 SAVE_CPPFLAGS="$CPPFLAGS"
3448 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3450 AC_CHECK_HEADERS(libpq-fe.h, [],
3451 [with_libpq="no (libpq-fe.h not found)"], [])
3453 CPPFLAGS="$SAVE_CPPFLAGS"
3455 if test "x$with_libpq" = "xyes"
3457 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3460 if test $pg_config_status -eq 0
3462 if test -n "$with_libpq_libdir"; then
3463 for dir in $with_libpq_libdir; do
3464 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3468 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3471 SAVE_LDFLAGS="$LDFLAGS"
3472 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3474 AC_CHECK_LIB(pq, PQconnectdb,
3476 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3478 AC_CHECK_LIB(pq, PQserverVersion,
3480 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3482 LDFLAGS="$SAVE_LDFLAGS"
3484 if test "x$with_libpq" = "xyes"
3486 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3487 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3488 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3489 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3491 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3494 # --with-libpthread {{{
3495 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3496 [ if test "x$withval" != "xno" \
3497 && test "x$withval" != "xyes"
3499 LDFLAGS="$LDFLAGS -L$withval/lib"
3500 CPPFLAGS="$CPPFLAGS -I$withval/include"
3501 with_libpthread="yes"
3503 if test "x$withval" = "xno"
3505 with_libpthread="no (disabled)"
3508 ], [with_libpthread="yes"])
3509 if test "x$with_libpthread" = "xyes"
3511 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3514 if test "x$with_libpthread" = "xyes"
3516 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3518 if test "x$with_libpthread" = "xyes"
3524 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3525 [Wether or not to use pthread (POSIX threads) library])
3526 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3531 with_python_path="$PATH"
3532 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3534 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3536 with_python="$withval"
3537 else if test -x "$withval"
3539 with_python_prog="$withval"
3540 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3542 else if test -d "$withval"
3544 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3547 AC_MSG_WARN([Argument not recognized: $withval])
3549 ], [with_python="yes"])
3552 SAVE_CPPFLAGS="$CPPFLAGS"
3553 SAVE_LDFLAGS="$LDFLAGS"
3556 PATH="$with_python_path"
3558 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3560 AC_MSG_CHECKING([for python])
3561 with_python_prog="`which python 2>/dev/null`"
3562 if test "x$with_python_prog" = "x"
3564 AC_MSG_RESULT([not found])
3565 with_python="no (interpreter not found)"
3567 AC_MSG_RESULT([$with_python_prog])
3571 if test "x$with_python" = "xyes"
3573 AC_MSG_CHECKING([for Python CPPFLAGS])
3574 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3575 python_config_status=$?
3577 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3579 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3582 AC_MSG_RESULT([$python_include_path])
3586 if test "x$with_python" = "xyes"
3588 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3589 AC_CHECK_HEADERS(Python.h,
3590 [with_python="yes"],
3591 [with_python="no ('Python.h' not found)"])
3594 if test "x$with_python" = "xyes"
3596 AC_MSG_CHECKING([for Python LDFLAGS])
3597 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`
3598 python_config_status=$?
3600 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3602 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3605 AC_MSG_RESULT([$python_library_path])
3609 if test "x$with_python" = "xyes"
3611 AC_MSG_CHECKING([for Python LIBS])
3612 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`
3613 python_config_status=$?
3615 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3617 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3620 AC_MSG_RESULT([$python_library_flags])
3624 if test "x$with_python" = "xyes"
3626 LDFLAGS="-L$python_library_path $LDFLAGS"
3627 LIBS="$python_library_flags $LIBS"
3629 AC_CHECK_FUNC(PyObject_CallFunction,
3630 [with_python="yes"],
3631 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3635 CPPFLAGS="$SAVE_CPPFLAGS"
3636 LDFLAGS="$SAVE_LDFLAGS"
3639 if test "x$with_python" = "xyes"
3641 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3642 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3643 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3644 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3645 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3646 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3650 # --with-librabbitmq {{{
3651 with_librabbitmq_cppflags=""
3652 with_librabbitmq_ldflags=""
3653 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3655 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3657 with_librabbitmq_cppflags="-I$withval/include"
3658 with_librabbitmq_ldflags="-L$withval/lib"
3659 with_librabbitmq="yes"
3661 with_librabbitmq="$withval"
3665 with_librabbitmq="yes"
3667 SAVE_CPPFLAGS="$CPPFLAGS"
3668 SAVE_LDFLAGS="$LDFLAGS"
3669 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3670 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3671 if test "x$with_librabbitmq" = "xyes"
3673 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3675 if test "x$with_librabbitmq" = "xyes"
3677 # librabbitmq up to version 0.9.1 provides "library_errno", later
3678 # versions use "library_error". The library does not provide a version
3679 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3680 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3683 # include <stdlib.h>
3689 # include <stdint.h>
3692 # include <inttypes.h>
3697 if test "x$with_librabbitmq" = "xyes"
3699 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3701 if test "x$with_librabbitmq" = "xyes"
3703 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3704 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3705 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3706 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3707 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3708 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3709 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3711 CPPFLAGS="$SAVE_CPPFLAGS"
3712 LDFLAGS="$SAVE_LDFLAGS"
3713 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3715 with_amqp_tcp_socket="no"
3716 if test "x$with_librabbitmq" = "xyes"
3718 SAVE_CPPFLAGS="$CPPFLAGS"
3719 SAVE_LDFLAGS="$LDFLAGS"
3721 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3722 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3725 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
3726 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
3727 if test "x$with_amqp_tcp_socket" = "xyes"
3729 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
3730 [Define if librabbitmq provides the new TCP socket interface.])
3733 AC_CHECK_DECLS(amqp_socket_close,
3734 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
3737 #ifdef HAVE_AMQP_TCP_SOCKET_H
3738 # include <amqp_tcp_socket.h>
3740 #ifdef HAVE_AMQP_SOCKET_H
3741 # include <amqp_socket.h>
3745 CPPFLAGS="$SAVE_CPPFLAGS"
3746 LDFLAGS="$SAVE_LDFLAGS"
3751 # --with-librouteros {{{
3752 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3754 if test "x$withval" = "xyes"
3756 with_librouteros="yes"
3757 else if test "x$withval" = "xno"
3759 with_librouteros="no"
3761 with_librouteros="yes"
3762 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3763 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3766 [with_librouteros="yes"])
3768 SAVE_CPPFLAGS="$CPPFLAGS"
3769 SAVE_LDFLAGS="$LDFLAGS"
3771 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3772 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3774 if test "x$with_librouteros" = "xyes"
3776 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3778 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3780 AC_CHECK_HEADERS(routeros_api.h,
3781 [with_librouteros="yes"],
3782 [with_librouteros="no (routeros_api.h not found)"])
3784 if test "x$with_librouteros" = "xyes"
3786 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3788 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3790 AC_CHECK_LIB(routeros, ros_interface,
3791 [with_librouteros="yes"],
3792 [with_librouteros="no (symbol 'ros_interface' not found)"])
3795 CPPFLAGS="$SAVE_CPPFLAGS"
3796 LDFLAGS="$SAVE_LDFLAGS"
3798 if test "x$with_librouteros" = "xyes"
3800 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3801 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3802 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3803 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3805 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3809 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3812 librrd_threadsafe="yes"
3813 librrd_rrdc_update="no"
3814 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3815 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3817 librrd_cflags="-I$withval/include"
3818 librrd_ldflags="-L$withval/lib"
3821 with_librrd="$withval"
3823 ], [with_librrd="yes"])
3824 if test "x$with_librrd" = "xyes"
3826 SAVE_CPPFLAGS="$CPPFLAGS"
3827 SAVE_LDFLAGS="$LDFLAGS"
3829 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3830 LDFLAGS="$LDFLAGS $librrd_ldflags"
3832 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3834 CPPFLAGS="$SAVE_CPPFLAGS"
3835 LDFLAGS="$SAVE_LDFLAGS"
3837 if test "x$with_librrd" = "xyes"
3839 SAVE_CPPFLAGS="$CPPFLAGS"
3840 SAVE_LDFLAGS="$LDFLAGS"
3842 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3843 LDFLAGS="$LDFLAGS $librrd_ldflags"
3845 AC_CHECK_LIB(rrd_th, rrd_update_r,
3847 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3849 [librrd_threadsafe="no"
3850 AC_CHECK_LIB(rrd, rrd_update,
3852 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3854 [with_librrd="no (symbol 'rrd_update' not found)"],
3859 if test "x$librrd_threadsafe" = "xyes"
3861 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3863 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3866 CPPFLAGS="$SAVE_CPPFLAGS"
3867 LDFLAGS="$SAVE_LDFLAGS"
3869 if test "x$with_librrd" = "xyes"
3871 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3872 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3873 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3874 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3876 if test "x$librrd_threadsafe" = "xyes"
3878 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3882 # --with-libsensors {{{
3883 with_sensors_cflags=""
3884 with_sensors_ldflags=""
3885 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3887 if test "x$withval" = "xno"
3889 with_libsensors="no"
3891 with_libsensors="yes"
3892 if test "x$withval" != "xyes"
3894 with_sensors_cflags="-I$withval/include"
3895 with_sensors_ldflags="-L$withval/lib"
3896 with_libsensors="yes"
3901 if test "x$ac_system" = "xLinux"
3903 with_libsensors="yes"
3905 with_libsensors="no (Linux only library)"
3908 if test "x$with_libsensors" = "xyes"
3910 SAVE_CPPFLAGS="$CPPFLAGS"
3911 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3913 # AC_CHECK_HEADERS(sensors/sensors.h,
3915 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3917 # [with_libsensors="no (sensors/sensors.h not found)"])
3918 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3920 CPPFLAGS="$SAVE_CPPFLAGS"
3922 if test "x$with_libsensors" = "xyes"
3924 SAVE_CPPFLAGS="$CPPFLAGS"
3925 SAVE_LDFLAGS="$LDFLAGS"
3926 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3927 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3929 AC_CHECK_LIB(sensors, sensors_init,
3931 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3933 [with_libsensors="no (libsensors not found)"])
3935 CPPFLAGS="$SAVE_CPPFLAGS"
3936 LDFLAGS="$SAVE_LDFLAGS"
3938 if test "x$with_libsensors" = "xyes"
3940 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3941 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3942 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3943 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3945 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3948 # --with-libsigrok {{{
3949 with_libsigrok_cflags=""
3950 with_libsigrok_ldflags=""
3951 AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
3953 if test "x$withval" = "xno"
3957 with_libsigrok="yes"
3958 if test "x$withval" != "xyes"
3960 with_libsigrok_cflags="-I$withval/include"
3961 with_libsigrok_ldflags="-L$withval/lib"
3964 ],[with_libsigrok="yes"])
3966 # libsigrok has a glib dependency
3967 if test "x$with_libsigrok" = "xyes"
3969 m4_ifdef([AM_PATH_GLIB_2_0],
3971 AM_PATH_GLIB_2_0([2.28.0],
3972 [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
3975 with_libsigrok="no (glib not available)"
3981 if test "x$with_libsigrok" = "xyes"
3983 SAVE_CPPFLAGS="$CPPFLAGS"
3984 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3986 AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
3988 CPPFLAGS="$SAVE_CPPFLAGS"
3992 if test "x$with_libsigrok" = "xyes"
3994 SAVE_CPPFLAGS="$CPPFLAGS"
3995 SAVE_LDFLAGS="$LDFLAGS"
3996 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
3997 LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
3999 AC_CHECK_LIB(sigrok, sr_init,
4001 AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
4003 [with_libsigrok="no (libsigrok not found)"])
4005 CPPFLAGS="$SAVE_CPPFLAGS"
4006 LDFLAGS="$SAVE_LDFLAGS"
4008 if test "x$with_libsigrok" = "xyes"
4010 BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
4011 BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
4012 AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
4013 AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
4015 AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
4018 # --with-libstatgrab {{{
4019 with_libstatgrab_cflags=""
4020 with_libstatgrab_ldflags=""
4021 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4023 if test "x$withval" != "xno" \
4024 && test "x$withval" != "xyes"
4026 with_libstatgrab_cflags="-I$withval/include"
4027 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4028 with_libstatgrab="yes"
4029 with_libstatgrab_pkg_config="no"
4031 with_libstatgrab="$withval"
4032 with_libstatgrab_pkg_config="yes"
4036 with_libstatgrab="yes"
4037 with_libstatgrab_pkg_config="yes"
4040 if test "x$with_libstatgrab" = "xyes" \
4041 && test "x$with_libstatgrab_pkg_config" = "xyes"
4043 if test "x$PKG_CONFIG" != "x"
4045 AC_MSG_CHECKING([pkg-config for libstatgrab])
4047 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4050 with_libstatgrab_pkg_config="no"
4051 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4052 temp_result="not found"
4054 AC_MSG_RESULT([$temp_result])
4056 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
4057 with_libstatgrab_pkg_config="no"
4058 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
4062 if test "x$with_libstatgrab" = "xyes" \
4063 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4064 && test "x$with_libstatgrab_cflags" = "x"
4066 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4067 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4070 with_libstatgrab_cflags="$temp_result"
4072 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4073 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4075 AC_MSG_RESULT([$temp_result])
4078 if test "x$with_libstatgrab" = "xyes" \
4079 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4080 && test "x$with_libstatgrab_ldflags" = "x"
4082 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4083 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4086 with_libstatgrab_ldflags="$temp_result"
4088 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4089 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4091 AC_MSG_RESULT([$temp_result])
4094 if test "x$with_libstatgrab" = "xyes"
4096 SAVE_CPPFLAGS="$CPPFLAGS"
4097 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4099 AC_CHECK_HEADERS(statgrab.h,
4100 [with_libstatgrab="yes"],
4101 [with_libstatgrab="no (statgrab.h not found)"])
4103 CPPFLAGS="$SAVE_CPPFLAGS"
4106 if test "x$with_libstatgrab" = "xyes"
4108 SAVE_CFLAGS="$CFLAGS"
4109 SAVE_LDFLAGS="$LDFLAGS"
4111 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4112 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4114 AC_CHECK_LIB(statgrab, sg_init,
4115 [with_libstatgrab="yes"],
4116 [with_libstatgrab="no (symbol sg_init not found)"])
4118 CFLAGS="$SAVE_CFLAGS"
4119 LDFLAGS="$SAVE_LDFLAGS"
4122 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4123 if test "x$with_libstatgrab" = "xyes"
4125 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4126 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4127 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4128 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4129 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4133 # --with-libtokyotyrant {{{
4134 with_libtokyotyrant_cppflags=""
4135 with_libtokyotyrant_ldflags=""
4136 with_libtokyotyrant_libs=""
4137 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4139 if test "x$withval" = "xno"
4141 with_libtokyotyrant="no"
4142 else if test "x$withval" = "xyes"
4144 with_libtokyotyrant="yes"
4146 with_libtokyotyrant_cppflags="-I$withval/include"
4147 with_libtokyotyrant_ldflags="-L$withval/include"
4148 with_libtokyotyrant_libs="-ltokyotyrant"
4149 with_libtokyotyrant="yes"
4153 with_libtokyotyrant="yes"
4156 if test "x$with_libtokyotyrant" = "xyes"
4158 if $PKG_CONFIG --exists tokyotyrant
4160 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4161 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4162 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4166 SAVE_CPPFLAGS="$CPPFLAGS"
4167 SAVE_LDFLAGS="$LDFLAGS"
4168 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4169 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4171 if test "x$with_libtokyotyrant" = "xyes"
4173 AC_CHECK_HEADERS(tcrdb.h,
4175 AC_DEFINE(HAVE_TCRDB_H, 1,
4176 [Define to 1 if you have the <tcrdb.h> header file.])
4177 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
4180 if test "x$with_libtokyotyrant" = "xyes"
4182 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
4184 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
4185 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
4187 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
4188 [$with_libtokyotyrant_libs])
4191 CPPFLAGS="$SAVE_CPPFLAGS"
4192 LDFLAGS="$SAVE_LDFLAGS"
4194 if test "x$with_libtokyotyrant" = "xyes"
4196 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
4197 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
4198 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
4199 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
4200 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
4201 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
4203 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
4206 # --with-libupsclient {{{
4207 with_libupsclient_config=""
4208 with_libupsclient_cflags=""
4209 with_libupsclient_libs=""
4210 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
4212 if test "x$withval" = "xno"
4214 with_libupsclient="no"
4215 else if test "x$withval" = "xyes"
4217 with_libupsclient="use_pkgconfig"
4219 if test -x "$withval"
4221 with_libupsclient_config="$withval"
4222 with_libupsclient="use_libupsclient_config"
4223 else if test -x "$withval/bin/libupsclient-config"
4225 with_libupsclient_config="$withval/bin/libupsclient-config"
4226 with_libupsclient="use_libupsclient_config"
4228 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
4229 with_libupsclient_cflags="-I$withval/include"
4230 with_libupsclient_libs="-L$withval/lib -lupsclient"
4231 with_libupsclient="yes"
4235 [with_libupsclient="use_pkgconfig"])
4237 # configure using libupsclient-config
4238 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4240 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
4241 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
4244 with_libupsclient="no ($with_libupsclient_config failed)"
4246 with_libupsclient_libs="`$with_libupsclient_config --libs`"
4249 with_libupsclient="no ($with_libupsclient_config failed)"
4252 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4254 with_libupsclient="yes"
4257 # configure using pkg-config
4258 if test "x$with_libupsclient" = "xuse_pkgconfig"
4260 if test "x$PKG_CONFIG" = "x"
4262 with_libupsclient="no (Don't have pkg-config)"
4265 if test "x$with_libupsclient" = "xuse_pkgconfig"
4267 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4268 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4271 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4274 if test "x$with_libupsclient" = "xuse_pkgconfig"
4276 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4279 with_libupsclient="no ($PKG_CONFIG failed)"
4281 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4284 with_libupsclient="no ($PKG_CONFIG failed)"
4287 if test "x$with_libupsclient" = "xuse_pkgconfig"
4289 with_libupsclient="yes"
4292 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4293 # the actual checks.
4294 if test "x$with_libupsclient" = "xyes"
4296 SAVE_CPPFLAGS="$CPPFLAGS"
4297 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4299 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4301 CPPFLAGS="$SAVE_CPPFLAGS"
4303 if test "x$with_libupsclient" = "xyes"
4305 SAVE_CPPFLAGS="$CPPFLAGS"
4306 SAVE_LDFLAGS="$LDFLAGS"
4308 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4309 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4311 AC_CHECK_LIB(upsclient, upscli_connect,
4312 [with_libupsclient="yes"],
4313 [with_libupsclient="no (symbol upscli_connect not found)"])
4315 CPPFLAGS="$SAVE_CPPFLAGS"
4316 LDFLAGS="$SAVE_LDFLAGS"
4318 if test "x$with_libupsclient" = "xyes"
4320 SAVE_CPPFLAGS="$CPPFLAGS"
4321 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4323 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4324 [#include <stdlib.h>
4326 #include <upsclient.h>])
4328 CPPFLAGS="$SAVE_CPPFLAGS"
4330 if test "x$with_libupsclient" = "xyes"
4332 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4333 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4334 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4335 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4339 # --with-libxmms {{{
4340 with_xmms_config="xmms-config"
4343 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4345 if test "x$withval" != "xno" \
4346 && test "x$withval" != "xyes"
4348 if test -f "$withval" && test -x "$withval";
4350 with_xmms_config="$withval"
4351 else if test -x "$withval/bin/xmms-config"
4353 with_xmms_config="$withval/bin/xmms-config"
4356 else if test "x$withval" = "xno"
4366 if test "x$with_libxmms" = "xyes"
4368 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4369 xmms_config_status=$?
4371 if test $xmms_config_status -ne 0
4376 if test "x$with_libxmms" = "xyes"
4378 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4379 xmms_config_status=$?
4381 if test $xmms_config_status -ne 0
4386 if test "x$with_libxmms" = "xyes"
4388 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4390 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4391 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4392 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4393 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4400 with_libxmms_numeric=0
4401 if test "x$with_libxmms" = "xyes"
4403 with_libxmms_numeric=1
4405 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4406 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4409 # --with-libyajl {{{
4410 with_libyajl_cppflags=""
4411 with_libyajl_ldflags=""
4412 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4414 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4416 with_libyajl_cppflags="-I$withval/include"
4417 with_libyajl_ldflags="-L$withval/lib"
4420 with_libyajl="$withval"
4426 if test "x$with_libyajl" = "xyes"
4428 SAVE_CPPFLAGS="$CPPFLAGS"
4429 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4431 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4432 AC_CHECK_HEADERS(yajl/yajl_version.h)
4434 CPPFLAGS="$SAVE_CPPFLAGS"
4436 if test "x$with_libyajl" = "xyes"
4438 SAVE_CPPFLAGS="$CPPFLAGS"
4439 SAVE_LDFLAGS="$LDFLAGS"
4440 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4441 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4443 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4445 CPPFLAGS="$SAVE_CPPFLAGS"
4446 LDFLAGS="$SAVE_LDFLAGS"
4448 if test "x$with_libyajl" = "xyes"
4450 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4451 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4452 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4453 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4454 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4455 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4456 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4458 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4462 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
4463 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
4465 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
4467 if test "x$withval" = "xno"
4470 else if test "x$withval" = "xyes"
4473 else if test -d "$with_mic/lib"
4475 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
4476 with_mic_cflags="-I$withval/include"
4477 with_mic_ldpath="-L$withval/lib/Linux"
4478 with_mic_libs="-lMicAccessSDK -lscif -lpthread"
4483 if test "x$with_mic" = "xyes"
4485 SAVE_CPPFLAGS="$CPPFLAGS"
4486 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4487 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
4488 CPPFLAGS="$SAVE_CPPFLAGS"
4490 if test "x$with_mic" = "xyes"
4492 SAVE_CPPFLAGS="$CPPFLAGS"
4493 SAVE_LDFLAGS="$LDFLAGS"
4495 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4496 LDFLAGS="$LDFLAGS $with_mic_ldpath"
4498 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
4499 [with_mic_ldpath="$with_mic_ldpath"
4500 with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
4501 [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
4503 CPPFLAGS="$SAVE_CPPFLAGS"
4504 LDFLAGS="$SAVE_LDFLAGS"
4507 if test "x$with_mic" = "xyes"
4509 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
4510 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
4511 BUILD_WITH_MIC_LDADD="$with_mic_libs"
4512 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
4513 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
4514 AC_SUBST(BUILD_WITH_MIC_LDADD)
4518 # --with-libvarnish {{{
4519 with_libvarnish_cppflags=""
4520 with_libvarnish_cflags=""
4521 with_libvarnish_libs=""
4522 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4524 if test "x$withval" = "xno"
4526 with_libvarnish="no"
4527 else if test "x$withval" = "xyes"
4529 with_libvarnish="use_pkgconfig"
4530 else if test -d "$with_libvarnish/lib"
4532 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4533 with_libvarnish_cflags="-I$withval/include"
4534 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4535 with_libvarnish="yes"
4538 [with_libvarnish="use_pkgconfig"])
4540 # configure using pkg-config
4541 if test "x$with_libvarnish" = "xuse_pkgconfig"
4543 if test "x$PKG_CONFIG" = "x"
4545 with_libvarnish="no (Don't have pkg-config)"
4548 if test "x$with_libvarnish" = "xuse_pkgconfig"
4550 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4551 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4554 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4557 if test "x$with_libvarnish" = "xuse_pkgconfig"
4559 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4562 with_libvarnish="no ($PKG_CONFIG failed)"
4564 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4567 with_libvarnish="no ($PKG_CONFIG failed)"
4570 if test "x$with_libvarnish" = "xuse_pkgconfig"
4572 with_libvarnish="yes"
4575 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4576 # the actual checks.
4577 if test "x$with_libvarnish" = "xyes"
4579 SAVE_CPPFLAGS="$CPPFLAGS"
4580 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4581 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4583 CPPFLAGS="$SAVE_CPPFLAGS"
4585 if test "x$with_libvarnish" = "xyes"
4587 SAVE_CPPFLAGS="$CPPFLAGS"
4588 #SAVE_LDFLAGS="$LDFLAGS"
4590 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4591 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4593 AC_CHECK_HEADERS(varnish/vsc.h,
4594 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4595 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4597 CPPFLAGS="$SAVE_CPPFLAGS"
4598 #LDFLAGS="$SAVE_LDFLAGS"
4600 if test "x$with_libvarnish" = "xyes"
4602 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4603 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4604 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4605 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4609 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4610 with_libxml2="no (pkg-config isn't available)"
4611 with_libxml2_cflags=""
4612 with_libxml2_ldflags=""
4613 with_libvirt="no (pkg-config isn't available)"
4614 with_libvirt_cflags=""
4615 with_libvirt_ldflags=""
4616 if test "x$PKG_CONFIG" != "x"
4618 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
4623 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4626 $PKG_CONFIG --exists libvirt 2>/dev/null
4631 with_libvirt="no (pkg-config doesn't know libvirt)"
4634 if test "x$with_libxml2" = "xyes"
4636 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
4641 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
4647 if test "x$with_libxml2" = "xyes"
4649 SAVE_CPPFLAGS="$CPPFLAGS"
4650 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4652 AC_CHECK_HEADERS(libxml/parser.h, [],
4653 [with_libxml2="no (libxml/parser.h not found)"])
4655 CPPFLAGS="$SAVE_CPPFLAGS"
4657 if test "x$with_libxml2" = "xyes"
4659 SAVE_CFLAGS="$CFLAGS"
4660 SAVE_LDFLAGS="$LDFLAGS"
4662 CFLAGS="$CFLAGS $with_libxml2_cflags"
4663 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4665 AC_CHECK_LIB(xml2, xmlXPathEval,
4666 [with_libxml2="yes"],
4667 [with_libxml2="no (symbol xmlXPathEval not found)"])
4669 CFLAGS="$SAVE_CFLAGS"
4670 LDFLAGS="$SAVE_LDFLAGS"
4672 dnl Add the right compiler flags and libraries.
4673 if test "x$with_libxml2" = "xyes"; then
4674 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4675 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4676 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4677 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4679 if test "x$with_libvirt" = "xyes"
4681 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
4686 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
4692 if test "x$with_libvirt" = "xyes"
4694 SAVE_CPPFLAGS="$CPPFLAGS"
4695 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4697 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4698 [with_libvirt="no (libvirt/libvirt.h not found)"])
4700 CPPFLAGS="$SAVE_CPPFLAGS"
4702 if test "x$with_libvirt" = "xyes"
4704 SAVE_CFLAGS="$CFLAGS"
4705 SAVE_LDFLAGS="$LDFLAGS"
4707 CFLAGS="$CFLAGS $with_libvirt_cflags"
4708 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4710 AC_CHECK_LIB(virt, virDomainBlockStats,
4711 [with_libvirt="yes"],
4712 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4714 CFLAGS="$SAVE_CFLAGS"
4715 LDFLAGS="$SAVE_LDFLAGS"
4717 dnl Add the right compiler flags and libraries.
4718 if test "x$with_libvirt" = "xyes"; then
4719 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4720 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4721 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4722 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4726 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4727 with_libopenipmipthread="yes"
4728 with_libopenipmipthread_cflags=""
4729 with_libopenipmipthread_libs=""
4731 AC_MSG_CHECKING([for pkg-config])
4733 if test "x$PKG_CONFIG" = "x"
4735 with_libopenipmipthread="no"
4738 temp_result="$PKG_CONFIG"
4740 AC_MSG_RESULT([$temp_result])
4742 if test "x$with_libopenipmipthread" = "xyes"
4744 AC_MSG_CHECKING([for libOpenIPMIpthread])
4745 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4748 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4750 AC_MSG_RESULT([$with_libopenipmipthread])
4753 if test "x$with_libopenipmipthread" = "xyes"
4755 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4756 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4759 with_libopenipmipthread_cflags="$temp_result"
4761 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4762 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4764 AC_MSG_RESULT([$temp_result])
4767 if test "x$with_libopenipmipthread" = "xyes"
4769 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4770 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4773 with_libopenipmipthread_ldflags="$temp_result"
4775 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4776 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4778 AC_MSG_RESULT([$temp_result])
4781 if test "x$with_libopenipmipthread" = "xyes"
4783 SAVE_CPPFLAGS="$CPPFLAGS"
4784 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4786 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4787 [with_libopenipmipthread="yes"],
4788 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4789 [#include <OpenIPMI/ipmiif.h>
4790 #include <OpenIPMI/ipmi_err.h>
4791 #include <OpenIPMI/ipmi_posix.h>
4792 #include <OpenIPMI/ipmi_conn.h>
4795 CPPFLAGS="$SAVE_CPPFLAGS"
4798 if test "x$with_libopenipmipthread" = "xyes"
4800 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4801 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4802 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4803 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4807 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4808 [with_libnotify="yes"],
4809 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4812 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4815 # Check for enabled/disabled features
4818 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4819 # ------------------------------------------------------------
4821 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4826 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4831 m4_define([EnDis],[disabled])dnl
4832 m4_define([YesNo],[no])dnl
4838 m4_define([EnDis],[enabled])dnl
4839 m4_define([YesNo],[yes])dnl
4842 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4846 m4_if([$3], [feature], [],
4850 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4856 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4858 enable_$1='[YesNo]'dnl
4860 if test "x$enable_$1" = "xno"
4864 if test "x$enable_$1" = "xyes"
4868 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4873 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4874 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4876 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4878 # AC_PLUGIN(name, default, info)
4879 # ------------------------------------------------------------
4886 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
4888 if test "x$enableval" = "xyes"
4891 else if test "x$enableval" = "xforce"
4896 enable_plugin="no (disabled on command line)"
4900 if test "x$enable_all_plugins" = "xauto"
4902 if test "x$2" = "xyes"
4909 enable_plugin="$enable_all_plugins"
4912 if test "x$enable_plugin" = "xyes"
4914 if test "x$2" = "xyes" || test "x$force" = "xyes"
4916 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4917 if test "x$2" != "xyes"
4919 dependency_warning="yes"
4921 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4922 dependency_error="yes"
4923 enable_plugin="no (dependency error)"
4926 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4927 enable_$1="$enable_plugin"
4929 )# AC_PLUGIN(name, default, info)
4931 m4_divert_once([HELP_ENABLE], [
4932 collectd features:])
4933 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4934 AC_COLLECTD([debug], [enable], [feature], [debugging])
4935 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4936 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4938 dependency_warning="no"
4939 dependency_error="no"
4945 plugin_conntrack="no"
4946 plugin_contextswitch="no"
4949 plugin_curl_json="no"
4950 plugin_curl_xml="no"
4956 plugin_interface="no"
4963 plugin_multimeter="no"
4967 plugin_processes="no"
4968 plugin_protocols="no"
4972 plugin_tcpconns="no"
4979 plugin_wireless="no"
4983 if test "x$ac_system" = "xLinux"
4985 plugin_battery="yes"
4986 plugin_conntrack="yes"
4987 plugin_contextswitch="yes"
4988 plugin_cgroups="yes"
4990 plugin_cpufreq="yes"
4992 plugin_entropy="yes"
4993 plugin_fscache="yes"
4994 plugin_interface="yes"
5001 plugin_processes="yes"
5002 plugin_protocols="yes"
5005 plugin_tcpconns="yes"
5006 plugin_thermal="yes"
5009 plugin_vserver="yes"
5010 plugin_wireless="yes"
5012 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
5018 if test "x$ac_system" = "xOpenBSD"
5020 plugin_tcpconns="yes"
5024 if test "x$with_libiokit" = "xyes"
5026 plugin_battery="yes"
5032 if test "x$ac_system" = "xAIX"
5034 plugin_tcpconns="yes"
5039 if test "x$ac_system" = "xFreeBSD"
5041 plugin_zfs_arc="yes"
5045 if test "x$with_perfstat" = "xyes"
5048 plugin_contextswitch="yes"
5052 plugin_interface="yes"
5057 if test "x$with_procinfo" = "xyes"
5059 plugin_processes="yes"
5063 if test "x$with_kstat" = "xyes"
5066 plugin_processes="yes"
5068 plugin_zfs_arc="yes"
5071 if test "x$with_devinfo$with_kstat" = "xyesyes"
5075 plugin_interface="yes"
5081 if test "x$with_libstatgrab" = "xyes"
5085 plugin_interface="yes"
5092 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5095 if test "x$have_strptime" = "xyes"
5101 if test "x$with_libopenipmipthread" = "xyes"
5106 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
5108 plugin_curl_json="yes"
5111 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5113 plugin_curl_xml="yes"
5116 if test "x$have_processor_info" = "xyes"
5120 if test "x$have_sysctl" = "xyes"
5125 if test "x$ac_system" = "xDarwin"
5130 if test "x$have_sysctlbyname" = "xyes"
5132 plugin_contextswitch="yes"
5135 plugin_tcpconns="yes"
5138 # Df plugin: Check if we know how to determine mount points first.
5139 #if test "x$have_listmntent" = "xyes"; then
5142 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
5146 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
5150 #if test "x$have_getmntent" = "xseq"
5154 if test "x$c_cv_have_one_getmntent" = "xyes"
5159 if test "x$c_cv_have_getmntent_r" = "xyes"
5164 # Df plugin: Check if we have either `statfs' or `statvfs' second.
5165 if test "x$plugin_df" = "xyes"
5168 if test "x$have_statfs" = "xyes"
5172 if test "x$have_statvfs" = "xyes"
5178 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
5180 plugin_ethstat="yes"
5183 if test "x$have_getifaddrs" = "xyes"
5185 plugin_interface="yes"
5188 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
5190 plugin_libvirt="yes"
5193 if test "x$have_getloadavg" = "xyes"
5198 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
5203 # Mac OS X memory interface
5204 if test "x$have_host_statistics" = "xyes"
5209 if test "x$have_termios_h" = "xyes"
5211 plugin_multimeter="yes"
5215 if test "x$have_thread_info" = "xyes"
5217 plugin_processes="yes"
5220 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
5222 plugin_processes="yes"
5225 if test "x$with_kvm_getswapinfo" = "xyes"
5230 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
5235 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
5237 plugin_tcpconns="yes"
5240 if test "x$have_getutent" = "xyes"
5244 if test "x$have_getutxent" = "xyes"
5249 m4_divert_once([HELP_ENABLE], [
5252 AC_ARG_ENABLE([all-plugins],
5253 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
5255 if test "x$enableval" = "xyes"
5257 enable_all_plugins="yes"
5258 else if test "x$enableval" = "xauto"
5260 enable_all_plugins="auto"
5262 enable_all_plugins="no"
5265 [enable_all_plugins="auto"])
5267 m4_divert_once([HELP_ENABLE], [])
5269 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
5270 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
5271 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
5272 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
5273 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
5274 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero's hardware sensors])
5275 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
5276 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
5277 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
5278 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
5279 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
5280 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
5281 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
5282 AC_PLUGIN([csv], [yes], [CSV output plugin])
5283 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
5284 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
5285 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
5286 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
5287 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
5288 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
5289 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
5290 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
5291 AC_PLUGIN([email], [yes], [EMail statistics])
5292 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
5293 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
5294 AC_PLUGIN([exec], [yes], [Execution of external programs])
5295 AC_PLUGIN([filecount], [yes], [Count files in directories])
5296 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
5297 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
5298 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
5299 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
5300 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
5301 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
5302 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
5303 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
5304 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
5305 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
5306 AC_PLUGIN([load], [$plugin_load], [System load])
5307 AC_PLUGIN([logfile], [yes], [File logging plugin])
5308 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
5309 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
5310 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
5311 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
5312 AC_PLUGIN([match_hashed], [yes], [The hashed match])
5313 AC_PLUGIN([match_regex], [yes], [The regex match])
5314 AC_PLUGIN([match_timediff], [yes], [The timediff match])
5315 AC_PLUGIN([match_value], [yes], [The value match])
5316 AC_PLUGIN([mbmon], [yes], [Query mbmond])
5317 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
5318 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
5319 AC_PLUGIN([memcached], [yes], [memcached statistics])
5320 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
5321 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
5322 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
5323 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
5324 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
5325 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
5326 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
5327 AC_PLUGIN([network], [yes], [Network communication plugin])
5328 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5329 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5330 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5331 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5332 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5333 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5334 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5335 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5336 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5337 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5338 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5339 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5340 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5341 # FIXME: Check for libevent, too.
5342 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5343 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5344 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5345 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5346 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5347 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5348 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5349 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5350 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5351 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5352 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5353 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5354 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5355 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
5356 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5357 AC_PLUGIN([statsd], [yes], [StatsD plugin])
5358 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5359 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5360 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5361 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5362 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5363 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5364 AC_PLUGIN([target_notification], [yes], [The notification target])
5365 AC_PLUGIN([target_replace], [yes], [The replace target])
5366 AC_PLUGIN([target_scale],[yes], [The scale target])
5367 AC_PLUGIN([target_set], [yes], [The set target])
5368 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5369 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5370 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5371 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5372 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5373 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5374 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5375 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5376 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5377 AC_PLUGIN([users], [$plugin_users], [User statistics])
5378 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5379 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5380 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5381 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5382 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5383 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5384 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5385 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5386 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5387 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5388 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5389 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5391 dnl Default configuration file
5392 # Load either syslog or logfile
5393 LOAD_PLUGIN_SYSLOG=""
5394 LOAD_PLUGIN_LOGFILE=""
5396 AC_MSG_CHECKING([which default log plugin to load])
5397 default_log_plugin="none"
5398 if test "x$enable_syslog" = "xyes"
5400 default_log_plugin="syslog"
5402 LOAD_PLUGIN_SYSLOG="##"
5405 if test "x$enable_logfile" = "xyes"
5407 if test "x$default_log_plugin" = "xnone"
5409 default_log_plugin="logfile"
5411 LOAD_PLUGIN_LOGFILE="#"
5414 LOAD_PLUGIN_LOGFILE="##"
5416 AC_MSG_RESULT([$default_log_plugin])
5418 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5419 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5421 DEFAULT_LOG_LEVEL="info"
5422 if test "x$enable_debug" = "xyes"
5424 DEFAULT_LOG_LEVEL="debug"
5426 AC_SUBST(DEFAULT_LOG_LEVEL)
5428 # Load only one of rrdtool, network, csv in the default config.
5429 LOAD_PLUGIN_RRDTOOL=""
5430 LOAD_PLUGIN_NETWORK=""
5433 AC_MSG_CHECKING([which default write plugin to load])
5434 default_write_plugin="none"
5435 if test "x$enable_rrdtool" = "xyes"
5437 default_write_plugin="rrdtool"
5439 LOAD_PLUGIN_RRDTOOL="##"
5442 if test "x$enable_network" = "xyes"
5444 if test "x$default_write_plugin" = "xnone"
5446 default_write_plugin="network"
5448 LOAD_PLUGIN_NETWORK="#"
5451 LOAD_PLUGIN_NETWORK="##"
5454 if test "x$enable_csv" = "xyes"
5456 if test "x$default_write_plugin" = "xnone"
5458 default_write_plugin="csv"
5463 LOAD_PLUGIN_CSV="##"
5465 AC_MSG_RESULT([$default_write_plugin])
5467 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5468 AC_SUBST(LOAD_PLUGIN_NETWORK)
5469 AC_SUBST(LOAD_PLUGIN_CSV)
5472 if test "x$ac_system" = "xLinux" \
5473 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5475 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5478 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5480 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5484 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
5485 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5487 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5489 PERL_BINDINGS_OPTIONS="$withval"
5490 with_perl_bindings="yes"
5492 with_perl_bindings="$withval"
5496 if test -n "$perl_interpreter"
5498 with_perl_bindings="yes"
5500 with_perl_bindings="no (no perl interpreter found)"
5503 if test "x$with_perl_bindings" = "xyes"
5505 PERL_BINDINGS="perl"
5509 AC_SUBST(PERL_BINDINGS)
5510 AC_SUBST(PERL_BINDINGS_OPTIONS)
5512 dnl libcollectdclient
5513 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5514 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5515 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5517 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5519 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5521 AC_SUBST(LCC_VERSION_MAJOR)
5522 AC_SUBST(LCC_VERSION_MINOR)
5523 AC_SUBST(LCC_VERSION_PATCH)
5524 AC_SUBST(LCC_VERSION_EXTRA)
5525 AC_SUBST(LCC_VERSION_STRING)
5527 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5529 AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
5532 if test "x$with_librrd" = "xyes" \
5533 && test "x$librrd_threadsafe" != "xyes"
5535 with_librrd="yes (warning: librrd is not thread-safe)"
5538 if test "x$with_libperl" = "xyes"
5540 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5542 enable_perl="no (needs libperl)"
5545 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5547 enable_perl="no (libperl doesn't support ithreads)"
5550 if test "x$with_perl_bindings" = "xyes" \
5551 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5553 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5560 intel mic . . . . . . $with_mic
5561 libaquaero5 . . . . . $with_libaquaero5
5562 libcredis . . . . . . $with_libcredis
5563 libcurl . . . . . . . $with_libcurl
5564 libdbi . . . . . . . $with_libdbi
5565 libesmtp . . . . . . $with_libesmtp
5566 libganglia . . . . . $with_libganglia
5567 libgcrypt . . . . . . $with_libgcrypt
5568 libhal . . . . . . . $with_libhal
5569 libiokit . . . . . . $with_libiokit
5570 libiptc . . . . . . . $with_libiptc
5571 libjvm . . . . . . . $with_java
5572 libkstat . . . . . . $with_kstat
5573 libkvm . . . . . . . $with_libkvm
5574 liblvm2app . . . . . $with_liblvm2app
5575 libmemcached . . . . $with_libmemcached
5576 libmnl . . . . . . . $with_libmnl
5577 libmodbus . . . . . . $with_libmodbus
5578 libmongoc . . . . . . $with_libmongoc
5579 libmysql . . . . . . $with_libmysql
5580 libnetapp . . . . . . $with_libnetapp
5581 libnetsnmp . . . . . $with_libnetsnmp
5582 libnotify . . . . . . $with_libnotify
5583 liboconfig . . . . . $with_liboconfig
5584 libopenipmi . . . . . $with_libopenipmipthread
5585 liboping . . . . . . $with_liboping
5586 libowcapi . . . . . . $with_libowcapi
5587 libpcap . . . . . . . $with_libpcap
5588 libperfstat . . . . . $with_perfstat
5589 libperl . . . . . . . $with_libperl
5590 libpq . . . . . . . . $with_libpq
5591 libpthread . . . . . $with_libpthread
5592 librabbitmq . . . . . $with_librabbitmq
5593 librouteros . . . . . $with_librouteros
5594 librrd . . . . . . . $with_librrd
5595 libsensors . . . . . $with_libsensors
5596 libsigrok . . . . . $with_libsigrok
5597 libstatgrab . . . . . $with_libstatgrab
5598 libtokyotyrant . . . $with_libtokyotyrant
5599 libupsclient . . . . $with_libupsclient
5600 libvarnish . . . . . $with_libvarnish
5601 libvirt . . . . . . . $with_libvirt
5602 libxml2 . . . . . . . $with_libxml2
5603 libxmms . . . . . . . $with_libxmms
5604 libyajl . . . . . . . $with_libyajl
5605 oracle . . . . . . . $with_oracle
5606 protobuf-c . . . . . $have_protoc_c
5607 python . . . . . . . $with_python
5610 daemon mode . . . . . $enable_daemon
5611 debug . . . . . . . . $enable_debug
5614 perl . . . . . . . . $with_perl_bindings
5617 aggregation . . . . . $enable_aggregation
5618 amqp . . . . . . . $enable_amqp
5619 apache . . . . . . . $enable_apache
5620 apcups . . . . . . . $enable_apcups
5621 aquaero . . . . . . . $enable_aquaero
5622 apple_sensors . . . . $enable_apple_sensors
5623 ascent . . . . . . . $enable_ascent
5624 battery . . . . . . . $enable_battery
5625 bind . . . . . . . . $enable_bind
5626 conntrack . . . . . . $enable_conntrack
5627 contextswitch . . . . $enable_contextswitch
5628 cgroups . . . . . . . $enable_cgroups
5629 cpu . . . . . . . . . $enable_cpu
5630 cpufreq . . . . . . . $enable_cpufreq
5631 csv . . . . . . . . . $enable_csv
5632 curl . . . . . . . . $enable_curl
5633 curl_json . . . . . . $enable_curl_json
5634 curl_xml . . . . . . $enable_curl_xml
5635 dbi . . . . . . . . . $enable_dbi
5636 df . . . . . . . . . $enable_df
5637 disk . . . . . . . . $enable_disk
5638 dns . . . . . . . . . $enable_dns
5639 email . . . . . . . . $enable_email
5640 entropy . . . . . . . $enable_entropy
5641 ethstat . . . . . . . $enable_ethstat
5642 exec . . . . . . . . $enable_exec
5643 filecount . . . . . . $enable_filecount
5644 fscache . . . . . . . $enable_fscache
5645 gmond . . . . . . . . $enable_gmond
5646 hddtemp . . . . . . . $enable_hddtemp
5647 interface . . . . . . $enable_interface
5648 ipmi . . . . . . . . $enable_ipmi
5649 iptables . . . . . . $enable_iptables
5650 ipvs . . . . . . . . $enable_ipvs
5651 irq . . . . . . . . . $enable_irq
5652 java . . . . . . . . $enable_java
5653 libvirt . . . . . . . $enable_libvirt
5654 load . . . . . . . . $enable_load
5655 logfile . . . . . . . $enable_logfile
5656 lpar . . . . . . . . $enable_lpar
5657 lvm . . . . . . . . . $enable_lvm
5658 madwifi . . . . . . . $enable_madwifi
5659 match_empty_counter . $enable_match_empty_counter
5660 match_hashed . . . . $enable_match_hashed
5661 match_regex . . . . . $enable_match_regex
5662 match_timediff . . . $enable_match_timediff
5663 match_value . . . . . $enable_match_value
5664 mbmon . . . . . . . . $enable_mbmon
5665 md . . . . . . . . . $enable_md
5666 memcachec . . . . . . $enable_memcachec
5667 memcached . . . . . . $enable_memcached
5668 memory . . . . . . . $enable_memory
5669 mic . . . . . . . . . $enable_mic
5670 modbus . . . . . . . $enable_modbus
5671 multimeter . . . . . $enable_multimeter
5672 mysql . . . . . . . . $enable_mysql
5673 netapp . . . . . . . $enable_netapp
5674 netlink . . . . . . . $enable_netlink
5675 network . . . . . . . $enable_network
5676 nfs . . . . . . . . . $enable_nfs
5677 nginx . . . . . . . . $enable_nginx
5678 notify_desktop . . . $enable_notify_desktop
5679 notify_email . . . . $enable_notify_email
5680 ntpd . . . . . . . . $enable_ntpd
5681 numa . . . . . . . . $enable_numa
5682 nut . . . . . . . . . $enable_nut
5683 olsrd . . . . . . . . $enable_olsrd
5684 onewire . . . . . . . $enable_onewire
5685 openvpn . . . . . . . $enable_openvpn
5686 oracle . . . . . . . $enable_oracle
5687 perl . . . . . . . . $enable_perl
5688 pf . . . . . . . . . $enable_pf
5689 pinba . . . . . . . . $enable_pinba
5690 ping . . . . . . . . $enable_ping
5691 postgresql . . . . . $enable_postgresql
5692 powerdns . . . . . . $enable_powerdns
5693 processes . . . . . . $enable_processes
5694 protocols . . . . . . $enable_protocols
5695 python . . . . . . . $enable_python
5696 redis . . . . . . . . $enable_redis
5697 routeros . . . . . . $enable_routeros
5698 rrdcached . . . . . . $enable_rrdcached
5699 rrdtool . . . . . . . $enable_rrdtool
5700 sensors . . . . . . . $enable_sensors
5701 serial . . . . . . . $enable_serial
5702 sigrok . . . . . . . $enable_sigrok
5703 snmp . . . . . . . . $enable_snmp
5704 statsd . . . . . . . $enable_statsd
5705 swap . . . . . . . . $enable_swap
5706 syslog . . . . . . . $enable_syslog
5707 table . . . . . . . . $enable_table
5708 tail . . . . . . . . $enable_tail
5709 tail_csv . . . . . . $enable_tail_csv
5710 tape . . . . . . . . $enable_tape
5711 target_notification . $enable_target_notification
5712 target_replace . . . $enable_target_replace
5713 target_scale . . . . $enable_target_scale
5714 target_set . . . . . $enable_target_set
5715 target_v5upgrade . . $enable_target_v5upgrade
5716 tcpconns . . . . . . $enable_tcpconns
5717 teamspeak2 . . . . . $enable_teamspeak2
5718 ted . . . . . . . . . $enable_ted
5719 thermal . . . . . . . $enable_thermal
5720 threshold . . . . . . $enable_threshold
5721 tokyotyrant . . . . . $enable_tokyotyrant
5722 unixsock . . . . . . $enable_unixsock
5723 uptime . . . . . . . $enable_uptime
5724 users . . . . . . . . $enable_users
5725 uuid . . . . . . . . $enable_uuid
5726 varnish . . . . . . . $enable_varnish
5727 vmem . . . . . . . . $enable_vmem
5728 vserver . . . . . . . $enable_vserver
5729 wireless . . . . . . $enable_wireless
5730 write_graphite . . . $enable_write_graphite
5731 write_http . . . . . $enable_write_http
5732 write_mongodb . . . . $enable_write_mongodb
5733 write_redis . . . . . $enable_write_redis
5734 write_riemann . . . . $enable_write_riemann
5735 xmms . . . . . . . . $enable_xmms
5736 zfs_arc . . . . . . . $enable_zfs_arc
5740 if test "x$dependency_error" = "xyes"; then
5741 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5744 if test "x$dependency_warning" = "xyes"; then
5745 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5748 # vim: set fdm=marker :