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)
6 m4_ifdef([LT_PACKAGE_VERSION],
9 LT_CONFIG_LTDL_DIR([libltdl])
11 LTDL_INIT([convenience])
12 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
17 AC_LIBLTDL_CONVENIENCE
21 AC_CONFIG_SUBDIRS(libltdl)
22 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
26 AM_INIT_AUTOMAKE(dist-bzip2)
29 AC_PREFIX_DEFAULT("/opt/collectd")
34 # Checks for programs.
42 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
50 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
51 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
53 AC_MSG_CHECKING([for kernel type ($host_os)])
56 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
60 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
70 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
76 AC_MSG_RESULT([$ac_system])
78 if test "x$ac_system" = "xLinux"
80 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
81 if test -z "$KERNEL_DIR"
83 KERNEL_DIR="/lib/modules/`uname -r`/source"
86 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
87 AC_SUBST(KERNEL_CFLAGS)
90 if test "x$ac_system" = "xSolaris"
92 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
94 if test "x$ac_system" = "xAIX"
96 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
99 # Where to install .pc files.
100 pkgconfigdir="${libdir}/pkgconfig"
101 AC_SUBST(pkgconfigdir)
103 # Check for standards compliance mode
104 AC_ARG_ENABLE(standards,
105 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
106 [enable_standards="$enableval"],
107 [enable_standards="no"])
108 if test "x$enable_standards" = "xyes"
110 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
111 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
112 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
113 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
114 if test "x$GCC" = "xyes"
116 CFLAGS="$CFLAGS -std=c99"
119 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
122 # Checks for header files.
129 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)
132 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
137 # include <sys/types.h>
140 AC_CHECK_HEADERS(netinet/in.h, [], [],
145 # include <sys/types.h>
147 #if HAVE_NETINET_IN_SYSTM_H
148 # include <netinet/in_systm.h>
151 AC_CHECK_HEADERS(netinet/ip.h, [], [],
156 # include <sys/types.h>
158 #if HAVE_NETINET_IN_SYSTM_H
159 # include <netinet/in_systm.h>
161 #if HAVE_NETINET_IN_H
162 # include <netinet/in.h>
165 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
170 # include <sys/types.h>
172 #if HAVE_NETINET_IN_SYSTM_H
173 # include <netinet/in_systm.h>
175 #if HAVE_NETINET_IN_H
176 # include <netinet/in.h>
178 #if HAVE_NETINET_IP_H
179 # include <netinet/ip.h>
182 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
187 # include <sys/types.h>
189 #if HAVE_NETINET_IN_SYSTM_H
190 # include <netinet/in_systm.h>
192 #if HAVE_NETINET_IN_H
193 # include <netinet/in.h>
195 #if HAVE_NETINET_IP_H
196 # include <netinet/ip.h>
199 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
204 # include <sys/types.h>
206 #if HAVE_NETINET_IN_SYSTM_H
207 # include <netinet/in_systm.h>
209 #if HAVE_NETINET_IN_H
210 # include <netinet/in.h>
213 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
218 # include <sys/types.h>
220 #if HAVE_NETINET_IN_SYSTM_H
221 # include <netinet/in_systm.h>
223 #if HAVE_NETINET_IN_H
224 # include <netinet/in.h>
226 #if HAVE_NETINET_IP6_H
227 # include <netinet/ip6.h>
230 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
235 # include <sys/types.h>
237 #if HAVE_NETINET_IN_SYSTM_H
238 # include <netinet/in_systm.h>
240 #if HAVE_NETINET_IN_H
241 # include <netinet/in.h>
243 #if HAVE_NETINET_IP_H
244 # include <netinet/ip.h>
247 AC_CHECK_HEADERS(netinet/udp.h, [], [],
252 # include <sys/types.h>
254 #if HAVE_NETINET_IN_SYSTM_H
255 # include <netinet/in_systm.h>
257 #if HAVE_NETINET_IN_H
258 # include <netinet/in.h>
260 #if HAVE_NETINET_IP_H
261 # include <netinet/ip.h>
266 AC_CHECK_HEADERS(sys/dkstat.h)
267 if test "x$ac_system" = "xDarwin"
269 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)
270 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
272 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
275 # include <sys/types.h>
278 # include <sys/param.h>
282 AC_MSG_CHECKING([for sysctl kern.cp_times])
283 if test -x /sbin/sysctl
285 /sbin/sysctl kern.cp_times 2>/dev/null
289 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
290 [Define if sysctl supports kern.cp_times])
299 AC_CHECK_HEADERS(linux/major.h libgen.h)
301 # For the battery plugin
302 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
304 #if HAVE_IOKIT_IOKITLIB_H
305 # include <IOKit/IOKitLib.h>
307 #if HAVE_IOKIT_IOTYPES_H
308 # include <IOKit/IOTypes.h>
312 # For the swap module
313 have_linux_wireless_h="no"
314 if test "x$ac_system" = "xLinux"
316 AC_CHECK_HEADERS(linux/wireless.h,
317 [have_linux_wireless_h="yes"],
318 [have_linux_wireless_h="no"],
321 #include <sys/ioctl.h>
322 #include <sys/socket.h>
326 # For the swap module
327 have_sys_swap_h="yes"
328 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
330 #undef _FILE_OFFSET_BITS
331 #undef _LARGEFILE64_SOURCE
333 # include <sys/types.h>
336 # include <sys/param.h>
340 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
343 if test "x$GCC" = "xyes"
345 hint_64="CFLAGS='-m64'"
347 hint_64="CFLAGS='-xarch=v9'"
349 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
353 # For the processes plugin
355 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
357 # For interface plugin
358 AC_CHECK_HEADERS(ifaddrs.h)
359 AC_CHECK_HEADERS(net/if.h, [], [],
362 # include <sys/types.h>
364 #if HAVE_SYS_SOCKET_H
365 # include <sys/socket.h>
368 AC_CHECK_HEADERS(linux/if.h, [], [],
371 # include <sys/types.h>
373 #if HAVE_SYS_SOCKET_H
374 # include <sys/socket.h>
377 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
380 # include <sys/types.h>
382 #if HAVE_SYS_SOCKET_H
383 # include <sys/socket.h>
386 # include <linux/if.h>
391 have_net_ip_vs_h="no"
393 if test "x$ac_system" = "xLinux"
395 SAVE_CFLAGS="$CFLAGS"
396 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
398 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
399 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
401 CFLAGS="$SAVE_CFLAGS"
405 AC_CHECK_HEADERS(sys/ucred.h, [], [],
408 # include <sys/types.h>
411 # include <sys/param.h>
415 # For mount interface
416 AC_CHECK_HEADERS(sys/mount.h, [], [],
419 # include <sys/types.h>
422 # include <sys/param.h>
426 # For the email plugin
427 AC_CHECK_HEADERS(linux/un.h, [], [],
429 #if HAVE_SYS_SOCKET_H
430 # include <sys/socket.h>
434 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)
437 AC_CHECK_HEADERS(arpa/nameser.h)
438 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
440 #if HAVE_ARPA_NAMESER_H
441 # include <arpa/nameser.h>
445 AC_CHECK_HEADERS(net/if_arp.h, [], [],
446 [#if HAVE_SYS_SOCKET_H
447 # include <sys/socket.h>
450 AC_CHECK_HEADERS(net/ppp_defs.h)
451 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
452 [#if HAVE_NET_PPP_DEFS_H
453 # include <net/ppp_defs.h>
456 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
461 # include <sys/types.h>
463 #if HAVE_SYS_SOCKET_H
464 # include <sys/socket.h>
469 #if HAVE_NETINET_IN_H
470 # include <netinet/in.h>
474 # For the multimeter plugin
476 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
479 # Checks for typedefs, structures, and compiler characteristics.
488 # Checks for library functions.
490 AC_PROG_GCC_TRADITIONAL
491 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
495 SAVE_CFLAGS="$CFLAGS"
496 # Emulate behavior of src/Makefile.am
497 if test "x$GCC" = "xyes"
499 CFLAGS="$CFLAGS -Wall -Werror"
502 AC_CACHE_CHECK([for strtok_r],
503 [c_cv_have_strtok_r_default],
512 char buffer[] = "foo,bar,baz";
519 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
522 printf ("token = %s;\n", token);
525 [c_cv_have_strtok_r_default="yes"],
526 [c_cv_have_strtok_r_default="no"]
530 if test "x$c_cv_have_strtok_r_default" = "xno"
532 CFLAGS="$CFLAGS -D_REENTRANT=1"
534 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
535 [c_cv_have_strtok_r_reentrant],
544 char buffer[] = "foo,bar,baz";
551 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
554 printf ("token = %s;\n", token);
557 [c_cv_have_strtok_r_reentrant="yes"],
558 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
563 CFLAGS="$SAVE_CFLAGS"
564 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
566 CFLAGS="$CFLAGS -D_REENTRANT=1"
569 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
571 socket_needs_socket="no"
572 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
573 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
575 clock_gettime_needs_rt="no"
576 clock_gettime_needs_posix4="no"
577 have_clock_gettime="no"
578 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
579 if test "x$have_clock_gettime" = "xno"
581 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
582 have_clock_gettime="yes"])
584 if test "x$have_clock_gettime" = "xno"
586 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
587 have_clock_gettime="yes"])
589 if test "x$have_clock_gettime" = "xyes"
591 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
593 AC_MSG_WARN(cannot find clock_gettime)
596 nanosleep_needs_rt="no"
597 nanosleep_needs_posix4="no"
598 AC_CHECK_FUNCS(nanosleep,
600 AC_CHECK_LIB(rt, nanosleep,
601 [nanosleep_needs_rt="yes"],
602 AC_CHECK_LIB(posix4, nanosleep,
603 [nanosleep_needs_posix4="yes"],
604 AC_MSG_ERROR(cannot find nanosleep))))
606 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
607 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
609 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
610 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
611 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
612 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
613 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
614 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
615 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
616 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
617 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
618 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
619 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
620 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
622 # Check for strptime {{{
623 if test "x$GCC" = "xyes"
625 SAVE_CFLAGS="$CFLAGS"
626 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
629 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
630 if test "x$have_strptime" = "xyes"
632 AC_CACHE_CHECK([whether strptime is exported by default],
633 [c_cv_have_strptime_default],
642 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
644 [c_cv_have_strptime_default="yes"],
645 [c_cv_have_strptime_default="no"]))
647 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
649 AC_CACHE_CHECK([whether strptime needs standards mode],
650 [c_cv_have_strptime_standards],
654 #ifndef _ISOC99_SOURCE
655 # define _ISOC99_SOURCE 1
657 #ifndef _POSIX_C_SOURCE
658 # define _POSIX_C_SOURCE 200112L
660 #ifndef _XOPEN_SOURCE
661 # define _XOPEN_SOURCE 500
668 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
670 [c_cv_have_strptime_standards="yes"],
671 [c_cv_have_strptime_standards="no"]))
673 if test "x$c_cv_have_strptime_standards" = "xyes"
675 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
681 if test "x$GCC" = "xyes"
683 CFLAGS="$SAVE_CFLAGS"
686 # }}} Check for strptime
688 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
689 if test "x$have_swapctl" = "xyes"; then
690 AC_CACHE_CHECK([whether swapctl takes two arguments],
691 [c_cv_have_swapctl_two_args],
693 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
694 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
695 # undef _FILE_OFFSET_BITS
696 # undef _LARGEFILE64_SOURCE
698 #include <sys/stat.h>
699 #include <sys/swap.h>]],
701 int num = swapctl(0, NULL);
704 [c_cv_have_swapctl_two_args="yes"],
705 [c_cv_have_swapctl_two_args="no"]
708 AC_CACHE_CHECK([whether swapctl takes three arguments],
709 [c_cv_have_swapctl_three_args],
711 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
712 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
713 # undef _FILE_OFFSET_BITS
714 # undef _LARGEFILE64_SOURCE
716 #include <sys/stat.h>
717 #include <sys/swap.h>]],
719 int num = swapctl(0, NULL,0);
722 [c_cv_have_swapctl_three_args="yes"],
723 [c_cv_have_swapctl_three_args="no"]
727 # Check for different versions of `swapctl' here..
728 if test "x$have_swapctl" = "xyes"; then
729 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
730 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
731 [Define if the function swapctl exists and takes two arguments.])
733 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
734 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
735 [Define if the function swapctl exists and takes three arguments.])
740 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
742 if test "x$withval" = "xno"; then
744 else if test "x$withval" = "xyes"; then
751 if test "x$nan_type" = "xnone"; then
752 AC_CACHE_CHECK([whether NAN is defined by default],
753 [c_cv_have_nan_default],
759 static double foo = NAN;
767 [c_cv_have_nan_default="yes"],
768 [c_cv_have_nan_default="no"]
771 if test "x$c_cv_have_nan_default" = "xyes"
776 if test "x$nan_type" = "xnone"; then
777 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
778 [c_cv_have_nan_isoc],
783 #define __USE_ISOC99 1
785 static double foo = NAN;
793 [c_cv_have_nan_isoc="yes"],
794 [c_cv_have_nan_isoc="no"]
797 if test "x$c_cv_have_nan_isoc" = "xyes"
802 if test "x$nan_type" = "xnone"; then
803 SAVE_LDFLAGS=$LDFLAGS
804 LDFLAGS="$LDFLAGS -lm"
805 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
806 [c_cv_have_nan_zero],
815 #define NAN (0.0 / 0.0)
817 # define isnan(f) ((f) != (f))
819 static double foo = NAN;
827 [c_cv_have_nan_zero="yes"],
828 [c_cv_have_nan_zero="no"]
831 LDFLAGS=$SAVE_LDFLAGS
832 if test "x$c_cv_have_nan_zero" = "xyes"
838 if test "x$nan_type" = "xdefault"; then
839 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
840 [Define if NAN is defined by default and can initialize static variables.])
841 else if test "x$nan_type" = "xisoc99"; then
842 AC_DEFINE(NAN_STATIC_ISOC, 1,
843 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
844 else if test "x$nan_type" = "xzero"; then
845 AC_DEFINE(NAN_ZERO_ZERO, 1,
846 [Define if NAN can be defined as (0.0 / 0.0)])
848 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
851 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
853 if test "x$withval" = "xnothing"; then
854 fp_layout_type="nothing"
855 else if test "x$withval" = "xendianflip"; then
856 fp_layout_type="endianflip"
857 else if test "x$withval" = "xintswap"; then
858 fp_layout_type="intswap"
860 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
863 [fp_layout_type="unknown"])
865 if test "x$fp_layout_type" = "xunknown"; then
866 AC_CACHE_CHECK([if doubles are stored in x86 representation],
867 [c_cv_fp_layout_need_nothing],
878 # include <inttypes.h>
881 # include <stdbool.h>
891 memcpy ((void *) &i0, (void *) &d, 8);
894 memcpy ((void *) c, (void *) &i1, 8);
896 if ((c[0] == 0x2f) && (c[1] == 0x25)
897 && (c[2] == 0xc0) && (c[3] == 0xc7)
898 && (c[4] == 0x43) && (c[5] == 0x2b)
899 && (c[6] == 0x1f) && (c[7] == 0x5b))
904 [c_cv_fp_layout_need_nothing="yes"],
905 [c_cv_fp_layout_need_nothing="no"]
908 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
909 fp_layout_type="nothing"
912 if test "x$fp_layout_type" = "xunknown"; then
913 AC_CACHE_CHECK([if endianflip converts to x86 representation],
914 [c_cv_fp_layout_need_endianflip],
925 # include <inttypes.h>
928 # include <stdbool.h>
930 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
931 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
932 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
933 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
934 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
935 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
936 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
937 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
946 memcpy ((void *) &i0, (void *) &d, 8);
948 i1 = endianflip (i0);
949 memcpy ((void *) c, (void *) &i1, 8);
951 if ((c[0] == 0x2f) && (c[1] == 0x25)
952 && (c[2] == 0xc0) && (c[3] == 0xc7)
953 && (c[4] == 0x43) && (c[5] == 0x2b)
954 && (c[6] == 0x1f) && (c[7] == 0x5b))
959 [c_cv_fp_layout_need_endianflip="yes"],
960 [c_cv_fp_layout_need_endianflip="no"]
963 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
964 fp_layout_type="endianflip"
967 if test "x$fp_layout_type" = "xunknown"; then
968 AC_CACHE_CHECK([if intswap converts to x86 representation],
969 [c_cv_fp_layout_need_intswap],
980 # include <inttypes.h>
983 # include <stdbool.h>
985 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
986 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
995 memcpy ((void *) &i0, (void *) &d, 8);
998 memcpy ((void *) c, (void *) &i1, 8);
1000 if ((c[0] == 0x2f) && (c[1] == 0x25)
1001 && (c[2] == 0xc0) && (c[3] == 0xc7)
1002 && (c[4] == 0x43) && (c[5] == 0x2b)
1003 && (c[6] == 0x1f) && (c[7] == 0x5b))
1008 [c_cv_fp_layout_need_intswap="yes"],
1009 [c_cv_fp_layout_need_intswap="no"]
1012 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1013 fp_layout_type="intswap"
1017 if test "x$fp_layout_type" = "xnothing"; then
1018 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1019 [Define if doubles are stored in x86 representation.])
1020 else if test "x$fp_layout_type" = "xendianflip"; then
1021 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1022 [Define if endianflip is needed to convert to x86 representation.])
1023 else if test "x$fp_layout_type" = "xintswap"; then
1024 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1025 [Define if intswap is needed to convert to x86 representation.])
1027 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1031 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1032 have_getvfsstat="no"
1033 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1034 have_listmntent="no"
1035 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1038 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1039 if test "x$have_getmntent" = "xno"; then
1040 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1042 if test "x$have_getmntent" = "xno"; then
1043 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1045 if test "x$have_getmntent" = "xno"; then
1046 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1049 if test "x$have_getmntent" = "xc"; then
1050 AC_CACHE_CHECK([whether getmntent takes one argument],
1051 [c_cv_have_one_getmntent],
1053 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1054 #include "$srcdir/src/utils_mount.h"]],
1058 fh = setmntent ("/etc/mtab", "r");
1059 me = getmntent (fh);
1062 [c_cv_have_one_getmntent="yes"],
1063 [c_cv_have_one_getmntent="no"]
1066 AC_CACHE_CHECK([whether getmntent takes two arguments],
1067 [c_cv_have_two_getmntent],
1069 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1070 #include "$srcdir/src/utils_mount.h"]],
1075 fh = fopen ("/etc/mnttab", "r");
1076 status = getmntent (fh, &mt);
1079 [c_cv_have_two_getmntent="yes"],
1080 [c_cv_have_two_getmntent="no"]
1085 # Check for different versions of `getmntent' here..
1087 if test "x$have_getmntent" = "xc"; then
1088 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1089 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1090 [Define if the function getmntent exists and takes one argument.])
1092 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1093 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1094 [Define if the function getmntent exists and takes two arguments.])
1097 if test "x$have_getmntent" = "xsun"; then
1098 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1099 [Define if the function getmntent exists. It's the version from libsun.])
1101 if test "x$have_getmntent" = "xseq"; then
1102 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1103 [Define if the function getmntent exists. It's the version from libseq.])
1105 if test "x$have_getmntent" = "xgen"; then
1106 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1107 [Define if the function getmntent exists. It's the version from libgen.])
1111 AC_MSG_CHECKING([if have htonll defined])
1116 #include <sys/types.h>
1117 #include <netinet/in.h>
1119 # include <inttypes.h>
1126 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1129 AC_MSG_RESULT([$have_htonll])
1131 # Check for structures
1132 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1133 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1136 #include <sys/types.h>
1137 #include <sys/socket.h>
1140 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1141 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1144 #include <sys/types.h>
1145 #include <sys/socket.h>
1146 #include <linux/if.h>
1147 #include <linux/netdevice.h>
1150 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1153 #include <netinet/in.h>
1157 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1159 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1160 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1161 have_struct_kinfo_proc_freebsd="yes"
1164 have_struct_kinfo_proc_freebsd="no"
1168 #include <sys/param.h>
1169 #include <sys/sysctl.h>
1170 #include <sys/user.h>
1173 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1175 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1176 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1177 have_struct_kinfo_proc_openbsd="yes"
1180 have_struct_kinfo_proc_openbsd="no"
1183 #include <sys/param.h>
1184 #include <sys/sysctl.h>
1188 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1189 [#define _BSD_SOURCE
1191 # include <stdint.h>
1193 #if HAVE_SYS_TYPES_H
1194 # include <sys/types.h>
1196 #if HAVE_NETINET_IN_SYSTM_H
1197 # include <netinet/in_systm.h>
1199 #if HAVE_NETINET_IN_H
1200 # include <netinet/in.h>
1202 #if HAVE_NETINET_IP_H
1203 # include <netinet/ip.h>
1205 #if HAVE_NETINET_UDP_H
1206 # include <netinet/udp.h>
1209 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1210 [#define _BSD_SOURCE
1212 # include <stdint.h>
1214 #if HAVE_SYS_TYPES_H
1215 # include <sys/types.h>
1217 #if HAVE_NETINET_IN_SYSTM_H
1218 # include <netinet/in_systm.h>
1220 #if HAVE_NETINET_IN_H
1221 # include <netinet/in.h>
1223 #if HAVE_NETINET_IP_H
1224 # include <netinet/ip.h>
1226 #if HAVE_NETINET_UDP_H
1227 # include <netinet/udp.h>
1231 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1241 # Checks for libraries begin here
1243 with_libresolv="yes"
1244 AC_CHECK_LIB(resolv, res_search,
1246 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1248 [with_libresolv="no"])
1249 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1251 dnl Check for HAL (hardware abstraction library)
1253 AC_CHECK_LIB(hal,libhal_device_property_exists,
1254 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1256 if test "x$with_libhal" = "xyes"; then
1257 if test "x$PKG_CONFIG" != "x"; then
1258 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1259 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1260 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1261 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1265 m4_divert_once([HELP_WITH], [
1266 collectd additional packages:])
1268 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1270 if test "x$ac_system" = "xAIX"
1275 with_perfstat="no (AIX only)"
1276 with_procinfo="no (AIX only)"
1279 if test "x$with_perfstat" = "xyes"
1281 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1282 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1284 if test "x$with_perfstat" = "xyes"
1286 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1287 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1288 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1289 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1291 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1294 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1296 # Processes plugin under AIX.
1297 if test "x$with_procinfo" = "xyes"
1299 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1301 if test "x$with_procinfo" = "xyes"
1303 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1306 if test "x$ac_system" = "xSolaris"
1311 with_kstat="no (Solaris only)"
1312 with_devinfo="no (Solaris only)"
1315 if test "x$with_kstat" = "xyes"
1317 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1319 if test "x$with_kstat" = "xyes"
1321 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1322 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1324 if test "x$with_kstat" = "xyes"
1326 AC_DEFINE(HAVE_LIBKSTAT, 1,
1327 [Define to 1 if you have the 'kstat' library (-lkstat)])
1329 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1330 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1333 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1340 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1343 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1344 if test "x$with_kvm_getprocs" = "xyes"
1346 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1347 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1350 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1352 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1353 if test "x$with_kvm_getswapinfo" = "xyes"
1355 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1356 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1359 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1361 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1362 if test "x$with_kvm_nlist" = "xyes"
1364 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1365 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1368 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1370 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1371 if test "x$with_kvm_openfiles" = "xyes"
1373 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1374 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1377 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1379 # --with-libcredis {{{
1380 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1382 if test "x$withval" = "xyes"
1384 with_libcredis="yes"
1385 else if test "x$withval" = "xno"
1389 with_libcredis="yes"
1390 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1391 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1394 [with_libcredis="yes"])
1396 SAVE_CPPFLAGS="$CPPFLAGS"
1397 SAVE_LDFLAGS="$LDFLAGS"
1399 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1400 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1402 if test "x$with_libcredis" = "xyes"
1404 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1406 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1408 AC_CHECK_HEADERS(credis.h,
1409 [with_libcredis="yes"],
1410 [with_libcredis="no (credis.h not found)"])
1412 if test "x$with_libcredis" = "xyes"
1414 if test "x$LIBCREDIS_LDFLAGS" != "x"
1416 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1418 AC_CHECK_LIB(credis, credis_info,
1419 [with_libcredis="yes"],
1420 [with_libcredis="no (symbol 'credis_info' not found)"])
1424 CPPFLAGS="$SAVE_CPPFLAGS"
1425 LDFLAGS="$SAVE_LDFLAGS"
1427 if test "x$with_libcredis" = "xyes"
1429 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1430 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1431 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1432 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1434 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1437 # --with-libcurl {{{
1438 with_curl_config="curl-config"
1441 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1443 if test "x$withval" = "xno"
1446 else if test "x$withval" = "xyes"
1450 if test -f "$withval" && test -x "$withval"
1452 with_curl_config="$withval"
1454 else if test -x "$withval/bin/curl-config"
1456 with_curl_config="$withval/bin/curl-config"
1465 if test "x$with_libcurl" = "xyes"
1467 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1468 curl_config_status=$?
1470 if test $curl_config_status -ne 0
1472 with_libcurl="no ($with_curl_config failed)"
1474 SAVE_CPPFLAGS="$CPPFLAGS"
1475 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1477 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1479 CPPFLAGS="$SAVE_CPPFLAGS"
1482 if test "x$with_libcurl" = "xyes"
1484 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1485 curl_config_status=$?
1487 if test $curl_config_status -ne 0
1489 with_libcurl="no ($with_curl_config failed)"
1491 AC_CHECK_LIB(curl, curl_easy_init,
1492 [with_libcurl="yes"],
1493 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1497 if test "x$with_libcurl" = "xyes"
1499 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1500 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1501 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1502 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1504 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1508 with_libdbi_cppflags=""
1509 with_libdbi_ldflags=""
1510 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1512 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1514 with_libdbi_cppflags="-I$withval/include"
1515 with_libdbi_ldflags="-L$withval/lib"
1518 with_libdbi="$withval"
1524 if test "x$with_libdbi" = "xyes"
1526 SAVE_CPPFLAGS="$CPPFLAGS"
1527 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1529 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1531 CPPFLAGS="$SAVE_CPPFLAGS"
1533 if test "x$with_libdbi" = "xyes"
1535 SAVE_CPPFLAGS="$CPPFLAGS"
1536 SAVE_LDFLAGS="$LDFLAGS"
1537 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1538 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1540 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1542 CPPFLAGS="$SAVE_CPPFLAGS"
1543 LDFLAGS="$SAVE_LDFLAGS"
1545 if test "x$with_libdbi" = "xyes"
1547 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1548 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1549 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1550 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1551 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1552 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1554 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1557 # --with-libesmtp {{{
1558 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1560 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1562 LDFLAGS="$LDFLAGS -L$withval/lib"
1563 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1566 with_libesmtp="$withval"
1572 if test "x$with_libesmtp" = "xyes"
1574 AC_CHECK_LIB(esmtp, smtp_create_session,
1576 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1577 ], [with_libesmtp="no (libesmtp not found)"])
1579 if test "x$with_libesmtp" = "xyes"
1581 AC_CHECK_HEADERS(libesmtp.h,
1583 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1584 ], [with_libesmtp="no (libesmtp.h not found)"])
1586 if test "x$with_libesmtp" = "xyes"
1592 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1593 [Wether or not to use the esmtp library])
1594 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1597 # --with-libganglia {{{
1598 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1600 if test -f "$withval" && test -x "$withval"
1602 with_libganglia_config="$withval"
1603 with_libganglia="yes"
1604 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1606 with_libganglia_config="$withval/bin/ganglia-config"
1607 with_libganglia="yes"
1608 else if test -d "$withval"
1610 GANGLIA_CPPFLAGS="-I$withval/include"
1611 GANGLIA_LDFLAGS="-L$withval/lib"
1612 with_libganglia="yes"
1614 with_libganglia_config="ganglia-config"
1615 with_libganglia="$withval"
1619 with_libganglia_config="ganglia-config"
1620 with_libganglia="yes"
1623 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1625 if test "x$GANGLIA_CPPFLAGS" = "x"
1627 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1630 if test "x$GANGLIA_LDFLAGS" = "x"
1632 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1635 if test "x$GANGLIA_LIBS" = "x"
1637 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1641 SAVE_CPPFLAGS="$CPPFLAGS"
1642 SAVE_LDFLAGS="$LDFLAGS"
1643 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1644 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1646 if test "x$with_libganglia" = "xyes"
1648 AC_CHECK_HEADERS(gm_protocol.h,
1650 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1651 [Define to 1 if you have the <gm_protocol.h> header file.])
1652 ], [with_libganglia="no (gm_protocol.h not found)"])
1655 if test "x$with_libganglia" = "xyes"
1657 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1659 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1660 [Define to 1 if you have the ganglia library (-lganglia).])
1661 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1664 CPPFLAGS="$SAVE_CPPFLAGS"
1665 LDFLAGS="$SAVE_LDFLAGS"
1667 AC_SUBST(GANGLIA_CPPFLAGS)
1668 AC_SUBST(GANGLIA_LDFLAGS)
1669 AC_SUBST(GANGLIA_LIBS)
1670 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1673 # --with-libgcrypt {{{
1674 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1675 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1676 GCRYPT_LIBS="$GCRYPT_LIBS"
1677 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1679 if test -f "$withval" && test -x "$withval"
1681 with_libgcrypt_config="$withval"
1682 with_libgcrypt="yes"
1683 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1685 with_libgcrypt_config="$withval/bin/gcrypt-config"
1686 with_libgcrypt="yes"
1687 else if test -d "$withval"
1689 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1690 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1691 with_libgcrypt="yes"
1693 with_libgcrypt_config="gcrypt-config"
1694 with_libgcrypt="$withval"
1698 with_libgcrypt_config="libgcrypt-config"
1699 with_libgcrypt="yes"
1702 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1704 if test "x$GCRYPT_CPPFLAGS" = "x"
1706 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1709 if test "x$GCRYPT_LDFLAGS" = "x"
1711 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1712 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1715 if test "x$GCRYPT_LIBS" = "x"
1717 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1721 SAVE_CPPFLAGS="$CPPFLAGS"
1722 SAVE_LDFLAGS="$LDFLAGS"
1723 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1724 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1726 if test "x$with_libgcrypt" = "xyes"
1728 if test "x$GCRYPT_CPPFLAGS" != "x"
1730 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1732 AC_CHECK_HEADERS(gcrypt.h,
1733 [with_libgcrypt="yes"],
1734 [with_libgcrypt="no (gcrypt.h not found)"])
1737 if test "x$with_libgcrypt" = "xyes"
1739 if test "x$GCRYPT_LDFLAGS" != "x"
1741 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1743 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1744 [with_libgcrypt="yes"],
1745 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1747 if test "$with_libgcrypt" != "no"; then
1748 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1752 CPPFLAGS="$SAVE_CPPFLAGS"
1753 LDFLAGS="$SAVE_LDFLAGS"
1755 if test "x$with_libgcrypt" = "xyes"
1757 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1760 AC_SUBST(GCRYPT_CPPFLAGS)
1761 AC_SUBST(GCRYPT_LDFLAGS)
1762 AC_SUBST(GCRYPT_LIBS)
1763 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1766 # --with-libiptc {{{
1767 with_own_libiptc="no"
1768 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1770 if test "x$withval" = "xshipped"
1772 with_own_libiptc="yes"
1774 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1776 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1777 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1780 with_libiptc="$withval"
1784 if test "x$ac_system" = "xLinux"
1788 with_libiptc="no (Linux only)"
1791 SAVE_CPPFLAGS="$CPPFLAGS"
1792 SAVE_LDFLAGS="$LDFLAGS"
1793 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1794 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1795 # check whether the header file for libiptc is available.
1796 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1798 AC_CHECK_HEADERS(libiptc/libiptc.h,
1800 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1804 with_own_libiptc="yes"
1807 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1809 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1811 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1815 with_own_libiptc="yes"
1818 # If the header file is available, check for the required type declaractions.
1819 # They may be missing in old versions of libiptc. In that case, they will be
1820 # declared in the iptables plugin.
1821 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1823 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1826 # include "$srcdir/src/owniptc/libiptc.h"
1827 # include "$srcdir/src/owniptc/libip6tc.h"
1829 # include <libiptc/libiptc.h>
1830 # include <libiptc/libip6tc.h>
1834 # Check for the iptc_init symbol in the library.
1835 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1837 AC_CHECK_LIB(iptc, iptc_init,
1839 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1843 with_own_libiptc="yes"
1846 # The system wide version failed for some reason. Check if we have the required
1847 # headers to build the shipped version.
1848 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1850 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1852 with_libiptc="no (Linux iptables headers not found)"
1853 with_own_libiptc="no"
1856 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1859 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1860 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1861 if test "x$with_libiptc" = "xyes"
1863 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1864 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1865 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1866 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1868 if test "x$with_own_libiptc" = "xyes"
1870 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1872 CPPFLAGS="$SAVE_CPPFLAGS"
1873 LDFLAGS="$SAVE_LDFLAGS"
1877 with_java_home="$JAVA_HOME"
1878 with_java_vmtype="client"
1883 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1885 if test "x$withval" = "xno"
1888 else if test "x$withval" = "xyes"
1892 with_java_home="$withval"
1897 if test "x$with_java" = "xyes"
1899 if test -d "$with_java_home"
1901 AC_MSG_CHECKING([for jni.h])
1902 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1903 if test "x$TMPDIR" != "x"
1905 AC_MSG_RESULT([found in $TMPDIR])
1906 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1908 AC_MSG_RESULT([not found])
1911 AC_MSG_CHECKING([for jni_md.h])
1912 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1913 if test "x$TMPDIR" != "x"
1915 AC_MSG_RESULT([found in $TMPDIR])
1916 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1918 AC_MSG_RESULT([not found])
1921 AC_MSG_CHECKING([for libjvm.so])
1922 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1923 if test "x$TMPDIR" != "x"
1925 AC_MSG_RESULT([found in $TMPDIR])
1926 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1928 AC_MSG_RESULT([not found])
1931 if test "x$JAVAC" = "x"
1933 AC_MSG_CHECKING([for javac])
1934 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1935 if test "x$TMPDIR" != "x"
1938 AC_MSG_RESULT([$JAVAC])
1940 AC_MSG_RESULT([not found])
1943 if test "x$JAR" = "x"
1945 AC_MSG_CHECKING([for jar])
1946 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1947 if test "x$TMPDIR" != "x"
1950 AC_MSG_RESULT([$JAR])
1952 AC_MSG_RESULT([not found])
1955 else if test "x$with_java_home" != "x"
1957 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1961 if test "x$JAVA_CPPFLAGS" != "x"
1963 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1965 if test "x$JAVA_CFLAGS" != "x"
1967 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1969 if test "x$JAVA_LDFLAGS" != "x"
1971 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1973 if test "x$JAVAC" = "x"
1975 with_javac_path="$PATH"
1976 if test "x$with_java_home" != "x"
1978 with_javac_path="$with_java_home:with_javac_path"
1979 if test -d "$with_java_home/bin"
1981 with_javac_path="$with_java_home/bin:with_javac_path"
1985 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1987 if test "x$JAVAC" = "x"
1989 with_java="no (javac not found)"
1991 if test "x$JAR" = "x"
1993 with_jar_path="$PATH"
1994 if test "x$with_java_home" != "x"
1996 with_jar_path="$with_java_home:$with_jar_path"
1997 if test -d "$with_java_home/bin"
1999 with_jar_path="$with_java_home/bin:$with_jar_path"
2003 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2005 if test "x$JAR" = "x"
2007 with_java="no (jar not found)"
2010 SAVE_CPPFLAGS="$CPPFLAGS"
2011 SAVE_CFLAGS="$CFLAGS"
2012 SAVE_LDFLAGS="$LDFLAGS"
2013 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2014 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2015 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2017 if test "x$with_java" = "xyes"
2019 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2021 if test "x$with_java" = "xyes"
2023 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2025 [with_java="no (libjvm not found)"],
2028 if test "x$with_java" = "xyes"
2030 JAVA_LIBS="$JAVA_LIBS -ljvm"
2031 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2034 CPPFLAGS="$SAVE_CPPFLAGS"
2035 CFLAGS="$SAVE_CFLAGS"
2036 LDFLAGS="$SAVE_LDFLAGS"
2038 AC_SUBST(JAVA_CPPFLAGS)
2039 AC_SUBST(JAVA_CFLAGS)
2040 AC_SUBST(JAVA_LDFLAGS)
2042 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2045 # --with-libmemcached {{{
2046 with_libmemcached_cppflags=""
2047 with_libmemcached_ldflags=""
2048 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2050 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2052 with_libmemcached_cppflags="-I$withval/include"
2053 with_libmemcached_ldflags="-L$withval/lib"
2054 with_libmemcached="yes"
2056 with_libmemcached="$withval"
2060 with_libmemcached="yes"
2062 if test "x$with_libmemcached" = "xyes"
2064 SAVE_CPPFLAGS="$CPPFLAGS"
2065 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2067 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2069 CPPFLAGS="$SAVE_CPPFLAGS"
2071 if test "x$with_libmemcached" = "xyes"
2073 SAVE_CPPFLAGS="$CPPFLAGS"
2074 SAVE_LDFLAGS="$LDFLAGS"
2075 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2076 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2078 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2080 CPPFLAGS="$SAVE_CPPFLAGS"
2081 LDFLAGS="$SAVE_LDFLAGS"
2083 if test "x$with_libmemcached" = "xyes"
2085 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2086 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2087 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2088 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2089 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2090 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2091 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2093 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2096 # --with-libmodbus {{{
2097 with_libmodbus_config=""
2098 with_libmodbus_cflags=""
2099 with_libmodbus_libs=""
2100 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2102 if test "x$withval" = "xno"
2105 else if test "x$withval" = "xyes"
2107 with_libmodbus="use_pkgconfig"
2108 else if test -d "$with_libmodbus/lib"
2110 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2111 with_libmodbus_cflags="-I$withval/include"
2112 with_libmodbus_libs="-L$withval/lib -lmodbus"
2113 with_libmodbus="yes"
2116 [with_libmodbus="use_pkgconfig"])
2118 # configure using pkg-config
2119 if test "x$with_libmodbus" = "xuse_pkgconfig"
2121 if test "x$PKG_CONFIG" = "x"
2123 with_libmodbus="no (Don't have pkg-config)"
2126 if test "x$with_libmodbus" = "xuse_pkgconfig"
2128 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
2129 $PKG_CONFIG --exists 'modbus' 2>/dev/null
2132 with_libmodbus="no (pkg-config doesn't know modbus)"
2135 if test "x$with_libmodbus" = "xuse_pkgconfig"
2137 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
2140 with_libmodbus="no ($PKG_CONFIG failed)"
2142 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
2145 with_libmodbus="no ($PKG_CONFIG failed)"
2148 if test "x$with_libmodbus" = "xuse_pkgconfig"
2150 with_libmodbus="yes"
2153 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2154 # the actual checks.
2155 if test "x$with_libmodbus" = "xyes"
2157 SAVE_CPPFLAGS="$CPPFLAGS"
2158 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2160 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2162 CPPFLAGS="$SAVE_CPPFLAGS"
2164 if test "x$with_libmodbus" = "xyes"
2166 SAVE_CPPFLAGS="$CPPFLAGS"
2167 SAVE_LDFLAGS="$LDFLAGS"
2169 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2170 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2172 AC_CHECK_LIB(modbus, modbus_connect,
2173 [with_libmodbus="yes"],
2174 [with_libmodbus="no (symbol modbus_connect not found)"])
2176 CPPFLAGS="$SAVE_CPPFLAGS"
2177 LDFLAGS="$SAVE_LDFLAGS"
2179 if test "x$with_libmodbus" = "xyes"
2181 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2182 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2183 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2184 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2188 # --with-libmysql {{{
2189 with_mysql_config="mysql_config"
2190 with_mysql_cflags=""
2192 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2194 if test "x$withval" = "xno"
2197 else if test "x$withval" = "xyes"
2201 if test -f "$withval" && test -x "$withval";
2203 with_mysql_config="$withval"
2204 else if test -x "$withval/bin/mysql_config"
2206 with_mysql_config="$withval/bin/mysql_config"
2214 if test "x$with_libmysql" = "xyes"
2216 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2217 mysql_config_status=$?
2219 if test $mysql_config_status -ne 0
2221 with_libmysql="no ($with_mysql_config failed)"
2223 SAVE_CPPFLAGS="$CPPFLAGS"
2224 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2227 have_mysql_mysql_h="no"
2228 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2230 if test "x$have_mysql_h" = "xno"
2232 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2235 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2237 with_libmysql="no (mysql.h not found)"
2240 CPPFLAGS="$SAVE_CPPFLAGS"
2243 if test "x$with_libmysql" = "xyes"
2245 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
2246 mysql_config_status=$?
2248 if test $mysql_config_status -ne 0
2250 with_libmysql="no ($with_mysql_config failed)"
2252 AC_CHECK_LIB(mysqlclient, mysql_init,
2253 [with_libmysql="yes"],
2254 [with_libmysql="no (symbol 'mysql_init' not found)"],
2257 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2258 [with_libmysql="yes"],
2259 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2263 if test "x$with_libmysql" = "xyes"
2265 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2266 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2267 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2268 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2270 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2273 # --with-libnetlink {{{
2274 with_libnetlink_cflags=""
2275 with_libnetlink_libs="-lnetlink"
2276 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2278 echo "libnetlink: withval = $withval"
2279 if test "x$withval" = "xyes"
2281 with_libnetlink="yes"
2282 else if test "x$withval" = "xno"
2284 with_libnetlink="no"
2286 if test -d "$withval/include"
2288 with_libnetlink_cflags="-I$withval/include"
2289 with_libnetlink_libs="-L$withval/lib -lnetlink"
2290 with_libnetlink="yes"
2292 AC_MSG_ERROR("no such directory: $withval/include")
2297 if test "x$ac_system" = "xLinux"
2299 with_libnetlink="yes"
2301 with_libnetlink="no (Linux only library)"
2304 if test "x$with_libnetlink" = "xyes"
2306 SAVE_CFLAGS="$CFLAGS"
2307 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2309 with_libnetlink="no (libnetlink.h not found)"
2311 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2313 with_libnetlink="yes"
2317 #include <sys/types.h>
2318 #include <asm/types.h>
2319 #include <sys/socket.h>
2320 #include <linux/netlink.h>
2321 #include <linux/rtnetlink.h>])
2322 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2324 #include <sys/types.h>
2325 #include <asm/types.h>
2326 #include <sys/socket.h>])
2330 #include <sys/types.h>
2331 #include <asm/types.h>
2332 #include <sys/socket.h>
2333 #include <linux/netlink.h>
2334 #include <linux/rtnetlink.h>
2338 int retval = TCA_STATS2;
2341 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2346 #include <sys/types.h>
2347 #include <asm/types.h>
2348 #include <sys/socket.h>
2349 #include <linux/netlink.h>
2350 #include <linux/rtnetlink.h>
2354 int retval = TCA_STATS;
2357 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2360 CFLAGS="$SAVE_CFLAGS"
2362 if test "x$with_libnetlink" = "xyes"
2364 AC_CHECK_LIB(netlink, rtnl_open,
2365 [with_libnetlink="yes"],
2366 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2367 [$with_libnetlink_libs])
2369 if test "x$with_libnetlink" = "xyes"
2371 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2372 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2373 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2374 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2376 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2379 # --with-libnetapp {{{
2380 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2381 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2382 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2383 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2384 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2385 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2386 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2388 if test -d "$withval"
2390 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2391 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2392 with_libnetapp="yes"
2394 with_libnetapp="$withval"
2398 with_libnetapp="yes"
2401 SAVE_CPPFLAGS="$CPPFLAGS"
2402 SAVE_LDFLAGS="$LDFLAGS"
2403 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2404 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2406 if test "x$with_libnetapp" = "xyes"
2408 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2410 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2412 AC_CHECK_HEADERS(netapp_api.h,
2413 [with_libnetapp="yes"],
2414 [with_libnetapp="no (netapp_api.h not found)"])
2417 if test "x$with_libnetapp" = "xyes"
2419 if test "x$LIBNETAPP_LDFLAGS" != "x"
2421 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2424 if test "x$LIBNETAPP_LIBS" = "x"
2426 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2428 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2430 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2431 [with_libnetapp="yes"],
2432 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2434 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2437 CPPFLAGS="$SAVE_CPPFLAGS"
2438 LDFLAGS="$SAVE_LDFLAGS"
2440 if test "x$with_libnetapp" = "xyes"
2442 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2445 AC_SUBST(LIBNETAPP_CPPFLAGS)
2446 AC_SUBST(LIBNETAPP_LDFLAGS)
2447 AC_SUBST(LIBNETAPP_LIBS)
2448 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2451 # --with-libnetsnmp {{{
2452 with_snmp_config="net-snmp-config"
2455 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2457 if test "x$withval" = "xno"
2459 with_libnetsnmp="no"
2460 else if test "x$withval" = "xyes"
2462 with_libnetsnmp="yes"
2464 if test -x "$withval"
2466 with_snmp_config="$withval"
2467 with_libnetsnmp="yes"
2469 with_snmp_config="$withval/bin/net-snmp-config"
2470 with_libnetsnmp="yes"
2474 [with_libnetsnmp="yes"])
2475 if test "x$with_libnetsnmp" = "xyes"
2477 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2478 snmp_config_status=$?
2480 if test $snmp_config_status -ne 0
2482 with_libnetsnmp="no ($with_snmp_config failed)"
2484 SAVE_CPPFLAGS="$CPPFLAGS"
2485 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2487 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2489 CPPFLAGS="$SAVE_CPPFLAGS"
2492 if test "x$with_libnetsnmp" = "xyes"
2494 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2495 snmp_config_status=$?
2497 if test $snmp_config_status -ne 0
2499 with_libnetsnmp="no ($with_snmp_config failed)"
2501 AC_CHECK_LIB(netsnmp, init_snmp,
2502 [with_libnetsnmp="yes"],
2503 [with_libnetsnmp="no (libnetsnmp not found)"],
2507 if test "x$with_libnetsnmp" = "xyes"
2509 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2510 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2511 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2512 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2514 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2517 # --with-liboconfig {{{
2518 with_own_liboconfig="no"
2519 liboconfig_LDFLAGS="$LDFLAGS"
2520 liboconfig_CPPFLAGS="$CPPFLAGS"
2521 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2523 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2525 if test -d "$withval/lib"
2527 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2529 if test -d "$withval/include"
2531 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2534 if test "x$withval" = "xno"
2536 AC_MSG_ERROR("liboconfig is required")
2540 with_liboconfig="yes"
2543 save_LDFLAGS="$LDFLAGS"
2544 save_CPPFLAGS="$CPPFLAGS"
2545 LDFLAGS="$liboconfig_LDFLAGS"
2546 CPPFLAGS="$liboconfig_CPPFLAGS"
2547 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2549 with_liboconfig="yes"
2550 with_own_liboconfig="no"
2553 with_liboconfig="yes"
2554 with_own_liboconfig="yes"
2555 LDFLAGS="$save_LDFLAGS"
2556 CPPFLAGS="$save_CPPFLAGS"
2559 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2560 if test "x$with_own_liboconfig" = "xyes"
2562 with_liboconfig="yes (shipped version)"
2566 # --with-liboping {{{
2567 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2569 if test "x$withval" = "xyes"
2572 else if test "x$withval" = "xno"
2577 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2578 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2581 [with_liboping="yes"])
2583 SAVE_CPPFLAGS="$CPPFLAGS"
2584 SAVE_LDFLAGS="$LDFLAGS"
2586 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2587 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2589 if test "x$with_liboping" = "xyes"
2591 if test "x$LIBOPING_CPPFLAGS" != "x"
2593 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2595 AC_CHECK_HEADERS(oping.h,
2596 [with_liboping="yes"],
2597 [with_liboping="no (oping.h not found)"])
2599 if test "x$with_liboping" = "xyes"
2601 if test "x$LIBOPING_LDFLAGS" != "x"
2603 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2605 AC_CHECK_LIB(oping, ping_construct,
2606 [with_liboping="yes"],
2607 [with_liboping="no (symbol 'ping_construct' not found)"])
2610 CPPFLAGS="$SAVE_CPPFLAGS"
2611 LDFLAGS="$SAVE_LDFLAGS"
2613 if test "x$with_liboping" = "xyes"
2615 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2616 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2617 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2618 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2620 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2624 with_oracle_cppflags=""
2626 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2628 if test "x$withval" = "xyes"
2630 if test "x$ORACLE_HOME" = "x"
2632 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2635 else if test "x$withval" = "xno"
2640 ORACLE_HOME="$withval"
2644 if test "x$ORACLE_HOME" = "x"
2646 with_oracle="no (ORACLE_HOME is not set)"
2651 if test "x$ORACLE_HOME" != "x"
2653 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2655 if test -e "$ORACLE_HOME/lib/ldflags"
2657 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2659 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2660 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2662 if test "x$with_oracle" = "xyes"
2664 SAVE_CPPFLAGS="$CPPFLAGS"
2665 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2667 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2669 CPPFLAGS="$SAVE_CPPFLAGS"
2671 if test "x$with_oracle" = "xyes"
2673 SAVE_CPPFLAGS="$CPPFLAGS"
2674 SAVE_LDFLAGS="$LDFLAGS"
2675 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2676 LDFLAGS="$LDFLAGS $with_oracle_libs"
2678 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2680 CPPFLAGS="$SAVE_CPPFLAGS"
2681 LDFLAGS="$SAVE_LDFLAGS"
2683 if test "x$with_oracle" = "xyes"
2685 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2686 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2687 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2688 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2692 # --with-libowcapi {{{
2693 with_libowcapi_cppflags=""
2694 with_libowcapi_libs="-lowcapi"
2695 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2697 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2699 with_libowcapi_cppflags="-I$withval/include"
2700 with_libowcapi_libs="-L$withval/lib -lowcapi"
2701 with_libowcapi="yes"
2703 with_libowcapi="$withval"
2707 with_libowcapi="yes"
2709 if test "x$with_libowcapi" = "xyes"
2711 SAVE_CPPFLAGS="$CPPFLAGS"
2712 CPPFLAGS="$with_libowcapi_cppflags"
2714 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2716 CPPFLAGS="$SAVE_CPPFLAGS"
2718 if test "x$with_libowcapi" = "xyes"
2720 SAVE_LDFLAGS="$LDFLAGS"
2721 SAVE_CPPFLAGS="$CPPFLAGS"
2722 LDFLAGS="$with_libowcapi_libs"
2723 CPPFLAGS="$with_libowcapi_cppflags"
2725 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2727 LDFLAGS="$SAVE_LDFLAGS"
2728 CPPFLAGS="$SAVE_CPPFLAGS"
2730 if test "x$with_libowcapi" = "xyes"
2732 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2733 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2734 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2735 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2739 # --with-libpcap {{{
2740 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2742 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2744 LDFLAGS="$LDFLAGS -L$withval/lib"
2745 CPPFLAGS="$CPPFLAGS -I$withval/include"
2748 with_libpcap="$withval"
2754 if test "x$with_libpcap" = "xyes"
2756 AC_CHECK_LIB(pcap, pcap_open_live,
2758 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2759 ], [with_libpcap="no (libpcap not found)"])
2761 if test "x$with_libpcap" = "xyes"
2763 AC_CHECK_HEADERS(pcap.h,,
2764 [with_libpcap="no (pcap.h not found)"])
2766 if test "x$with_libpcap" = "xyes"
2768 AC_CHECK_HEADERS(pcap-bpf.h,,
2769 [with_libpcap="no (pcap-bpf.h not found)"])
2771 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2774 # --with-libperl {{{
2775 perl_interpreter="perl"
2776 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2778 if test -x "$withval"
2780 perl_interpreter="$withval"
2782 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2784 LDFLAGS="$LDFLAGS -L$withval/lib"
2785 CPPFLAGS="$CPPFLAGS -I$withval/include"
2786 perl_interpreter="$withval/bin/perl"
2789 with_libperl="$withval"
2796 AC_MSG_CHECKING([for perl])
2797 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2798 if test -x "$perl_interpreter"
2800 AC_MSG_RESULT([yes ($perl_interpreter)])
2806 AC_SUBST(PERL, "$perl_interpreter")
2808 if test "x$with_libperl" = "xyes" \
2809 && test -n "$perl_interpreter"
2811 SAVE_CFLAGS="$CFLAGS"
2812 SAVE_LDFLAGS="$LDFLAGS"
2813 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2814 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2815 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2816 CFLAGS="$CFLAGS $PERL_CFLAGS"
2817 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2819 AC_CACHE_CHECK([for libperl],
2820 [c_cv_have_libperl],
2824 #define PERL_NO_GET_CONTEXT
2831 load_module (PERL_LOADMOD_NOIMPORT,
2832 newSVpv ("Collectd::Plugin::FooBar", 24),
2835 [c_cv_have_libperl="yes"],
2836 [c_cv_have_libperl="no"]
2840 if test "x$c_cv_have_libperl" = "xyes"
2842 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2843 AC_SUBST(PERL_CFLAGS)
2844 AC_SUBST(PERL_LDFLAGS)
2849 CFLAGS="$SAVE_CFLAGS"
2850 LDFLAGS="$SAVE_LDFLAGS"
2851 else if test -z "$perl_interpreter"; then
2852 with_libperl="no (no perl interpreter found)"
2853 c_cv_have_libperl="no"
2855 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2857 if test "x$with_libperl" = "xyes"
2859 SAVE_CFLAGS="$CFLAGS"
2860 SAVE_LDFLAGS="$LDFLAGS"
2861 CFLAGS="$CFLAGS $PERL_CFLAGS"
2862 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2864 AC_CACHE_CHECK([if perl supports ithreads],
2865 [c_cv_have_perl_ithreads],
2873 #if !defined(USE_ITHREADS)
2874 # error "Perl does not support ithreads!"
2875 #endif /* !defined(USE_ITHREADS) */
2878 [c_cv_have_perl_ithreads="yes"],
2879 [c_cv_have_perl_ithreads="no"]
2883 if test "x$c_cv_have_perl_ithreads" = "xyes"
2885 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2888 CFLAGS="$SAVE_CFLAGS"
2889 LDFLAGS="$SAVE_LDFLAGS"
2892 if test "x$with_libperl" = "xyes"
2894 SAVE_CFLAGS="$CFLAGS"
2895 SAVE_LDFLAGS="$LDFLAGS"
2896 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2897 # (see issues #41 and #42)
2898 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2899 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2901 AC_CACHE_CHECK([for broken Perl_load_module()],
2902 [c_cv_have_broken_perl_load_module],
2906 #define PERL_NO_GET_CONTEXT
2913 load_module (PERL_LOADMOD_NOIMPORT,
2914 newSVpv ("Collectd::Plugin::FooBar", 24),
2917 [c_cv_have_broken_perl_load_module="no"],
2918 [c_cv_have_broken_perl_load_module="yes"]
2922 CFLAGS="$SAVE_CFLAGS"
2923 LDFLAGS="$SAVE_LDFLAGS"
2925 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2926 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2928 if test "x$with_libperl" = "xyes"
2930 SAVE_CFLAGS="$CFLAGS"
2931 SAVE_LDFLAGS="$LDFLAGS"
2932 CFLAGS="$CFLAGS $PERL_CFLAGS"
2933 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2936 [struct mgvtbl.svt_local],
2937 [have_struct_mgvtbl_svt_local="yes"],
2938 [have_struct_mgvtbl_svt_local="no"],
2945 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2947 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2948 [Define if Perl's struct mgvtbl has member svt_local.])
2951 CFLAGS="$SAVE_CFLAGS"
2952 LDFLAGS="$SAVE_LDFLAGS"
2957 with_pg_config="pg_config"
2958 with_libpq_includedir=""
2959 with_libpq_libdir=""
2960 with_libpq_cppflags=""
2961 with_libpq_ldflags=""
2962 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2965 if test "x$withval" = "xno"
2968 else if test "x$withval" = "xyes"
2972 if test -f "$withval" && test -x "$withval";
2974 with_pg_config="$withval"
2975 else if test -x "$withval/bin/pg_config"
2977 with_pg_config="$withval/bin/pg_config"
2985 if test "x$with_libpq" = "xyes"
2987 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2990 if test $pg_config_status -eq 0
2992 if test -n "$with_libpq_includedir"; then
2993 for dir in $with_libpq_includedir; do
2994 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2998 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3001 SAVE_CPPFLAGS="$CPPFLAGS"
3002 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3004 AC_CHECK_HEADERS(libpq-fe.h, [],
3005 [with_libpq="no (libpq-fe.h not found)"], [])
3007 CPPFLAGS="$SAVE_CPPFLAGS"
3009 if test "x$with_libpq" = "xyes"
3011 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3014 if test $pg_config_status -eq 0
3016 if test -n "$with_libpq_libdir"; then
3017 for dir in $with_libpq_libdir; do
3018 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3022 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3025 SAVE_LDFLAGS="$LDFLAGS"
3026 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3028 AC_CHECK_LIB(pq, PQconnectdb,
3030 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3032 AC_CHECK_LIB(pq, PQserverVersion,
3034 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3036 LDFLAGS="$SAVE_LDFLAGS"
3038 if test "x$with_libpq" = "xyes"
3040 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3041 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3042 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3043 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3045 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3048 # --with-libpthread {{{
3049 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3050 [ if test "x$withval" != "xno" \
3051 && test "x$withval" != "xyes"
3053 LDFLAGS="$LDFLAGS -L$withval/lib"
3054 CPPFLAGS="$CPPFLAGS -I$withval/include"
3055 with_libpthread="yes"
3057 if test "x$withval" = "xno"
3059 with_libpthread="no (disabled)"
3062 ], [with_libpthread="yes"])
3063 if test "x$with_libpthread" = "xyes"
3065 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3068 if test "x$with_libpthread" = "xyes"
3070 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3072 if test "x$with_libpthread" = "xyes"
3078 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3079 [Wether or not to use pthread (POSIX threads) library])
3080 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3085 with_python_path="$PATH"
3086 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3088 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3090 with_python="$withval"
3091 else if test -x "$withval"
3093 with_python_prog="$withval"
3094 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3096 else if test -d "$withval"
3098 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3101 AC_MSG_WARN([Argument not recognized: $withval])
3103 ], [with_python="yes"])
3106 SAVE_CPPFLAGS="$CPPFLAGS"
3107 SAVE_LDFLAGS="$LDFLAGS"
3110 PATH="$with_python_path"
3112 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3114 AC_MSG_CHECKING([for python])
3115 with_python_prog="`which python 2>/dev/null`"
3116 if test "x$with_python_prog" = "x"
3118 AC_MSG_RESULT([not found])
3119 with_python="no (interpreter not found)"
3121 AC_MSG_RESULT([$with_python_prog])
3125 if test "x$with_python" = "xyes"
3127 AC_MSG_CHECKING([for Python CPPFLAGS])
3128 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3129 python_config_status=$?
3131 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3133 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3136 AC_MSG_RESULT([$python_include_path])
3140 if test "x$with_python" = "xyes"
3142 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3143 AC_CHECK_HEADERS(Python.h,
3144 [with_python="yes"],
3145 [with_python="no ('Python.h' not found)"])
3148 if test "x$with_python" = "xyes"
3150 AC_MSG_CHECKING([for Python LDFLAGS])
3151 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`
3152 python_config_status=$?
3154 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3156 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3159 AC_MSG_RESULT([$python_library_path])
3163 if test "x$with_python" = "xyes"
3165 AC_MSG_CHECKING([for Python LIBS])
3166 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`
3167 python_config_status=$?
3169 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3171 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3174 AC_MSG_RESULT([$python_library_flags])
3178 if test "x$with_python" = "xyes"
3180 LDFLAGS="-L$python_library_path $LDFLAGS"
3181 LIBS="$python_library_flags $LIBS"
3183 AC_CHECK_FUNC(PyObject_CallFunction,
3184 [with_python="yes"],
3185 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3189 CPPFLAGS="$SAVE_CPPFLAGS"
3190 LDFLAGS="$SAVE_LDFLAGS"
3193 if test "x$with_python" = "xyes"
3195 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3196 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3197 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3198 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3199 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3200 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3204 # --with-librabbitmq {{{
3205 with_librabbitmq_cppflags=""
3206 with_librabbitmq_ldflags=""
3207 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3209 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3211 with_librabbitmq_cppflags="-I$withval/include"
3212 with_librabbitmq_ldflags="-L$withval/lib"
3213 with_librabbitmq="yes"
3215 with_librabbitmq="$withval"
3219 with_librabbitmq="yes"
3221 if test "x$with_librabbitmq" = "xyes"
3223 SAVE_CPPFLAGS="$CPPFLAGS"
3224 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3226 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3228 CPPFLAGS="$SAVE_CPPFLAGS"
3230 if test "x$with_librabbitmq" = "xyes"
3232 SAVE_CPPFLAGS="$CPPFLAGS"
3233 SAVE_LDFLAGS="$LDFLAGS"
3234 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3235 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3237 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3239 CPPFLAGS="$SAVE_CPPFLAGS"
3240 LDFLAGS="$SAVE_LDFLAGS"
3242 if test "x$with_librabbitmq" = "xyes"
3244 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3245 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3246 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3247 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3248 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3249 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3250 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3252 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3255 # --with-librouteros {{{
3256 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3258 if test "x$withval" = "xyes"
3260 with_librouteros="yes"
3261 else if test "x$withval" = "xno"
3263 with_librouteros="no"
3265 with_librouteros="yes"
3266 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3267 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3270 [with_librouteros="yes"])
3272 SAVE_CPPFLAGS="$CPPFLAGS"
3273 SAVE_LDFLAGS="$LDFLAGS"
3275 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3276 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3278 if test "x$with_librouteros" = "xyes"
3280 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3282 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3284 AC_CHECK_HEADERS(routeros_api.h,
3285 [with_librouteros="yes"],
3286 [with_librouteros="no (routeros_api.h not found)"])
3288 if test "x$with_librouteros" = "xyes"
3290 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3292 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3294 AC_CHECK_LIB(routeros, ros_interface,
3295 [with_librouteros="yes"],
3296 [with_librouteros="no (symbol 'ros_interface' not found)"])
3299 CPPFLAGS="$SAVE_CPPFLAGS"
3300 LDFLAGS="$SAVE_LDFLAGS"
3302 if test "x$with_librouteros" = "xyes"
3304 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3305 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3306 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3307 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3309 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3313 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3316 librrd_threadsafe="yes"
3317 librrd_rrdc_update="no"
3318 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3319 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3321 librrd_cflags="-I$withval/include"
3322 librrd_ldflags="-L$withval/lib"
3325 with_librrd="$withval"
3327 ], [with_librrd="yes"])
3328 if test "x$with_librrd" = "xyes"
3330 SAVE_CPPFLAGS="$CPPFLAGS"
3331 SAVE_LDFLAGS="$LDFLAGS"
3333 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3334 LDFLAGS="$LDFLAGS $librrd_ldflags"
3336 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3338 CPPFLAGS="$SAVE_CPPFLAGS"
3339 LDFLAGS="$SAVE_LDFLAGS"
3341 if test "x$with_librrd" = "xyes"
3343 SAVE_CPPFLAGS="$CPPFLAGS"
3344 SAVE_LDFLAGS="$LDFLAGS"
3346 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3347 LDFLAGS="$LDFLAGS $librrd_ldflags"
3349 AC_CHECK_LIB(rrd_th, rrd_update_r,
3351 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3353 [librrd_threadsafe="no"
3354 AC_CHECK_LIB(rrd, rrd_update,
3356 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3358 [with_librrd="no (symbol 'rrd_update' not found)"],
3363 if test "x$librrd_threadsafe" = "xyes"
3365 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3367 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3370 CPPFLAGS="$SAVE_CPPFLAGS"
3371 LDFLAGS="$SAVE_LDFLAGS"
3373 if test "x$with_librrd" = "xyes"
3375 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3376 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3377 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3378 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3380 if test "x$librrd_threadsafe" = "xyes"
3382 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3386 # --with-libsensors {{{
3387 with_sensors_cflags=""
3388 with_sensors_ldflags=""
3389 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3391 if test "x$withval" = "xno"
3393 with_libsensors="no"
3395 with_libsensors="yes"
3396 if test "x$withval" != "xyes"
3398 with_sensors_cflags="-I$withval/include"
3399 with_sensors_ldflags="-L$withval/lib"
3400 with_libsensors="yes"
3405 if test "x$ac_system" = "xLinux"
3407 with_libsensors="yes"
3409 with_libsensors="no (Linux only library)"
3412 if test "x$with_libsensors" = "xyes"
3414 SAVE_CPPFLAGS="$CPPFLAGS"
3415 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3417 # AC_CHECK_HEADERS(sensors/sensors.h,
3419 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3421 # [with_libsensors="no (sensors/sensors.h not found)"])
3422 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3424 CPPFLAGS="$SAVE_CPPFLAGS"
3426 if test "x$with_libsensors" = "xyes"
3428 SAVE_CPPFLAGS="$CPPFLAGS"
3429 SAVE_LDFLAGS="$LDFLAGS"
3430 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3431 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3433 AC_CHECK_LIB(sensors, sensors_init,
3435 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3437 [with_libsensors="no (libsensors not found)"])
3439 CPPFLAGS="$SAVE_CPPFLAGS"
3440 LDFLAGS="$SAVE_LDFLAGS"
3442 if test "x$with_libsensors" = "xyes"
3444 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3445 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3446 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3447 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3449 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3452 # --with-libstatgrab {{{
3453 with_libstatgrab_cflags=""
3454 with_libstatgrab_ldflags=""
3455 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3457 if test "x$withval" != "xno" \
3458 && test "x$withval" != "xyes"
3460 with_libstatgrab_cflags="-I$withval/include"
3461 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3462 with_libstatgrab="yes"
3463 with_libstatgrab_pkg_config="no"
3465 with_libstatgrab="$withval"
3466 with_libstatgrab_pkg_config="yes"
3470 with_libstatgrab="yes"
3471 with_libstatgrab_pkg_config="yes"
3474 if test "x$with_libstatgrab" = "xyes" \
3475 && test "x$with_libstatgrab_pkg_config" = "xyes"
3477 if test "x$PKG_CONFIG" != "x"
3479 AC_MSG_CHECKING([pkg-config for libstatgrab])
3481 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3484 with_libstatgrab_pkg_config="no"
3485 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3486 temp_result="not found"
3488 AC_MSG_RESULT([$temp_result])
3490 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3491 with_libstatgrab_pkg_config="no"
3492 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3496 if test "x$with_libstatgrab" = "xyes" \
3497 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3498 && test "x$with_libstatgrab_cflags" = "x"
3500 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3501 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3504 with_libstatgrab_cflags="$temp_result"
3506 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3507 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3509 AC_MSG_RESULT([$temp_result])
3512 if test "x$with_libstatgrab" = "xyes" \
3513 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3514 && test "x$with_libstatgrab_ldflags" = "x"
3516 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3517 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3520 with_libstatgrab_ldflags="$temp_result"
3522 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3523 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3525 AC_MSG_RESULT([$temp_result])
3528 if test "x$with_libstatgrab" = "xyes"
3530 SAVE_CPPFLAGS="$CPPFLAGS"
3531 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3533 AC_CHECK_HEADERS(statgrab.h,
3534 [with_libstatgrab="yes"],
3535 [with_libstatgrab="no (statgrab.h not found)"])
3537 CPPFLAGS="$SAVE_CPPFLAGS"
3540 if test "x$with_libstatgrab" = "xyes"
3542 SAVE_CFLAGS="$CFLAGS"
3543 SAVE_LDFLAGS="$LDFLAGS"
3545 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3546 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3548 AC_CHECK_LIB(statgrab, sg_init,
3549 [with_libstatgrab="yes"],
3550 [with_libstatgrab="no (symbol sg_init not found)"])
3552 CFLAGS="$SAVE_CFLAGS"
3553 LDFLAGS="$SAVE_LDFLAGS"
3556 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3557 if test "x$with_libstatgrab" = "xyes"
3559 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3560 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3561 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3562 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3563 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3567 # --with-libtokyotyrant {{{
3568 with_libtokyotyrant_cppflags=""
3569 with_libtokyotyrant_ldflags=""
3570 with_libtokyotyrant_libs=""
3571 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3573 if test "x$withval" = "xno"
3575 with_libtokyotyrant="no"
3576 else if test "x$withval" = "xyes"
3578 with_libtokyotyrant="yes"
3580 with_libtokyotyrant_cppflags="-I$withval/include"
3581 with_libtokyotyrant_ldflags="-L$withval/include"
3582 with_libtokyotyrant_libs="-ltokyotyrant"
3583 with_libtokyotyrant="yes"
3587 with_libtokyotyrant="yes"
3590 if test "x$with_libtokyotyrant" = "xyes"
3592 if $PKG_CONFIG --exists tokyotyrant
3594 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3595 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3596 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3600 SAVE_CPPFLAGS="$CPPFLAGS"
3601 SAVE_LDFLAGS="$LDFLAGS"
3602 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3603 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3605 if test "x$with_libtokyotyrant" = "xyes"
3607 AC_CHECK_HEADERS(tcrdb.h,
3609 AC_DEFINE(HAVE_TCRDB_H, 1,
3610 [Define to 1 if you have the <tcrdb.h> header file.])
3611 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3614 if test "x$with_libtokyotyrant" = "xyes"
3616 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3618 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3619 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3621 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3622 [$with_libtokyotyrant_libs])
3625 CPPFLAGS="$SAVE_CPPFLAGS"
3626 LDFLAGS="$SAVE_LDFLAGS"
3628 if test "x$with_libtokyotyrant" = "xyes"
3630 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3631 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3632 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3633 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3634 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3635 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3637 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3640 # --with-libupsclient {{{
3641 with_libupsclient_config=""
3642 with_libupsclient_cflags=""
3643 with_libupsclient_libs=""
3644 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3646 if test "x$withval" = "xno"
3648 with_libupsclient="no"
3649 else if test "x$withval" = "xyes"
3651 with_libupsclient="use_pkgconfig"
3653 if test -x "$withval"
3655 with_libupsclient_config="$withval"
3656 with_libupsclient="use_libupsclient_config"
3657 else if test -x "$withval/bin/libupsclient-config"
3659 with_libupsclient_config="$withval/bin/libupsclient-config"
3660 with_libupsclient="use_libupsclient_config"
3662 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3663 with_libupsclient_cflags="-I$withval/include"
3664 with_libupsclient_libs="-L$withval/lib -lupsclient"
3665 with_libupsclient="yes"
3669 [with_libupsclient="use_pkgconfig"])
3671 # configure using libupsclient-config
3672 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3674 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3675 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3678 with_libupsclient="no ($with_libupsclient_config failed)"
3680 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3683 with_libupsclient="no ($with_libupsclient_config failed)"
3686 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3688 with_libupsclient="yes"
3691 # configure using pkg-config
3692 if test "x$with_libupsclient" = "xuse_pkgconfig"
3694 if test "x$PKG_CONFIG" = "x"
3696 with_libupsclient="no (Don't have pkg-config)"
3699 if test "x$with_libupsclient" = "xuse_pkgconfig"
3701 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3702 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3705 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3708 if test "x$with_libupsclient" = "xuse_pkgconfig"
3710 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3713 with_libupsclient="no ($PKG_CONFIG failed)"
3715 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3718 with_libupsclient="no ($PKG_CONFIG failed)"
3721 if test "x$with_libupsclient" = "xuse_pkgconfig"
3723 with_libupsclient="yes"
3726 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3727 # the actual checks.
3728 if test "x$with_libupsclient" = "xyes"
3730 SAVE_CPPFLAGS="$CPPFLAGS"
3731 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3733 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3735 CPPFLAGS="$SAVE_CPPFLAGS"
3737 if test "x$with_libupsclient" = "xyes"
3739 SAVE_CPPFLAGS="$CPPFLAGS"
3740 SAVE_LDFLAGS="$LDFLAGS"
3742 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3743 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3745 AC_CHECK_LIB(upsclient, upscli_connect,
3746 [with_libupsclient="yes"],
3747 [with_libupsclient="no (symbol upscli_connect not found)"])
3749 CPPFLAGS="$SAVE_CPPFLAGS"
3750 LDFLAGS="$SAVE_LDFLAGS"
3752 if test "x$with_libupsclient" = "xyes"
3754 SAVE_CPPFLAGS="$CPPFLAGS"
3755 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3757 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3758 [#include <stdlib.h>
3760 #include <upsclient.h>])
3762 CPPFLAGS="$SAVE_CPPFLAGS"
3764 if test "x$with_libupsclient" = "xyes"
3766 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3767 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3768 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3769 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3773 # --with-libxmms {{{
3774 with_xmms_config="xmms-config"
3777 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3779 if test "x$withval" != "xno" \
3780 && test "x$withval" != "xyes"
3782 if test -f "$withval" && test -x "$withval";
3784 with_xmms_config="$withval"
3785 else if test -x "$withval/bin/xmms-config"
3787 with_xmms_config="$withval/bin/xmms-config"
3790 else if test "x$withval" = "xno"
3800 if test "x$with_libxmms" = "xyes"
3802 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3803 xmms_config_status=$?
3805 if test $xmms_config_status -ne 0
3810 if test "x$with_libxmms" = "xyes"
3812 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3813 xmms_config_status=$?
3815 if test $xmms_config_status -ne 0
3820 if test "x$with_libxmms" = "xyes"
3822 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3824 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3825 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3826 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3827 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3834 with_libxmms_numeric=0
3835 if test "x$with_libxmms" = "xyes"
3837 with_libxmms_numeric=1
3839 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3840 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3843 # --with-libyajl {{{
3844 with_libyajl_cppflags=""
3845 with_libyajl_ldflags=""
3846 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3848 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3850 with_libyajl_cppflags="-I$withval/include"
3851 with_libyajl_ldflags="-L$withval/lib"
3854 with_libyajl="$withval"
3860 if test "x$with_libyajl" = "xyes"
3862 SAVE_CPPFLAGS="$CPPFLAGS"
3863 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3865 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3867 CPPFLAGS="$SAVE_CPPFLAGS"
3869 if test "x$with_libyajl" = "xyes"
3871 SAVE_CPPFLAGS="$CPPFLAGS"
3872 SAVE_LDFLAGS="$LDFLAGS"
3873 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3874 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3876 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3878 CPPFLAGS="$SAVE_CPPFLAGS"
3879 LDFLAGS="$SAVE_LDFLAGS"
3881 if test "x$with_libyajl" = "xyes"
3883 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3884 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3885 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3886 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3887 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3888 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3889 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3891 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3894 # --with-libvarnish {{{
3895 with_libvarnish_cppflags=""
3896 with_libvarnish_cflags=""
3897 with_libvarnish_libs=""
3898 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
3900 if test "x$withval" = "xno"
3902 with_libvarnish="no"
3903 else if test "x$withval" = "xyes"
3905 with_libvarnish="use_pkgconfig"
3906 else if test -d "$with_libvarnish/lib"
3908 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
3909 with_libvarnish_cflags="-I$withval/include"
3910 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
3911 with_libvarnish="yes"
3914 [with_libvarnish="use_pkgconfig"])
3916 # configure using pkg-config
3917 if test "x$with_libvarnish" = "xuse_pkgconfig"
3919 if test "x$PKG_CONFIG" = "x"
3921 with_libvarnish="no (Don't have pkg-config)"
3924 if test "x$with_libvarnish" = "xuse_pkgconfig"
3926 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
3927 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
3930 with_libvarnish="no (pkg-config doesn't know varnishapi)"
3933 if test "x$with_libvarnish" = "xuse_pkgconfig"
3935 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
3938 with_libvarnish="no ($PKG_CONFIG failed)"
3940 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
3943 with_libvarnish="no ($PKG_CONFIG failed)"
3946 if test "x$with_libvarnish" = "xuse_pkgconfig"
3948 with_libvarnish="yes"
3951 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
3952 # the actual checks.
3953 if test "x$with_libvarnish" = "xyes"
3955 SAVE_CPPFLAGS="$CPPFLAGS"
3956 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
3957 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
3959 CPPFLAGS="$SAVE_CPPFLAGS"
3961 if test "x$with_libvarnish" = "xyes"
3963 SAVE_CPPFLAGS="$CPPFLAGS"
3964 #SAVE_LDFLAGS="$LDFLAGS"
3966 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
3967 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
3969 AC_CHECK_LIB(varnishapi, VSL_OpenStats,
3970 [with_libvarnish="yes"],
3971 [with_libvarnish="no (symbol VSL_OpenStats not found)"],
3972 [$with_libvarnish_libs])
3974 CPPFLAGS="$SAVE_CPPFLAGS"
3975 #LDFLAGS="$SAVE_LDFLAGS"
3977 if test "x$with_libvarnish" = "xyes"
3979 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
3980 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
3981 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
3982 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
3986 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3987 with_libxml2="no (pkg-config isn't available)"
3988 with_libxml2_cflags=""
3989 with_libxml2_ldflags=""
3990 with_libvirt="no (pkg-config isn't available)"
3991 with_libvirt_cflags=""
3992 with_libvirt_ldflags=""
3993 if test "x$PKG_CONFIG" != "x"
3995 pkg-config --exists 'libxml-2.0' 2>/dev/null
4000 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4003 pkg-config --exists libvirt 2>/dev/null
4008 with_libvirt="no (pkg-config doesn't know libvirt)"
4011 if test "x$with_libxml2" = "xyes"
4013 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4018 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4024 if test "x$with_libxml2" = "xyes"
4026 SAVE_CPPFLAGS="$CPPFLAGS"
4027 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4029 AC_CHECK_HEADERS(libxml/parser.h, [],
4030 [with_libxml2="no (libxml/parser.h not found)"])
4032 CPPFLAGS="$SAVE_CPPFLAGS"
4034 if test "x$with_libxml2" = "xyes"
4036 SAVE_CFLAGS="$CFLAGS"
4037 SAVE_LDFLAGS="$LDFLAGS"
4039 CFLAGS="$CFLAGS $with_libxml2_cflags"
4040 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4042 AC_CHECK_LIB(xml2, xmlXPathEval,
4043 [with_libxml2="yes"],
4044 [with_libxml2="no (symbol xmlXPathEval not found)"])
4046 CFLAGS="$SAVE_CFLAGS"
4047 LDFLAGS="$SAVE_LDFLAGS"
4049 dnl Add the right compiler flags and libraries.
4050 if test "x$with_libxml2" = "xyes"; then
4051 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4052 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4053 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4054 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4056 if test "x$with_libvirt" = "xyes"
4058 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4063 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4069 if test "x$with_libvirt" = "xyes"
4071 SAVE_CPPFLAGS="$CPPFLAGS"
4072 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4074 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4075 [with_libvirt="no (libvirt/libvirt.h not found)"])
4077 CPPFLAGS="$SAVE_CPPFLAGS"
4079 if test "x$with_libvirt" = "xyes"
4081 SAVE_CFLAGS="$CFLAGS"
4082 SAVE_LDFLAGS="$LDFLAGS"
4084 CFLAGS="$CFLAGS $with_libvirt_cflags"
4085 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4087 AC_CHECK_LIB(virt, virDomainBlockStats,
4088 [with_libvirt="yes"],
4089 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4091 CFLAGS="$SAVE_CFLAGS"
4092 LDFLAGS="$SAVE_LDFLAGS"
4094 dnl Add the right compiler flags and libraries.
4095 if test "x$with_libvirt" = "xyes"; then
4096 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4097 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4098 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4099 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4103 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4104 with_libopenipmipthread="yes"
4105 with_libopenipmipthread_cflags=""
4106 with_libopenipmipthread_libs=""
4108 AC_MSG_CHECKING([for pkg-config])
4110 if test "x$PKG_CONFIG" = "x"
4112 with_libopenipmipthread="no"
4115 temp_result="$PKG_CONFIG"
4117 AC_MSG_RESULT([$temp_result])
4119 if test "x$with_libopenipmipthread" = "xyes"
4121 AC_MSG_CHECKING([for libOpenIPMIpthread])
4122 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4125 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4127 AC_MSG_RESULT([$with_libopenipmipthread])
4130 if test "x$with_libopenipmipthread" = "xyes"
4132 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4133 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4136 with_libopenipmipthread_cflags="$temp_result"
4138 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4139 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4141 AC_MSG_RESULT([$temp_result])
4144 if test "x$with_libopenipmipthread" = "xyes"
4146 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4147 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4150 with_libopenipmipthread_ldflags="$temp_result"
4152 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4153 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4155 AC_MSG_RESULT([$temp_result])
4158 if test "x$with_libopenipmipthread" = "xyes"
4160 SAVE_CPPFLAGS="$CPPFLAGS"
4161 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4163 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4164 [with_libopenipmipthread="yes"],
4165 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4166 [#include <OpenIPMI/ipmiif.h>
4167 #include <OpenIPMI/ipmi_err.h>
4168 #include <OpenIPMI/ipmi_posix.h>
4169 #include <OpenIPMI/ipmi_conn.h>
4172 CPPFLAGS="$SAVE_CPPFLAGS"
4175 if test "x$with_libopenipmipthread" = "xyes"
4177 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4178 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4179 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4180 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4184 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4185 [with_libnotify="yes"],
4186 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4189 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4192 # Check for enabled/disabled features
4195 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4196 # ------------------------------------------------------------
4198 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4203 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4208 m4_define([EnDis],[disabled])dnl
4209 m4_define([YesNo],[no])dnl
4215 m4_define([EnDis],[enabled])dnl
4216 m4_define([YesNo],[yes])dnl
4219 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4223 m4_if([$3], [feature], [],
4227 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4233 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4235 enable_$1='[YesNo]'dnl
4237 if test "x$enable_$1" = "xno"
4241 if test "x$enable_$1" = "xyes"
4245 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4250 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4251 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4253 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4255 # AC_PLUGIN(name, default, info)
4256 # ------------------------------------------------------------
4263 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4265 if test "x$enableval" = "xyes"
4268 else if test "x$enableval" = "xforce"
4273 enable_plugin="no (disabled on command line)"
4277 if test "x$enable_all_plugins" = "xauto"
4279 if test "x$2" = "xyes"
4286 enable_plugin="$enable_all_plugins"
4289 if test "x$enable_plugin" = "xyes"
4291 if test "x$2" = "xyes" || test "x$force" = "xyes"
4293 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4294 if test "x$2" != "xyes"
4296 dependency_warning="yes"
4298 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4299 dependency_error="yes"
4300 enable_plugin="no (dependency error)"
4303 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4304 enable_$1="$enable_plugin"
4306 )# AC_PLUGIN(name, default, info)
4308 m4_divert_once([HELP_ENABLE], [
4309 collectd features:])
4310 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4311 AC_COLLECTD([debug], [enable], [feature], [debugging])
4312 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4313 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4315 dependency_warning="no"
4316 dependency_error="no"
4321 plugin_conntrack="no"
4322 plugin_contextswitch="no"
4325 plugin_curl_json="no"
4326 plugin_curl_xml="no"
4330 plugin_interface="no"
4337 plugin_multimeter="no"
4341 plugin_processes="no"
4342 plugin_protocols="no"
4346 plugin_tcpconns="no"
4353 plugin_wireless="no"
4357 if test "x$ac_system" = "xLinux"
4359 plugin_battery="yes"
4360 plugin_conntrack="yes"
4361 plugin_contextswitch="yes"
4363 plugin_cpufreq="yes"
4365 plugin_entropy="yes"
4366 plugin_interface="yes"
4371 plugin_fscache="yes"
4372 plugin_processes="yes"
4373 plugin_protocols="yes"
4376 plugin_tcpconns="yes"
4377 plugin_thermal="yes"
4380 plugin_vserver="yes"
4381 plugin_wireless="yes"
4383 if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4389 if test "x$ac_system" = "xOpenBSD"
4391 plugin_tcpconns="yes"
4395 if test "x$with_libiokit" = "xyes"
4397 plugin_battery="yes"
4402 if test "x$with_perfstat" = "xyes"
4408 plugin_interface="yes"
4412 if test "x$with_procinfo" = "xyes"
4414 plugin_processes="yes"
4418 if test "x$with_kstat" = "xyes"
4421 plugin_zfs_arc="yes"
4424 if test "x$with_devinfo$with_kstat" = "xyesyes"
4428 plugin_interface="yes"
4434 if test "x$with_libstatgrab" = "xyes"
4438 plugin_interface="yes"
4445 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4448 if test "x$have_strptime" = "xyes"
4454 if test "x$with_libopenipmipthread" = "xyes"
4459 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4461 plugin_curl_json="yes"
4464 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4466 plugin_curl_xml="yes"
4469 if test "x$have_processor_info" = "xyes"
4473 if test "x$have_sysctl" = "xyes"
4478 if test "x$ac_system" = "xDarwin"
4483 if test "x$have_sysctlbyname" = "xyes"
4485 plugin_contextswitch="yes"
4488 plugin_tcpconns="yes"
4491 # Df plugin: Check if we know how to determine mount points first.
4492 #if test "x$have_listmntent" = "xyes"; then
4495 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4499 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4503 #if test "x$have_getmntent" = "xseq"
4507 if test "x$c_cv_have_one_getmntent" = "xyes"
4512 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4513 if test "x$plugin_df" = "xyes"
4516 if test "x$have_statfs" = "xyes"
4520 if test "x$have_statvfs" = "xyes"
4526 if test "x$have_getifaddrs" = "xyes"
4528 plugin_interface="yes"
4531 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4533 plugin_libvirt="yes"
4536 if test "x$have_getloadavg" = "xyes"
4541 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4546 # Mac OS X memory interface
4547 if test "x$have_host_statistics" = "xyes"
4552 if test "x$have_termios_h" = "xyes"
4554 plugin_multimeter="yes"
4558 if test "x$have_thread_info" = "xyes"
4560 plugin_processes="yes"
4563 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4565 plugin_processes="yes"
4568 if test "x$with_kvm_getswapinfo" = "xyes"
4573 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4578 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4580 plugin_tcpconns="yes"
4583 if test "x$have_getutent" = "xyes"
4587 if test "x$have_getutxent" = "xyes"
4592 m4_divert_once([HELP_ENABLE], [
4595 AC_ARG_ENABLE([all-plugins],
4596 AC_HELP_STRING([--enable-all-plugins],
4597 [enable all plugins (auto by def)]),
4599 if test "x$enableval" = "xyes"
4601 enable_all_plugins="yes"
4602 else if test "x$enableval" = "xauto"
4604 enable_all_plugins="auto"
4606 enable_all_plugins="no"
4609 [enable_all_plugins="auto"])
4611 m4_divert_once([HELP_ENABLE], [])
4613 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4614 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4615 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4616 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4617 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4618 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4619 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4620 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4621 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4622 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4623 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4624 AC_PLUGIN([csv], [yes], [CSV output plugin])
4625 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4626 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4627 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4628 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4629 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4630 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4631 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4632 AC_PLUGIN([email], [yes], [EMail statistics])
4633 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4634 AC_PLUGIN([exec], [yes], [Execution of external programs])
4635 AC_PLUGIN([filecount], [yes], [Count files in directories])
4636 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4637 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4638 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4639 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4640 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4641 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4642 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4643 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4644 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4645 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4646 AC_PLUGIN([load], [$plugin_load], [System load])
4647 AC_PLUGIN([logfile], [yes], [File logging plugin])
4648 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4649 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4650 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4651 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4652 AC_PLUGIN([match_regex], [yes], [The regex match])
4653 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4654 AC_PLUGIN([match_value], [yes], [The value match])
4655 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4656 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4657 AC_PLUGIN([memcached], [yes], [memcached statistics])
4658 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4659 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4660 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4661 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4662 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4663 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4664 AC_PLUGIN([network], [yes], [Network communication plugin])
4665 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4666 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4667 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4668 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4669 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4670 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4671 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4672 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4673 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4674 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4675 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4676 # FIXME: Check for libevent, too.
4677 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4678 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4679 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4680 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4681 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4682 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4683 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4684 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4685 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4686 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4687 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4688 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4689 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4690 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4691 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4692 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4693 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4694 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4695 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4696 AC_PLUGIN([target_notification], [yes], [The notification target])
4697 AC_PLUGIN([target_replace], [yes], [The replace target])
4698 AC_PLUGIN([target_scale],[yes], [The scale target])
4699 AC_PLUGIN([target_set], [yes], [The set target])
4700 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4701 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4702 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4703 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4704 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4705 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4706 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4707 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4708 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4709 AC_PLUGIN([users], [$plugin_users], [User statistics])
4710 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4711 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4712 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4713 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4714 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4715 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4716 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4717 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4718 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4720 dnl Default configuration file
4721 # Load either syslog or logfile
4722 LOAD_PLUGIN_SYSLOG=""
4723 LOAD_PLUGIN_LOGFILE=""
4725 AC_MSG_CHECKING([which default log plugin to load])
4726 default_log_plugin="none"
4727 if test "x$enable_syslog" = "xyes"
4729 default_log_plugin="syslog"
4731 LOAD_PLUGIN_SYSLOG="##"
4734 if test "x$enable_logfile" = "xyes"
4736 if test "x$default_log_plugin" = "xnone"
4738 default_log_plugin="logfile"
4740 LOAD_PLUGIN_LOGFILE="#"
4743 LOAD_PLUGIN_LOGFILE="##"
4745 AC_MSG_RESULT([$default_log_plugin])
4747 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4748 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4750 DEFAULT_LOG_LEVEL="info"
4751 if test "x$enable_debug" = "xyes"
4753 DEFAULT_LOG_LEVEL="debug"
4755 AC_SUBST(DEFAULT_LOG_LEVEL)
4757 # Load only one of rrdtool, network, csv in the default config.
4758 LOAD_PLUGIN_RRDTOOL=""
4759 LOAD_PLUGIN_NETWORK=""
4762 AC_MSG_CHECKING([which default write plugin to load])
4763 default_write_plugin="none"
4764 if test "x$enable_rrdtool" = "xyes"
4766 default_write_plugin="rrdtool"
4768 LOAD_PLUGIN_RRDTOOL="##"
4771 if test "x$enable_network" = "xyes"
4773 if test "x$default_write_plugin" = "xnone"
4775 default_write_plugin="network"
4777 LOAD_PLUGIN_NETWORK="#"
4780 LOAD_PLUGIN_NETWORK="##"
4783 if test "x$enable_csv" = "xyes"
4785 if test "x$default_write_plugin" = "xnone"
4787 default_write_plugin="csv"
4792 LOAD_PLUGIN_CSV="##"
4794 AC_MSG_RESULT([$default_write_plugin])
4796 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4797 AC_SUBST(LOAD_PLUGIN_NETWORK)
4798 AC_SUBST(LOAD_PLUGIN_CSV)
4801 if test "x$ac_system" = "xLinux" \
4802 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4804 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4808 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4810 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4812 PERL_BINDINGS_OPTIONS="$withval"
4813 with_perl_bindings="yes"
4815 PERL_BINDINGS_OPTIONS=""
4816 with_perl_bindings="$withval"
4820 PERL_BINDINGS_OPTIONS=""
4821 if test -n "$perl_interpreter"
4823 with_perl_bindings="yes"
4825 with_perl_bindings="no (no perl interpreter found)"
4828 if test "x$with_perl_bindings" = "xyes"
4830 PERL_BINDINGS="perl"
4834 AC_SUBST(PERL_BINDINGS)
4835 AC_SUBST(PERL_BINDINGS_OPTIONS)
4837 dnl libcollectdclient
4838 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4839 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4840 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4842 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4844 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4846 AC_SUBST(LCC_VERSION_MAJOR)
4847 AC_SUBST(LCC_VERSION_MINOR)
4848 AC_SUBST(LCC_VERSION_PATCH)
4849 AC_SUBST(LCC_VERSION_EXTRA)
4850 AC_SUBST(LCC_VERSION_STRING)
4852 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4854 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)
4856 if test "x$with_librrd" = "xyes" \
4857 && test "x$librrd_threadsafe" != "xyes"
4859 with_librrd="yes (warning: librrd is not thread-safe)"
4862 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
4864 with_libiptc="yes (shipped version)"
4867 if test "x$with_libperl" = "xyes"
4869 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4871 enable_perl="no (needs libperl)"
4874 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4876 enable_perl="no (libperl doesn't support ithreads)"
4879 if test "x$with_perl_bindings" = "xyes" \
4880 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4882 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4889 libcurl . . . . . . . $with_libcurl
4890 libdbi . . . . . . . $with_libdbi
4891 libcredis . . . . . . $with_libcredis
4892 libesmtp . . . . . . $with_libesmtp
4893 libganglia . . . . . $with_libganglia
4894 libgcrypt . . . . . . $with_libgcrypt
4895 libiokit . . . . . . $with_libiokit
4896 libiptc . . . . . . . $with_libiptc
4897 libjvm . . . . . . . $with_java
4898 libkstat . . . . . . $with_kstat
4899 libkvm . . . . . . . $with_libkvm
4900 libmemcached . . . . $with_libmemcached
4901 libmodbus . . . . . . $with_libmodbus
4902 libmysql . . . . . . $with_libmysql
4903 libnetapp . . . . . . $with_libnetapp
4904 libnetlink . . . . . $with_libnetlink
4905 libnetsnmp . . . . . $with_libnetsnmp
4906 libnotify . . . . . . $with_libnotify
4907 liboconfig . . . . . $with_liboconfig
4908 libopenipmi . . . . . $with_libopenipmipthread
4909 liboping . . . . . . $with_liboping
4910 libpcap . . . . . . . $with_libpcap
4911 libperfstat . . . . . $with_perfstat
4912 libperl . . . . . . . $with_libperl
4913 libpq . . . . . . . . $with_libpq
4914 libpthread . . . . . $with_libpthread
4915 librabbitmq . . . . . $with_librabbitmq
4916 librouteros . . . . . $with_librouteros
4917 librrd . . . . . . . $with_librrd
4918 libsensors . . . . . $with_libsensors
4919 libstatgrab . . . . . $with_libstatgrab
4920 libtokyotyrant . . . $with_libtokyotyrant
4921 libupsclient . . . . $with_libupsclient
4922 libvarnish . . . . . $with_libvarnish
4923 libvirt . . . . . . . $with_libvirt
4924 libxml2 . . . . . . . $with_libxml2
4925 libxmms . . . . . . . $with_libxmms
4926 libyajl . . . . . . . $with_libyajl
4927 libevent . . . . . . $with_libevent
4928 protobuf-c . . . . . $have_protoc_c
4929 oracle . . . . . . . $with_oracle
4930 python . . . . . . . $with_python
4933 daemon mode . . . . . $enable_daemon
4934 debug . . . . . . . . $enable_debug
4937 perl . . . . . . . . $with_perl_bindings
4940 amqp . . . . . . . $enable_amqp
4941 apache . . . . . . . $enable_apache
4942 apcups . . . . . . . $enable_apcups
4943 apple_sensors . . . . $enable_apple_sensors
4944 ascent . . . . . . . $enable_ascent
4945 battery . . . . . . . $enable_battery
4946 bind . . . . . . . . $enable_bind
4947 conntrack . . . . . . $enable_conntrack
4948 contextswitch . . . . $enable_contextswitch
4949 cpu . . . . . . . . . $enable_cpu
4950 cpufreq . . . . . . . $enable_cpufreq
4951 csv . . . . . . . . . $enable_csv
4952 curl . . . . . . . . $enable_curl
4953 curl_json . . . . . . $enable_curl_json
4954 curl_xml . . . . . . $enable_curl_xml
4955 dbi . . . . . . . . . $enable_dbi
4956 df . . . . . . . . . $enable_df
4957 disk . . . . . . . . $enable_disk
4958 dns . . . . . . . . . $enable_dns
4959 email . . . . . . . . $enable_email
4960 entropy . . . . . . . $enable_entropy
4961 exec . . . . . . . . $enable_exec
4962 filecount . . . . . . $enable_filecount
4963 fscache . . . . . . . $enable_fscache
4964 gmond . . . . . . . . $enable_gmond
4965 hddtemp . . . . . . . $enable_hddtemp
4966 interface . . . . . . $enable_interface
4967 ipmi . . . . . . . . $enable_ipmi
4968 iptables . . . . . . $enable_iptables
4969 ipvs . . . . . . . . $enable_ipvs
4970 irq . . . . . . . . . $enable_irq
4971 java . . . . . . . . $enable_java
4972 libvirt . . . . . . . $enable_libvirt
4973 load . . . . . . . . $enable_load
4974 logfile . . . . . . . $enable_logfile
4975 lpar... . . . . . . . $enable_lpar
4976 madwifi . . . . . . . $enable_madwifi
4977 match_empty_counter . $enable_match_empty_counter
4978 match_hashed . . . . $enable_match_hashed
4979 match_regex . . . . . $enable_match_regex
4980 match_timediff . . . $enable_match_timediff
4981 match_value . . . . . $enable_match_value
4982 mbmon . . . . . . . . $enable_mbmon
4983 memcachec . . . . . . $enable_memcachec
4984 memcached . . . . . . $enable_memcached
4985 memory . . . . . . . $enable_memory
4986 modbus . . . . . . . $enable_modbus
4987 multimeter . . . . . $enable_multimeter
4988 mysql . . . . . . . . $enable_mysql
4989 netapp . . . . . . . $enable_netapp
4990 netlink . . . . . . . $enable_netlink
4991 network . . . . . . . $enable_network
4992 nfs . . . . . . . . . $enable_nfs
4993 nginx . . . . . . . . $enable_nginx
4994 notify_desktop . . . $enable_notify_desktop
4995 notify_email . . . . $enable_notify_email
4996 ntpd . . . . . . . . $enable_ntpd
4997 nut . . . . . . . . . $enable_nut
4998 olsrd . . . . . . . . $enable_olsrd
4999 onewire . . . . . . . $enable_onewire
5000 openvpn . . . . . . . $enable_openvpn
5001 oracle . . . . . . . $enable_oracle
5002 perl . . . . . . . . $enable_perl
5003 pinba . . . . . . . . $enable_pinba
5004 ping . . . . . . . . $enable_ping
5005 postgresql . . . . . $enable_postgresql
5006 powerdns . . . . . . $enable_powerdns
5007 processes . . . . . . $enable_processes
5008 protocols . . . . . . $enable_protocols
5009 python . . . . . . . $enable_python
5010 redis . . . . . . . . $enable_redis
5011 routeros . . . . . . $enable_routeros
5012 rrdcached . . . . . . $enable_rrdcached
5013 rrdtool . . . . . . . $enable_rrdtool
5014 sensors . . . . . . . $enable_sensors
5015 serial . . . . . . . $enable_serial
5016 snmp . . . . . . . . $enable_snmp
5017 swap . . . . . . . . $enable_swap
5018 syslog . . . . . . . $enable_syslog
5019 table . . . . . . . . $enable_table
5020 tail . . . . . . . . $enable_tail
5021 tape . . . . . . . . $enable_tape
5022 target_notification . $enable_target_notification
5023 target_replace . . . $enable_target_replace
5024 target_scale . . . . $enable_target_scale
5025 target_set . . . . . $enable_target_set
5026 target_v5upgrade . . $enable_target_v5upgrade
5027 tcpconns . . . . . . $enable_tcpconns
5028 teamspeak2 . . . . . $enable_teamspeak2
5029 ted . . . . . . . . . $enable_ted
5030 thermal . . . . . . . $enable_thermal
5031 threshold . . . . . . $enable_threshold
5032 tokyotyrant . . . . . $enable_tokyotyrant
5033 unixsock . . . . . . $enable_unixsock
5034 uptime . . . . . . . $enable_uptime
5035 users . . . . . . . . $enable_users
5036 uuid . . . . . . . . $enable_uuid
5037 varnish . . . . . . . $enable_varnish
5038 vmem . . . . . . . . $enable_vmem
5039 vserver . . . . . . . $enable_vserver
5040 wireless . . . . . . $enable_wireless
5041 write_http . . . . . $enable_write_http
5042 write_redis . . . . . $enable_write_redis
5043 xmms . . . . . . . . $enable_xmms
5044 zfs_arc . . . . . . . $enable_zfs_arc
5048 if test "x$dependency_error" = "xyes"; then
5049 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5052 if test "x$dependency_warning" = "xyes"; then
5053 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5056 # vim: set fdm=marker :