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.])
94 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
96 if test "x$ac_system" = "xAIX"
98 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
101 # Where to install .pc files.
102 pkgconfigdir="${libdir}/pkgconfig"
103 AC_SUBST(pkgconfigdir)
105 # Check for standards compliance mode
106 AC_ARG_ENABLE(standards,
107 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
108 [enable_standards="$enableval"],
109 [enable_standards="no"])
110 if test "x$enable_standards" = "xyes"
112 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
113 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
114 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
115 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
116 if test "x$GCC" = "xyes"
118 CFLAGS="$CFLAGS -std=c99"
121 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
124 # Checks for header files.
131 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)
134 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
139 # include <sys/types.h>
142 AC_CHECK_HEADERS(netinet/in.h, [], [],
147 # include <sys/types.h>
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
153 AC_CHECK_HEADERS(netinet/ip.h, [], [],
158 # include <sys/types.h>
160 #if HAVE_NETINET_IN_SYSTM_H
161 # include <netinet/in_systm.h>
163 #if HAVE_NETINET_IN_H
164 # include <netinet/in.h>
167 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
172 # include <sys/types.h>
174 #if HAVE_NETINET_IN_SYSTM_H
175 # include <netinet/in_systm.h>
177 #if HAVE_NETINET_IN_H
178 # include <netinet/in.h>
180 #if HAVE_NETINET_IP_H
181 # include <netinet/ip.h>
184 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
189 # include <sys/types.h>
191 #if HAVE_NETINET_IN_SYSTM_H
192 # include <netinet/in_systm.h>
194 #if HAVE_NETINET_IN_H
195 # include <netinet/in.h>
197 #if HAVE_NETINET_IP_H
198 # include <netinet/ip.h>
201 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
206 # include <sys/types.h>
208 #if HAVE_NETINET_IN_SYSTM_H
209 # include <netinet/in_systm.h>
211 #if HAVE_NETINET_IN_H
212 # include <netinet/in.h>
215 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
220 # include <sys/types.h>
222 #if HAVE_NETINET_IN_SYSTM_H
223 # include <netinet/in_systm.h>
225 #if HAVE_NETINET_IN_H
226 # include <netinet/in.h>
228 #if HAVE_NETINET_IP6_H
229 # include <netinet/ip6.h>
232 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
237 # include <sys/types.h>
239 #if HAVE_NETINET_IN_SYSTM_H
240 # include <netinet/in_systm.h>
242 #if HAVE_NETINET_IN_H
243 # include <netinet/in.h>
245 #if HAVE_NETINET_IP_H
246 # include <netinet/ip.h>
249 AC_CHECK_HEADERS(netinet/udp.h, [], [],
254 # include <sys/types.h>
256 #if HAVE_NETINET_IN_SYSTM_H
257 # include <netinet/in_systm.h>
259 #if HAVE_NETINET_IN_H
260 # include <netinet/in.h>
262 #if HAVE_NETINET_IP_H
263 # include <netinet/ip.h>
268 AC_CHECK_HEADERS(sys/dkstat.h)
269 if test "x$ac_system" = "xDarwin"
271 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)
272 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
274 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
277 # include <sys/types.h>
280 # include <sys/param.h>
284 AC_MSG_CHECKING([for sysctl kern.cp_times])
285 if test -x /sbin/sysctl
287 /sbin/sysctl kern.cp_times 2>/dev/null
291 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
292 [Define if sysctl supports kern.cp_times])
301 AC_CHECK_HEADERS(linux/major.h libgen.h)
303 # For the battery plugin
304 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
306 #if HAVE_IOKIT_IOKITLIB_H
307 # include <IOKit/IOKitLib.h>
309 #if HAVE_IOKIT_IOTYPES_H
310 # include <IOKit/IOTypes.h>
314 # For the swap module
315 have_linux_wireless_h="no"
316 if test "x$ac_system" = "xLinux"
318 AC_CHECK_HEADERS(linux/wireless.h,
319 [have_linux_wireless_h="yes"],
320 [have_linux_wireless_h="no"],
323 #include <sys/ioctl.h>
324 #include <sys/socket.h>
328 # For the swap module
329 have_sys_swap_h="yes"
330 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
332 #undef _FILE_OFFSET_BITS
333 #undef _LARGEFILE64_SOURCE
335 # include <sys/types.h>
338 # include <sys/param.h>
342 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
345 if test "x$GCC" = "xyes"
347 hint_64="CFLAGS='-m64'"
349 hint_64="CFLAGS='-xarch=v9'"
351 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
355 # For the processes plugin
357 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
359 # For interface plugin
360 AC_CHECK_HEADERS(ifaddrs.h)
361 AC_CHECK_HEADERS(net/if.h, [], [],
364 # include <sys/types.h>
366 #if HAVE_SYS_SOCKET_H
367 # include <sys/socket.h>
370 AC_CHECK_HEADERS(linux/if.h, [], [],
373 # include <sys/types.h>
375 #if HAVE_SYS_SOCKET_H
376 # include <sys/socket.h>
379 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
382 # include <sys/types.h>
384 #if HAVE_SYS_SOCKET_H
385 # include <sys/socket.h>
388 # include <linux/if.h>
393 have_linux_ip_vs_h="no"
394 have_net_ip_vs_h="no"
396 ip_vs_h_needs_kernel_cflags="no"
397 if test "x$ac_system" = "xLinux"
399 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
400 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
401 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
403 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
405 SAVE_CFLAGS="$CFLAGS"
406 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
408 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
410 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
411 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
412 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
414 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
416 ip_vs_h_needs_kernel_cflags="yes"
419 CFLAGS="$SAVE_CFLAGS"
422 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
425 AC_CHECK_HEADERS(sys/ucred.h, [], [],
428 # include <sys/types.h>
431 # include <sys/param.h>
435 # For mount interface
436 AC_CHECK_HEADERS(sys/mount.h, [], [],
439 # include <sys/types.h>
442 # include <sys/param.h>
446 # For the email plugin
447 AC_CHECK_HEADERS(linux/un.h, [], [],
449 #if HAVE_SYS_SOCKET_H
450 # include <sys/socket.h>
454 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)
457 AC_CHECK_HEADERS(arpa/nameser.h)
458 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
460 #if HAVE_ARPA_NAMESER_H
461 # include <arpa/nameser.h>
465 AC_CHECK_HEADERS(net/if_arp.h, [], [],
466 [#if HAVE_SYS_SOCKET_H
467 # include <sys/socket.h>
470 AC_CHECK_HEADERS(net/ppp_defs.h)
471 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
472 [#if HAVE_NET_PPP_DEFS_H
473 # include <net/ppp_defs.h>
476 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
481 # include <sys/types.h>
483 #if HAVE_SYS_SOCKET_H
484 # include <sys/socket.h>
489 #if HAVE_NETINET_IN_H
490 # include <netinet/in.h>
494 AC_CHECK_HEADERS(netinet/ip_compat.h)
496 # For the multimeter plugin
498 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
501 # Checks for typedefs, structures, and compiler characteristics.
510 # Checks for library functions.
512 AC_PROG_GCC_TRADITIONAL
513 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
517 SAVE_CFLAGS="$CFLAGS"
518 # Emulate behavior of src/Makefile.am
519 if test "x$GCC" = "xyes"
521 CFLAGS="$CFLAGS -Wall -Werror"
524 AC_CACHE_CHECK([for strtok_r],
525 [c_cv_have_strtok_r_default],
534 char buffer[] = "foo,bar,baz";
541 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
544 printf ("token = %s;\n", token);
547 [c_cv_have_strtok_r_default="yes"],
548 [c_cv_have_strtok_r_default="no"]
552 if test "x$c_cv_have_strtok_r_default" = "xno"
554 CFLAGS="$CFLAGS -D_REENTRANT=1"
556 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
557 [c_cv_have_strtok_r_reentrant],
566 char buffer[] = "foo,bar,baz";
573 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
576 printf ("token = %s;\n", token);
579 [c_cv_have_strtok_r_reentrant="yes"],
580 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
585 CFLAGS="$SAVE_CFLAGS"
586 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
588 CFLAGS="$CFLAGS -D_REENTRANT=1"
591 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
593 socket_needs_socket="no"
594 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
595 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
597 clock_gettime_needs_rt="no"
598 clock_gettime_needs_posix4="no"
599 have_clock_gettime="no"
600 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
601 if test "x$have_clock_gettime" = "xno"
603 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
604 have_clock_gettime="yes"])
606 if test "x$have_clock_gettime" = "xno"
608 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
609 have_clock_gettime="yes"])
611 if test "x$have_clock_gettime" = "xyes"
613 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
615 AC_MSG_WARN(cannot find clock_gettime)
618 nanosleep_needs_rt="no"
619 nanosleep_needs_posix4="no"
620 AC_CHECK_FUNCS(nanosleep,
622 AC_CHECK_LIB(rt, nanosleep,
623 [nanosleep_needs_rt="yes"],
624 AC_CHECK_LIB(posix4, nanosleep,
625 [nanosleep_needs_posix4="yes"],
626 AC_MSG_ERROR(cannot find nanosleep))))
628 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
629 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
631 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
632 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
633 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
634 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
635 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
636 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
637 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
638 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
639 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
640 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
641 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
642 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
644 # Check for strptime {{{
645 if test "x$GCC" = "xyes"
647 SAVE_CFLAGS="$CFLAGS"
648 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
651 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
652 if test "x$have_strptime" = "xyes"
654 AC_CACHE_CHECK([whether strptime is exported by default],
655 [c_cv_have_strptime_default],
664 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
666 [c_cv_have_strptime_default="yes"],
667 [c_cv_have_strptime_default="no"]))
669 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
671 AC_CACHE_CHECK([whether strptime needs standards mode],
672 [c_cv_have_strptime_standards],
676 #ifndef _ISOC99_SOURCE
677 # define _ISOC99_SOURCE 1
679 #ifndef _POSIX_C_SOURCE
680 # define _POSIX_C_SOURCE 200112L
682 #ifndef _XOPEN_SOURCE
683 # define _XOPEN_SOURCE 500
690 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
692 [c_cv_have_strptime_standards="yes"],
693 [c_cv_have_strptime_standards="no"]))
695 if test "x$c_cv_have_strptime_standards" = "xyes"
697 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
703 if test "x$GCC" = "xyes"
705 CFLAGS="$SAVE_CFLAGS"
708 # }}} Check for strptime
710 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
711 if test "x$have_swapctl" = "xyes"; then
712 AC_CACHE_CHECK([whether swapctl takes two arguments],
713 [c_cv_have_swapctl_two_args],
715 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
716 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
717 # undef _FILE_OFFSET_BITS
718 # undef _LARGEFILE64_SOURCE
720 #include <sys/stat.h>
721 #include <sys/swap.h>]],
723 int num = swapctl(0, NULL);
726 [c_cv_have_swapctl_two_args="yes"],
727 [c_cv_have_swapctl_two_args="no"]
730 AC_CACHE_CHECK([whether swapctl takes three arguments],
731 [c_cv_have_swapctl_three_args],
733 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
734 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
735 # undef _FILE_OFFSET_BITS
736 # undef _LARGEFILE64_SOURCE
738 #include <sys/stat.h>
739 #include <sys/swap.h>]],
741 int num = swapctl(0, NULL,0);
744 [c_cv_have_swapctl_three_args="yes"],
745 [c_cv_have_swapctl_three_args="no"]
749 # Check for different versions of `swapctl' here..
750 if test "x$have_swapctl" = "xyes"; then
751 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
752 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
753 [Define if the function swapctl exists and takes two arguments.])
755 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
756 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
757 [Define if the function swapctl exists and takes three arguments.])
762 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
764 if test "x$withval" = "xno"; then
766 else if test "x$withval" = "xyes"; then
773 if test "x$nan_type" = "xnone"; then
774 AC_CACHE_CHECK([whether NAN is defined by default],
775 [c_cv_have_nan_default],
781 static double foo = NAN;
789 [c_cv_have_nan_default="yes"],
790 [c_cv_have_nan_default="no"]
793 if test "x$c_cv_have_nan_default" = "xyes"
798 if test "x$nan_type" = "xnone"; then
799 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
800 [c_cv_have_nan_isoc],
805 #define __USE_ISOC99 1
807 static double foo = NAN;
815 [c_cv_have_nan_isoc="yes"],
816 [c_cv_have_nan_isoc="no"]
819 if test "x$c_cv_have_nan_isoc" = "xyes"
824 if test "x$nan_type" = "xnone"; then
825 SAVE_LDFLAGS=$LDFLAGS
826 LDFLAGS="$LDFLAGS -lm"
827 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
828 [c_cv_have_nan_zero],
837 #define NAN (0.0 / 0.0)
839 # define isnan(f) ((f) != (f))
841 static double foo = NAN;
849 [c_cv_have_nan_zero="yes"],
850 [c_cv_have_nan_zero="no"]
853 LDFLAGS=$SAVE_LDFLAGS
854 if test "x$c_cv_have_nan_zero" = "xyes"
860 if test "x$nan_type" = "xdefault"; then
861 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
862 [Define if NAN is defined by default and can initialize static variables.])
863 else if test "x$nan_type" = "xisoc99"; then
864 AC_DEFINE(NAN_STATIC_ISOC, 1,
865 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
866 else if test "x$nan_type" = "xzero"; then
867 AC_DEFINE(NAN_ZERO_ZERO, 1,
868 [Define if NAN can be defined as (0.0 / 0.0)])
870 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
873 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
875 if test "x$withval" = "xnothing"; then
876 fp_layout_type="nothing"
877 else if test "x$withval" = "xendianflip"; then
878 fp_layout_type="endianflip"
879 else if test "x$withval" = "xintswap"; then
880 fp_layout_type="intswap"
882 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
885 [fp_layout_type="unknown"])
887 if test "x$fp_layout_type" = "xunknown"; then
888 AC_CACHE_CHECK([if doubles are stored in x86 representation],
889 [c_cv_fp_layout_need_nothing],
900 # include <inttypes.h>
903 # include <stdbool.h>
913 memcpy ((void *) &i0, (void *) &d, 8);
916 memcpy ((void *) c, (void *) &i1, 8);
918 if ((c[0] == 0x2f) && (c[1] == 0x25)
919 && (c[2] == 0xc0) && (c[3] == 0xc7)
920 && (c[4] == 0x43) && (c[5] == 0x2b)
921 && (c[6] == 0x1f) && (c[7] == 0x5b))
926 [c_cv_fp_layout_need_nothing="yes"],
927 [c_cv_fp_layout_need_nothing="no"]
930 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
931 fp_layout_type="nothing"
934 if test "x$fp_layout_type" = "xunknown"; then
935 AC_CACHE_CHECK([if endianflip converts to x86 representation],
936 [c_cv_fp_layout_need_endianflip],
947 # include <inttypes.h>
950 # include <stdbool.h>
952 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
953 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
954 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
955 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
956 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
957 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
958 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
959 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
968 memcpy ((void *) &i0, (void *) &d, 8);
970 i1 = endianflip (i0);
971 memcpy ((void *) c, (void *) &i1, 8);
973 if ((c[0] == 0x2f) && (c[1] == 0x25)
974 && (c[2] == 0xc0) && (c[3] == 0xc7)
975 && (c[4] == 0x43) && (c[5] == 0x2b)
976 && (c[6] == 0x1f) && (c[7] == 0x5b))
981 [c_cv_fp_layout_need_endianflip="yes"],
982 [c_cv_fp_layout_need_endianflip="no"]
985 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
986 fp_layout_type="endianflip"
989 if test "x$fp_layout_type" = "xunknown"; then
990 AC_CACHE_CHECK([if intswap converts to x86 representation],
991 [c_cv_fp_layout_need_intswap],
1002 # include <inttypes.h>
1005 # include <stdbool.h>
1007 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1008 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1017 memcpy ((void *) &i0, (void *) &d, 8);
1020 memcpy ((void *) c, (void *) &i1, 8);
1022 if ((c[0] == 0x2f) && (c[1] == 0x25)
1023 && (c[2] == 0xc0) && (c[3] == 0xc7)
1024 && (c[4] == 0x43) && (c[5] == 0x2b)
1025 && (c[6] == 0x1f) && (c[7] == 0x5b))
1030 [c_cv_fp_layout_need_intswap="yes"],
1031 [c_cv_fp_layout_need_intswap="no"]
1034 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1035 fp_layout_type="intswap"
1039 if test "x$fp_layout_type" = "xnothing"; then
1040 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1041 [Define if doubles are stored in x86 representation.])
1042 else if test "x$fp_layout_type" = "xendianflip"; then
1043 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1044 [Define if endianflip is needed to convert to x86 representation.])
1045 else if test "x$fp_layout_type" = "xintswap"; then
1046 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1047 [Define if intswap is needed to convert to x86 representation.])
1049 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1053 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1054 have_getvfsstat="no"
1055 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1056 have_listmntent="no"
1057 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1060 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1061 if test "x$have_getmntent" = "xno"; then
1062 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1064 if test "x$have_getmntent" = "xno"; then
1065 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1067 if test "x$have_getmntent" = "xno"; then
1068 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1071 if test "x$have_getmntent" = "xc"; then
1072 AC_CACHE_CHECK([whether getmntent takes one argument],
1073 [c_cv_have_one_getmntent],
1075 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1076 #include "$srcdir/src/utils_mount.h"]],
1080 fh = setmntent ("/etc/mtab", "r");
1081 me = getmntent (fh);
1084 [c_cv_have_one_getmntent="yes"],
1085 [c_cv_have_one_getmntent="no"]
1088 AC_CACHE_CHECK([whether getmntent takes two arguments],
1089 [c_cv_have_two_getmntent],
1091 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1092 #include "$srcdir/src/utils_mount.h"]],
1097 fh = fopen ("/etc/mnttab", "r");
1098 status = getmntent (fh, &mt);
1101 [c_cv_have_two_getmntent="yes"],
1102 [c_cv_have_two_getmntent="no"]
1107 # Check for different versions of `getmntent' here..
1109 if test "x$have_getmntent" = "xc"; then
1110 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1111 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1112 [Define if the function getmntent exists and takes one argument.])
1114 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1115 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1116 [Define if the function getmntent exists and takes two arguments.])
1119 if test "x$have_getmntent" = "xsun"; then
1120 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1121 [Define if the function getmntent exists. It's the version from libsun.])
1123 if test "x$have_getmntent" = "xseq"; then
1124 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1125 [Define if the function getmntent exists. It's the version from libseq.])
1127 if test "x$have_getmntent" = "xgen"; then
1128 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1129 [Define if the function getmntent exists. It's the version from libgen.])
1133 AC_MSG_CHECKING([if have htonll defined])
1138 #include <sys/types.h>
1139 #include <netinet/in.h>
1141 # include <inttypes.h>
1148 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1151 AC_MSG_RESULT([$have_htonll])
1153 # Check for structures
1154 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1155 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1158 #include <sys/types.h>
1159 #include <sys/socket.h>
1162 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1163 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1166 #include <sys/types.h>
1167 #include <sys/socket.h>
1168 #include <linux/if.h>
1169 #include <linux/netdevice.h>
1172 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1175 #include <netinet/in.h>
1179 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1181 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1182 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1183 have_struct_kinfo_proc_freebsd="yes"
1186 have_struct_kinfo_proc_freebsd="no"
1190 #include <sys/param.h>
1191 #include <sys/sysctl.h>
1192 #include <sys/user.h>
1195 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1197 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1198 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1199 have_struct_kinfo_proc_openbsd="yes"
1202 have_struct_kinfo_proc_openbsd="no"
1205 #include <sys/param.h>
1206 #include <sys/sysctl.h>
1210 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1211 [#define _BSD_SOURCE
1213 # include <stdint.h>
1215 #if HAVE_SYS_TYPES_H
1216 # include <sys/types.h>
1218 #if HAVE_NETINET_IN_SYSTM_H
1219 # include <netinet/in_systm.h>
1221 #if HAVE_NETINET_IN_H
1222 # include <netinet/in.h>
1224 #if HAVE_NETINET_IP_H
1225 # include <netinet/ip.h>
1227 #if HAVE_NETINET_UDP_H
1228 # include <netinet/udp.h>
1231 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1232 [#define _BSD_SOURCE
1234 # include <stdint.h>
1236 #if HAVE_SYS_TYPES_H
1237 # include <sys/types.h>
1239 #if HAVE_NETINET_IN_SYSTM_H
1240 # include <netinet/in_systm.h>
1242 #if HAVE_NETINET_IN_H
1243 # include <netinet/in.h>
1245 #if HAVE_NETINET_IP_H
1246 # include <netinet/ip.h>
1248 #if HAVE_NETINET_UDP_H
1249 # include <netinet/udp.h>
1253 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1263 # Checks for libraries begin here
1265 with_libresolv="yes"
1266 AC_CHECK_LIB(resolv, res_search,
1268 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1270 [with_libresolv="no"])
1271 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1273 dnl Check for HAL (hardware abstraction library)
1275 AC_CHECK_LIB(hal,libhal_device_property_exists,
1276 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1278 if test "x$with_libhal" = "xyes"; then
1279 if test "x$PKG_CONFIG" != "x"; then
1280 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1281 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1282 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1283 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1287 m4_divert_once([HELP_WITH], [
1288 collectd additional packages:])
1290 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1292 if test "x$ac_system" = "xAIX"
1297 with_perfstat="no (AIX only)"
1298 with_procinfo="no (AIX only)"
1301 if test "x$with_perfstat" = "xyes"
1303 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1304 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1306 if test "x$with_perfstat" = "xyes"
1308 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1309 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1310 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1311 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1313 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1316 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1318 # Processes plugin under AIX.
1319 if test "x$with_procinfo" = "xyes"
1321 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1323 if test "x$with_procinfo" = "xyes"
1325 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1328 if test "x$ac_system" = "xSolaris"
1333 with_kstat="no (Solaris only)"
1334 with_devinfo="no (Solaris only)"
1337 if test "x$with_kstat" = "xyes"
1339 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1341 if test "x$with_kstat" = "xyes"
1343 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1344 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1346 if test "x$with_kstat" = "xyes"
1348 AC_DEFINE(HAVE_LIBKSTAT, 1,
1349 [Define to 1 if you have the 'kstat' library (-lkstat)])
1351 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1352 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1355 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1362 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1365 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1366 if test "x$with_kvm_getprocs" = "xyes"
1368 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1369 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1372 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1374 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1375 if test "x$with_kvm_getswapinfo" = "xyes"
1377 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1378 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1381 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1383 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1384 if test "x$with_kvm_nlist" = "xyes"
1386 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1387 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1388 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1391 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1393 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1394 if test "x$with_kvm_openfiles" = "xyes"
1396 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1397 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1400 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1402 # --with-libcredis {{{
1403 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1405 if test "x$withval" = "xyes"
1407 with_libcredis="yes"
1408 else if test "x$withval" = "xno"
1412 with_libcredis="yes"
1413 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1414 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1417 [with_libcredis="yes"])
1419 SAVE_CPPFLAGS="$CPPFLAGS"
1420 SAVE_LDFLAGS="$LDFLAGS"
1422 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1423 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1425 if test "x$with_libcredis" = "xyes"
1427 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1429 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1431 AC_CHECK_HEADERS(credis.h,
1432 [with_libcredis="yes"],
1433 [with_libcredis="no (credis.h not found)"])
1435 if test "x$with_libcredis" = "xyes"
1437 if test "x$LIBCREDIS_LDFLAGS" != "x"
1439 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1441 AC_CHECK_LIB(credis, credis_info,
1442 [with_libcredis="yes"],
1443 [with_libcredis="no (symbol 'credis_info' not found)"])
1447 CPPFLAGS="$SAVE_CPPFLAGS"
1448 LDFLAGS="$SAVE_LDFLAGS"
1450 if test "x$with_libcredis" = "xyes"
1452 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1453 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1454 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1455 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1457 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1460 # --with-libcurl {{{
1461 with_curl_config="curl-config"
1464 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1466 if test "x$withval" = "xno"
1469 else if test "x$withval" = "xyes"
1473 if test -f "$withval" && test -x "$withval"
1475 with_curl_config="$withval"
1477 else if test -x "$withval/bin/curl-config"
1479 with_curl_config="$withval/bin/curl-config"
1488 if test "x$with_libcurl" = "xyes"
1490 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1491 curl_config_status=$?
1493 if test $curl_config_status -ne 0
1495 with_libcurl="no ($with_curl_config failed)"
1497 SAVE_CPPFLAGS="$CPPFLAGS"
1498 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1500 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1502 CPPFLAGS="$SAVE_CPPFLAGS"
1505 if test "x$with_libcurl" = "xyes"
1507 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1508 curl_config_status=$?
1510 if test $curl_config_status -ne 0
1512 with_libcurl="no ($with_curl_config failed)"
1514 AC_CHECK_LIB(curl, curl_easy_init,
1515 [with_libcurl="yes"],
1516 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1520 if test "x$with_libcurl" = "xyes"
1522 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1523 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1524 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1525 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1527 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1531 with_libdbi_cppflags=""
1532 with_libdbi_ldflags=""
1533 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1535 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1537 with_libdbi_cppflags="-I$withval/include"
1538 with_libdbi_ldflags="-L$withval/lib"
1541 with_libdbi="$withval"
1547 if test "x$with_libdbi" = "xyes"
1549 SAVE_CPPFLAGS="$CPPFLAGS"
1550 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1552 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1554 CPPFLAGS="$SAVE_CPPFLAGS"
1556 if test "x$with_libdbi" = "xyes"
1558 SAVE_CPPFLAGS="$CPPFLAGS"
1559 SAVE_LDFLAGS="$LDFLAGS"
1560 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1561 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1563 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1565 CPPFLAGS="$SAVE_CPPFLAGS"
1566 LDFLAGS="$SAVE_LDFLAGS"
1568 if test "x$with_libdbi" = "xyes"
1570 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1571 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1572 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1573 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1574 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1575 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1577 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1580 # --with-libesmtp {{{
1581 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1583 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1585 LDFLAGS="$LDFLAGS -L$withval/lib"
1586 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1589 with_libesmtp="$withval"
1595 if test "x$with_libesmtp" = "xyes"
1597 AC_CHECK_LIB(esmtp, smtp_create_session,
1599 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1600 ], [with_libesmtp="no (libesmtp not found)"])
1602 if test "x$with_libesmtp" = "xyes"
1604 AC_CHECK_HEADERS(libesmtp.h,
1606 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1607 ], [with_libesmtp="no (libesmtp.h not found)"])
1609 if test "x$with_libesmtp" = "xyes"
1615 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1616 [Wether or not to use the esmtp library])
1617 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1620 # --with-libganglia {{{
1621 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1623 if test -f "$withval" && test -x "$withval"
1625 with_libganglia_config="$withval"
1626 with_libganglia="yes"
1627 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1629 with_libganglia_config="$withval/bin/ganglia-config"
1630 with_libganglia="yes"
1631 else if test -d "$withval"
1633 GANGLIA_CPPFLAGS="-I$withval/include"
1634 GANGLIA_LDFLAGS="-L$withval/lib"
1635 with_libganglia="yes"
1637 with_libganglia_config="ganglia-config"
1638 with_libganglia="$withval"
1642 with_libganglia_config="ganglia-config"
1643 with_libganglia="yes"
1646 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1648 if test "x$GANGLIA_CPPFLAGS" = "x"
1650 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1653 if test "x$GANGLIA_LDFLAGS" = "x"
1655 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1658 if test "x$GANGLIA_LIBS" = "x"
1660 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1664 SAVE_CPPFLAGS="$CPPFLAGS"
1665 SAVE_LDFLAGS="$LDFLAGS"
1666 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1667 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1669 if test "x$with_libganglia" = "xyes"
1671 AC_CHECK_HEADERS(gm_protocol.h,
1673 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1674 [Define to 1 if you have the <gm_protocol.h> header file.])
1675 ], [with_libganglia="no (gm_protocol.h not found)"])
1678 if test "x$with_libganglia" = "xyes"
1680 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1682 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1683 [Define to 1 if you have the ganglia library (-lganglia).])
1684 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1687 CPPFLAGS="$SAVE_CPPFLAGS"
1688 LDFLAGS="$SAVE_LDFLAGS"
1690 AC_SUBST(GANGLIA_CPPFLAGS)
1691 AC_SUBST(GANGLIA_LDFLAGS)
1692 AC_SUBST(GANGLIA_LIBS)
1693 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1696 # --with-libgcrypt {{{
1697 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1698 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1699 GCRYPT_LIBS="$GCRYPT_LIBS"
1700 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1702 if test -f "$withval" && test -x "$withval"
1704 with_libgcrypt_config="$withval"
1705 with_libgcrypt="yes"
1706 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1708 with_libgcrypt_config="$withval/bin/gcrypt-config"
1709 with_libgcrypt="yes"
1710 else if test -d "$withval"
1712 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1713 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1714 with_libgcrypt="yes"
1716 with_libgcrypt_config="gcrypt-config"
1717 with_libgcrypt="$withval"
1721 with_libgcrypt_config="libgcrypt-config"
1722 with_libgcrypt="yes"
1725 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1727 if test "x$GCRYPT_CPPFLAGS" = "x"
1729 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1732 if test "x$GCRYPT_LDFLAGS" = "x"
1734 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1735 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1738 if test "x$GCRYPT_LIBS" = "x"
1740 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1744 SAVE_CPPFLAGS="$CPPFLAGS"
1745 SAVE_LDFLAGS="$LDFLAGS"
1746 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1747 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1749 if test "x$with_libgcrypt" = "xyes"
1751 if test "x$GCRYPT_CPPFLAGS" != "x"
1753 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1755 AC_CHECK_HEADERS(gcrypt.h,
1756 [with_libgcrypt="yes"],
1757 [with_libgcrypt="no (gcrypt.h not found)"])
1760 if test "x$with_libgcrypt" = "xyes"
1762 if test "x$GCRYPT_LDFLAGS" != "x"
1764 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1766 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1767 [with_libgcrypt="yes"],
1768 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1770 if test "$with_libgcrypt" != "no"; then
1771 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1775 CPPFLAGS="$SAVE_CPPFLAGS"
1776 LDFLAGS="$SAVE_LDFLAGS"
1778 if test "x$with_libgcrypt" = "xyes"
1780 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1783 AC_SUBST(GCRYPT_CPPFLAGS)
1784 AC_SUBST(GCRYPT_LDFLAGS)
1785 AC_SUBST(GCRYPT_LIBS)
1786 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1789 # --with-libiptc {{{
1790 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1792 if test "x$withval" = "xshipped"
1795 else if test "x$withval" = "xyes"
1797 with_libiptc="pkgconfig"
1798 else if test "x$withval" = "xno"
1803 with_libiptc_cflags="-I$withval/include"
1804 with_libiptc_libs="-L$withval/lib"
1808 if test "x$ac_system" = "xLinux"
1810 with_libiptc="pkgconfig"
1812 with_libiptc="no (Linux only)"
1816 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1818 with_libiptc="no (Don't have pkg-config)"
1821 if test "x$with_libiptc" = "xpkgconfig"
1823 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
1826 with_libiptc="no (pkg-config doesn't know libiptc)"
1829 if test "x$with_libiptc" = "xpkgconfig"
1831 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
1834 with_libiptc="no ($PKG_CONFIG failed)"
1836 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
1839 with_libiptc="no ($PKG_CONFIG failed)"
1843 SAVE_CPPFLAGS="$CPPFLAGS"
1844 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
1846 # check whether the header file for libiptc is available.
1847 if test "x$with_libiptc" = "xpkgconfig"
1849 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
1850 [with_libiptc="no (header file missing)"])
1852 # If the header file is available, check for the required type declaractions.
1853 # They may be missing in old versions of libiptc. In that case, they will be
1854 # declared in the iptables plugin.
1855 if test "x$with_libiptc" = "xpkgconfig"
1857 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
1859 # Check for the iptc_init symbol in the library.
1860 # This could be in iptc or ip4tc
1861 if test "x$with_libiptc" = "xpkgconfig"
1863 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
1864 [with_libiptc="pkgconfig"],
1865 [with_libiptc="no"],
1866 [$with_libiptc_libs])
1868 if test "x$with_libiptc" = "xpkgconfig"
1873 CPPFLAGS="$SAVE_CPPFLAGS"
1875 if test "x$with_libiptc" = "xown"
1877 with_libiptc_cflags=""
1878 with_libiptc_libs=""
1880 if test "x$with_libiptc" = "xown"
1882 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1884 with_libiptc="no (Linux iptables headers not found)"
1887 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1890 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
1891 if test "x$with_libiptc" = "xown"
1893 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1897 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1898 if test "x$with_libiptc" = "xyes"
1900 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
1901 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
1902 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1903 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1908 with_java_home="$JAVA_HOME"
1909 with_java_vmtype="client"
1914 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1916 if test "x$withval" = "xno"
1919 else if test "x$withval" = "xyes"
1923 with_java_home="$withval"
1928 if test "x$with_java" = "xyes"
1930 if test -d "$with_java_home"
1932 AC_MSG_CHECKING([for jni.h])
1933 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1934 if test "x$TMPDIR" != "x"
1936 AC_MSG_RESULT([found in $TMPDIR])
1937 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1939 AC_MSG_RESULT([not found])
1942 AC_MSG_CHECKING([for jni_md.h])
1943 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1944 if test "x$TMPDIR" != "x"
1946 AC_MSG_RESULT([found in $TMPDIR])
1947 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1949 AC_MSG_RESULT([not found])
1952 AC_MSG_CHECKING([for libjvm.so])
1953 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1954 if test "x$TMPDIR" != "x"
1956 AC_MSG_RESULT([found in $TMPDIR])
1957 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1959 AC_MSG_RESULT([not found])
1962 if test "x$JAVAC" = "x"
1964 AC_MSG_CHECKING([for javac])
1965 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1966 if test "x$TMPDIR" != "x"
1969 AC_MSG_RESULT([$JAVAC])
1971 AC_MSG_RESULT([not found])
1974 if test "x$JAR" = "x"
1976 AC_MSG_CHECKING([for jar])
1977 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1978 if test "x$TMPDIR" != "x"
1981 AC_MSG_RESULT([$JAR])
1983 AC_MSG_RESULT([not found])
1986 else if test "x$with_java_home" != "x"
1988 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1992 if test "x$JAVA_CPPFLAGS" != "x"
1994 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1996 if test "x$JAVA_CFLAGS" != "x"
1998 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2000 if test "x$JAVA_LDFLAGS" != "x"
2002 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2004 if test "x$JAVAC" = "x"
2006 with_javac_path="$PATH"
2007 if test "x$with_java_home" != "x"
2009 with_javac_path="$with_java_home:with_javac_path"
2010 if test -d "$with_java_home/bin"
2012 with_javac_path="$with_java_home/bin:with_javac_path"
2016 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2018 if test "x$JAVAC" = "x"
2020 with_java="no (javac not found)"
2022 if test "x$JAR" = "x"
2024 with_jar_path="$PATH"
2025 if test "x$with_java_home" != "x"
2027 with_jar_path="$with_java_home:$with_jar_path"
2028 if test -d "$with_java_home/bin"
2030 with_jar_path="$with_java_home/bin:$with_jar_path"
2034 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2036 if test "x$JAR" = "x"
2038 with_java="no (jar not found)"
2041 SAVE_CPPFLAGS="$CPPFLAGS"
2042 SAVE_CFLAGS="$CFLAGS"
2043 SAVE_LDFLAGS="$LDFLAGS"
2044 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2045 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2046 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2048 if test "x$with_java" = "xyes"
2050 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2052 if test "x$with_java" = "xyes"
2054 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2056 [with_java="no (libjvm not found)"],
2059 if test "x$with_java" = "xyes"
2061 JAVA_LIBS="$JAVA_LIBS -ljvm"
2062 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2065 CPPFLAGS="$SAVE_CPPFLAGS"
2066 CFLAGS="$SAVE_CFLAGS"
2067 LDFLAGS="$SAVE_LDFLAGS"
2069 AC_SUBST(JAVA_CPPFLAGS)
2070 AC_SUBST(JAVA_CFLAGS)
2071 AC_SUBST(JAVA_LDFLAGS)
2073 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2076 # --with-libmemcached {{{
2077 with_libmemcached_cppflags=""
2078 with_libmemcached_ldflags=""
2079 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2081 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2083 with_libmemcached_cppflags="-I$withval/include"
2084 with_libmemcached_ldflags="-L$withval/lib"
2085 with_libmemcached="yes"
2087 with_libmemcached="$withval"
2091 with_libmemcached="yes"
2093 if test "x$with_libmemcached" = "xyes"
2095 SAVE_CPPFLAGS="$CPPFLAGS"
2096 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2098 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2100 CPPFLAGS="$SAVE_CPPFLAGS"
2102 if test "x$with_libmemcached" = "xyes"
2104 SAVE_CPPFLAGS="$CPPFLAGS"
2105 SAVE_LDFLAGS="$LDFLAGS"
2106 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2107 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2109 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2111 CPPFLAGS="$SAVE_CPPFLAGS"
2112 LDFLAGS="$SAVE_LDFLAGS"
2114 if test "x$with_libmemcached" = "xyes"
2116 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2117 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2118 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2119 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2120 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2121 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2122 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2124 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2127 # --with-libmodbus {{{
2128 with_libmodbus_config=""
2129 with_libmodbus_cflags=""
2130 with_libmodbus_libs=""
2131 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2133 if test "x$withval" = "xno"
2136 else if test "x$withval" = "xyes"
2138 with_libmodbus="use_pkgconfig"
2139 else if test -d "$with_libmodbus/lib"
2141 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2142 with_libmodbus_cflags="-I$withval/include"
2143 with_libmodbus_libs="-L$withval/lib -lmodbus"
2144 with_libmodbus="yes"
2147 [with_libmodbus="use_pkgconfig"])
2149 # configure using pkg-config
2150 if test "x$with_libmodbus" = "xuse_pkgconfig"
2152 if test "x$PKG_CONFIG" = "x"
2154 with_libmodbus="no (Don't have pkg-config)"
2157 if test "x$with_libmodbus" = "xuse_pkgconfig"
2159 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
2160 $PKG_CONFIG --exists 'modbus' 2>/dev/null
2163 with_libmodbus="no (pkg-config doesn't know modbus)"
2166 if test "x$with_libmodbus" = "xuse_pkgconfig"
2168 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
2171 with_libmodbus="no ($PKG_CONFIG failed)"
2173 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
2176 with_libmodbus="no ($PKG_CONFIG failed)"
2179 if test "x$with_libmodbus" = "xuse_pkgconfig"
2181 with_libmodbus="yes"
2184 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2185 # the actual checks.
2186 if test "x$with_libmodbus" = "xyes"
2188 SAVE_CPPFLAGS="$CPPFLAGS"
2189 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2191 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2193 CPPFLAGS="$SAVE_CPPFLAGS"
2195 if test "x$with_libmodbus" = "xyes"
2197 SAVE_CPPFLAGS="$CPPFLAGS"
2198 SAVE_LDFLAGS="$LDFLAGS"
2200 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2201 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2203 AC_CHECK_LIB(modbus, modbus_connect,
2204 [with_libmodbus="yes"],
2205 [with_libmodbus="no (symbol modbus_connect not found)"])
2207 CPPFLAGS="$SAVE_CPPFLAGS"
2208 LDFLAGS="$SAVE_LDFLAGS"
2210 if test "x$with_libmodbus" = "xyes"
2212 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2213 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2214 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2215 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2219 # --with-libmysql {{{
2220 with_mysql_config="mysql_config"
2221 with_mysql_cflags=""
2223 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2225 if test "x$withval" = "xno"
2228 else if test "x$withval" = "xyes"
2232 if test -f "$withval" && test -x "$withval";
2234 with_mysql_config="$withval"
2235 else if test -x "$withval/bin/mysql_config"
2237 with_mysql_config="$withval/bin/mysql_config"
2245 if test "x$with_libmysql" = "xyes"
2247 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2248 mysql_config_status=$?
2250 if test $mysql_config_status -ne 0
2252 with_libmysql="no ($with_mysql_config failed)"
2254 SAVE_CPPFLAGS="$CPPFLAGS"
2255 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2258 have_mysql_mysql_h="no"
2259 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2261 if test "x$have_mysql_h" = "xno"
2263 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2266 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2268 with_libmysql="no (mysql.h not found)"
2271 CPPFLAGS="$SAVE_CPPFLAGS"
2274 if test "x$with_libmysql" = "xyes"
2276 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2277 mysql_config_status=$?
2279 if test $mysql_config_status -ne 0
2281 with_libmysql="no ($with_mysql_config failed)"
2283 AC_CHECK_LIB(mysqlclient, mysql_init,
2284 [with_libmysql="yes"],
2285 [with_libmysql="no (symbol 'mysql_init' not found)"],
2288 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2289 [with_libmysql="yes"],
2290 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2294 if test "x$with_libmysql" = "xyes"
2296 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2297 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2298 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2299 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2301 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2304 # --with-libnetlink {{{
2305 with_libnetlink_cflags=""
2306 with_libnetlink_libs="-lnetlink"
2307 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2309 echo "libnetlink: withval = $withval"
2310 if test "x$withval" = "xyes"
2312 with_libnetlink="yes"
2313 else if test "x$withval" = "xno"
2315 with_libnetlink="no"
2317 if test -d "$withval/include"
2319 with_libnetlink_cflags="-I$withval/include"
2320 with_libnetlink_libs="-L$withval/lib -lnetlink"
2321 with_libnetlink="yes"
2323 AC_MSG_ERROR("no such directory: $withval/include")
2328 if test "x$ac_system" = "xLinux"
2330 with_libnetlink="yes"
2332 with_libnetlink="no (Linux only library)"
2335 if test "x$with_libnetlink" = "xyes"
2337 SAVE_CFLAGS="$CFLAGS"
2338 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2340 with_libnetlink="no (libnetlink.h not found)"
2342 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2344 with_libnetlink="yes"
2348 #include <sys/types.h>
2349 #include <asm/types.h>
2350 #include <sys/socket.h>
2351 #include <linux/netlink.h>
2352 #include <linux/rtnetlink.h>])
2353 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2355 #include <sys/types.h>
2356 #include <asm/types.h>
2357 #include <sys/socket.h>])
2361 #include <sys/types.h>
2362 #include <asm/types.h>
2363 #include <sys/socket.h>
2364 #include <linux/netlink.h>
2365 #include <linux/rtnetlink.h>
2369 int retval = TCA_STATS2;
2372 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2377 #include <sys/types.h>
2378 #include <asm/types.h>
2379 #include <sys/socket.h>
2380 #include <linux/netlink.h>
2381 #include <linux/rtnetlink.h>
2385 int retval = TCA_STATS;
2388 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2391 CFLAGS="$SAVE_CFLAGS"
2393 if test "x$with_libnetlink" = "xyes"
2395 AC_CHECK_LIB(netlink, rtnl_open,
2396 [with_libnetlink="yes"],
2397 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2398 [$with_libnetlink_libs])
2400 if test "x$with_libnetlink" = "xyes"
2402 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2403 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2404 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2405 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2407 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2410 # --with-libnetapp {{{
2411 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2412 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2413 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2414 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2415 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2416 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2417 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2419 if test -d "$withval"
2421 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2422 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2423 with_libnetapp="yes"
2425 with_libnetapp="$withval"
2429 with_libnetapp="yes"
2432 SAVE_CPPFLAGS="$CPPFLAGS"
2433 SAVE_LDFLAGS="$LDFLAGS"
2434 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2435 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2437 if test "x$with_libnetapp" = "xyes"
2439 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2441 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2443 AC_CHECK_HEADERS(netapp_api.h,
2444 [with_libnetapp="yes"],
2445 [with_libnetapp="no (netapp_api.h not found)"])
2448 if test "x$with_libnetapp" = "xyes"
2450 if test "x$LIBNETAPP_LDFLAGS" != "x"
2452 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2455 if test "x$LIBNETAPP_LIBS" = "x"
2457 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2459 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2461 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2462 [with_libnetapp="yes"],
2463 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2465 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2468 CPPFLAGS="$SAVE_CPPFLAGS"
2469 LDFLAGS="$SAVE_LDFLAGS"
2471 if test "x$with_libnetapp" = "xyes"
2473 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2476 AC_SUBST(LIBNETAPP_CPPFLAGS)
2477 AC_SUBST(LIBNETAPP_LDFLAGS)
2478 AC_SUBST(LIBNETAPP_LIBS)
2479 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2482 # --with-libnetsnmp {{{
2483 with_snmp_config="net-snmp-config"
2486 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2488 if test "x$withval" = "xno"
2490 with_libnetsnmp="no"
2491 else if test "x$withval" = "xyes"
2493 with_libnetsnmp="yes"
2495 if test -x "$withval"
2497 with_snmp_config="$withval"
2498 with_libnetsnmp="yes"
2500 with_snmp_config="$withval/bin/net-snmp-config"
2501 with_libnetsnmp="yes"
2505 [with_libnetsnmp="yes"])
2506 if test "x$with_libnetsnmp" = "xyes"
2508 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2509 snmp_config_status=$?
2511 if test $snmp_config_status -ne 0
2513 with_libnetsnmp="no ($with_snmp_config failed)"
2515 SAVE_CPPFLAGS="$CPPFLAGS"
2516 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2518 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2520 CPPFLAGS="$SAVE_CPPFLAGS"
2523 if test "x$with_libnetsnmp" = "xyes"
2525 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2526 snmp_config_status=$?
2528 if test $snmp_config_status -ne 0
2530 with_libnetsnmp="no ($with_snmp_config failed)"
2532 AC_CHECK_LIB(netsnmp, init_snmp,
2533 [with_libnetsnmp="yes"],
2534 [with_libnetsnmp="no (libnetsnmp not found)"],
2538 if test "x$with_libnetsnmp" = "xyes"
2540 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2541 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2542 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2543 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2545 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2548 # --with-liboconfig {{{
2549 with_own_liboconfig="no"
2550 liboconfig_LDFLAGS="$LDFLAGS"
2551 liboconfig_CPPFLAGS="$CPPFLAGS"
2552 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2554 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2556 if test -d "$withval/lib"
2558 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2560 if test -d "$withval/include"
2562 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2565 if test "x$withval" = "xno"
2567 AC_MSG_ERROR("liboconfig is required")
2571 with_liboconfig="yes"
2574 save_LDFLAGS="$LDFLAGS"
2575 save_CPPFLAGS="$CPPFLAGS"
2576 LDFLAGS="$liboconfig_LDFLAGS"
2577 CPPFLAGS="$liboconfig_CPPFLAGS"
2578 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2580 with_liboconfig="yes"
2581 with_own_liboconfig="no"
2584 with_liboconfig="yes"
2585 with_own_liboconfig="yes"
2586 LDFLAGS="$save_LDFLAGS"
2587 CPPFLAGS="$save_CPPFLAGS"
2590 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2591 if test "x$with_own_liboconfig" = "xyes"
2593 with_liboconfig="yes (shipped version)"
2597 # --with-liboping {{{
2598 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2600 if test "x$withval" = "xyes"
2603 else if test "x$withval" = "xno"
2608 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2609 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2612 [with_liboping="yes"])
2614 SAVE_CPPFLAGS="$CPPFLAGS"
2615 SAVE_LDFLAGS="$LDFLAGS"
2617 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2618 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2620 if test "x$with_liboping" = "xyes"
2622 if test "x$LIBOPING_CPPFLAGS" != "x"
2624 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2626 AC_CHECK_HEADERS(oping.h,
2627 [with_liboping="yes"],
2628 [with_liboping="no (oping.h not found)"])
2630 if test "x$with_liboping" = "xyes"
2632 if test "x$LIBOPING_LDFLAGS" != "x"
2634 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2636 AC_CHECK_LIB(oping, ping_construct,
2637 [with_liboping="yes"],
2638 [with_liboping="no (symbol 'ping_construct' not found)"])
2641 CPPFLAGS="$SAVE_CPPFLAGS"
2642 LDFLAGS="$SAVE_LDFLAGS"
2644 if test "x$with_liboping" = "xyes"
2646 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2647 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2648 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2649 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2651 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2655 with_oracle_cppflags=""
2657 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2659 if test "x$withval" = "xyes"
2661 if test "x$ORACLE_HOME" = "x"
2663 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2666 else if test "x$withval" = "xno"
2671 ORACLE_HOME="$withval"
2675 if test "x$ORACLE_HOME" = "x"
2677 with_oracle="no (ORACLE_HOME is not set)"
2682 if test "x$ORACLE_HOME" != "x"
2684 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2686 if test -e "$ORACLE_HOME/lib/ldflags"
2688 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2690 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2691 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2693 if test "x$with_oracle" = "xyes"
2695 SAVE_CPPFLAGS="$CPPFLAGS"
2696 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2698 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2700 CPPFLAGS="$SAVE_CPPFLAGS"
2702 if test "x$with_oracle" = "xyes"
2704 SAVE_CPPFLAGS="$CPPFLAGS"
2705 SAVE_LDFLAGS="$LDFLAGS"
2706 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2707 LDFLAGS="$LDFLAGS $with_oracle_libs"
2709 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2711 CPPFLAGS="$SAVE_CPPFLAGS"
2712 LDFLAGS="$SAVE_LDFLAGS"
2714 if test "x$with_oracle" = "xyes"
2716 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2717 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2718 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2719 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2723 # --with-libowcapi {{{
2724 with_libowcapi_cppflags=""
2725 with_libowcapi_libs="-lowcapi"
2726 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2728 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2730 with_libowcapi_cppflags="-I$withval/include"
2731 with_libowcapi_libs="-L$withval/lib -lowcapi"
2732 with_libowcapi="yes"
2734 with_libowcapi="$withval"
2738 with_libowcapi="yes"
2740 if test "x$with_libowcapi" = "xyes"
2742 SAVE_CPPFLAGS="$CPPFLAGS"
2743 CPPFLAGS="$with_libowcapi_cppflags"
2745 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2747 CPPFLAGS="$SAVE_CPPFLAGS"
2749 if test "x$with_libowcapi" = "xyes"
2751 SAVE_LDFLAGS="$LDFLAGS"
2752 SAVE_CPPFLAGS="$CPPFLAGS"
2753 LDFLAGS="$with_libowcapi_libs"
2754 CPPFLAGS="$with_libowcapi_cppflags"
2756 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2758 LDFLAGS="$SAVE_LDFLAGS"
2759 CPPFLAGS="$SAVE_CPPFLAGS"
2761 if test "x$with_libowcapi" = "xyes"
2763 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2764 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2765 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2766 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2770 # --with-libpcap {{{
2771 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2773 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2775 LDFLAGS="$LDFLAGS -L$withval/lib"
2776 CPPFLAGS="$CPPFLAGS -I$withval/include"
2779 with_libpcap="$withval"
2785 if test "x$with_libpcap" = "xyes"
2787 AC_CHECK_LIB(pcap, pcap_open_live,
2789 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2790 ], [with_libpcap="no (libpcap not found)"])
2792 if test "x$with_libpcap" = "xyes"
2794 AC_CHECK_HEADERS(pcap.h,,
2795 [with_libpcap="no (pcap.h not found)"])
2797 if test "x$with_libpcap" = "xyes"
2799 AC_CHECK_HEADERS(pcap-bpf.h,,
2800 [with_libpcap="no (pcap-bpf.h not found)"])
2802 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2805 # --with-libperl {{{
2806 perl_interpreter="perl"
2807 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2809 if test -x "$withval"
2811 perl_interpreter="$withval"
2813 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2815 LDFLAGS="$LDFLAGS -L$withval/lib"
2816 CPPFLAGS="$CPPFLAGS -I$withval/include"
2817 perl_interpreter="$withval/bin/perl"
2820 with_libperl="$withval"
2827 AC_MSG_CHECKING([for perl])
2828 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2829 if test -x "$perl_interpreter"
2831 AC_MSG_RESULT([yes ($perl_interpreter)])
2837 AC_SUBST(PERL, "$perl_interpreter")
2839 if test "x$with_libperl" = "xyes" \
2840 && test -n "$perl_interpreter"
2842 SAVE_CFLAGS="$CFLAGS"
2843 SAVE_LDFLAGS="$LDFLAGS"
2844 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2845 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2846 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2847 CFLAGS="$CFLAGS $PERL_CFLAGS"
2848 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2850 AC_CACHE_CHECK([for libperl],
2851 [c_cv_have_libperl],
2855 #define PERL_NO_GET_CONTEXT
2862 load_module (PERL_LOADMOD_NOIMPORT,
2863 newSVpv ("Collectd::Plugin::FooBar", 24),
2866 [c_cv_have_libperl="yes"],
2867 [c_cv_have_libperl="no"]
2871 if test "x$c_cv_have_libperl" = "xyes"
2873 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2874 AC_SUBST(PERL_CFLAGS)
2875 AC_SUBST(PERL_LDFLAGS)
2880 CFLAGS="$SAVE_CFLAGS"
2881 LDFLAGS="$SAVE_LDFLAGS"
2882 else if test -z "$perl_interpreter"; then
2883 with_libperl="no (no perl interpreter found)"
2884 c_cv_have_libperl="no"
2886 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2888 if test "x$with_libperl" = "xyes"
2890 SAVE_CFLAGS="$CFLAGS"
2891 SAVE_LDFLAGS="$LDFLAGS"
2892 CFLAGS="$CFLAGS $PERL_CFLAGS"
2893 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2895 AC_CACHE_CHECK([if perl supports ithreads],
2896 [c_cv_have_perl_ithreads],
2904 #if !defined(USE_ITHREADS)
2905 # error "Perl does not support ithreads!"
2906 #endif /* !defined(USE_ITHREADS) */
2909 [c_cv_have_perl_ithreads="yes"],
2910 [c_cv_have_perl_ithreads="no"]
2914 if test "x$c_cv_have_perl_ithreads" = "xyes"
2916 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2919 CFLAGS="$SAVE_CFLAGS"
2920 LDFLAGS="$SAVE_LDFLAGS"
2923 if test "x$with_libperl" = "xyes"
2925 SAVE_CFLAGS="$CFLAGS"
2926 SAVE_LDFLAGS="$LDFLAGS"
2927 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2928 # (see issues #41 and #42)
2929 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2930 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2932 AC_CACHE_CHECK([for broken Perl_load_module()],
2933 [c_cv_have_broken_perl_load_module],
2937 #define PERL_NO_GET_CONTEXT
2944 load_module (PERL_LOADMOD_NOIMPORT,
2945 newSVpv ("Collectd::Plugin::FooBar", 24),
2948 [c_cv_have_broken_perl_load_module="no"],
2949 [c_cv_have_broken_perl_load_module="yes"]
2953 CFLAGS="$SAVE_CFLAGS"
2954 LDFLAGS="$SAVE_LDFLAGS"
2956 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2957 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2959 if test "x$with_libperl" = "xyes"
2961 SAVE_CFLAGS="$CFLAGS"
2962 SAVE_LDFLAGS="$LDFLAGS"
2963 CFLAGS="$CFLAGS $PERL_CFLAGS"
2964 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2967 [struct mgvtbl.svt_local],
2968 [have_struct_mgvtbl_svt_local="yes"],
2969 [have_struct_mgvtbl_svt_local="no"],
2976 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2978 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2979 [Define if Perl's struct mgvtbl has member svt_local.])
2982 CFLAGS="$SAVE_CFLAGS"
2983 LDFLAGS="$SAVE_LDFLAGS"
2988 with_pg_config="pg_config"
2989 with_libpq_includedir=""
2990 with_libpq_libdir=""
2991 with_libpq_cppflags=""
2992 with_libpq_ldflags=""
2993 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2996 if test "x$withval" = "xno"
2999 else if test "x$withval" = "xyes"
3003 if test -f "$withval" && test -x "$withval";
3005 with_pg_config="$withval"
3006 else if test -x "$withval/bin/pg_config"
3008 with_pg_config="$withval/bin/pg_config"
3016 if test "x$with_libpq" = "xyes"
3018 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3021 if test $pg_config_status -eq 0
3023 if test -n "$with_libpq_includedir"; then
3024 for dir in $with_libpq_includedir; do
3025 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3029 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3032 SAVE_CPPFLAGS="$CPPFLAGS"
3033 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3035 AC_CHECK_HEADERS(libpq-fe.h, [],
3036 [with_libpq="no (libpq-fe.h not found)"], [])
3038 CPPFLAGS="$SAVE_CPPFLAGS"
3040 if test "x$with_libpq" = "xyes"
3042 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3045 if test $pg_config_status -eq 0
3047 if test -n "$with_libpq_libdir"; then
3048 for dir in $with_libpq_libdir; do
3049 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3053 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3056 SAVE_LDFLAGS="$LDFLAGS"
3057 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3059 AC_CHECK_LIB(pq, PQconnectdb,
3061 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3063 AC_CHECK_LIB(pq, PQserverVersion,
3065 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3067 LDFLAGS="$SAVE_LDFLAGS"
3069 if test "x$with_libpq" = "xyes"
3071 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3072 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3073 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3074 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3076 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3079 # --with-libpthread {{{
3080 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3081 [ if test "x$withval" != "xno" \
3082 && test "x$withval" != "xyes"
3084 LDFLAGS="$LDFLAGS -L$withval/lib"
3085 CPPFLAGS="$CPPFLAGS -I$withval/include"
3086 with_libpthread="yes"
3088 if test "x$withval" = "xno"
3090 with_libpthread="no (disabled)"
3093 ], [with_libpthread="yes"])
3094 if test "x$with_libpthread" = "xyes"
3096 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3099 if test "x$with_libpthread" = "xyes"
3101 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3103 if test "x$with_libpthread" = "xyes"
3109 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3110 [Wether or not to use pthread (POSIX threads) library])
3111 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3116 with_python_path="$PATH"
3117 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3119 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3121 with_python="$withval"
3122 else if test -x "$withval"
3124 with_python_prog="$withval"
3125 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3127 else if test -d "$withval"
3129 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3132 AC_MSG_WARN([Argument not recognized: $withval])
3134 ], [with_python="yes"])
3137 SAVE_CPPFLAGS="$CPPFLAGS"
3138 SAVE_LDFLAGS="$LDFLAGS"
3141 PATH="$with_python_path"
3143 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3145 AC_MSG_CHECKING([for python])
3146 with_python_prog="`which python 2>/dev/null`"
3147 if test "x$with_python_prog" = "x"
3149 AC_MSG_RESULT([not found])
3150 with_python="no (interpreter not found)"
3152 AC_MSG_RESULT([$with_python_prog])
3156 if test "x$with_python" = "xyes"
3158 AC_MSG_CHECKING([for Python CPPFLAGS])
3159 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3160 python_config_status=$?
3162 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3164 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3167 AC_MSG_RESULT([$python_include_path])
3171 if test "x$with_python" = "xyes"
3173 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3174 AC_CHECK_HEADERS(Python.h,
3175 [with_python="yes"],
3176 [with_python="no ('Python.h' not found)"])
3179 if test "x$with_python" = "xyes"
3181 AC_MSG_CHECKING([for Python LDFLAGS])
3182 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`
3183 python_config_status=$?
3185 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3187 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3190 AC_MSG_RESULT([$python_library_path])
3194 if test "x$with_python" = "xyes"
3196 AC_MSG_CHECKING([for Python LIBS])
3197 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`
3198 python_config_status=$?
3200 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3202 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3205 AC_MSG_RESULT([$python_library_flags])
3209 if test "x$with_python" = "xyes"
3211 LDFLAGS="-L$python_library_path $LDFLAGS"
3212 LIBS="$python_library_flags $LIBS"
3214 AC_CHECK_FUNC(PyObject_CallFunction,
3215 [with_python="yes"],
3216 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3220 CPPFLAGS="$SAVE_CPPFLAGS"
3221 LDFLAGS="$SAVE_LDFLAGS"
3224 if test "x$with_python" = "xyes"
3226 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3227 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3228 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3229 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3230 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3231 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3235 # --with-librabbitmq {{{
3236 with_librabbitmq_cppflags=""
3237 with_librabbitmq_ldflags=""
3238 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3240 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3242 with_librabbitmq_cppflags="-I$withval/include"
3243 with_librabbitmq_ldflags="-L$withval/lib"
3244 with_librabbitmq="yes"
3246 with_librabbitmq="$withval"
3250 with_librabbitmq="yes"
3252 SAVE_CPPFLAGS="$CPPFLAGS"
3253 SAVE_LDFLAGS="$LDFLAGS"
3254 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3255 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3256 if test "x$with_librabbitmq" = "xyes"
3258 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3260 if test "x$with_librabbitmq" = "xyes"
3262 # librabbitmq up to version 0.9.1 provides "library_errno", later
3263 # versions use "library_error". The library does not provide a version
3264 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3265 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3268 # include <stdlib.h>
3274 # include <stdint.h>
3277 # include <inttypes.h>
3282 if test "x$with_librabbitmq" = "xyes"
3284 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3286 if test "x$with_librabbitmq" = "xyes"
3288 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3289 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3290 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3291 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3292 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3293 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3294 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3296 CPPFLAGS="$SAVE_CPPFLAGS"
3297 LDFLAGS="$SAVE_LDFLAGS"
3298 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3301 # --with-librouteros {{{
3302 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3304 if test "x$withval" = "xyes"
3306 with_librouteros="yes"
3307 else if test "x$withval" = "xno"
3309 with_librouteros="no"
3311 with_librouteros="yes"
3312 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3313 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3316 [with_librouteros="yes"])
3318 SAVE_CPPFLAGS="$CPPFLAGS"
3319 SAVE_LDFLAGS="$LDFLAGS"
3321 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3322 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3324 if test "x$with_librouteros" = "xyes"
3326 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3328 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3330 AC_CHECK_HEADERS(routeros_api.h,
3331 [with_librouteros="yes"],
3332 [with_librouteros="no (routeros_api.h not found)"])
3334 if test "x$with_librouteros" = "xyes"
3336 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3338 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3340 AC_CHECK_LIB(routeros, ros_interface,
3341 [with_librouteros="yes"],
3342 [with_librouteros="no (symbol 'ros_interface' not found)"])
3345 CPPFLAGS="$SAVE_CPPFLAGS"
3346 LDFLAGS="$SAVE_LDFLAGS"
3348 if test "x$with_librouteros" = "xyes"
3350 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3351 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3352 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3353 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3355 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3359 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3362 librrd_threadsafe="yes"
3363 librrd_rrdc_update="no"
3364 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3365 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3367 librrd_cflags="-I$withval/include"
3368 librrd_ldflags="-L$withval/lib"
3371 with_librrd="$withval"
3373 ], [with_librrd="yes"])
3374 if test "x$with_librrd" = "xyes"
3376 SAVE_CPPFLAGS="$CPPFLAGS"
3377 SAVE_LDFLAGS="$LDFLAGS"
3379 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3380 LDFLAGS="$LDFLAGS $librrd_ldflags"
3382 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3384 CPPFLAGS="$SAVE_CPPFLAGS"
3385 LDFLAGS="$SAVE_LDFLAGS"
3387 if test "x$with_librrd" = "xyes"
3389 SAVE_CPPFLAGS="$CPPFLAGS"
3390 SAVE_LDFLAGS="$LDFLAGS"
3392 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3393 LDFLAGS="$LDFLAGS $librrd_ldflags"
3395 AC_CHECK_LIB(rrd_th, rrd_update_r,
3397 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3399 [librrd_threadsafe="no"
3400 AC_CHECK_LIB(rrd, rrd_update,
3402 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3404 [with_librrd="no (symbol 'rrd_update' not found)"],
3409 if test "x$librrd_threadsafe" = "xyes"
3411 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3413 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3416 CPPFLAGS="$SAVE_CPPFLAGS"
3417 LDFLAGS="$SAVE_LDFLAGS"
3419 if test "x$with_librrd" = "xyes"
3421 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3422 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3423 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3424 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3426 if test "x$librrd_threadsafe" = "xyes"
3428 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3432 # --with-libsensors {{{
3433 with_sensors_cflags=""
3434 with_sensors_ldflags=""
3435 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3437 if test "x$withval" = "xno"
3439 with_libsensors="no"
3441 with_libsensors="yes"
3442 if test "x$withval" != "xyes"
3444 with_sensors_cflags="-I$withval/include"
3445 with_sensors_ldflags="-L$withval/lib"
3446 with_libsensors="yes"
3451 if test "x$ac_system" = "xLinux"
3453 with_libsensors="yes"
3455 with_libsensors="no (Linux only library)"
3458 if test "x$with_libsensors" = "xyes"
3460 SAVE_CPPFLAGS="$CPPFLAGS"
3461 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3463 # AC_CHECK_HEADERS(sensors/sensors.h,
3465 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3467 # [with_libsensors="no (sensors/sensors.h not found)"])
3468 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3470 CPPFLAGS="$SAVE_CPPFLAGS"
3472 if test "x$with_libsensors" = "xyes"
3474 SAVE_CPPFLAGS="$CPPFLAGS"
3475 SAVE_LDFLAGS="$LDFLAGS"
3476 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3477 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3479 AC_CHECK_LIB(sensors, sensors_init,
3481 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3483 [with_libsensors="no (libsensors not found)"])
3485 CPPFLAGS="$SAVE_CPPFLAGS"
3486 LDFLAGS="$SAVE_LDFLAGS"
3488 if test "x$with_libsensors" = "xyes"
3490 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3491 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3492 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3493 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3495 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3498 # --with-libstatgrab {{{
3499 with_libstatgrab_cflags=""
3500 with_libstatgrab_ldflags=""
3501 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3503 if test "x$withval" != "xno" \
3504 && test "x$withval" != "xyes"
3506 with_libstatgrab_cflags="-I$withval/include"
3507 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3508 with_libstatgrab="yes"
3509 with_libstatgrab_pkg_config="no"
3511 with_libstatgrab="$withval"
3512 with_libstatgrab_pkg_config="yes"
3516 with_libstatgrab="yes"
3517 with_libstatgrab_pkg_config="yes"
3520 if test "x$with_libstatgrab" = "xyes" \
3521 && test "x$with_libstatgrab_pkg_config" = "xyes"
3523 if test "x$PKG_CONFIG" != "x"
3525 AC_MSG_CHECKING([pkg-config for libstatgrab])
3527 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3530 with_libstatgrab_pkg_config="no"
3531 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3532 temp_result="not found"
3534 AC_MSG_RESULT([$temp_result])
3536 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3537 with_libstatgrab_pkg_config="no"
3538 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3542 if test "x$with_libstatgrab" = "xyes" \
3543 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3544 && test "x$with_libstatgrab_cflags" = "x"
3546 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3547 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3550 with_libstatgrab_cflags="$temp_result"
3552 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3553 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3555 AC_MSG_RESULT([$temp_result])
3558 if test "x$with_libstatgrab" = "xyes" \
3559 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3560 && test "x$with_libstatgrab_ldflags" = "x"
3562 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3563 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3566 with_libstatgrab_ldflags="$temp_result"
3568 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3569 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3571 AC_MSG_RESULT([$temp_result])
3574 if test "x$with_libstatgrab" = "xyes"
3576 SAVE_CPPFLAGS="$CPPFLAGS"
3577 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3579 AC_CHECK_HEADERS(statgrab.h,
3580 [with_libstatgrab="yes"],
3581 [with_libstatgrab="no (statgrab.h not found)"])
3583 CPPFLAGS="$SAVE_CPPFLAGS"
3586 if test "x$with_libstatgrab" = "xyes"
3588 SAVE_CFLAGS="$CFLAGS"
3589 SAVE_LDFLAGS="$LDFLAGS"
3591 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3592 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3594 AC_CHECK_LIB(statgrab, sg_init,
3595 [with_libstatgrab="yes"],
3596 [with_libstatgrab="no (symbol sg_init not found)"])
3598 CFLAGS="$SAVE_CFLAGS"
3599 LDFLAGS="$SAVE_LDFLAGS"
3602 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3603 if test "x$with_libstatgrab" = "xyes"
3605 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3606 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3607 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3608 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3609 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3613 # --with-libtokyotyrant {{{
3614 with_libtokyotyrant_cppflags=""
3615 with_libtokyotyrant_ldflags=""
3616 with_libtokyotyrant_libs=""
3617 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3619 if test "x$withval" = "xno"
3621 with_libtokyotyrant="no"
3622 else if test "x$withval" = "xyes"
3624 with_libtokyotyrant="yes"
3626 with_libtokyotyrant_cppflags="-I$withval/include"
3627 with_libtokyotyrant_ldflags="-L$withval/include"
3628 with_libtokyotyrant_libs="-ltokyotyrant"
3629 with_libtokyotyrant="yes"
3633 with_libtokyotyrant="yes"
3636 if test "x$with_libtokyotyrant" = "xyes"
3638 if $PKG_CONFIG --exists tokyotyrant
3640 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3641 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3642 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3646 SAVE_CPPFLAGS="$CPPFLAGS"
3647 SAVE_LDFLAGS="$LDFLAGS"
3648 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3649 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3651 if test "x$with_libtokyotyrant" = "xyes"
3653 AC_CHECK_HEADERS(tcrdb.h,
3655 AC_DEFINE(HAVE_TCRDB_H, 1,
3656 [Define to 1 if you have the <tcrdb.h> header file.])
3657 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3660 if test "x$with_libtokyotyrant" = "xyes"
3662 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3664 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3665 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3667 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3668 [$with_libtokyotyrant_libs])
3671 CPPFLAGS="$SAVE_CPPFLAGS"
3672 LDFLAGS="$SAVE_LDFLAGS"
3674 if test "x$with_libtokyotyrant" = "xyes"
3676 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3677 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3678 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3679 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3680 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3681 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3683 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3686 # --with-libupsclient {{{
3687 with_libupsclient_config=""
3688 with_libupsclient_cflags=""
3689 with_libupsclient_libs=""
3690 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3692 if test "x$withval" = "xno"
3694 with_libupsclient="no"
3695 else if test "x$withval" = "xyes"
3697 with_libupsclient="use_pkgconfig"
3699 if test -x "$withval"
3701 with_libupsclient_config="$withval"
3702 with_libupsclient="use_libupsclient_config"
3703 else if test -x "$withval/bin/libupsclient-config"
3705 with_libupsclient_config="$withval/bin/libupsclient-config"
3706 with_libupsclient="use_libupsclient_config"
3708 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3709 with_libupsclient_cflags="-I$withval/include"
3710 with_libupsclient_libs="-L$withval/lib -lupsclient"
3711 with_libupsclient="yes"
3715 [with_libupsclient="use_pkgconfig"])
3717 # configure using libupsclient-config
3718 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3720 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3721 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3724 with_libupsclient="no ($with_libupsclient_config failed)"
3726 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3729 with_libupsclient="no ($with_libupsclient_config failed)"
3732 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3734 with_libupsclient="yes"
3737 # configure using pkg-config
3738 if test "x$with_libupsclient" = "xuse_pkgconfig"
3740 if test "x$PKG_CONFIG" = "x"
3742 with_libupsclient="no (Don't have pkg-config)"
3745 if test "x$with_libupsclient" = "xuse_pkgconfig"
3747 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3748 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3751 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3754 if test "x$with_libupsclient" = "xuse_pkgconfig"
3756 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3759 with_libupsclient="no ($PKG_CONFIG failed)"
3761 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3764 with_libupsclient="no ($PKG_CONFIG failed)"
3767 if test "x$with_libupsclient" = "xuse_pkgconfig"
3769 with_libupsclient="yes"
3772 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3773 # the actual checks.
3774 if test "x$with_libupsclient" = "xyes"
3776 SAVE_CPPFLAGS="$CPPFLAGS"
3777 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3779 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3781 CPPFLAGS="$SAVE_CPPFLAGS"
3783 if test "x$with_libupsclient" = "xyes"
3785 SAVE_CPPFLAGS="$CPPFLAGS"
3786 SAVE_LDFLAGS="$LDFLAGS"
3788 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3789 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3791 AC_CHECK_LIB(upsclient, upscli_connect,
3792 [with_libupsclient="yes"],
3793 [with_libupsclient="no (symbol upscli_connect not found)"])
3795 CPPFLAGS="$SAVE_CPPFLAGS"
3796 LDFLAGS="$SAVE_LDFLAGS"
3798 if test "x$with_libupsclient" = "xyes"
3800 SAVE_CPPFLAGS="$CPPFLAGS"
3801 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3803 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3804 [#include <stdlib.h>
3806 #include <upsclient.h>])
3808 CPPFLAGS="$SAVE_CPPFLAGS"
3810 if test "x$with_libupsclient" = "xyes"
3812 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3813 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3814 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3815 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3819 # --with-libxmms {{{
3820 with_xmms_config="xmms-config"
3823 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3825 if test "x$withval" != "xno" \
3826 && test "x$withval" != "xyes"
3828 if test -f "$withval" && test -x "$withval";
3830 with_xmms_config="$withval"
3831 else if test -x "$withval/bin/xmms-config"
3833 with_xmms_config="$withval/bin/xmms-config"
3836 else if test "x$withval" = "xno"
3846 if test "x$with_libxmms" = "xyes"
3848 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3849 xmms_config_status=$?
3851 if test $xmms_config_status -ne 0
3856 if test "x$with_libxmms" = "xyes"
3858 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3859 xmms_config_status=$?
3861 if test $xmms_config_status -ne 0
3866 if test "x$with_libxmms" = "xyes"
3868 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3870 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3871 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3872 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3873 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3880 with_libxmms_numeric=0
3881 if test "x$with_libxmms" = "xyes"
3883 with_libxmms_numeric=1
3885 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3886 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3889 # --with-libyajl {{{
3890 with_libyajl_cppflags=""
3891 with_libyajl_ldflags=""
3892 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3894 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3896 with_libyajl_cppflags="-I$withval/include"
3897 with_libyajl_ldflags="-L$withval/lib"
3900 with_libyajl="$withval"
3906 if test "x$with_libyajl" = "xyes"
3908 SAVE_CPPFLAGS="$CPPFLAGS"
3909 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3911 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3912 AC_CHECK_HEADERS(yajl/yajl_version.h)
3914 CPPFLAGS="$SAVE_CPPFLAGS"
3916 if test "x$with_libyajl" = "xyes"
3918 SAVE_CPPFLAGS="$CPPFLAGS"
3919 SAVE_LDFLAGS="$LDFLAGS"
3920 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3921 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3923 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3925 CPPFLAGS="$SAVE_CPPFLAGS"
3926 LDFLAGS="$SAVE_LDFLAGS"
3928 if test "x$with_libyajl" = "xyes"
3930 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3931 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3932 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3933 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3934 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3935 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3936 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3938 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3941 # --with-libvarnish {{{
3942 with_libvarnish_cppflags=""
3943 with_libvarnish_cflags=""
3944 with_libvarnish_libs=""
3945 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
3947 if test "x$withval" = "xno"
3949 with_libvarnish="no"
3950 else if test "x$withval" = "xyes"
3952 with_libvarnish="use_pkgconfig"
3953 else if test -d "$with_libvarnish/lib"
3955 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
3956 with_libvarnish_cflags="-I$withval/include"
3957 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
3958 with_libvarnish="yes"
3961 [with_libvarnish="use_pkgconfig"])
3963 # configure using pkg-config
3964 if test "x$with_libvarnish" = "xuse_pkgconfig"
3966 if test "x$PKG_CONFIG" = "x"
3968 with_libvarnish="no (Don't have pkg-config)"
3971 if test "x$with_libvarnish" = "xuse_pkgconfig"
3973 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
3974 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
3977 with_libvarnish="no (pkg-config doesn't know varnishapi)"
3980 if test "x$with_libvarnish" = "xuse_pkgconfig"
3982 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
3985 with_libvarnish="no ($PKG_CONFIG failed)"
3987 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
3990 with_libvarnish="no ($PKG_CONFIG failed)"
3993 if test "x$with_libvarnish" = "xuse_pkgconfig"
3995 with_libvarnish="yes"
3998 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
3999 # the actual checks.
4000 if test "x$with_libvarnish" = "xyes"
4002 SAVE_CPPFLAGS="$CPPFLAGS"
4003 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4004 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4006 CPPFLAGS="$SAVE_CPPFLAGS"
4008 if test "x$with_libvarnish" = "xyes"
4010 SAVE_CPPFLAGS="$CPPFLAGS"
4011 #SAVE_LDFLAGS="$LDFLAGS"
4013 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4014 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4016 AC_CHECK_LIB(varnishapi, VSL_OpenStats,
4017 [with_libvarnish="yes"],
4018 [with_libvarnish="no (symbol VSL_OpenStats not found)"],
4019 [$with_libvarnish_libs])
4021 CPPFLAGS="$SAVE_CPPFLAGS"
4022 #LDFLAGS="$SAVE_LDFLAGS"
4024 if test "x$with_libvarnish" = "xyes"
4026 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4027 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4028 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4029 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4033 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4034 with_libxml2="no (pkg-config isn't available)"
4035 with_libxml2_cflags=""
4036 with_libxml2_ldflags=""
4037 with_libvirt="no (pkg-config isn't available)"
4038 with_libvirt_cflags=""
4039 with_libvirt_ldflags=""
4040 if test "x$PKG_CONFIG" != "x"
4042 pkg-config --exists 'libxml-2.0' 2>/dev/null
4047 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4050 pkg-config --exists libvirt 2>/dev/null
4055 with_libvirt="no (pkg-config doesn't know libvirt)"
4058 if test "x$with_libxml2" = "xyes"
4060 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4065 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4071 if test "x$with_libxml2" = "xyes"
4073 SAVE_CPPFLAGS="$CPPFLAGS"
4074 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4076 AC_CHECK_HEADERS(libxml/parser.h, [],
4077 [with_libxml2="no (libxml/parser.h not found)"])
4079 CPPFLAGS="$SAVE_CPPFLAGS"
4081 if test "x$with_libxml2" = "xyes"
4083 SAVE_CFLAGS="$CFLAGS"
4084 SAVE_LDFLAGS="$LDFLAGS"
4086 CFLAGS="$CFLAGS $with_libxml2_cflags"
4087 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4089 AC_CHECK_LIB(xml2, xmlXPathEval,
4090 [with_libxml2="yes"],
4091 [with_libxml2="no (symbol xmlXPathEval not found)"])
4093 CFLAGS="$SAVE_CFLAGS"
4094 LDFLAGS="$SAVE_LDFLAGS"
4096 dnl Add the right compiler flags and libraries.
4097 if test "x$with_libxml2" = "xyes"; then
4098 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4099 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4100 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4101 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4103 if test "x$with_libvirt" = "xyes"
4105 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4110 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4116 if test "x$with_libvirt" = "xyes"
4118 SAVE_CPPFLAGS="$CPPFLAGS"
4119 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4121 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4122 [with_libvirt="no (libvirt/libvirt.h not found)"])
4124 CPPFLAGS="$SAVE_CPPFLAGS"
4126 if test "x$with_libvirt" = "xyes"
4128 SAVE_CFLAGS="$CFLAGS"
4129 SAVE_LDFLAGS="$LDFLAGS"
4131 CFLAGS="$CFLAGS $with_libvirt_cflags"
4132 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4134 AC_CHECK_LIB(virt, virDomainBlockStats,
4135 [with_libvirt="yes"],
4136 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4138 CFLAGS="$SAVE_CFLAGS"
4139 LDFLAGS="$SAVE_LDFLAGS"
4141 dnl Add the right compiler flags and libraries.
4142 if test "x$with_libvirt" = "xyes"; then
4143 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4144 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4145 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4146 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4150 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4151 with_libopenipmipthread="yes"
4152 with_libopenipmipthread_cflags=""
4153 with_libopenipmipthread_libs=""
4155 AC_MSG_CHECKING([for pkg-config])
4157 if test "x$PKG_CONFIG" = "x"
4159 with_libopenipmipthread="no"
4162 temp_result="$PKG_CONFIG"
4164 AC_MSG_RESULT([$temp_result])
4166 if test "x$with_libopenipmipthread" = "xyes"
4168 AC_MSG_CHECKING([for libOpenIPMIpthread])
4169 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4172 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4174 AC_MSG_RESULT([$with_libopenipmipthread])
4177 if test "x$with_libopenipmipthread" = "xyes"
4179 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4180 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4183 with_libopenipmipthread_cflags="$temp_result"
4185 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4186 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4188 AC_MSG_RESULT([$temp_result])
4191 if test "x$with_libopenipmipthread" = "xyes"
4193 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4194 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4197 with_libopenipmipthread_ldflags="$temp_result"
4199 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4200 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4202 AC_MSG_RESULT([$temp_result])
4205 if test "x$with_libopenipmipthread" = "xyes"
4207 SAVE_CPPFLAGS="$CPPFLAGS"
4208 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4210 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4211 [with_libopenipmipthread="yes"],
4212 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4213 [#include <OpenIPMI/ipmiif.h>
4214 #include <OpenIPMI/ipmi_err.h>
4215 #include <OpenIPMI/ipmi_posix.h>
4216 #include <OpenIPMI/ipmi_conn.h>
4219 CPPFLAGS="$SAVE_CPPFLAGS"
4222 if test "x$with_libopenipmipthread" = "xyes"
4224 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4225 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4226 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4227 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4231 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4232 [with_libnotify="yes"],
4233 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4236 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4239 # Check for enabled/disabled features
4242 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4243 # ------------------------------------------------------------
4245 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4250 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4255 m4_define([EnDis],[disabled])dnl
4256 m4_define([YesNo],[no])dnl
4262 m4_define([EnDis],[enabled])dnl
4263 m4_define([YesNo],[yes])dnl
4266 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4270 m4_if([$3], [feature], [],
4274 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4280 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4282 enable_$1='[YesNo]'dnl
4284 if test "x$enable_$1" = "xno"
4288 if test "x$enable_$1" = "xyes"
4292 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4297 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4298 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4300 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4302 # AC_PLUGIN(name, default, info)
4303 # ------------------------------------------------------------
4310 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4312 if test "x$enableval" = "xyes"
4315 else if test "x$enableval" = "xforce"
4320 enable_plugin="no (disabled on command line)"
4324 if test "x$enable_all_plugins" = "xauto"
4326 if test "x$2" = "xyes"
4333 enable_plugin="$enable_all_plugins"
4336 if test "x$enable_plugin" = "xyes"
4338 if test "x$2" = "xyes" || test "x$force" = "xyes"
4340 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4341 if test "x$2" != "xyes"
4343 dependency_warning="yes"
4345 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4346 dependency_error="yes"
4347 enable_plugin="no (dependency error)"
4350 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4351 enable_$1="$enable_plugin"
4353 )# AC_PLUGIN(name, default, info)
4355 m4_divert_once([HELP_ENABLE], [
4356 collectd features:])
4357 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4358 AC_COLLECTD([debug], [enable], [feature], [debugging])
4359 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4360 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4362 dependency_warning="no"
4363 dependency_error="no"
4368 plugin_conntrack="no"
4369 plugin_contextswitch="no"
4372 plugin_curl_json="no"
4373 plugin_curl_xml="no"
4377 plugin_interface="no"
4384 plugin_multimeter="no"
4388 plugin_processes="no"
4389 plugin_protocols="no"
4393 plugin_tcpconns="no"
4400 plugin_wireless="no"
4404 if test "x$ac_system" = "xLinux"
4406 plugin_battery="yes"
4407 plugin_conntrack="yes"
4408 plugin_contextswitch="yes"
4410 plugin_cpufreq="yes"
4412 plugin_entropy="yes"
4413 plugin_interface="yes"
4418 plugin_fscache="yes"
4419 plugin_processes="yes"
4420 plugin_protocols="yes"
4423 plugin_tcpconns="yes"
4424 plugin_thermal="yes"
4427 plugin_vserver="yes"
4428 plugin_wireless="yes"
4430 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4436 if test "x$ac_system" = "xOpenBSD"
4438 plugin_tcpconns="yes"
4442 if test "x$with_libiokit" = "xyes"
4444 plugin_battery="yes"
4449 if test "x$with_perfstat" = "xyes"
4455 plugin_interface="yes"
4459 if test "x$with_procinfo" = "xyes"
4461 plugin_processes="yes"
4465 if test "x$with_kstat" = "xyes"
4468 plugin_zfs_arc="yes"
4471 if test "x$with_devinfo$with_kstat" = "xyesyes"
4475 plugin_interface="yes"
4481 if test "x$with_libstatgrab" = "xyes"
4485 plugin_interface="yes"
4492 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4495 if test "x$have_strptime" = "xyes"
4501 if test "x$with_libopenipmipthread" = "xyes"
4506 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4508 plugin_curl_json="yes"
4511 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4513 plugin_curl_xml="yes"
4516 if test "x$have_processor_info" = "xyes"
4520 if test "x$have_sysctl" = "xyes"
4525 if test "x$ac_system" = "xDarwin"
4530 if test "x$have_sysctlbyname" = "xyes"
4532 plugin_contextswitch="yes"
4535 plugin_tcpconns="yes"
4538 # Df plugin: Check if we know how to determine mount points first.
4539 #if test "x$have_listmntent" = "xyes"; then
4542 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4546 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4550 #if test "x$have_getmntent" = "xseq"
4554 if test "x$c_cv_have_one_getmntent" = "xyes"
4559 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4560 if test "x$plugin_df" = "xyes"
4563 if test "x$have_statfs" = "xyes"
4567 if test "x$have_statvfs" = "xyes"
4573 if test "x$have_getifaddrs" = "xyes"
4575 plugin_interface="yes"
4578 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4580 plugin_libvirt="yes"
4583 if test "x$have_getloadavg" = "xyes"
4588 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4593 # Mac OS X memory interface
4594 if test "x$have_host_statistics" = "xyes"
4599 if test "x$have_termios_h" = "xyes"
4601 plugin_multimeter="yes"
4605 if test "x$have_thread_info" = "xyes"
4607 plugin_processes="yes"
4610 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4612 plugin_processes="yes"
4615 if test "x$with_kvm_getswapinfo" = "xyes"
4620 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4625 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4627 plugin_tcpconns="yes"
4630 if test "x$have_getutent" = "xyes"
4634 if test "x$have_getutxent" = "xyes"
4639 m4_divert_once([HELP_ENABLE], [
4642 AC_ARG_ENABLE([all-plugins],
4643 AC_HELP_STRING([--enable-all-plugins],
4644 [enable all plugins (auto by def)]),
4646 if test "x$enableval" = "xyes"
4648 enable_all_plugins="yes"
4649 else if test "x$enableval" = "xauto"
4651 enable_all_plugins="auto"
4653 enable_all_plugins="no"
4656 [enable_all_plugins="auto"])
4658 m4_divert_once([HELP_ENABLE], [])
4660 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4661 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4662 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4663 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4664 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4665 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4666 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4667 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4668 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4669 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4670 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4671 AC_PLUGIN([csv], [yes], [CSV output plugin])
4672 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4673 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4674 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4675 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4676 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4677 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4678 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4679 AC_PLUGIN([email], [yes], [EMail statistics])
4680 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4681 AC_PLUGIN([exec], [yes], [Execution of external programs])
4682 AC_PLUGIN([filecount], [yes], [Count files in directories])
4683 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4684 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4685 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4686 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4687 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4688 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4689 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4690 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4691 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4692 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4693 AC_PLUGIN([load], [$plugin_load], [System load])
4694 AC_PLUGIN([logfile], [yes], [File logging plugin])
4695 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4696 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4697 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4698 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4699 AC_PLUGIN([match_regex], [yes], [The regex match])
4700 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4701 AC_PLUGIN([match_value], [yes], [The value match])
4702 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4703 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4704 AC_PLUGIN([memcached], [yes], [memcached statistics])
4705 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4706 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4707 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4708 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4709 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4710 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4711 AC_PLUGIN([network], [yes], [Network communication plugin])
4712 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4713 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4714 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4715 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4716 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4717 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4718 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4719 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4720 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4721 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4722 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4723 # FIXME: Check for libevent, too.
4724 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4725 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4726 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4727 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4728 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4729 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4730 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4731 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4732 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4733 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4734 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4735 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4736 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4737 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4738 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4739 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4740 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4741 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4742 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4743 AC_PLUGIN([target_notification], [yes], [The notification target])
4744 AC_PLUGIN([target_replace], [yes], [The replace target])
4745 AC_PLUGIN([target_scale],[yes], [The scale target])
4746 AC_PLUGIN([target_set], [yes], [The set target])
4747 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4748 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4749 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4750 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4751 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4752 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4753 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4754 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4755 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4756 AC_PLUGIN([users], [$plugin_users], [User statistics])
4757 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4758 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4759 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4760 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4761 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4762 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4763 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4764 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4765 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4767 dnl Default configuration file
4768 # Load either syslog or logfile
4769 LOAD_PLUGIN_SYSLOG=""
4770 LOAD_PLUGIN_LOGFILE=""
4772 AC_MSG_CHECKING([which default log plugin to load])
4773 default_log_plugin="none"
4774 if test "x$enable_syslog" = "xyes"
4776 default_log_plugin="syslog"
4778 LOAD_PLUGIN_SYSLOG="##"
4781 if test "x$enable_logfile" = "xyes"
4783 if test "x$default_log_plugin" = "xnone"
4785 default_log_plugin="logfile"
4787 LOAD_PLUGIN_LOGFILE="#"
4790 LOAD_PLUGIN_LOGFILE="##"
4792 AC_MSG_RESULT([$default_log_plugin])
4794 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4795 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4797 DEFAULT_LOG_LEVEL="info"
4798 if test "x$enable_debug" = "xyes"
4800 DEFAULT_LOG_LEVEL="debug"
4802 AC_SUBST(DEFAULT_LOG_LEVEL)
4804 # Load only one of rrdtool, network, csv in the default config.
4805 LOAD_PLUGIN_RRDTOOL=""
4806 LOAD_PLUGIN_NETWORK=""
4809 AC_MSG_CHECKING([which default write plugin to load])
4810 default_write_plugin="none"
4811 if test "x$enable_rrdtool" = "xyes"
4813 default_write_plugin="rrdtool"
4815 LOAD_PLUGIN_RRDTOOL="##"
4818 if test "x$enable_network" = "xyes"
4820 if test "x$default_write_plugin" = "xnone"
4822 default_write_plugin="network"
4824 LOAD_PLUGIN_NETWORK="#"
4827 LOAD_PLUGIN_NETWORK="##"
4830 if test "x$enable_csv" = "xyes"
4832 if test "x$default_write_plugin" = "xnone"
4834 default_write_plugin="csv"
4839 LOAD_PLUGIN_CSV="##"
4841 AC_MSG_RESULT([$default_write_plugin])
4843 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4844 AC_SUBST(LOAD_PLUGIN_NETWORK)
4845 AC_SUBST(LOAD_PLUGIN_CSV)
4848 if test "x$ac_system" = "xLinux" \
4849 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
4851 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4854 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
4856 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
4860 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4862 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4864 PERL_BINDINGS_OPTIONS="$withval"
4865 with_perl_bindings="yes"
4867 PERL_BINDINGS_OPTIONS=""
4868 with_perl_bindings="$withval"
4872 PERL_BINDINGS_OPTIONS=""
4873 if test -n "$perl_interpreter"
4875 with_perl_bindings="yes"
4877 with_perl_bindings="no (no perl interpreter found)"
4880 if test "x$with_perl_bindings" = "xyes"
4882 PERL_BINDINGS="perl"
4886 AC_SUBST(PERL_BINDINGS)
4887 AC_SUBST(PERL_BINDINGS_OPTIONS)
4889 dnl libcollectdclient
4890 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4891 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4892 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4894 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4896 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4898 AC_SUBST(LCC_VERSION_MAJOR)
4899 AC_SUBST(LCC_VERSION_MINOR)
4900 AC_SUBST(LCC_VERSION_PATCH)
4901 AC_SUBST(LCC_VERSION_EXTRA)
4902 AC_SUBST(LCC_VERSION_STRING)
4904 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4906 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)
4908 if test "x$with_librrd" = "xyes" \
4909 && test "x$librrd_threadsafe" != "xyes"
4911 with_librrd="yes (warning: librrd is not thread-safe)"
4914 if test "x$with_libperl" = "xyes"
4916 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4918 enable_perl="no (needs libperl)"
4921 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4923 enable_perl="no (libperl doesn't support ithreads)"
4926 if test "x$with_perl_bindings" = "xyes" \
4927 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4929 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4936 libcurl . . . . . . . $with_libcurl
4937 libdbi . . . . . . . $with_libdbi
4938 libcredis . . . . . . $with_libcredis
4939 libesmtp . . . . . . $with_libesmtp
4940 libganglia . . . . . $with_libganglia
4941 libgcrypt . . . . . . $with_libgcrypt
4942 libiokit . . . . . . $with_libiokit
4943 libiptc . . . . . . . $with_libiptc
4944 libjvm . . . . . . . $with_java
4945 libkstat . . . . . . $with_kstat
4946 libkvm . . . . . . . $with_libkvm
4947 libmemcached . . . . $with_libmemcached
4948 libmodbus . . . . . . $with_libmodbus
4949 libmysql . . . . . . $with_libmysql
4950 libnetapp . . . . . . $with_libnetapp
4951 libnetlink . . . . . $with_libnetlink
4952 libnetsnmp . . . . . $with_libnetsnmp
4953 libnotify . . . . . . $with_libnotify
4954 liboconfig . . . . . $with_liboconfig
4955 libopenipmi . . . . . $with_libopenipmipthread
4956 liboping . . . . . . $with_liboping
4957 libpcap . . . . . . . $with_libpcap
4958 libperfstat . . . . . $with_perfstat
4959 libperl . . . . . . . $with_libperl
4960 libpq . . . . . . . . $with_libpq
4961 libpthread . . . . . $with_libpthread
4962 librabbitmq . . . . . $with_librabbitmq
4963 librouteros . . . . . $with_librouteros
4964 librrd . . . . . . . $with_librrd
4965 libsensors . . . . . $with_libsensors
4966 libstatgrab . . . . . $with_libstatgrab
4967 libtokyotyrant . . . $with_libtokyotyrant
4968 libupsclient . . . . $with_libupsclient
4969 libvarnish . . . . . $with_libvarnish
4970 libvirt . . . . . . . $with_libvirt
4971 libxml2 . . . . . . . $with_libxml2
4972 libxmms . . . . . . . $with_libxmms
4973 libyajl . . . . . . . $with_libyajl
4974 libevent . . . . . . $with_libevent
4975 protobuf-c . . . . . $have_protoc_c
4976 oracle . . . . . . . $with_oracle
4977 python . . . . . . . $with_python
4980 daemon mode . . . . . $enable_daemon
4981 debug . . . . . . . . $enable_debug
4984 perl . . . . . . . . $with_perl_bindings
4987 amqp . . . . . . . $enable_amqp
4988 apache . . . . . . . $enable_apache
4989 apcups . . . . . . . $enable_apcups
4990 apple_sensors . . . . $enable_apple_sensors
4991 ascent . . . . . . . $enable_ascent
4992 battery . . . . . . . $enable_battery
4993 bind . . . . . . . . $enable_bind
4994 conntrack . . . . . . $enable_conntrack
4995 contextswitch . . . . $enable_contextswitch
4996 cpu . . . . . . . . . $enable_cpu
4997 cpufreq . . . . . . . $enable_cpufreq
4998 csv . . . . . . . . . $enable_csv
4999 curl . . . . . . . . $enable_curl
5000 curl_json . . . . . . $enable_curl_json
5001 curl_xml . . . . . . $enable_curl_xml
5002 dbi . . . . . . . . . $enable_dbi
5003 df . . . . . . . . . $enable_df
5004 disk . . . . . . . . $enable_disk
5005 dns . . . . . . . . . $enable_dns
5006 email . . . . . . . . $enable_email
5007 entropy . . . . . . . $enable_entropy
5008 exec . . . . . . . . $enable_exec
5009 filecount . . . . . . $enable_filecount
5010 fscache . . . . . . . $enable_fscache
5011 gmond . . . . . . . . $enable_gmond
5012 hddtemp . . . . . . . $enable_hddtemp
5013 interface . . . . . . $enable_interface
5014 ipmi . . . . . . . . $enable_ipmi
5015 iptables . . . . . . $enable_iptables
5016 ipvs . . . . . . . . $enable_ipvs
5017 irq . . . . . . . . . $enable_irq
5018 java . . . . . . . . $enable_java
5019 libvirt . . . . . . . $enable_libvirt
5020 load . . . . . . . . $enable_load
5021 logfile . . . . . . . $enable_logfile
5022 lpar... . . . . . . . $enable_lpar
5023 madwifi . . . . . . . $enable_madwifi
5024 match_empty_counter . $enable_match_empty_counter
5025 match_hashed . . . . $enable_match_hashed
5026 match_regex . . . . . $enable_match_regex
5027 match_timediff . . . $enable_match_timediff
5028 match_value . . . . . $enable_match_value
5029 mbmon . . . . . . . . $enable_mbmon
5030 memcachec . . . . . . $enable_memcachec
5031 memcached . . . . . . $enable_memcached
5032 memory . . . . . . . $enable_memory
5033 modbus . . . . . . . $enable_modbus
5034 multimeter . . . . . $enable_multimeter
5035 mysql . . . . . . . . $enable_mysql
5036 netapp . . . . . . . $enable_netapp
5037 netlink . . . . . . . $enable_netlink
5038 network . . . . . . . $enable_network
5039 nfs . . . . . . . . . $enable_nfs
5040 nginx . . . . . . . . $enable_nginx
5041 notify_desktop . . . $enable_notify_desktop
5042 notify_email . . . . $enable_notify_email
5043 ntpd . . . . . . . . $enable_ntpd
5044 nut . . . . . . . . . $enable_nut
5045 olsrd . . . . . . . . $enable_olsrd
5046 onewire . . . . . . . $enable_onewire
5047 openvpn . . . . . . . $enable_openvpn
5048 oracle . . . . . . . $enable_oracle
5049 perl . . . . . . . . $enable_perl
5050 pinba . . . . . . . . $enable_pinba
5051 ping . . . . . . . . $enable_ping
5052 postgresql . . . . . $enable_postgresql
5053 powerdns . . . . . . $enable_powerdns
5054 processes . . . . . . $enable_processes
5055 protocols . . . . . . $enable_protocols
5056 python . . . . . . . $enable_python
5057 redis . . . . . . . . $enable_redis
5058 routeros . . . . . . $enable_routeros
5059 rrdcached . . . . . . $enable_rrdcached
5060 rrdtool . . . . . . . $enable_rrdtool
5061 sensors . . . . . . . $enable_sensors
5062 serial . . . . . . . $enable_serial
5063 snmp . . . . . . . . $enable_snmp
5064 swap . . . . . . . . $enable_swap
5065 syslog . . . . . . . $enable_syslog
5066 table . . . . . . . . $enable_table
5067 tail . . . . . . . . $enable_tail
5068 tape . . . . . . . . $enable_tape
5069 target_notification . $enable_target_notification
5070 target_replace . . . $enable_target_replace
5071 target_scale . . . . $enable_target_scale
5072 target_set . . . . . $enable_target_set
5073 target_v5upgrade . . $enable_target_v5upgrade
5074 tcpconns . . . . . . $enable_tcpconns
5075 teamspeak2 . . . . . $enable_teamspeak2
5076 ted . . . . . . . . . $enable_ted
5077 thermal . . . . . . . $enable_thermal
5078 threshold . . . . . . $enable_threshold
5079 tokyotyrant . . . . . $enable_tokyotyrant
5080 unixsock . . . . . . $enable_unixsock
5081 uptime . . . . . . . $enable_uptime
5082 users . . . . . . . . $enable_users
5083 uuid . . . . . . . . $enable_uuid
5084 varnish . . . . . . . $enable_varnish
5085 vmem . . . . . . . . $enable_vmem
5086 vserver . . . . . . . $enable_vserver
5087 wireless . . . . . . $enable_wireless
5088 write_http . . . . . $enable_write_http
5089 write_redis . . . . . $enable_write_redis
5090 xmms . . . . . . . . $enable_xmms
5091 zfs_arc . . . . . . . $enable_zfs_arc
5095 if test "x$dependency_error" = "xyes"; then
5096 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5099 if test "x$dependency_warning" = "xyes"; then
5100 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5103 # vim: set fdm=marker :