1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 m4_ifdef([LT_PACKAGE_VERSION],
10 LT_CONFIG_LTDL_DIR([libltdl])
12 LTDL_INIT([convenience])
13 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
18 AC_LIBLTDL_CONVENIENCE
22 AC_CONFIG_SUBDIRS(libltdl)
23 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
27 AM_INIT_AUTOMAKE(dist-bzip2)
30 AC_PREFIX_DEFAULT("/opt/collectd")
35 # Checks for programs.
43 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
51 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
52 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
54 AC_MSG_CHECKING([for kernel type ($host_os)])
57 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
61 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
71 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
77 AC_MSG_RESULT([$ac_system])
79 if test "x$ac_system" = "xLinux"
81 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
82 if test -z "$KERNEL_DIR"
84 KERNEL_DIR="/lib/modules/`uname -r`/source"
87 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
88 AC_SUBST(KERNEL_CFLAGS)
91 if test "x$ac_system" = "xSolaris"
93 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
95 if test "x$ac_system" = "xAIX"
97 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
100 # Where to install .pc files.
101 pkgconfigdir="${libdir}/pkgconfig"
102 AC_SUBST(pkgconfigdir)
104 # Check for standards compliance mode
105 AC_ARG_ENABLE(standards,
106 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
107 [enable_standards="$enableval"],
108 [enable_standards="no"])
109 if test "x$enable_standards" = "xyes"
111 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
112 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
113 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
114 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
115 if test "x$GCC" = "xyes"
117 CFLAGS="$CFLAGS -std=c99"
120 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
123 # Checks for header files.
130 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)
133 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
138 # include <sys/types.h>
141 AC_CHECK_HEADERS(netinet/in.h, [], [],
146 # include <sys/types.h>
148 #if HAVE_NETINET_IN_SYSTM_H
149 # include <netinet/in_systm.h>
152 AC_CHECK_HEADERS(netinet/ip.h, [], [],
157 # include <sys/types.h>
159 #if HAVE_NETINET_IN_SYSTM_H
160 # include <netinet/in_systm.h>
162 #if HAVE_NETINET_IN_H
163 # include <netinet/in.h>
166 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
171 # include <sys/types.h>
173 #if HAVE_NETINET_IN_SYSTM_H
174 # include <netinet/in_systm.h>
176 #if HAVE_NETINET_IN_H
177 # include <netinet/in.h>
179 #if HAVE_NETINET_IP_H
180 # include <netinet/ip.h>
183 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
188 # include <sys/types.h>
190 #if HAVE_NETINET_IN_SYSTM_H
191 # include <netinet/in_systm.h>
193 #if HAVE_NETINET_IN_H
194 # include <netinet/in.h>
196 #if HAVE_NETINET_IP_H
197 # include <netinet/ip.h>
200 AC_CHECK_HEADERS(netinet/ip6.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/icmp6.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_IP6_H
228 # include <netinet/ip6.h>
231 AC_CHECK_HEADERS(netinet/tcp.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/udp.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>
261 #if HAVE_NETINET_IP_H
262 # include <netinet/ip.h>
267 AC_CHECK_HEADERS(sys/dkstat.h)
268 if test "x$ac_system" = "xDarwin"
270 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)
271 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
273 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
276 # include <sys/types.h>
279 # include <sys/param.h>
283 AC_MSG_CHECKING([for sysctl kern.cp_times])
284 if test -x /sbin/sysctl
286 /sbin/sysctl kern.cp_times 2>/dev/null
290 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
291 [Define if sysctl supports kern.cp_times])
300 AC_CHECK_HEADERS(linux/major.h libgen.h)
302 # For the battery plugin
303 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
305 #if HAVE_IOKIT_IOKITLIB_H
306 # include <IOKit/IOKitLib.h>
308 #if HAVE_IOKIT_IOTYPES_H
309 # include <IOKit/IOTypes.h>
313 # For the swap module
314 have_linux_wireless_h="no"
315 if test "x$ac_system" = "xLinux"
317 AC_CHECK_HEADERS(linux/wireless.h,
318 [have_linux_wireless_h="yes"],
319 [have_linux_wireless_h="no"],
322 #include <sys/ioctl.h>
323 #include <sys/socket.h>
327 # For the swap module
328 have_sys_swap_h="yes"
329 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
331 #undef _FILE_OFFSET_BITS
332 #undef _LARGEFILE64_SOURCE
334 # include <sys/types.h>
337 # include <sys/param.h>
341 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
344 if test "x$GCC" = "xyes"
346 hint_64="CFLAGS='-m64'"
348 hint_64="CFLAGS='-xarch=v9'"
350 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
354 # For the processes plugin
356 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
358 # For interface plugin
359 AC_CHECK_HEADERS(ifaddrs.h)
360 AC_CHECK_HEADERS(net/if.h, [], [],
363 # include <sys/types.h>
365 #if HAVE_SYS_SOCKET_H
366 # include <sys/socket.h>
369 AC_CHECK_HEADERS(linux/if.h, [], [],
372 # include <sys/types.h>
374 #if HAVE_SYS_SOCKET_H
375 # include <sys/socket.h>
378 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
381 # include <sys/types.h>
383 #if HAVE_SYS_SOCKET_H
384 # include <sys/socket.h>
387 # include <linux/if.h>
392 have_linux_ip_vs_h="no"
393 have_net_ip_vs_h="no"
395 ip_vs_h_needs_kernel_cflags="no"
396 if test "x$ac_system" = "xLinux"
398 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
399 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
400 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
402 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
404 SAVE_CFLAGS="$CFLAGS"
405 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
407 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
409 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
410 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
411 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
413 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
415 ip_vs_h_needs_kernel_cflags="yes"
418 CFLAGS="$SAVE_CFLAGS"
421 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
424 AC_CHECK_HEADERS(sys/ucred.h, [], [],
427 # include <sys/types.h>
430 # include <sys/param.h>
434 # For mount interface
435 AC_CHECK_HEADERS(sys/mount.h, [], [],
438 # include <sys/types.h>
441 # include <sys/param.h>
445 # For the email plugin
446 AC_CHECK_HEADERS(linux/un.h, [], [],
448 #if HAVE_SYS_SOCKET_H
449 # include <sys/socket.h>
453 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
456 AC_CHECK_HEADERS(arpa/nameser.h)
457 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
459 #if HAVE_ARPA_NAMESER_H
460 # include <arpa/nameser.h>
464 AC_CHECK_HEADERS(net/if_arp.h, [], [],
465 [#if HAVE_SYS_SOCKET_H
466 # include <sys/socket.h>
469 AC_CHECK_HEADERS(net/ppp_defs.h)
470 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
471 [#if HAVE_NET_PPP_DEFS_H
472 # include <net/ppp_defs.h>
475 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
480 # include <sys/types.h>
482 #if HAVE_SYS_SOCKET_H
483 # include <sys/socket.h>
488 #if HAVE_NETINET_IN_H
489 # include <netinet/in.h>
493 # For the multimeter plugin
495 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
498 # Checks for typedefs, structures, and compiler characteristics.
507 # Checks for library functions.
509 AC_PROG_GCC_TRADITIONAL
510 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
514 SAVE_CFLAGS="$CFLAGS"
515 # Emulate behavior of src/Makefile.am
516 if test "x$GCC" = "xyes"
518 CFLAGS="$CFLAGS -Wall -Werror"
521 AC_CACHE_CHECK([for strtok_r],
522 [c_cv_have_strtok_r_default],
531 char buffer[] = "foo,bar,baz";
538 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
541 printf ("token = %s;\n", token);
544 [c_cv_have_strtok_r_default="yes"],
545 [c_cv_have_strtok_r_default="no"]
549 if test "x$c_cv_have_strtok_r_default" = "xno"
551 CFLAGS="$CFLAGS -D_REENTRANT=1"
553 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
554 [c_cv_have_strtok_r_reentrant],
563 char buffer[] = "foo,bar,baz";
570 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
573 printf ("token = %s;\n", token);
576 [c_cv_have_strtok_r_reentrant="yes"],
577 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
582 CFLAGS="$SAVE_CFLAGS"
583 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
585 CFLAGS="$CFLAGS -D_REENTRANT=1"
588 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
590 socket_needs_socket="no"
591 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
592 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
594 clock_gettime_needs_rt="no"
595 clock_gettime_needs_posix4="no"
596 have_clock_gettime="no"
597 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
598 if test "x$have_clock_gettime" = "xno"
600 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
601 have_clock_gettime="yes"])
603 if test "x$have_clock_gettime" = "xno"
605 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
606 have_clock_gettime="yes"])
608 if test "x$have_clock_gettime" = "xyes"
610 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
612 AC_MSG_WARN(cannot find clock_gettime)
615 nanosleep_needs_rt="no"
616 nanosleep_needs_posix4="no"
617 AC_CHECK_FUNCS(nanosleep,
619 AC_CHECK_LIB(rt, nanosleep,
620 [nanosleep_needs_rt="yes"],
621 AC_CHECK_LIB(posix4, nanosleep,
622 [nanosleep_needs_posix4="yes"],
623 AC_MSG_ERROR(cannot find nanosleep))))
625 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
626 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
628 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
629 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
630 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
631 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
632 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
633 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
634 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
635 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
636 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
637 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
638 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
639 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
641 # Check for strptime {{{
642 if test "x$GCC" = "xyes"
644 SAVE_CFLAGS="$CFLAGS"
645 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
648 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
649 if test "x$have_strptime" = "xyes"
651 AC_CACHE_CHECK([whether strptime is exported by default],
652 [c_cv_have_strptime_default],
661 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
663 [c_cv_have_strptime_default="yes"],
664 [c_cv_have_strptime_default="no"]))
666 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
668 AC_CACHE_CHECK([whether strptime needs standards mode],
669 [c_cv_have_strptime_standards],
673 #ifndef _ISOC99_SOURCE
674 # define _ISOC99_SOURCE 1
676 #ifndef _POSIX_C_SOURCE
677 # define _POSIX_C_SOURCE 200112L
679 #ifndef _XOPEN_SOURCE
680 # define _XOPEN_SOURCE 500
687 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
689 [c_cv_have_strptime_standards="yes"],
690 [c_cv_have_strptime_standards="no"]))
692 if test "x$c_cv_have_strptime_standards" = "xyes"
694 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
700 if test "x$GCC" = "xyes"
702 CFLAGS="$SAVE_CFLAGS"
705 # }}} Check for strptime
707 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
708 if test "x$have_swapctl" = "xyes"; then
709 AC_CACHE_CHECK([whether swapctl takes two arguments],
710 [c_cv_have_swapctl_two_args],
712 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
713 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
714 # undef _FILE_OFFSET_BITS
715 # undef _LARGEFILE64_SOURCE
717 #include <sys/stat.h>
718 #include <sys/swap.h>]],
720 int num = swapctl(0, NULL);
723 [c_cv_have_swapctl_two_args="yes"],
724 [c_cv_have_swapctl_two_args="no"]
727 AC_CACHE_CHECK([whether swapctl takes three arguments],
728 [c_cv_have_swapctl_three_args],
730 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
731 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
732 # undef _FILE_OFFSET_BITS
733 # undef _LARGEFILE64_SOURCE
735 #include <sys/stat.h>
736 #include <sys/swap.h>]],
738 int num = swapctl(0, NULL,0);
741 [c_cv_have_swapctl_three_args="yes"],
742 [c_cv_have_swapctl_three_args="no"]
746 # Check for different versions of `swapctl' here..
747 if test "x$have_swapctl" = "xyes"; then
748 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
749 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
750 [Define if the function swapctl exists and takes two arguments.])
752 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
753 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
754 [Define if the function swapctl exists and takes three arguments.])
759 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
761 if test "x$withval" = "xno"; then
763 else if test "x$withval" = "xyes"; then
770 if test "x$nan_type" = "xnone"; then
771 AC_CACHE_CHECK([whether NAN is defined by default],
772 [c_cv_have_nan_default],
778 static double foo = NAN;
786 [c_cv_have_nan_default="yes"],
787 [c_cv_have_nan_default="no"]
790 if test "x$c_cv_have_nan_default" = "xyes"
795 if test "x$nan_type" = "xnone"; then
796 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
797 [c_cv_have_nan_isoc],
802 #define __USE_ISOC99 1
804 static double foo = NAN;
812 [c_cv_have_nan_isoc="yes"],
813 [c_cv_have_nan_isoc="no"]
816 if test "x$c_cv_have_nan_isoc" = "xyes"
821 if test "x$nan_type" = "xnone"; then
822 SAVE_LDFLAGS=$LDFLAGS
823 LDFLAGS="$LDFLAGS -lm"
824 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
825 [c_cv_have_nan_zero],
834 #define NAN (0.0 / 0.0)
836 # define isnan(f) ((f) != (f))
838 static double foo = NAN;
846 [c_cv_have_nan_zero="yes"],
847 [c_cv_have_nan_zero="no"]
850 LDFLAGS=$SAVE_LDFLAGS
851 if test "x$c_cv_have_nan_zero" = "xyes"
857 if test "x$nan_type" = "xdefault"; then
858 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
859 [Define if NAN is defined by default and can initialize static variables.])
860 else if test "x$nan_type" = "xisoc99"; then
861 AC_DEFINE(NAN_STATIC_ISOC, 1,
862 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
863 else if test "x$nan_type" = "xzero"; then
864 AC_DEFINE(NAN_ZERO_ZERO, 1,
865 [Define if NAN can be defined as (0.0 / 0.0)])
867 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
870 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
872 if test "x$withval" = "xnothing"; then
873 fp_layout_type="nothing"
874 else if test "x$withval" = "xendianflip"; then
875 fp_layout_type="endianflip"
876 else if test "x$withval" = "xintswap"; then
877 fp_layout_type="intswap"
879 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
882 [fp_layout_type="unknown"])
884 if test "x$fp_layout_type" = "xunknown"; then
885 AC_CACHE_CHECK([if doubles are stored in x86 representation],
886 [c_cv_fp_layout_need_nothing],
897 # include <inttypes.h>
900 # include <stdbool.h>
910 memcpy ((void *) &i0, (void *) &d, 8);
913 memcpy ((void *) c, (void *) &i1, 8);
915 if ((c[0] == 0x2f) && (c[1] == 0x25)
916 && (c[2] == 0xc0) && (c[3] == 0xc7)
917 && (c[4] == 0x43) && (c[5] == 0x2b)
918 && (c[6] == 0x1f) && (c[7] == 0x5b))
923 [c_cv_fp_layout_need_nothing="yes"],
924 [c_cv_fp_layout_need_nothing="no"]
927 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
928 fp_layout_type="nothing"
931 if test "x$fp_layout_type" = "xunknown"; then
932 AC_CACHE_CHECK([if endianflip converts to x86 representation],
933 [c_cv_fp_layout_need_endianflip],
944 # include <inttypes.h>
947 # include <stdbool.h>
949 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
950 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
951 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
952 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
953 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
954 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
955 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
956 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
965 memcpy ((void *) &i0, (void *) &d, 8);
967 i1 = endianflip (i0);
968 memcpy ((void *) c, (void *) &i1, 8);
970 if ((c[0] == 0x2f) && (c[1] == 0x25)
971 && (c[2] == 0xc0) && (c[3] == 0xc7)
972 && (c[4] == 0x43) && (c[5] == 0x2b)
973 && (c[6] == 0x1f) && (c[7] == 0x5b))
978 [c_cv_fp_layout_need_endianflip="yes"],
979 [c_cv_fp_layout_need_endianflip="no"]
982 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
983 fp_layout_type="endianflip"
986 if test "x$fp_layout_type" = "xunknown"; then
987 AC_CACHE_CHECK([if intswap converts to x86 representation],
988 [c_cv_fp_layout_need_intswap],
999 # include <inttypes.h>
1002 # include <stdbool.h>
1004 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1005 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1014 memcpy ((void *) &i0, (void *) &d, 8);
1017 memcpy ((void *) c, (void *) &i1, 8);
1019 if ((c[0] == 0x2f) && (c[1] == 0x25)
1020 && (c[2] == 0xc0) && (c[3] == 0xc7)
1021 && (c[4] == 0x43) && (c[5] == 0x2b)
1022 && (c[6] == 0x1f) && (c[7] == 0x5b))
1027 [c_cv_fp_layout_need_intswap="yes"],
1028 [c_cv_fp_layout_need_intswap="no"]
1031 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1032 fp_layout_type="intswap"
1036 if test "x$fp_layout_type" = "xnothing"; then
1037 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1038 [Define if doubles are stored in x86 representation.])
1039 else if test "x$fp_layout_type" = "xendianflip"; then
1040 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1041 [Define if endianflip is needed to convert to x86 representation.])
1042 else if test "x$fp_layout_type" = "xintswap"; then
1043 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1044 [Define if intswap is needed to convert to x86 representation.])
1046 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1050 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1051 have_getvfsstat="no"
1052 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1053 have_listmntent="no"
1054 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1057 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1058 if test "x$have_getmntent" = "xno"; then
1059 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1061 if test "x$have_getmntent" = "xno"; then
1062 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1064 if test "x$have_getmntent" = "xno"; then
1065 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1068 if test "x$have_getmntent" = "xc"; then
1069 AC_CACHE_CHECK([whether getmntent takes one argument],
1070 [c_cv_have_one_getmntent],
1072 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1073 #include "$srcdir/src/utils_mount.h"]],
1077 fh = setmntent ("/etc/mtab", "r");
1078 me = getmntent (fh);
1081 [c_cv_have_one_getmntent="yes"],
1082 [c_cv_have_one_getmntent="no"]
1085 AC_CACHE_CHECK([whether getmntent takes two arguments],
1086 [c_cv_have_two_getmntent],
1088 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1089 #include "$srcdir/src/utils_mount.h"]],
1094 fh = fopen ("/etc/mnttab", "r");
1095 status = getmntent (fh, &mt);
1098 [c_cv_have_two_getmntent="yes"],
1099 [c_cv_have_two_getmntent="no"]
1104 # Check for different versions of `getmntent' here..
1106 if test "x$have_getmntent" = "xc"; then
1107 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1108 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1109 [Define if the function getmntent exists and takes one argument.])
1111 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1112 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1113 [Define if the function getmntent exists and takes two arguments.])
1116 if test "x$have_getmntent" = "xsun"; then
1117 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1118 [Define if the function getmntent exists. It's the version from libsun.])
1120 if test "x$have_getmntent" = "xseq"; then
1121 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1122 [Define if the function getmntent exists. It's the version from libseq.])
1124 if test "x$have_getmntent" = "xgen"; then
1125 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1126 [Define if the function getmntent exists. It's the version from libgen.])
1130 AC_MSG_CHECKING([if have htonll defined])
1135 #include <sys/types.h>
1136 #include <netinet/in.h>
1138 # include <inttypes.h>
1145 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1148 AC_MSG_RESULT([$have_htonll])
1150 # Check for structures
1151 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1152 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1155 #include <sys/types.h>
1156 #include <sys/socket.h>
1159 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1160 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1163 #include <sys/types.h>
1164 #include <sys/socket.h>
1165 #include <linux/if.h>
1166 #include <linux/netdevice.h>
1169 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1172 #include <netinet/in.h>
1176 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1178 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1179 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1180 have_struct_kinfo_proc_freebsd="yes"
1183 have_struct_kinfo_proc_freebsd="no"
1187 #include <sys/param.h>
1188 #include <sys/sysctl.h>
1189 #include <sys/user.h>
1192 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1194 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1195 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1196 have_struct_kinfo_proc_openbsd="yes"
1199 have_struct_kinfo_proc_openbsd="no"
1202 #include <sys/param.h>
1203 #include <sys/sysctl.h>
1207 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1208 [#define _BSD_SOURCE
1210 # include <stdint.h>
1212 #if HAVE_SYS_TYPES_H
1213 # include <sys/types.h>
1215 #if HAVE_NETINET_IN_SYSTM_H
1216 # include <netinet/in_systm.h>
1218 #if HAVE_NETINET_IN_H
1219 # include <netinet/in.h>
1221 #if HAVE_NETINET_IP_H
1222 # include <netinet/ip.h>
1224 #if HAVE_NETINET_UDP_H
1225 # include <netinet/udp.h>
1228 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1229 [#define _BSD_SOURCE
1231 # include <stdint.h>
1233 #if HAVE_SYS_TYPES_H
1234 # include <sys/types.h>
1236 #if HAVE_NETINET_IN_SYSTM_H
1237 # include <netinet/in_systm.h>
1239 #if HAVE_NETINET_IN_H
1240 # include <netinet/in.h>
1242 #if HAVE_NETINET_IP_H
1243 # include <netinet/ip.h>
1245 #if HAVE_NETINET_UDP_H
1246 # include <netinet/udp.h>
1250 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1260 # Checks for libraries begin here
1262 with_libresolv="yes"
1263 AC_CHECK_LIB(resolv, res_search,
1265 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1267 [with_libresolv="no"])
1268 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1270 dnl Check for HAL (hardware abstraction library)
1272 AC_CHECK_LIB(hal,libhal_device_property_exists,
1273 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1275 if test "x$with_libhal" = "xyes"; then
1276 if test "x$PKG_CONFIG" != "x"; then
1277 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1278 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1279 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1280 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1284 m4_divert_once([HELP_WITH], [
1285 collectd additional packages:])
1287 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1289 if test "x$ac_system" = "xAIX"
1294 with_perfstat="no (AIX only)"
1295 with_procinfo="no (AIX only)"
1298 if test "x$with_perfstat" = "xyes"
1300 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1301 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1303 if test "x$with_perfstat" = "xyes"
1305 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1306 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1307 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1308 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1310 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1313 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1315 # Processes plugin under AIX.
1316 if test "x$with_procinfo" = "xyes"
1318 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1320 if test "x$with_procinfo" = "xyes"
1322 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1325 if test "x$ac_system" = "xSolaris"
1330 with_kstat="no (Solaris only)"
1331 with_devinfo="no (Solaris only)"
1334 if test "x$with_kstat" = "xyes"
1336 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1338 if test "x$with_kstat" = "xyes"
1340 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1341 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1343 if test "x$with_kstat" = "xyes"
1345 AC_DEFINE(HAVE_LIBKSTAT, 1,
1346 [Define to 1 if you have the 'kstat' library (-lkstat)])
1348 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1349 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1352 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1359 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1362 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1363 if test "x$with_kvm_getprocs" = "xyes"
1365 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1366 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1369 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1371 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1372 if test "x$with_kvm_getswapinfo" = "xyes"
1374 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1375 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1378 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1380 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1381 if test "x$with_kvm_nlist" = "xyes"
1383 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1384 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1387 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1389 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1390 if test "x$with_kvm_openfiles" = "xyes"
1392 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1393 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1396 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1398 # --with-libcredis {{{
1399 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1401 if test "x$withval" = "xyes"
1403 with_libcredis="yes"
1404 else if test "x$withval" = "xno"
1408 with_libcredis="yes"
1409 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1410 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1413 [with_libcredis="yes"])
1415 SAVE_CPPFLAGS="$CPPFLAGS"
1416 SAVE_LDFLAGS="$LDFLAGS"
1418 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1419 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1421 if test "x$with_libcredis" = "xyes"
1423 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1425 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1427 AC_CHECK_HEADERS(credis.h,
1428 [with_libcredis="yes"],
1429 [with_libcredis="no (credis.h not found)"])
1431 if test "x$with_libcredis" = "xyes"
1433 if test "x$LIBCREDIS_LDFLAGS" != "x"
1435 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1437 AC_CHECK_LIB(credis, credis_info,
1438 [with_libcredis="yes"],
1439 [with_libcredis="no (symbol 'credis_info' not found)"])
1443 CPPFLAGS="$SAVE_CPPFLAGS"
1444 LDFLAGS="$SAVE_LDFLAGS"
1446 if test "x$with_libcredis" = "xyes"
1448 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1449 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1450 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1451 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1453 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1456 # --with-libcurl {{{
1457 with_curl_config="curl-config"
1460 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1462 if test "x$withval" = "xno"
1465 else if test "x$withval" = "xyes"
1469 if test -f "$withval" && test -x "$withval"
1471 with_curl_config="$withval"
1473 else if test -x "$withval/bin/curl-config"
1475 with_curl_config="$withval/bin/curl-config"
1484 if test "x$with_libcurl" = "xyes"
1486 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1487 curl_config_status=$?
1489 if test $curl_config_status -ne 0
1491 with_libcurl="no ($with_curl_config failed)"
1493 SAVE_CPPFLAGS="$CPPFLAGS"
1494 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1496 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1498 CPPFLAGS="$SAVE_CPPFLAGS"
1501 if test "x$with_libcurl" = "xyes"
1503 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1504 curl_config_status=$?
1506 if test $curl_config_status -ne 0
1508 with_libcurl="no ($with_curl_config failed)"
1510 AC_CHECK_LIB(curl, curl_easy_init,
1511 [with_libcurl="yes"],
1512 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1516 if test "x$with_libcurl" = "xyes"
1518 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1519 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1520 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1521 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1523 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1527 with_libdbi_cppflags=""
1528 with_libdbi_ldflags=""
1529 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1531 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1533 with_libdbi_cppflags="-I$withval/include"
1534 with_libdbi_ldflags="-L$withval/lib"
1537 with_libdbi="$withval"
1543 if test "x$with_libdbi" = "xyes"
1545 SAVE_CPPFLAGS="$CPPFLAGS"
1546 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1548 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1550 CPPFLAGS="$SAVE_CPPFLAGS"
1552 if test "x$with_libdbi" = "xyes"
1554 SAVE_CPPFLAGS="$CPPFLAGS"
1555 SAVE_LDFLAGS="$LDFLAGS"
1556 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1557 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1559 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1561 CPPFLAGS="$SAVE_CPPFLAGS"
1562 LDFLAGS="$SAVE_LDFLAGS"
1564 if test "x$with_libdbi" = "xyes"
1566 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1567 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1568 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1569 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1570 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1571 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1573 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1576 # --with-libesmtp {{{
1577 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1579 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1581 LDFLAGS="$LDFLAGS -L$withval/lib"
1582 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1585 with_libesmtp="$withval"
1591 if test "x$with_libesmtp" = "xyes"
1593 AC_CHECK_LIB(esmtp, smtp_create_session,
1595 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1596 ], [with_libesmtp="no (libesmtp not found)"])
1598 if test "x$with_libesmtp" = "xyes"
1600 AC_CHECK_HEADERS(libesmtp.h,
1602 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1603 ], [with_libesmtp="no (libesmtp.h not found)"])
1605 if test "x$with_libesmtp" = "xyes"
1611 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1612 [Wether or not to use the esmtp library])
1613 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1616 # --with-libganglia {{{
1617 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1619 if test -f "$withval" && test -x "$withval"
1621 with_libganglia_config="$withval"
1622 with_libganglia="yes"
1623 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1625 with_libganglia_config="$withval/bin/ganglia-config"
1626 with_libganglia="yes"
1627 else if test -d "$withval"
1629 GANGLIA_CPPFLAGS="-I$withval/include"
1630 GANGLIA_LDFLAGS="-L$withval/lib"
1631 with_libganglia="yes"
1633 with_libganglia_config="ganglia-config"
1634 with_libganglia="$withval"
1638 with_libganglia_config="ganglia-config"
1639 with_libganglia="yes"
1642 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1644 if test "x$GANGLIA_CPPFLAGS" = "x"
1646 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1649 if test "x$GANGLIA_LDFLAGS" = "x"
1651 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1654 if test "x$GANGLIA_LIBS" = "x"
1656 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1660 SAVE_CPPFLAGS="$CPPFLAGS"
1661 SAVE_LDFLAGS="$LDFLAGS"
1662 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1663 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1665 if test "x$with_libganglia" = "xyes"
1667 AC_CHECK_HEADERS(gm_protocol.h,
1669 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1670 [Define to 1 if you have the <gm_protocol.h> header file.])
1671 ], [with_libganglia="no (gm_protocol.h not found)"])
1674 if test "x$with_libganglia" = "xyes"
1676 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1678 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1679 [Define to 1 if you have the ganglia library (-lganglia).])
1680 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1683 CPPFLAGS="$SAVE_CPPFLAGS"
1684 LDFLAGS="$SAVE_LDFLAGS"
1686 AC_SUBST(GANGLIA_CPPFLAGS)
1687 AC_SUBST(GANGLIA_LDFLAGS)
1688 AC_SUBST(GANGLIA_LIBS)
1689 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1692 # --with-libgcrypt {{{
1693 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1694 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1695 GCRYPT_LIBS="$GCRYPT_LIBS"
1696 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1698 if test -f "$withval" && test -x "$withval"
1700 with_libgcrypt_config="$withval"
1701 with_libgcrypt="yes"
1702 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1704 with_libgcrypt_config="$withval/bin/gcrypt-config"
1705 with_libgcrypt="yes"
1706 else if test -d "$withval"
1708 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1709 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1710 with_libgcrypt="yes"
1712 with_libgcrypt_config="gcrypt-config"
1713 with_libgcrypt="$withval"
1717 with_libgcrypt_config="libgcrypt-config"
1718 with_libgcrypt="yes"
1721 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1723 if test "x$GCRYPT_CPPFLAGS" = "x"
1725 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1728 if test "x$GCRYPT_LDFLAGS" = "x"
1730 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1731 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1734 if test "x$GCRYPT_LIBS" = "x"
1736 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1740 SAVE_CPPFLAGS="$CPPFLAGS"
1741 SAVE_LDFLAGS="$LDFLAGS"
1742 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1743 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1745 if test "x$with_libgcrypt" = "xyes"
1747 if test "x$GCRYPT_CPPFLAGS" != "x"
1749 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1751 AC_CHECK_HEADERS(gcrypt.h,
1752 [with_libgcrypt="yes"],
1753 [with_libgcrypt="no (gcrypt.h not found)"])
1756 if test "x$with_libgcrypt" = "xyes"
1758 if test "x$GCRYPT_LDFLAGS" != "x"
1760 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1762 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1763 [with_libgcrypt="yes"],
1764 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1766 if test "$with_libgcrypt" != "no"; then
1767 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1771 CPPFLAGS="$SAVE_CPPFLAGS"
1772 LDFLAGS="$SAVE_LDFLAGS"
1774 if test "x$with_libgcrypt" = "xyes"
1776 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1779 AC_SUBST(GCRYPT_CPPFLAGS)
1780 AC_SUBST(GCRYPT_LDFLAGS)
1781 AC_SUBST(GCRYPT_LIBS)
1782 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1785 # --with-libiptc {{{
1786 with_own_libiptc="no"
1787 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1789 if test "x$withval" = "xshipped"
1791 with_own_libiptc="yes"
1793 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1795 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1796 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1799 with_libiptc="$withval"
1803 if test "x$ac_system" = "xLinux"
1807 with_libiptc="no (Linux only)"
1810 SAVE_CPPFLAGS="$CPPFLAGS"
1811 SAVE_LDFLAGS="$LDFLAGS"
1812 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1813 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1814 # check whether the header file for libiptc is available.
1815 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1817 AC_CHECK_HEADERS(libiptc/libiptc.h,
1819 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1823 with_own_libiptc="yes"
1826 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1828 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1830 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1834 with_own_libiptc="yes"
1837 # If the header file is available, check for the required type declaractions.
1838 # They may be missing in old versions of libiptc. In that case, they will be
1839 # declared in the iptables plugin.
1840 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1842 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1845 # include "$srcdir/src/owniptc/libiptc.h"
1846 # include "$srcdir/src/owniptc/libip6tc.h"
1848 # include <libiptc/libiptc.h>
1849 # include <libiptc/libip6tc.h>
1853 # Check for the iptc_init symbol in the library.
1854 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1856 AC_CHECK_LIB(iptc, iptc_init,
1858 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1862 with_own_libiptc="yes"
1866 # The system wide version failed for some reason. Check if we have the required
1867 # headers to build the shipped version.
1868 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1870 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1872 with_libiptc="no (Linux iptables headers not found)"
1873 with_own_libiptc="no"
1876 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1879 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1880 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1881 if test "x$with_libiptc" = "xyes"
1883 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1884 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1885 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1886 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1888 if test "x$with_own_libiptc" = "xyes"
1890 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1892 CPPFLAGS="$SAVE_CPPFLAGS"
1893 LDFLAGS="$SAVE_LDFLAGS"
1897 with_java_home="$JAVA_HOME"
1898 with_java_vmtype="client"
1903 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1905 if test "x$withval" = "xno"
1908 else if test "x$withval" = "xyes"
1912 with_java_home="$withval"
1917 if test "x$with_java" = "xyes"
1919 if test -d "$with_java_home"
1921 AC_MSG_CHECKING([for jni.h])
1922 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1923 if test "x$TMPDIR" != "x"
1925 AC_MSG_RESULT([found in $TMPDIR])
1926 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1928 AC_MSG_RESULT([not found])
1931 AC_MSG_CHECKING([for jni_md.h])
1932 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1933 if test "x$TMPDIR" != "x"
1935 AC_MSG_RESULT([found in $TMPDIR])
1936 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1938 AC_MSG_RESULT([not found])
1941 AC_MSG_CHECKING([for libjvm.so])
1942 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1943 if test "x$TMPDIR" != "x"
1945 AC_MSG_RESULT([found in $TMPDIR])
1946 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1948 AC_MSG_RESULT([not found])
1951 if test "x$JAVAC" = "x"
1953 AC_MSG_CHECKING([for javac])
1954 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1955 if test "x$TMPDIR" != "x"
1958 AC_MSG_RESULT([$JAVAC])
1960 AC_MSG_RESULT([not found])
1963 if test "x$JAR" = "x"
1965 AC_MSG_CHECKING([for jar])
1966 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1967 if test "x$TMPDIR" != "x"
1970 AC_MSG_RESULT([$JAR])
1972 AC_MSG_RESULT([not found])
1975 else if test "x$with_java_home" != "x"
1977 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1981 if test "x$JAVA_CPPFLAGS" != "x"
1983 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1985 if test "x$JAVA_CFLAGS" != "x"
1987 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1989 if test "x$JAVA_LDFLAGS" != "x"
1991 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1993 if test "x$JAVAC" = "x"
1995 with_javac_path="$PATH"
1996 if test "x$with_java_home" != "x"
1998 with_javac_path="$with_java_home:with_javac_path"
1999 if test -d "$with_java_home/bin"
2001 with_javac_path="$with_java_home/bin:with_javac_path"
2005 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2007 if test "x$JAVAC" = "x"
2009 with_java="no (javac not found)"
2011 if test "x$JAR" = "x"
2013 with_jar_path="$PATH"
2014 if test "x$with_java_home" != "x"
2016 with_jar_path="$with_java_home:$with_jar_path"
2017 if test -d "$with_java_home/bin"
2019 with_jar_path="$with_java_home/bin:$with_jar_path"
2023 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2025 if test "x$JAR" = "x"
2027 with_java="no (jar not found)"
2030 SAVE_CPPFLAGS="$CPPFLAGS"
2031 SAVE_CFLAGS="$CFLAGS"
2032 SAVE_LDFLAGS="$LDFLAGS"
2033 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2034 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2035 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2037 if test "x$with_java" = "xyes"
2039 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2041 if test "x$with_java" = "xyes"
2043 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2045 [with_java="no (libjvm not found)"],
2048 if test "x$with_java" = "xyes"
2050 JAVA_LIBS="$JAVA_LIBS -ljvm"
2051 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2054 CPPFLAGS="$SAVE_CPPFLAGS"
2055 CFLAGS="$SAVE_CFLAGS"
2056 LDFLAGS="$SAVE_LDFLAGS"
2058 AC_SUBST(JAVA_CPPFLAGS)
2059 AC_SUBST(JAVA_CFLAGS)
2060 AC_SUBST(JAVA_LDFLAGS)
2062 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2065 # --with-libmemcached {{{
2066 with_libmemcached_cppflags=""
2067 with_libmemcached_ldflags=""
2068 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2070 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2072 with_libmemcached_cppflags="-I$withval/include"
2073 with_libmemcached_ldflags="-L$withval/lib"
2074 with_libmemcached="yes"
2076 with_libmemcached="$withval"
2080 with_libmemcached="yes"
2082 if test "x$with_libmemcached" = "xyes"
2084 SAVE_CPPFLAGS="$CPPFLAGS"
2085 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2087 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2089 CPPFLAGS="$SAVE_CPPFLAGS"
2091 if test "x$with_libmemcached" = "xyes"
2093 SAVE_CPPFLAGS="$CPPFLAGS"
2094 SAVE_LDFLAGS="$LDFLAGS"
2095 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2096 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2098 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2100 CPPFLAGS="$SAVE_CPPFLAGS"
2101 LDFLAGS="$SAVE_LDFLAGS"
2103 if test "x$with_libmemcached" = "xyes"
2105 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2106 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2107 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2108 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2109 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2110 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2111 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2113 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2116 # --with-libmodbus {{{
2117 with_libmodbus_config=""
2118 with_libmodbus_cflags=""
2119 with_libmodbus_libs=""
2120 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2122 if test "x$withval" = "xno"
2125 else if test "x$withval" = "xyes"
2127 with_libmodbus="use_pkgconfig"
2128 else if test -d "$with_libmodbus/lib"
2130 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2131 with_libmodbus_cflags="-I$withval/include"
2132 with_libmodbus_libs="-L$withval/lib -lmodbus"
2133 with_libmodbus="yes"
2136 [with_libmodbus="use_pkgconfig"])
2138 # configure using pkg-config
2139 if test "x$with_libmodbus" = "xuse_pkgconfig"
2141 if test "x$PKG_CONFIG" = "x"
2143 with_libmodbus="no (Don't have pkg-config)"
2146 if test "x$with_libmodbus" = "xuse_pkgconfig"
2148 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
2149 $PKG_CONFIG --exists 'modbus' 2>/dev/null
2152 with_libmodbus="no (pkg-config doesn't know modbus)"
2155 if test "x$with_libmodbus" = "xuse_pkgconfig"
2157 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
2160 with_libmodbus="no ($PKG_CONFIG failed)"
2162 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
2165 with_libmodbus="no ($PKG_CONFIG failed)"
2168 if test "x$with_libmodbus" = "xuse_pkgconfig"
2170 with_libmodbus="yes"
2173 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2174 # the actual checks.
2175 if test "x$with_libmodbus" = "xyes"
2177 SAVE_CPPFLAGS="$CPPFLAGS"
2178 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2180 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2182 CPPFLAGS="$SAVE_CPPFLAGS"
2184 if test "x$with_libmodbus" = "xyes"
2186 SAVE_CPPFLAGS="$CPPFLAGS"
2187 SAVE_LDFLAGS="$LDFLAGS"
2189 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2190 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2192 AC_CHECK_LIB(modbus, modbus_connect,
2193 [with_libmodbus="yes"],
2194 [with_libmodbus="no (symbol modbus_connect not found)"])
2196 CPPFLAGS="$SAVE_CPPFLAGS"
2197 LDFLAGS="$SAVE_LDFLAGS"
2199 if test "x$with_libmodbus" = "xyes"
2201 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2202 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2203 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2204 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2208 # --with-libmysql {{{
2209 with_mysql_config="mysql_config"
2210 with_mysql_cflags=""
2212 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2214 if test "x$withval" = "xno"
2217 else if test "x$withval" = "xyes"
2221 if test -f "$withval" && test -x "$withval";
2223 with_mysql_config="$withval"
2224 else if test -x "$withval/bin/mysql_config"
2226 with_mysql_config="$withval/bin/mysql_config"
2234 if test "x$with_libmysql" = "xyes"
2236 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2237 mysql_config_status=$?
2239 if test $mysql_config_status -ne 0
2241 with_libmysql="no ($with_mysql_config failed)"
2243 SAVE_CPPFLAGS="$CPPFLAGS"
2244 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2247 have_mysql_mysql_h="no"
2248 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2250 if test "x$have_mysql_h" = "xno"
2252 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2255 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2257 with_libmysql="no (mysql.h not found)"
2260 CPPFLAGS="$SAVE_CPPFLAGS"
2263 if test "x$with_libmysql" = "xyes"
2265 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
2266 mysql_config_status=$?
2268 if test $mysql_config_status -ne 0
2270 with_libmysql="no ($with_mysql_config failed)"
2272 AC_CHECK_LIB(mysqlclient, mysql_init,
2273 [with_libmysql="yes"],
2274 [with_libmysql="no (symbol 'mysql_init' not found)"],
2277 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2278 [with_libmysql="yes"],
2279 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2283 if test "x$with_libmysql" = "xyes"
2285 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2286 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2287 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2288 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2290 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2293 # --with-libnetlink {{{
2294 with_libnetlink_cflags=""
2295 with_libnetlink_libs="-lnetlink"
2296 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2298 echo "libnetlink: withval = $withval"
2299 if test "x$withval" = "xyes"
2301 with_libnetlink="yes"
2302 else if test "x$withval" = "xno"
2304 with_libnetlink="no"
2306 if test -d "$withval/include"
2308 with_libnetlink_cflags="-I$withval/include"
2309 with_libnetlink_libs="-L$withval/lib -lnetlink"
2310 with_libnetlink="yes"
2312 AC_MSG_ERROR("no such directory: $withval/include")
2317 if test "x$ac_system" = "xLinux"
2319 with_libnetlink="yes"
2321 with_libnetlink="no (Linux only library)"
2324 if test "x$with_libnetlink" = "xyes"
2326 SAVE_CFLAGS="$CFLAGS"
2327 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2329 with_libnetlink="no (libnetlink.h not found)"
2331 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2333 with_libnetlink="yes"
2337 #include <sys/types.h>
2338 #include <asm/types.h>
2339 #include <sys/socket.h>
2340 #include <linux/netlink.h>
2341 #include <linux/rtnetlink.h>])
2342 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2344 #include <sys/types.h>
2345 #include <asm/types.h>
2346 #include <sys/socket.h>])
2350 #include <sys/types.h>
2351 #include <asm/types.h>
2352 #include <sys/socket.h>
2353 #include <linux/netlink.h>
2354 #include <linux/rtnetlink.h>
2358 int retval = TCA_STATS2;
2361 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2366 #include <sys/types.h>
2367 #include <asm/types.h>
2368 #include <sys/socket.h>
2369 #include <linux/netlink.h>
2370 #include <linux/rtnetlink.h>
2374 int retval = TCA_STATS;
2377 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2380 CFLAGS="$SAVE_CFLAGS"
2382 if test "x$with_libnetlink" = "xyes"
2384 AC_CHECK_LIB(netlink, rtnl_open,
2385 [with_libnetlink="yes"],
2386 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2387 [$with_libnetlink_libs])
2389 if test "x$with_libnetlink" = "xyes"
2391 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2392 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2393 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2394 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2396 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2399 # --with-libnetapp {{{
2400 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2401 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2402 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2403 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2404 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2405 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2406 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2408 if test -d "$withval"
2410 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2411 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2412 with_libnetapp="yes"
2414 with_libnetapp="$withval"
2418 with_libnetapp="yes"
2421 SAVE_CPPFLAGS="$CPPFLAGS"
2422 SAVE_LDFLAGS="$LDFLAGS"
2423 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2424 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2426 if test "x$with_libnetapp" = "xyes"
2428 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2430 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2432 AC_CHECK_HEADERS(netapp_api.h,
2433 [with_libnetapp="yes"],
2434 [with_libnetapp="no (netapp_api.h not found)"])
2437 if test "x$with_libnetapp" = "xyes"
2439 if test "x$LIBNETAPP_LDFLAGS" != "x"
2441 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2444 if test "x$LIBNETAPP_LIBS" = "x"
2446 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2448 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2450 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2451 [with_libnetapp="yes"],
2452 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2454 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2457 CPPFLAGS="$SAVE_CPPFLAGS"
2458 LDFLAGS="$SAVE_LDFLAGS"
2460 if test "x$with_libnetapp" = "xyes"
2462 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2465 AC_SUBST(LIBNETAPP_CPPFLAGS)
2466 AC_SUBST(LIBNETAPP_LDFLAGS)
2467 AC_SUBST(LIBNETAPP_LIBS)
2468 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2471 # --with-libnetsnmp {{{
2472 with_snmp_config="net-snmp-config"
2475 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2477 if test "x$withval" = "xno"
2479 with_libnetsnmp="no"
2480 else if test "x$withval" = "xyes"
2482 with_libnetsnmp="yes"
2484 if test -x "$withval"
2486 with_snmp_config="$withval"
2487 with_libnetsnmp="yes"
2489 with_snmp_config="$withval/bin/net-snmp-config"
2490 with_libnetsnmp="yes"
2494 [with_libnetsnmp="yes"])
2495 if test "x$with_libnetsnmp" = "xyes"
2497 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2498 snmp_config_status=$?
2500 if test $snmp_config_status -ne 0
2502 with_libnetsnmp="no ($with_snmp_config failed)"
2504 SAVE_CPPFLAGS="$CPPFLAGS"
2505 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2507 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2509 CPPFLAGS="$SAVE_CPPFLAGS"
2512 if test "x$with_libnetsnmp" = "xyes"
2514 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2515 snmp_config_status=$?
2517 if test $snmp_config_status -ne 0
2519 with_libnetsnmp="no ($with_snmp_config failed)"
2521 AC_CHECK_LIB(netsnmp, init_snmp,
2522 [with_libnetsnmp="yes"],
2523 [with_libnetsnmp="no (libnetsnmp not found)"],
2527 if test "x$with_libnetsnmp" = "xyes"
2529 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2530 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2531 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2532 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2534 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2537 # --with-liboconfig {{{
2538 with_own_liboconfig="no"
2539 liboconfig_LDFLAGS="$LDFLAGS"
2540 liboconfig_CPPFLAGS="$CPPFLAGS"
2541 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2543 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2545 if test -d "$withval/lib"
2547 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2549 if test -d "$withval/include"
2551 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2554 if test "x$withval" = "xno"
2556 AC_MSG_ERROR("liboconfig is required")
2560 with_liboconfig="yes"
2563 save_LDFLAGS="$LDFLAGS"
2564 save_CPPFLAGS="$CPPFLAGS"
2565 LDFLAGS="$liboconfig_LDFLAGS"
2566 CPPFLAGS="$liboconfig_CPPFLAGS"
2567 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2569 with_liboconfig="yes"
2570 with_own_liboconfig="no"
2573 with_liboconfig="yes"
2574 with_own_liboconfig="yes"
2575 LDFLAGS="$save_LDFLAGS"
2576 CPPFLAGS="$save_CPPFLAGS"
2579 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2580 if test "x$with_own_liboconfig" = "xyes"
2582 with_liboconfig="yes (shipped version)"
2586 # --with-liboping {{{
2587 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2589 if test "x$withval" = "xyes"
2592 else if test "x$withval" = "xno"
2597 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2598 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2601 [with_liboping="yes"])
2603 SAVE_CPPFLAGS="$CPPFLAGS"
2604 SAVE_LDFLAGS="$LDFLAGS"
2606 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2607 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2609 if test "x$with_liboping" = "xyes"
2611 if test "x$LIBOPING_CPPFLAGS" != "x"
2613 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2615 AC_CHECK_HEADERS(oping.h,
2616 [with_liboping="yes"],
2617 [with_liboping="no (oping.h not found)"])
2619 if test "x$with_liboping" = "xyes"
2621 if test "x$LIBOPING_LDFLAGS" != "x"
2623 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2625 AC_CHECK_LIB(oping, ping_construct,
2626 [with_liboping="yes"],
2627 [with_liboping="no (symbol 'ping_construct' not found)"])
2630 CPPFLAGS="$SAVE_CPPFLAGS"
2631 LDFLAGS="$SAVE_LDFLAGS"
2633 if test "x$with_liboping" = "xyes"
2635 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2636 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2637 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2638 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2640 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2644 with_oracle_cppflags=""
2646 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2648 if test "x$withval" = "xyes"
2650 if test "x$ORACLE_HOME" = "x"
2652 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2655 else if test "x$withval" = "xno"
2660 ORACLE_HOME="$withval"
2664 if test "x$ORACLE_HOME" = "x"
2666 with_oracle="no (ORACLE_HOME is not set)"
2671 if test "x$ORACLE_HOME" != "x"
2673 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2675 if test -e "$ORACLE_HOME/lib/ldflags"
2677 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2679 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2680 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2682 if test "x$with_oracle" = "xyes"
2684 SAVE_CPPFLAGS="$CPPFLAGS"
2685 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2687 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2689 CPPFLAGS="$SAVE_CPPFLAGS"
2691 if test "x$with_oracle" = "xyes"
2693 SAVE_CPPFLAGS="$CPPFLAGS"
2694 SAVE_LDFLAGS="$LDFLAGS"
2695 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2696 LDFLAGS="$LDFLAGS $with_oracle_libs"
2698 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2700 CPPFLAGS="$SAVE_CPPFLAGS"
2701 LDFLAGS="$SAVE_LDFLAGS"
2703 if test "x$with_oracle" = "xyes"
2705 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2706 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2707 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2708 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2712 # --with-libowcapi {{{
2713 with_libowcapi_cppflags=""
2714 with_libowcapi_libs="-lowcapi"
2715 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2717 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2719 with_libowcapi_cppflags="-I$withval/include"
2720 with_libowcapi_libs="-L$withval/lib -lowcapi"
2721 with_libowcapi="yes"
2723 with_libowcapi="$withval"
2727 with_libowcapi="yes"
2729 if test "x$with_libowcapi" = "xyes"
2731 SAVE_CPPFLAGS="$CPPFLAGS"
2732 CPPFLAGS="$with_libowcapi_cppflags"
2734 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2736 CPPFLAGS="$SAVE_CPPFLAGS"
2738 if test "x$with_libowcapi" = "xyes"
2740 SAVE_LDFLAGS="$LDFLAGS"
2741 SAVE_CPPFLAGS="$CPPFLAGS"
2742 LDFLAGS="$with_libowcapi_libs"
2743 CPPFLAGS="$with_libowcapi_cppflags"
2745 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2747 LDFLAGS="$SAVE_LDFLAGS"
2748 CPPFLAGS="$SAVE_CPPFLAGS"
2750 if test "x$with_libowcapi" = "xyes"
2752 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2753 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2754 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2755 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2759 # --with-libpcap {{{
2760 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2762 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2764 LDFLAGS="$LDFLAGS -L$withval/lib"
2765 CPPFLAGS="$CPPFLAGS -I$withval/include"
2768 with_libpcap="$withval"
2774 if test "x$with_libpcap" = "xyes"
2776 AC_CHECK_LIB(pcap, pcap_open_live,
2778 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2779 ], [with_libpcap="no (libpcap not found)"])
2781 if test "x$with_libpcap" = "xyes"
2783 AC_CHECK_HEADERS(pcap.h,,
2784 [with_libpcap="no (pcap.h not found)"])
2786 if test "x$with_libpcap" = "xyes"
2788 AC_CHECK_HEADERS(pcap-bpf.h,,
2789 [with_libpcap="no (pcap-bpf.h not found)"])
2791 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2794 # --with-libperl {{{
2795 perl_interpreter="perl"
2796 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2798 if test -x "$withval"
2800 perl_interpreter="$withval"
2802 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2804 LDFLAGS="$LDFLAGS -L$withval/lib"
2805 CPPFLAGS="$CPPFLAGS -I$withval/include"
2806 perl_interpreter="$withval/bin/perl"
2809 with_libperl="$withval"
2816 AC_MSG_CHECKING([for perl])
2817 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2818 if test -x "$perl_interpreter"
2820 AC_MSG_RESULT([yes ($perl_interpreter)])
2826 AC_SUBST(PERL, "$perl_interpreter")
2828 if test "x$with_libperl" = "xyes" \
2829 && test -n "$perl_interpreter"
2831 SAVE_CFLAGS="$CFLAGS"
2832 SAVE_LDFLAGS="$LDFLAGS"
2833 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2834 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2835 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2836 CFLAGS="$CFLAGS $PERL_CFLAGS"
2837 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2839 AC_CACHE_CHECK([for libperl],
2840 [c_cv_have_libperl],
2844 #define PERL_NO_GET_CONTEXT
2851 load_module (PERL_LOADMOD_NOIMPORT,
2852 newSVpv ("Collectd::Plugin::FooBar", 24),
2855 [c_cv_have_libperl="yes"],
2856 [c_cv_have_libperl="no"]
2860 if test "x$c_cv_have_libperl" = "xyes"
2862 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2863 AC_SUBST(PERL_CFLAGS)
2864 AC_SUBST(PERL_LDFLAGS)
2869 CFLAGS="$SAVE_CFLAGS"
2870 LDFLAGS="$SAVE_LDFLAGS"
2871 else if test -z "$perl_interpreter"; then
2872 with_libperl="no (no perl interpreter found)"
2873 c_cv_have_libperl="no"
2875 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2877 if test "x$with_libperl" = "xyes"
2879 SAVE_CFLAGS="$CFLAGS"
2880 SAVE_LDFLAGS="$LDFLAGS"
2881 CFLAGS="$CFLAGS $PERL_CFLAGS"
2882 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2884 AC_CACHE_CHECK([if perl supports ithreads],
2885 [c_cv_have_perl_ithreads],
2893 #if !defined(USE_ITHREADS)
2894 # error "Perl does not support ithreads!"
2895 #endif /* !defined(USE_ITHREADS) */
2898 [c_cv_have_perl_ithreads="yes"],
2899 [c_cv_have_perl_ithreads="no"]
2903 if test "x$c_cv_have_perl_ithreads" = "xyes"
2905 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2908 CFLAGS="$SAVE_CFLAGS"
2909 LDFLAGS="$SAVE_LDFLAGS"
2912 if test "x$with_libperl" = "xyes"
2914 SAVE_CFLAGS="$CFLAGS"
2915 SAVE_LDFLAGS="$LDFLAGS"
2916 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2917 # (see issues #41 and #42)
2918 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2919 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2921 AC_CACHE_CHECK([for broken Perl_load_module()],
2922 [c_cv_have_broken_perl_load_module],
2926 #define PERL_NO_GET_CONTEXT
2933 load_module (PERL_LOADMOD_NOIMPORT,
2934 newSVpv ("Collectd::Plugin::FooBar", 24),
2937 [c_cv_have_broken_perl_load_module="no"],
2938 [c_cv_have_broken_perl_load_module="yes"]
2942 CFLAGS="$SAVE_CFLAGS"
2943 LDFLAGS="$SAVE_LDFLAGS"
2945 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2946 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2948 if test "x$with_libperl" = "xyes"
2950 SAVE_CFLAGS="$CFLAGS"
2951 SAVE_LDFLAGS="$LDFLAGS"
2952 CFLAGS="$CFLAGS $PERL_CFLAGS"
2953 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2956 [struct mgvtbl.svt_local],
2957 [have_struct_mgvtbl_svt_local="yes"],
2958 [have_struct_mgvtbl_svt_local="no"],
2965 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2967 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2968 [Define if Perl's struct mgvtbl has member svt_local.])
2971 CFLAGS="$SAVE_CFLAGS"
2972 LDFLAGS="$SAVE_LDFLAGS"
2977 with_pg_config="pg_config"
2978 with_libpq_includedir=""
2979 with_libpq_libdir=""
2980 with_libpq_cppflags=""
2981 with_libpq_ldflags=""
2982 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2985 if test "x$withval" = "xno"
2988 else if test "x$withval" = "xyes"
2992 if test -f "$withval" && test -x "$withval";
2994 with_pg_config="$withval"
2995 else if test -x "$withval/bin/pg_config"
2997 with_pg_config="$withval/bin/pg_config"
3005 if test "x$with_libpq" = "xyes"
3007 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3010 if test $pg_config_status -eq 0
3012 if test -n "$with_libpq_includedir"; then
3013 for dir in $with_libpq_includedir; do
3014 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3018 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3021 SAVE_CPPFLAGS="$CPPFLAGS"
3022 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3024 AC_CHECK_HEADERS(libpq-fe.h, [],
3025 [with_libpq="no (libpq-fe.h not found)"], [])
3027 CPPFLAGS="$SAVE_CPPFLAGS"
3029 if test "x$with_libpq" = "xyes"
3031 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3034 if test $pg_config_status -eq 0
3036 if test -n "$with_libpq_libdir"; then
3037 for dir in $with_libpq_libdir; do
3038 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3042 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3045 SAVE_LDFLAGS="$LDFLAGS"
3046 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3048 AC_CHECK_LIB(pq, PQconnectdb,
3050 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3052 AC_CHECK_LIB(pq, PQserverVersion,
3054 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3056 LDFLAGS="$SAVE_LDFLAGS"
3058 if test "x$with_libpq" = "xyes"
3060 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3061 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3062 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3063 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3065 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3068 # --with-libpthread {{{
3069 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3070 [ if test "x$withval" != "xno" \
3071 && test "x$withval" != "xyes"
3073 LDFLAGS="$LDFLAGS -L$withval/lib"
3074 CPPFLAGS="$CPPFLAGS -I$withval/include"
3075 with_libpthread="yes"
3077 if test "x$withval" = "xno"
3079 with_libpthread="no (disabled)"
3082 ], [with_libpthread="yes"])
3083 if test "x$with_libpthread" = "xyes"
3085 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3088 if test "x$with_libpthread" = "xyes"
3090 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3092 if test "x$with_libpthread" = "xyes"
3098 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3099 [Wether or not to use pthread (POSIX threads) library])
3100 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3105 with_python_path="$PATH"
3106 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3108 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3110 with_python="$withval"
3111 else if test -x "$withval"
3113 with_python_prog="$withval"
3114 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3116 else if test -d "$withval"
3118 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3121 AC_MSG_WARN([Argument not recognized: $withval])
3123 ], [with_python="yes"])
3126 SAVE_CPPFLAGS="$CPPFLAGS"
3127 SAVE_LDFLAGS="$LDFLAGS"
3130 PATH="$with_python_path"
3132 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3134 AC_MSG_CHECKING([for python])
3135 with_python_prog="`which python 2>/dev/null`"
3136 if test "x$with_python_prog" = "x"
3138 AC_MSG_RESULT([not found])
3139 with_python="no (interpreter not found)"
3141 AC_MSG_RESULT([$with_python_prog])
3145 if test "x$with_python" = "xyes"
3147 AC_MSG_CHECKING([for Python CPPFLAGS])
3148 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3149 python_config_status=$?
3151 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3153 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3156 AC_MSG_RESULT([$python_include_path])
3160 if test "x$with_python" = "xyes"
3162 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3163 AC_CHECK_HEADERS(Python.h,
3164 [with_python="yes"],
3165 [with_python="no ('Python.h' not found)"])
3168 if test "x$with_python" = "xyes"
3170 AC_MSG_CHECKING([for Python LDFLAGS])
3171 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`
3172 python_config_status=$?
3174 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3176 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3179 AC_MSG_RESULT([$python_library_path])
3183 if test "x$with_python" = "xyes"
3185 AC_MSG_CHECKING([for Python LIBS])
3186 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`
3187 python_config_status=$?
3189 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3191 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3194 AC_MSG_RESULT([$python_library_flags])
3198 if test "x$with_python" = "xyes"
3200 LDFLAGS="-L$python_library_path $LDFLAGS"
3201 LIBS="$python_library_flags $LIBS"
3203 AC_CHECK_FUNC(PyObject_CallFunction,
3204 [with_python="yes"],
3205 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3209 CPPFLAGS="$SAVE_CPPFLAGS"
3210 LDFLAGS="$SAVE_LDFLAGS"
3213 if test "x$with_python" = "xyes"
3215 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3216 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3217 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3218 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3219 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3220 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3224 # --with-librabbitmq {{{
3225 with_librabbitmq_cppflags=""
3226 with_librabbitmq_ldflags=""
3227 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3229 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3231 with_librabbitmq_cppflags="-I$withval/include"
3232 with_librabbitmq_ldflags="-L$withval/lib"
3233 with_librabbitmq="yes"
3235 with_librabbitmq="$withval"
3239 with_librabbitmq="yes"
3241 if test "x$with_librabbitmq" = "xyes"
3243 SAVE_CPPFLAGS="$CPPFLAGS"
3244 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3246 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3248 CPPFLAGS="$SAVE_CPPFLAGS"
3250 if test "x$with_librabbitmq" = "xyes"
3252 SAVE_CPPFLAGS="$CPPFLAGS"
3253 SAVE_LDFLAGS="$LDFLAGS"
3254 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3255 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3257 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3259 CPPFLAGS="$SAVE_CPPFLAGS"
3260 LDFLAGS="$SAVE_LDFLAGS"
3262 if test "x$with_librabbitmq" = "xyes"
3264 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3265 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3266 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3267 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3268 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3269 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3270 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3272 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3275 # --with-librouteros {{{
3276 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3278 if test "x$withval" = "xyes"
3280 with_librouteros="yes"
3281 else if test "x$withval" = "xno"
3283 with_librouteros="no"
3285 with_librouteros="yes"
3286 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3287 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3290 [with_librouteros="yes"])
3292 SAVE_CPPFLAGS="$CPPFLAGS"
3293 SAVE_LDFLAGS="$LDFLAGS"
3295 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3296 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3298 if test "x$with_librouteros" = "xyes"
3300 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3302 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3304 AC_CHECK_HEADERS(routeros_api.h,
3305 [with_librouteros="yes"],
3306 [with_librouteros="no (routeros_api.h not found)"])
3308 if test "x$with_librouteros" = "xyes"
3310 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3312 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3314 AC_CHECK_LIB(routeros, ros_interface,
3315 [with_librouteros="yes"],
3316 [with_librouteros="no (symbol 'ros_interface' not found)"])
3319 CPPFLAGS="$SAVE_CPPFLAGS"
3320 LDFLAGS="$SAVE_LDFLAGS"
3322 if test "x$with_librouteros" = "xyes"
3324 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3325 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3326 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3327 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3329 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3333 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3336 librrd_threadsafe="yes"
3337 librrd_rrdc_update="no"
3338 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3339 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3341 librrd_cflags="-I$withval/include"
3342 librrd_ldflags="-L$withval/lib"
3345 with_librrd="$withval"
3347 ], [with_librrd="yes"])
3348 if test "x$with_librrd" = "xyes"
3350 SAVE_CPPFLAGS="$CPPFLAGS"
3351 SAVE_LDFLAGS="$LDFLAGS"
3353 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3354 LDFLAGS="$LDFLAGS $librrd_ldflags"
3356 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3358 CPPFLAGS="$SAVE_CPPFLAGS"
3359 LDFLAGS="$SAVE_LDFLAGS"
3361 if test "x$with_librrd" = "xyes"
3363 SAVE_CPPFLAGS="$CPPFLAGS"
3364 SAVE_LDFLAGS="$LDFLAGS"
3366 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3367 LDFLAGS="$LDFLAGS $librrd_ldflags"
3369 AC_CHECK_LIB(rrd_th, rrd_update_r,
3371 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3373 [librrd_threadsafe="no"
3374 AC_CHECK_LIB(rrd, rrd_update,
3376 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3378 [with_librrd="no (symbol 'rrd_update' not found)"],
3383 if test "x$librrd_threadsafe" = "xyes"
3385 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3387 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3390 CPPFLAGS="$SAVE_CPPFLAGS"
3391 LDFLAGS="$SAVE_LDFLAGS"
3393 if test "x$with_librrd" = "xyes"
3395 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3396 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3397 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3398 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3400 if test "x$librrd_threadsafe" = "xyes"
3402 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3406 # --with-libsensors {{{
3407 with_sensors_cflags=""
3408 with_sensors_ldflags=""
3409 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3411 if test "x$withval" = "xno"
3413 with_libsensors="no"
3415 with_libsensors="yes"
3416 if test "x$withval" != "xyes"
3418 with_sensors_cflags="-I$withval/include"
3419 with_sensors_ldflags="-L$withval/lib"
3420 with_libsensors="yes"
3425 if test "x$ac_system" = "xLinux"
3427 with_libsensors="yes"
3429 with_libsensors="no (Linux only library)"
3432 if test "x$with_libsensors" = "xyes"
3434 SAVE_CPPFLAGS="$CPPFLAGS"
3435 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3437 # AC_CHECK_HEADERS(sensors/sensors.h,
3439 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3441 # [with_libsensors="no (sensors/sensors.h not found)"])
3442 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3444 CPPFLAGS="$SAVE_CPPFLAGS"
3446 if test "x$with_libsensors" = "xyes"
3448 SAVE_CPPFLAGS="$CPPFLAGS"
3449 SAVE_LDFLAGS="$LDFLAGS"
3450 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3451 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3453 AC_CHECK_LIB(sensors, sensors_init,
3455 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3457 [with_libsensors="no (libsensors not found)"])
3459 CPPFLAGS="$SAVE_CPPFLAGS"
3460 LDFLAGS="$SAVE_LDFLAGS"
3462 if test "x$with_libsensors" = "xyes"
3464 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3465 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3466 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3467 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3469 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3472 # --with-libstatgrab {{{
3473 with_libstatgrab_cflags=""
3474 with_libstatgrab_ldflags=""
3475 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3477 if test "x$withval" != "xno" \
3478 && test "x$withval" != "xyes"
3480 with_libstatgrab_cflags="-I$withval/include"
3481 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3482 with_libstatgrab="yes"
3483 with_libstatgrab_pkg_config="no"
3485 with_libstatgrab="$withval"
3486 with_libstatgrab_pkg_config="yes"
3490 with_libstatgrab="yes"
3491 with_libstatgrab_pkg_config="yes"
3494 if test "x$with_libstatgrab" = "xyes" \
3495 && test "x$with_libstatgrab_pkg_config" = "xyes"
3497 if test "x$PKG_CONFIG" != "x"
3499 AC_MSG_CHECKING([pkg-config for libstatgrab])
3501 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3504 with_libstatgrab_pkg_config="no"
3505 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3506 temp_result="not found"
3508 AC_MSG_RESULT([$temp_result])
3510 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3511 with_libstatgrab_pkg_config="no"
3512 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3516 if test "x$with_libstatgrab" = "xyes" \
3517 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3518 && test "x$with_libstatgrab_cflags" = "x"
3520 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3521 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3524 with_libstatgrab_cflags="$temp_result"
3526 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3527 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3529 AC_MSG_RESULT([$temp_result])
3532 if test "x$with_libstatgrab" = "xyes" \
3533 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3534 && test "x$with_libstatgrab_ldflags" = "x"
3536 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3537 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3540 with_libstatgrab_ldflags="$temp_result"
3542 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3543 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3545 AC_MSG_RESULT([$temp_result])
3548 if test "x$with_libstatgrab" = "xyes"
3550 SAVE_CPPFLAGS="$CPPFLAGS"
3551 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3553 AC_CHECK_HEADERS(statgrab.h,
3554 [with_libstatgrab="yes"],
3555 [with_libstatgrab="no (statgrab.h not found)"])
3557 CPPFLAGS="$SAVE_CPPFLAGS"
3560 if test "x$with_libstatgrab" = "xyes"
3562 SAVE_CFLAGS="$CFLAGS"
3563 SAVE_LDFLAGS="$LDFLAGS"
3565 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3566 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3568 AC_CHECK_LIB(statgrab, sg_init,
3569 [with_libstatgrab="yes"],
3570 [with_libstatgrab="no (symbol sg_init not found)"])
3572 CFLAGS="$SAVE_CFLAGS"
3573 LDFLAGS="$SAVE_LDFLAGS"
3576 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3577 if test "x$with_libstatgrab" = "xyes"
3579 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3580 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3581 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3582 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3583 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3587 # --with-libtokyotyrant {{{
3588 with_libtokyotyrant_cppflags=""
3589 with_libtokyotyrant_ldflags=""
3590 with_libtokyotyrant_libs=""
3591 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3593 if test "x$withval" = "xno"
3595 with_libtokyotyrant="no"
3596 else if test "x$withval" = "xyes"
3598 with_libtokyotyrant="yes"
3600 with_libtokyotyrant_cppflags="-I$withval/include"
3601 with_libtokyotyrant_ldflags="-L$withval/include"
3602 with_libtokyotyrant_libs="-ltokyotyrant"
3603 with_libtokyotyrant="yes"
3607 with_libtokyotyrant="yes"
3610 if test "x$with_libtokyotyrant" = "xyes"
3612 if $PKG_CONFIG --exists tokyotyrant
3614 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3615 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3616 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3620 SAVE_CPPFLAGS="$CPPFLAGS"
3621 SAVE_LDFLAGS="$LDFLAGS"
3622 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3623 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3625 if test "x$with_libtokyotyrant" = "xyes"
3627 AC_CHECK_HEADERS(tcrdb.h,
3629 AC_DEFINE(HAVE_TCRDB_H, 1,
3630 [Define to 1 if you have the <tcrdb.h> header file.])
3631 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3634 if test "x$with_libtokyotyrant" = "xyes"
3636 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3638 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3639 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3641 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3642 [$with_libtokyotyrant_libs])
3645 CPPFLAGS="$SAVE_CPPFLAGS"
3646 LDFLAGS="$SAVE_LDFLAGS"
3648 if test "x$with_libtokyotyrant" = "xyes"
3650 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3651 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3652 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3653 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3654 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3655 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3657 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3660 # --with-libupsclient {{{
3661 with_libupsclient_config=""
3662 with_libupsclient_cflags=""
3663 with_libupsclient_libs=""
3664 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3666 if test "x$withval" = "xno"
3668 with_libupsclient="no"
3669 else if test "x$withval" = "xyes"
3671 with_libupsclient="use_pkgconfig"
3673 if test -x "$withval"
3675 with_libupsclient_config="$withval"
3676 with_libupsclient="use_libupsclient_config"
3677 else if test -x "$withval/bin/libupsclient-config"
3679 with_libupsclient_config="$withval/bin/libupsclient-config"
3680 with_libupsclient="use_libupsclient_config"
3682 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3683 with_libupsclient_cflags="-I$withval/include"
3684 with_libupsclient_libs="-L$withval/lib -lupsclient"
3685 with_libupsclient="yes"
3689 [with_libupsclient="use_pkgconfig"])
3691 # configure using libupsclient-config
3692 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3694 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3695 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3698 with_libupsclient="no ($with_libupsclient_config failed)"
3700 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3703 with_libupsclient="no ($with_libupsclient_config failed)"
3706 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3708 with_libupsclient="yes"
3711 # configure using pkg-config
3712 if test "x$with_libupsclient" = "xuse_pkgconfig"
3714 if test "x$PKG_CONFIG" = "x"
3716 with_libupsclient="no (Don't have pkg-config)"
3719 if test "x$with_libupsclient" = "xuse_pkgconfig"
3721 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3722 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3725 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3728 if test "x$with_libupsclient" = "xuse_pkgconfig"
3730 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3733 with_libupsclient="no ($PKG_CONFIG failed)"
3735 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3738 with_libupsclient="no ($PKG_CONFIG failed)"
3741 if test "x$with_libupsclient" = "xuse_pkgconfig"
3743 with_libupsclient="yes"
3746 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3747 # the actual checks.
3748 if test "x$with_libupsclient" = "xyes"
3750 SAVE_CPPFLAGS="$CPPFLAGS"
3751 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3753 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3755 CPPFLAGS="$SAVE_CPPFLAGS"
3757 if test "x$with_libupsclient" = "xyes"
3759 SAVE_CPPFLAGS="$CPPFLAGS"
3760 SAVE_LDFLAGS="$LDFLAGS"
3762 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3763 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3765 AC_CHECK_LIB(upsclient, upscli_connect,
3766 [with_libupsclient="yes"],
3767 [with_libupsclient="no (symbol upscli_connect not found)"])
3769 CPPFLAGS="$SAVE_CPPFLAGS"
3770 LDFLAGS="$SAVE_LDFLAGS"
3772 if test "x$with_libupsclient" = "xyes"
3774 SAVE_CPPFLAGS="$CPPFLAGS"
3775 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3777 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3778 [#include <stdlib.h>
3780 #include <upsclient.h>])
3782 CPPFLAGS="$SAVE_CPPFLAGS"
3784 if test "x$with_libupsclient" = "xyes"
3786 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3787 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3788 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3789 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3793 # --with-libxmms {{{
3794 with_xmms_config="xmms-config"
3797 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3799 if test "x$withval" != "xno" \
3800 && test "x$withval" != "xyes"
3802 if test -f "$withval" && test -x "$withval";
3804 with_xmms_config="$withval"
3805 else if test -x "$withval/bin/xmms-config"
3807 with_xmms_config="$withval/bin/xmms-config"
3810 else if test "x$withval" = "xno"
3820 if test "x$with_libxmms" = "xyes"
3822 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3823 xmms_config_status=$?
3825 if test $xmms_config_status -ne 0
3830 if test "x$with_libxmms" = "xyes"
3832 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3833 xmms_config_status=$?
3835 if test $xmms_config_status -ne 0
3840 if test "x$with_libxmms" = "xyes"
3842 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3844 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3845 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3846 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3847 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3854 with_libxmms_numeric=0
3855 if test "x$with_libxmms" = "xyes"
3857 with_libxmms_numeric=1
3859 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3860 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3863 # --with-libyajl {{{
3864 with_libyajl_cppflags=""
3865 with_libyajl_ldflags=""
3866 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3868 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3870 with_libyajl_cppflags="-I$withval/include"
3871 with_libyajl_ldflags="-L$withval/lib"
3874 with_libyajl="$withval"
3880 if test "x$with_libyajl" = "xyes"
3882 SAVE_CPPFLAGS="$CPPFLAGS"
3883 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3885 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3886 AC_CHECK_HEADERS(yajl/yajl_version.h)
3888 CPPFLAGS="$SAVE_CPPFLAGS"
3890 if test "x$with_libyajl" = "xyes"
3892 SAVE_CPPFLAGS="$CPPFLAGS"
3893 SAVE_LDFLAGS="$LDFLAGS"
3894 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3895 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3897 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3899 CPPFLAGS="$SAVE_CPPFLAGS"
3900 LDFLAGS="$SAVE_LDFLAGS"
3902 if test "x$with_libyajl" = "xyes"
3904 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3905 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3906 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3907 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3908 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3909 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3910 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3912 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3915 # --with-libvarnish {{{
3916 with_libvarnish_cppflags=""
3917 with_libvarnish_cflags=""
3918 with_libvarnish_libs=""
3919 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
3921 if test "x$withval" = "xno"
3923 with_libvarnish="no"
3924 else if test "x$withval" = "xyes"
3926 with_libvarnish="use_pkgconfig"
3927 else if test -d "$with_libvarnish/lib"
3929 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
3930 with_libvarnish_cflags="-I$withval/include"
3931 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
3932 with_libvarnish="yes"
3935 [with_libvarnish="use_pkgconfig"])
3937 # configure using pkg-config
3938 if test "x$with_libvarnish" = "xuse_pkgconfig"
3940 if test "x$PKG_CONFIG" = "x"
3942 with_libvarnish="no (Don't have pkg-config)"
3945 if test "x$with_libvarnish" = "xuse_pkgconfig"
3947 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
3948 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
3951 with_libvarnish="no (pkg-config doesn't know varnishapi)"
3954 if test "x$with_libvarnish" = "xuse_pkgconfig"
3956 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
3959 with_libvarnish="no ($PKG_CONFIG failed)"
3961 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
3964 with_libvarnish="no ($PKG_CONFIG failed)"
3967 if test "x$with_libvarnish" = "xuse_pkgconfig"
3969 with_libvarnish="yes"
3972 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
3973 # the actual checks.
3974 if test "x$with_libvarnish" = "xyes"
3976 SAVE_CPPFLAGS="$CPPFLAGS"
3977 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
3978 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
3980 CPPFLAGS="$SAVE_CPPFLAGS"
3982 if test "x$with_libvarnish" = "xyes"
3984 SAVE_CPPFLAGS="$CPPFLAGS"
3985 #SAVE_LDFLAGS="$LDFLAGS"
3987 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
3988 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
3990 AC_CHECK_LIB(varnishapi, VSL_OpenStats,
3991 [with_libvarnish="yes"],
3992 [with_libvarnish="no (symbol VSL_OpenStats not found)"],
3993 [$with_libvarnish_libs])
3995 CPPFLAGS="$SAVE_CPPFLAGS"
3996 #LDFLAGS="$SAVE_LDFLAGS"
3998 if test "x$with_libvarnish" = "xyes"
4000 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4001 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4002 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4003 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4007 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4008 with_libxml2="no (pkg-config isn't available)"
4009 with_libxml2_cflags=""
4010 with_libxml2_ldflags=""
4011 with_libvirt="no (pkg-config isn't available)"
4012 with_libvirt_cflags=""
4013 with_libvirt_ldflags=""
4014 if test "x$PKG_CONFIG" != "x"
4016 pkg-config --exists 'libxml-2.0' 2>/dev/null
4021 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4024 pkg-config --exists libvirt 2>/dev/null
4029 with_libvirt="no (pkg-config doesn't know libvirt)"
4032 if test "x$with_libxml2" = "xyes"
4034 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4039 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4045 if test "x$with_libxml2" = "xyes"
4047 SAVE_CPPFLAGS="$CPPFLAGS"
4048 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4050 AC_CHECK_HEADERS(libxml/parser.h, [],
4051 [with_libxml2="no (libxml/parser.h not found)"])
4053 CPPFLAGS="$SAVE_CPPFLAGS"
4055 if test "x$with_libxml2" = "xyes"
4057 SAVE_CFLAGS="$CFLAGS"
4058 SAVE_LDFLAGS="$LDFLAGS"
4060 CFLAGS="$CFLAGS $with_libxml2_cflags"
4061 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4063 AC_CHECK_LIB(xml2, xmlXPathEval,
4064 [with_libxml2="yes"],
4065 [with_libxml2="no (symbol xmlXPathEval not found)"])
4067 CFLAGS="$SAVE_CFLAGS"
4068 LDFLAGS="$SAVE_LDFLAGS"
4070 dnl Add the right compiler flags and libraries.
4071 if test "x$with_libxml2" = "xyes"; then
4072 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4073 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4074 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4075 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4077 if test "x$with_libvirt" = "xyes"
4079 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4084 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4090 if test "x$with_libvirt" = "xyes"
4092 SAVE_CPPFLAGS="$CPPFLAGS"
4093 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4095 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4096 [with_libvirt="no (libvirt/libvirt.h not found)"])
4098 CPPFLAGS="$SAVE_CPPFLAGS"
4100 if test "x$with_libvirt" = "xyes"
4102 SAVE_CFLAGS="$CFLAGS"
4103 SAVE_LDFLAGS="$LDFLAGS"
4105 CFLAGS="$CFLAGS $with_libvirt_cflags"
4106 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4108 AC_CHECK_LIB(virt, virDomainBlockStats,
4109 [with_libvirt="yes"],
4110 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4112 CFLAGS="$SAVE_CFLAGS"
4113 LDFLAGS="$SAVE_LDFLAGS"
4115 dnl Add the right compiler flags and libraries.
4116 if test "x$with_libvirt" = "xyes"; then
4117 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4118 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4119 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4120 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4124 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4125 with_libopenipmipthread="yes"
4126 with_libopenipmipthread_cflags=""
4127 with_libopenipmipthread_libs=""
4129 AC_MSG_CHECKING([for pkg-config])
4131 if test "x$PKG_CONFIG" = "x"
4133 with_libopenipmipthread="no"
4136 temp_result="$PKG_CONFIG"
4138 AC_MSG_RESULT([$temp_result])
4140 if test "x$with_libopenipmipthread" = "xyes"
4142 AC_MSG_CHECKING([for libOpenIPMIpthread])
4143 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4146 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4148 AC_MSG_RESULT([$with_libopenipmipthread])
4151 if test "x$with_libopenipmipthread" = "xyes"
4153 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4154 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4157 with_libopenipmipthread_cflags="$temp_result"
4159 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4160 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4162 AC_MSG_RESULT([$temp_result])
4165 if test "x$with_libopenipmipthread" = "xyes"
4167 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4168 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4171 with_libopenipmipthread_ldflags="$temp_result"
4173 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4174 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4176 AC_MSG_RESULT([$temp_result])
4179 if test "x$with_libopenipmipthread" = "xyes"
4181 SAVE_CPPFLAGS="$CPPFLAGS"
4182 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4184 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4185 [with_libopenipmipthread="yes"],
4186 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4187 [#include <OpenIPMI/ipmiif.h>
4188 #include <OpenIPMI/ipmi_err.h>
4189 #include <OpenIPMI/ipmi_posix.h>
4190 #include <OpenIPMI/ipmi_conn.h>
4193 CPPFLAGS="$SAVE_CPPFLAGS"
4196 if test "x$with_libopenipmipthread" = "xyes"
4198 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4199 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4200 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4201 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4205 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4206 [with_libnotify="yes"],
4207 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4210 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4213 # Check for enabled/disabled features
4216 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4217 # ------------------------------------------------------------
4219 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4224 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4229 m4_define([EnDis],[disabled])dnl
4230 m4_define([YesNo],[no])dnl
4236 m4_define([EnDis],[enabled])dnl
4237 m4_define([YesNo],[yes])dnl
4240 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4244 m4_if([$3], [feature], [],
4248 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4254 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4256 enable_$1='[YesNo]'dnl
4258 if test "x$enable_$1" = "xno"
4262 if test "x$enable_$1" = "xyes"
4266 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4271 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4272 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4274 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4276 # AC_PLUGIN(name, default, info)
4277 # ------------------------------------------------------------
4284 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4286 if test "x$enableval" = "xyes"
4289 else if test "x$enableval" = "xforce"
4294 enable_plugin="no (disabled on command line)"
4298 if test "x$enable_all_plugins" = "xauto"
4300 if test "x$2" = "xyes"
4307 enable_plugin="$enable_all_plugins"
4310 if test "x$enable_plugin" = "xyes"
4312 if test "x$2" = "xyes" || test "x$force" = "xyes"
4314 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4315 if test "x$2" != "xyes"
4317 dependency_warning="yes"
4319 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4320 dependency_error="yes"
4321 enable_plugin="no (dependency error)"
4324 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4325 enable_$1="$enable_plugin"
4327 )# AC_PLUGIN(name, default, info)
4329 m4_divert_once([HELP_ENABLE], [
4330 collectd features:])
4331 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4332 AC_COLLECTD([debug], [enable], [feature], [debugging])
4333 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4334 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4336 dependency_warning="no"
4337 dependency_error="no"
4342 plugin_conntrack="no"
4343 plugin_contextswitch="no"
4346 plugin_curl_json="no"
4347 plugin_curl_xml="no"
4351 plugin_interface="no"
4358 plugin_multimeter="no"
4362 plugin_processes="no"
4363 plugin_protocols="no"
4367 plugin_tcpconns="no"
4374 plugin_wireless="no"
4378 if test "x$ac_system" = "xLinux"
4380 plugin_battery="yes"
4381 plugin_conntrack="yes"
4382 plugin_contextswitch="yes"
4384 plugin_cpufreq="yes"
4386 plugin_entropy="yes"
4387 plugin_interface="yes"
4392 plugin_fscache="yes"
4393 plugin_processes="yes"
4394 plugin_protocols="yes"
4397 plugin_tcpconns="yes"
4398 plugin_thermal="yes"
4401 plugin_vserver="yes"
4402 plugin_wireless="yes"
4404 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4410 if test "x$ac_system" = "xOpenBSD"
4412 plugin_tcpconns="yes"
4416 if test "x$with_libiokit" = "xyes"
4418 plugin_battery="yes"
4423 if test "x$with_perfstat" = "xyes"
4429 plugin_interface="yes"
4433 if test "x$with_procinfo" = "xyes"
4435 plugin_processes="yes"
4439 if test "x$with_kstat" = "xyes"
4442 plugin_zfs_arc="yes"
4445 if test "x$with_devinfo$with_kstat" = "xyesyes"
4449 plugin_interface="yes"
4455 if test "x$with_libstatgrab" = "xyes"
4459 plugin_interface="yes"
4466 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4469 if test "x$have_strptime" = "xyes"
4475 if test "x$with_libopenipmipthread" = "xyes"
4480 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4482 plugin_curl_json="yes"
4485 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4487 plugin_curl_xml="yes"
4490 if test "x$have_processor_info" = "xyes"
4494 if test "x$have_sysctl" = "xyes"
4499 if test "x$ac_system" = "xDarwin"
4504 if test "x$have_sysctlbyname" = "xyes"
4506 plugin_contextswitch="yes"
4509 plugin_tcpconns="yes"
4512 # Df plugin: Check if we know how to determine mount points first.
4513 #if test "x$have_listmntent" = "xyes"; then
4516 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4520 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4524 #if test "x$have_getmntent" = "xseq"
4528 if test "x$c_cv_have_one_getmntent" = "xyes"
4533 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4534 if test "x$plugin_df" = "xyes"
4537 if test "x$have_statfs" = "xyes"
4541 if test "x$have_statvfs" = "xyes"
4547 if test "x$have_getifaddrs" = "xyes"
4549 plugin_interface="yes"
4552 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4554 plugin_libvirt="yes"
4557 if test "x$have_getloadavg" = "xyes"
4562 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4567 # Mac OS X memory interface
4568 if test "x$have_host_statistics" = "xyes"
4573 if test "x$have_termios_h" = "xyes"
4575 plugin_multimeter="yes"
4579 if test "x$have_thread_info" = "xyes"
4581 plugin_processes="yes"
4584 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4586 plugin_processes="yes"
4589 if test "x$with_kvm_getswapinfo" = "xyes"
4594 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4599 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4601 plugin_tcpconns="yes"
4604 if test "x$have_getutent" = "xyes"
4608 if test "x$have_getutxent" = "xyes"
4613 m4_divert_once([HELP_ENABLE], [
4616 AC_ARG_ENABLE([all-plugins],
4617 AC_HELP_STRING([--enable-all-plugins],
4618 [enable all plugins (auto by def)]),
4620 if test "x$enableval" = "xyes"
4622 enable_all_plugins="yes"
4623 else if test "x$enableval" = "xauto"
4625 enable_all_plugins="auto"
4627 enable_all_plugins="no"
4630 [enable_all_plugins="auto"])
4632 m4_divert_once([HELP_ENABLE], [])
4634 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4635 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4636 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4637 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4638 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4639 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4640 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4641 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4642 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4643 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4644 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4645 AC_PLUGIN([csv], [yes], [CSV output plugin])
4646 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4647 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4648 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4649 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4650 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4651 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4652 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4653 AC_PLUGIN([email], [yes], [EMail statistics])
4654 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4655 AC_PLUGIN([exec], [yes], [Execution of external programs])
4656 AC_PLUGIN([filecount], [yes], [Count files in directories])
4657 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4658 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4659 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4660 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4661 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4662 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4663 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4664 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4665 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4666 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4667 AC_PLUGIN([load], [$plugin_load], [System load])
4668 AC_PLUGIN([logfile], [yes], [File logging plugin])
4669 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4670 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4671 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4672 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4673 AC_PLUGIN([match_regex], [yes], [The regex match])
4674 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4675 AC_PLUGIN([match_value], [yes], [The value match])
4676 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4677 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4678 AC_PLUGIN([memcached], [yes], [memcached statistics])
4679 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4680 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4681 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4682 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4683 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4684 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4685 AC_PLUGIN([network], [yes], [Network communication plugin])
4686 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4687 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4688 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4689 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4690 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4691 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4692 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4693 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4694 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4695 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4696 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4697 # FIXME: Check for libevent, too.
4698 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4699 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4700 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4701 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4702 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4703 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4704 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4705 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4706 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4707 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4708 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4709 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4710 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4711 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4712 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4713 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4714 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4715 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4716 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4717 AC_PLUGIN([target_notification], [yes], [The notification target])
4718 AC_PLUGIN([target_replace], [yes], [The replace target])
4719 AC_PLUGIN([target_scale],[yes], [The scale target])
4720 AC_PLUGIN([target_set], [yes], [The set target])
4721 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4722 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4723 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4724 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4725 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4726 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4727 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4728 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4729 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4730 AC_PLUGIN([users], [$plugin_users], [User statistics])
4731 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4732 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4733 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4734 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4735 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4736 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4737 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4738 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4739 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4741 dnl Default configuration file
4742 # Load either syslog or logfile
4743 LOAD_PLUGIN_SYSLOG=""
4744 LOAD_PLUGIN_LOGFILE=""
4746 AC_MSG_CHECKING([which default log plugin to load])
4747 default_log_plugin="none"
4748 if test "x$enable_syslog" = "xyes"
4750 default_log_plugin="syslog"
4752 LOAD_PLUGIN_SYSLOG="##"
4755 if test "x$enable_logfile" = "xyes"
4757 if test "x$default_log_plugin" = "xnone"
4759 default_log_plugin="logfile"
4761 LOAD_PLUGIN_LOGFILE="#"
4764 LOAD_PLUGIN_LOGFILE="##"
4766 AC_MSG_RESULT([$default_log_plugin])
4768 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4769 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4771 DEFAULT_LOG_LEVEL="info"
4772 if test "x$enable_debug" = "xyes"
4774 DEFAULT_LOG_LEVEL="debug"
4776 AC_SUBST(DEFAULT_LOG_LEVEL)
4778 # Load only one of rrdtool, network, csv in the default config.
4779 LOAD_PLUGIN_RRDTOOL=""
4780 LOAD_PLUGIN_NETWORK=""
4783 AC_MSG_CHECKING([which default write plugin to load])
4784 default_write_plugin="none"
4785 if test "x$enable_rrdtool" = "xyes"
4787 default_write_plugin="rrdtool"
4789 LOAD_PLUGIN_RRDTOOL="##"
4792 if test "x$enable_network" = "xyes"
4794 if test "x$default_write_plugin" = "xnone"
4796 default_write_plugin="network"
4798 LOAD_PLUGIN_NETWORK="#"
4801 LOAD_PLUGIN_NETWORK="##"
4804 if test "x$enable_csv" = "xyes"
4806 if test "x$default_write_plugin" = "xnone"
4808 default_write_plugin="csv"
4813 LOAD_PLUGIN_CSV="##"
4815 AC_MSG_RESULT([$default_write_plugin])
4817 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4818 AC_SUBST(LOAD_PLUGIN_NETWORK)
4819 AC_SUBST(LOAD_PLUGIN_CSV)
4822 if test "x$ac_system" = "xLinux" \
4823 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
4825 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4828 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
4830 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
4834 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4836 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4838 PERL_BINDINGS_OPTIONS="$withval"
4839 with_perl_bindings="yes"
4841 PERL_BINDINGS_OPTIONS=""
4842 with_perl_bindings="$withval"
4846 PERL_BINDINGS_OPTIONS=""
4847 if test -n "$perl_interpreter"
4849 with_perl_bindings="yes"
4851 with_perl_bindings="no (no perl interpreter found)"
4854 if test "x$with_perl_bindings" = "xyes"
4856 PERL_BINDINGS="perl"
4860 AC_SUBST(PERL_BINDINGS)
4861 AC_SUBST(PERL_BINDINGS_OPTIONS)
4863 dnl libcollectdclient
4864 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4865 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4866 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4868 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4870 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4872 AC_SUBST(LCC_VERSION_MAJOR)
4873 AC_SUBST(LCC_VERSION_MINOR)
4874 AC_SUBST(LCC_VERSION_PATCH)
4875 AC_SUBST(LCC_VERSION_EXTRA)
4876 AC_SUBST(LCC_VERSION_STRING)
4878 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4880 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
4882 if test "x$with_librrd" = "xyes" \
4883 && test "x$librrd_threadsafe" != "xyes"
4885 with_librrd="yes (warning: librrd is not thread-safe)"
4888 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
4890 with_libiptc="yes (shipped version)"
4893 if test "x$with_libperl" = "xyes"
4895 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4897 enable_perl="no (needs libperl)"
4900 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4902 enable_perl="no (libperl doesn't support ithreads)"
4905 if test "x$with_perl_bindings" = "xyes" \
4906 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4908 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4915 libcurl . . . . . . . $with_libcurl
4916 libdbi . . . . . . . $with_libdbi
4917 libcredis . . . . . . $with_libcredis
4918 libesmtp . . . . . . $with_libesmtp
4919 libganglia . . . . . $with_libganglia
4920 libgcrypt . . . . . . $with_libgcrypt
4921 libiokit . . . . . . $with_libiokit
4922 libiptc . . . . . . . $with_libiptc
4923 libjvm . . . . . . . $with_java
4924 libkstat . . . . . . $with_kstat
4925 libkvm . . . . . . . $with_libkvm
4926 libmemcached . . . . $with_libmemcached
4927 libmodbus . . . . . . $with_libmodbus
4928 libmysql . . . . . . $with_libmysql
4929 libnetapp . . . . . . $with_libnetapp
4930 libnetlink . . . . . $with_libnetlink
4931 libnetsnmp . . . . . $with_libnetsnmp
4932 libnotify . . . . . . $with_libnotify
4933 liboconfig . . . . . $with_liboconfig
4934 libopenipmi . . . . . $with_libopenipmipthread
4935 liboping . . . . . . $with_liboping
4936 libpcap . . . . . . . $with_libpcap
4937 libperfstat . . . . . $with_perfstat
4938 libperl . . . . . . . $with_libperl
4939 libpq . . . . . . . . $with_libpq
4940 libpthread . . . . . $with_libpthread
4941 librabbitmq . . . . . $with_librabbitmq
4942 librouteros . . . . . $with_librouteros
4943 librrd . . . . . . . $with_librrd
4944 libsensors . . . . . $with_libsensors
4945 libstatgrab . . . . . $with_libstatgrab
4946 libtokyotyrant . . . $with_libtokyotyrant
4947 libupsclient . . . . $with_libupsclient
4948 libvarnish . . . . . $with_libvarnish
4949 libvirt . . . . . . . $with_libvirt
4950 libxml2 . . . . . . . $with_libxml2
4951 libxmms . . . . . . . $with_libxmms
4952 libyajl . . . . . . . $with_libyajl
4953 libevent . . . . . . $with_libevent
4954 protobuf-c . . . . . $have_protoc_c
4955 oracle . . . . . . . $with_oracle
4956 python . . . . . . . $with_python
4959 daemon mode . . . . . $enable_daemon
4960 debug . . . . . . . . $enable_debug
4963 perl . . . . . . . . $with_perl_bindings
4966 amqp . . . . . . . $enable_amqp
4967 apache . . . . . . . $enable_apache
4968 apcups . . . . . . . $enable_apcups
4969 apple_sensors . . . . $enable_apple_sensors
4970 ascent . . . . . . . $enable_ascent
4971 battery . . . . . . . $enable_battery
4972 bind . . . . . . . . $enable_bind
4973 conntrack . . . . . . $enable_conntrack
4974 contextswitch . . . . $enable_contextswitch
4975 cpu . . . . . . . . . $enable_cpu
4976 cpufreq . . . . . . . $enable_cpufreq
4977 csv . . . . . . . . . $enable_csv
4978 curl . . . . . . . . $enable_curl
4979 curl_json . . . . . . $enable_curl_json
4980 curl_xml . . . . . . $enable_curl_xml
4981 dbi . . . . . . . . . $enable_dbi
4982 df . . . . . . . . . $enable_df
4983 disk . . . . . . . . $enable_disk
4984 dns . . . . . . . . . $enable_dns
4985 email . . . . . . . . $enable_email
4986 entropy . . . . . . . $enable_entropy
4987 exec . . . . . . . . $enable_exec
4988 filecount . . . . . . $enable_filecount
4989 fscache . . . . . . . $enable_fscache
4990 gmond . . . . . . . . $enable_gmond
4991 hddtemp . . . . . . . $enable_hddtemp
4992 interface . . . . . . $enable_interface
4993 ipmi . . . . . . . . $enable_ipmi
4994 iptables . . . . . . $enable_iptables
4995 ipvs . . . . . . . . $enable_ipvs
4996 irq . . . . . . . . . $enable_irq
4997 java . . . . . . . . $enable_java
4998 libvirt . . . . . . . $enable_libvirt
4999 load . . . . . . . . $enable_load
5000 logfile . . . . . . . $enable_logfile
5001 lpar... . . . . . . . $enable_lpar
5002 madwifi . . . . . . . $enable_madwifi
5003 match_empty_counter . $enable_match_empty_counter
5004 match_hashed . . . . $enable_match_hashed
5005 match_regex . . . . . $enable_match_regex
5006 match_timediff . . . $enable_match_timediff
5007 match_value . . . . . $enable_match_value
5008 mbmon . . . . . . . . $enable_mbmon
5009 memcachec . . . . . . $enable_memcachec
5010 memcached . . . . . . $enable_memcached
5011 memory . . . . . . . $enable_memory
5012 modbus . . . . . . . $enable_modbus
5013 multimeter . . . . . $enable_multimeter
5014 mysql . . . . . . . . $enable_mysql
5015 netapp . . . . . . . $enable_netapp
5016 netlink . . . . . . . $enable_netlink
5017 network . . . . . . . $enable_network
5018 nfs . . . . . . . . . $enable_nfs
5019 nginx . . . . . . . . $enable_nginx
5020 notify_desktop . . . $enable_notify_desktop
5021 notify_email . . . . $enable_notify_email
5022 ntpd . . . . . . . . $enable_ntpd
5023 nut . . . . . . . . . $enable_nut
5024 olsrd . . . . . . . . $enable_olsrd
5025 onewire . . . . . . . $enable_onewire
5026 openvpn . . . . . . . $enable_openvpn
5027 oracle . . . . . . . $enable_oracle
5028 perl . . . . . . . . $enable_perl
5029 pinba . . . . . . . . $enable_pinba
5030 ping . . . . . . . . $enable_ping
5031 postgresql . . . . . $enable_postgresql
5032 powerdns . . . . . . $enable_powerdns
5033 processes . . . . . . $enable_processes
5034 protocols . . . . . . $enable_protocols
5035 python . . . . . . . $enable_python
5036 redis . . . . . . . . $enable_redis
5037 routeros . . . . . . $enable_routeros
5038 rrdcached . . . . . . $enable_rrdcached
5039 rrdtool . . . . . . . $enable_rrdtool
5040 sensors . . . . . . . $enable_sensors
5041 serial . . . . . . . $enable_serial
5042 snmp . . . . . . . . $enable_snmp
5043 swap . . . . . . . . $enable_swap
5044 syslog . . . . . . . $enable_syslog
5045 table . . . . . . . . $enable_table
5046 tail . . . . . . . . $enable_tail
5047 tape . . . . . . . . $enable_tape
5048 target_notification . $enable_target_notification
5049 target_replace . . . $enable_target_replace
5050 target_scale . . . . $enable_target_scale
5051 target_set . . . . . $enable_target_set
5052 target_v5upgrade . . $enable_target_v5upgrade
5053 tcpconns . . . . . . $enable_tcpconns
5054 teamspeak2 . . . . . $enable_teamspeak2
5055 ted . . . . . . . . . $enable_ted
5056 thermal . . . . . . . $enable_thermal
5057 threshold . . . . . . $enable_threshold
5058 tokyotyrant . . . . . $enable_tokyotyrant
5059 unixsock . . . . . . $enable_unixsock
5060 uptime . . . . . . . $enable_uptime
5061 users . . . . . . . . $enable_users
5062 uuid . . . . . . . . $enable_uuid
5063 varnish . . . . . . . $enable_varnish
5064 vmem . . . . . . . . $enable_vmem
5065 vserver . . . . . . . $enable_vserver
5066 wireless . . . . . . $enable_wireless
5067 write_http . . . . . $enable_write_http
5068 write_redis . . . . . $enable_write_redis
5069 xmms . . . . . . . . $enable_xmms
5070 zfs_arc . . . . . . . $enable_zfs_arc
5074 if test "x$dependency_error" = "xyes"; then
5075 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5078 if test "x$dependency_warning" = "xyes"; then
5079 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5082 # vim: set fdm=marker :