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(syslog, [have_syslog="yes"], [have_syslog="no"])
618 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
619 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
620 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
621 if test "x$have_swapctl" = "xyes"; then
622 AC_CACHE_CHECK([whether swapctl takes two arguments],
623 [c_cv_have_swapctl_two_args],
625 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
626 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
627 # undef _FILE_OFFSET_BITS
628 # undef _LARGEFILE64_SOURCE
630 #include <sys/stat.h>
631 #include <sys/swap.h>]],
633 int num = swapctl(0, NULL);
636 [c_cv_have_swapctl_two_args="yes"],
637 [c_cv_have_swapctl_two_args="no"]
640 AC_CACHE_CHECK([whether swapctl takes three arguments],
641 [c_cv_have_swapctl_three_args],
643 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
644 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
645 # undef _FILE_OFFSET_BITS
646 # undef _LARGEFILE64_SOURCE
648 #include <sys/stat.h>
649 #include <sys/swap.h>]],
651 int num = swapctl(0, NULL,0);
654 [c_cv_have_swapctl_three_args="yes"],
655 [c_cv_have_swapctl_three_args="no"]
659 # Check for different versions of `swapctl' here..
660 if test "x$have_swapctl" = "xyes"; then
661 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
662 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
663 [Define if the function swapctl exists and takes two arguments.])
665 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
666 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
667 [Define if the function swapctl exists and takes three arguments.])
672 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
675 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
677 if test "x$withval" = "xno"; then
679 else if test "x$withval" = "xyes"; then
686 if test "x$nan_type" = "xnone"; then
687 AC_CACHE_CHECK([whether NAN is defined by default],
688 [c_cv_have_nan_default],
694 static float foo = NAN;
702 [c_cv_have_nan_default="yes"],
703 [c_cv_have_nan_default="no"]
706 if test "x$c_cv_have_nan_default" = "xyes"
711 if test "x$nan_type" = "xnone"; then
712 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
713 [c_cv_have_nan_isoc],
718 #define __USE_ISOC99 1
720 static float foo = NAN;
728 [c_cv_have_nan_isoc="yes"],
729 [c_cv_have_nan_isoc="no"]
732 if test "x$c_cv_have_nan_isoc" = "xyes"
737 if test "x$nan_type" = "xnone"; then
738 SAVE_LDFLAGS=$LDFLAGS
739 LDFLAGS="$LDFLAGS -lm"
740 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
741 [c_cv_have_nan_zero],
750 #define NAN (0.0 / 0.0)
752 # define isnan(f) ((f) != (f))
754 static float foo = NAN;
762 [c_cv_have_nan_zero="yes"],
763 [c_cv_have_nan_zero="no"]
766 LDFLAGS=$SAVE_LDFLAGS
767 if test "x$c_cv_have_nan_zero" = "xyes"
773 if test "x$nan_type" = "xdefault"; then
774 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
775 [Define if NAN is defined by default and can initialize static variables.])
776 else if test "x$nan_type" = "xisoc99"; then
777 AC_DEFINE(NAN_STATIC_ISOC, 1,
778 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
779 else if test "x$nan_type" = "xzero"; then
780 AC_DEFINE(NAN_ZERO_ZERO, 1,
781 [Define if NAN can be defined as (0.0 / 0.0)])
783 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
786 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
788 if test "x$withval" = "xnothing"; then
789 fp_layout_type="nothing"
790 else if test "x$withval" = "xendianflip"; then
791 fp_layout_type="endianflip"
792 else if test "x$withval" = "xintswap"; then
793 fp_layout_type="intswap"
795 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
798 [fp_layout_type="unknown"])
800 if test "x$fp_layout_type" = "xunknown"; then
801 AC_CACHE_CHECK([if doubles are stored in x86 representation],
802 [c_cv_fp_layout_need_nothing],
813 # include <inttypes.h>
816 # include <stdbool.h>
826 memcpy ((void *) &i0, (void *) &d, 8);
829 memcpy ((void *) c, (void *) &i1, 8);
831 if ((c[0] == 0x2f) && (c[1] == 0x25)
832 && (c[2] == 0xc0) && (c[3] == 0xc7)
833 && (c[4] == 0x43) && (c[5] == 0x2b)
834 && (c[6] == 0x1f) && (c[7] == 0x5b))
839 [c_cv_fp_layout_need_nothing="yes"],
840 [c_cv_fp_layout_need_nothing="no"]
843 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
844 fp_layout_type="nothing"
847 if test "x$fp_layout_type" = "xunknown"; then
848 AC_CACHE_CHECK([if endianflip converts to x86 representation],
849 [c_cv_fp_layout_need_endianflip],
860 # include <inttypes.h>
863 # include <stdbool.h>
865 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
866 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
867 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
868 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
869 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
870 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
871 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
872 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
881 memcpy ((void *) &i0, (void *) &d, 8);
883 i1 = endianflip (i0);
884 memcpy ((void *) c, (void *) &i1, 8);
886 if ((c[0] == 0x2f) && (c[1] == 0x25)
887 && (c[2] == 0xc0) && (c[3] == 0xc7)
888 && (c[4] == 0x43) && (c[5] == 0x2b)
889 && (c[6] == 0x1f) && (c[7] == 0x5b))
894 [c_cv_fp_layout_need_endianflip="yes"],
895 [c_cv_fp_layout_need_endianflip="no"]
898 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
899 fp_layout_type="endianflip"
902 if test "x$fp_layout_type" = "xunknown"; then
903 AC_CACHE_CHECK([if intswap converts to x86 representation],
904 [c_cv_fp_layout_need_intswap],
915 # include <inttypes.h>
918 # include <stdbool.h>
920 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
921 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
930 memcpy ((void *) &i0, (void *) &d, 8);
933 memcpy ((void *) c, (void *) &i1, 8);
935 if ((c[0] == 0x2f) && (c[1] == 0x25)
936 && (c[2] == 0xc0) && (c[3] == 0xc7)
937 && (c[4] == 0x43) && (c[5] == 0x2b)
938 && (c[6] == 0x1f) && (c[7] == 0x5b))
943 [c_cv_fp_layout_need_intswap="yes"],
944 [c_cv_fp_layout_need_intswap="no"]
947 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
948 fp_layout_type="intswap"
952 if test "x$fp_layout_type" = "xnothing"; then
953 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
954 [Define if doubles are stored in x86 representation.])
955 else if test "x$fp_layout_type" = "xendianflip"; then
956 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
957 [Define if endianflip is needed to convert to x86 representation.])
958 else if test "x$fp_layout_type" = "xintswap"; then
959 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
960 [Define if intswap is needed to convert to x86 representation.])
962 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
966 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
968 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
970 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
973 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
974 if test "x$have_getmntent" = "xno"; then
975 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
977 if test "x$have_getmntent" = "xno"; then
978 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
980 if test "x$have_getmntent" = "xno"; then
981 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
984 if test "x$have_getmntent" = "xc"; then
985 AC_CACHE_CHECK([whether getmntent takes one argument],
986 [c_cv_have_one_getmntent],
988 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
989 #include "$srcdir/src/utils_mount.h"]],
993 fh = setmntent ("/etc/mtab", "r");
997 [c_cv_have_one_getmntent="yes"],
998 [c_cv_have_one_getmntent="no"]
1001 AC_CACHE_CHECK([whether getmntent takes two arguments],
1002 [c_cv_have_two_getmntent],
1004 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1005 #include "$srcdir/src/utils_mount.h"]],
1010 fh = fopen ("/etc/mnttab", "r");
1011 status = getmntent (fh, &mt);
1014 [c_cv_have_two_getmntent="yes"],
1015 [c_cv_have_two_getmntent="no"]
1020 # Check for different versions of `getmntent' here..
1022 if test "x$have_getmntent" = "xc"; then
1023 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1024 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1025 [Define if the function getmntent exists and takes one argument.])
1027 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1028 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1029 [Define if the function getmntent exists and takes two arguments.])
1032 if test "x$have_getmntent" = "xsun"; then
1033 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1034 [Define if the function getmntent exists. It's the version from libsun.])
1036 if test "x$have_getmntent" = "xseq"; then
1037 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1038 [Define if the function getmntent exists. It's the version from libseq.])
1040 if test "x$have_getmntent" = "xgen"; then
1041 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1042 [Define if the function getmntent exists. It's the version from libgen.])
1046 AC_MSG_CHECKING([if have htonll defined])
1051 #include <sys/types.h>
1052 #include <netinet/in.h>
1054 # include <inttypes.h>
1061 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1064 AC_MSG_RESULT([$have_htonll])
1066 # Check for structures
1067 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1068 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1071 #include <sys/types.h>
1072 #include <sys/socket.h>
1075 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1076 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1079 #include <sys/types.h>
1080 #include <sys/socket.h>
1081 #include <linux/if.h>
1082 #include <linux/netdevice.h>
1085 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1088 #include <netinet/in.h>
1092 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1094 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1095 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1096 have_struct_kinfo_proc_freebsd="yes"
1099 have_struct_kinfo_proc_freebsd="no"
1103 #include <sys/param.h>
1104 #include <sys/sysctl.h>
1105 #include <sys/user.h>
1108 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1110 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1111 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1112 have_struct_kinfo_proc_openbsd="yes"
1115 have_struct_kinfo_proc_openbsd="no"
1118 #include <sys/param.h>
1119 #include <sys/sysctl.h>
1123 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1124 [#define _BSD_SOURCE
1126 # include <stdint.h>
1128 #if HAVE_SYS_TYPES_H
1129 # include <sys/types.h>
1131 #if HAVE_NETINET_IN_SYSTM_H
1132 # include <netinet/in_systm.h>
1134 #if HAVE_NETINET_IN_H
1135 # include <netinet/in.h>
1137 #if HAVE_NETINET_IP_H
1138 # include <netinet/ip.h>
1140 #if HAVE_NETINET_UDP_H
1141 # include <netinet/udp.h>
1144 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1145 [#define _BSD_SOURCE
1147 # include <stdint.h>
1149 #if HAVE_SYS_TYPES_H
1150 # include <sys/types.h>
1152 #if HAVE_NETINET_IN_SYSTM_H
1153 # include <netinet/in_systm.h>
1155 #if HAVE_NETINET_IN_H
1156 # include <netinet/in.h>
1158 #if HAVE_NETINET_IP_H
1159 # include <netinet/ip.h>
1161 #if HAVE_NETINET_UDP_H
1162 # include <netinet/udp.h>
1166 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1176 # Checks for libraries begin here
1178 with_libresolv="yes"
1179 AC_CHECK_LIB(resolv, res_search,
1181 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1183 [with_libresolv="no"])
1184 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1186 dnl Check for HAL (hardware abstraction library)
1188 AC_CHECK_LIB(hal,libhal_device_property_exists,
1189 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1191 if test "x$with_libhal" = "xyes"; then
1192 if test "x$PKG_CONFIG" != "x"; then
1193 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1194 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1195 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1196 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1200 m4_divert_once([HELP_WITH], [
1201 collectd additional packages:])
1203 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1205 if test "x$ac_system" = "xAIX"
1210 with_perfstat="no (AIX only)"
1211 with_procinfo="no (AIX only)"
1214 if test "x$with_perfstat" = "xyes"
1216 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1217 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1219 if test "x$with_perfstat" = "xyes"
1221 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1222 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1223 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1224 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1226 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1229 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1231 # Processes plugin under AIX.
1232 if test "x$with_procinfo" = "xyes"
1234 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1236 if test "x$with_procinfo" = "xyes"
1238 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1241 if test "x$ac_system" = "xSolaris"
1246 with_kstat="no (Solaris only)"
1247 with_devinfo="no (Solaris only)"
1250 if test "x$with_kstat" = "xyes"
1252 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1254 if test "x$with_kstat" = "xyes"
1256 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1257 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1259 if test "x$with_kstat" = "xyes"
1261 AC_DEFINE(HAVE_LIBKSTAT, 1,
1262 [Define to 1 if you have the 'kstat' library (-lkstat)])
1264 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1265 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1268 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1275 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1278 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1279 if test "x$with_kvm_getprocs" = "xyes"
1281 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1282 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1285 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1287 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1288 if test "x$with_kvm_getswapinfo" = "xyes"
1290 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1291 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1294 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1296 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1297 if test "x$with_kvm_nlist" = "xyes"
1299 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1300 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1303 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1305 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1306 if test "x$with_kvm_openfiles" = "xyes"
1308 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1309 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1312 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1314 # --with-libcredis {{{
1315 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1317 if test "x$withval" = "xyes"
1319 with_libcredis="yes"
1320 else if test "x$withval" = "xno"
1324 with_libcredis="yes"
1325 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1326 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1329 [with_libcredis="yes"])
1331 SAVE_CPPFLAGS="$CPPFLAGS"
1332 SAVE_LDFLAGS="$LDFLAGS"
1334 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1335 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1337 if test "x$with_libcredis" = "xyes"
1339 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1341 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1343 AC_CHECK_HEADERS(credis.h,
1344 [with_libcredis="yes"],
1345 [with_libcredis="no ('credis.h' not found)"])
1347 if test "x$with_libcredis" = "xyes"
1349 if test "x$LIBCREDIS_LDFLAGS" != "x"
1351 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1353 AC_CHECK_LIB(credis, credis_info,
1354 [with_libcredis="yes"],
1355 [with_libcredis="no (symbol 'credis_info' not found)"])
1359 CPPFLAGS="$SAVE_CPPFLAGS"
1360 LDFLAGS="$SAVE_LDFLAGS"
1362 if test "x$with_libcredis" = "xyes"
1364 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1365 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1366 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1367 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1369 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1372 # --with-libcurl {{{
1373 with_curl_config="curl-config"
1376 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1378 if test "x$withval" = "xno"
1381 else if test "x$withval" = "xyes"
1385 if test -f "$withval" && test -x "$withval"
1387 with_curl_config="$withval"
1389 else if test -x "$withval/bin/curl-config"
1391 with_curl_config="$withval/bin/curl-config"
1400 if test "x$with_libcurl" = "xyes"
1402 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1403 curl_config_status=$?
1405 if test $curl_config_status -ne 0
1407 with_libcurl="no ($with_curl_config failed)"
1409 SAVE_CPPFLAGS="$CPPFLAGS"
1410 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1412 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1414 CPPFLAGS="$SAVE_CPPFLAGS"
1417 if test "x$with_libcurl" = "xyes"
1419 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1420 curl_config_status=$?
1422 if test $curl_config_status -ne 0
1424 with_libcurl="no ($with_curl_config failed)"
1426 AC_CHECK_LIB(curl, curl_easy_init,
1427 [with_libcurl="yes"],
1428 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1432 if test "x$with_libcurl" = "xyes"
1434 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1435 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1436 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1437 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1439 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1443 with_libdbi_cppflags=""
1444 with_libdbi_ldflags=""
1445 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1447 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1449 with_libdbi_cppflags="-I$withval/include"
1450 with_libdbi_ldflags="-L$withval/lib"
1453 with_libdbi="$withval"
1459 if test "x$with_libdbi" = "xyes"
1461 SAVE_CPPFLAGS="$CPPFLAGS"
1462 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1464 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1466 CPPFLAGS="$SAVE_CPPFLAGS"
1468 if test "x$with_libdbi" = "xyes"
1470 SAVE_CPPFLAGS="$CPPFLAGS"
1471 SAVE_LDFLAGS="$LDFLAGS"
1472 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1473 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1475 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1477 CPPFLAGS="$SAVE_CPPFLAGS"
1478 LDFLAGS="$SAVE_LDFLAGS"
1480 if test "x$with_libdbi" = "xyes"
1482 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1483 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1484 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1485 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1486 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1487 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1489 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1492 # --with-libesmtp {{{
1493 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1495 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1497 LDFLAGS="$LDFLAGS -L$withval/lib"
1498 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1501 with_libesmtp="$withval"
1507 if test "x$with_libesmtp" = "xyes"
1509 AC_CHECK_LIB(esmtp, smtp_create_session,
1511 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1512 ], [with_libesmtp="no (libesmtp not found)"])
1514 if test "x$with_libesmtp" = "xyes"
1516 AC_CHECK_HEADERS(libesmtp.h,
1518 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1519 ], [with_libesmtp="no (libesmtp.h not found)"])
1521 if test "x$with_libesmtp" = "xyes"
1527 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1528 [Wether or not to use the esmtp library])
1529 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1532 # --with-libganglia {{{
1533 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1535 if test -f "$withval" && test -x "$withval"
1537 with_libganglia_config="$withval"
1538 with_libganglia="yes"
1539 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1541 with_libganglia_config="$withval/bin/ganglia-config"
1542 with_libganglia="yes"
1543 else if test -d "$withval"
1545 GANGLIA_CPPFLAGS="-I$withval/include"
1546 GANGLIA_LDFLAGS="-L$withval/lib"
1547 with_libganglia="yes"
1549 with_libganglia_config="ganglia-config"
1550 with_libganglia="$withval"
1554 with_libganglia_config="ganglia-config"
1555 with_libganglia="yes"
1558 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1560 if test "x$GANGLIA_CPPFLAGS" = "x"
1562 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1565 if test "x$GANGLIA_LDFLAGS" = "x"
1567 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1570 if test "x$GANGLIA_LIBS" = "x"
1572 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1576 SAVE_CPPFLAGS="$CPPFLAGS"
1577 SAVE_LDFLAGS="$LDFLAGS"
1578 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1579 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1581 if test "x$with_libganglia" = "xyes"
1583 AC_CHECK_HEADERS(gm_protocol.h,
1585 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1586 [Define to 1 if you have the <gm_protocol.h> header file.])
1587 ], [with_libganglia="no (gm_protocol.h not found)"])
1590 if test "x$with_libganglia" = "xyes"
1592 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1594 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1595 [Define to 1 if you have the ganglia library (-lganglia).])
1596 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1599 CPPFLAGS="$SAVE_CPPFLAGS"
1600 LDFLAGS="$SAVE_LDFLAGS"
1602 AC_SUBST(GANGLIA_CPPFLAGS)
1603 AC_SUBST(GANGLIA_LDFLAGS)
1604 AC_SUBST(GANGLIA_LIBS)
1605 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1608 # --with-libgcrypt {{{
1609 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1610 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1611 GCRYPT_LIBS="$GCRYPT_LIBS"
1612 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1614 if test -f "$withval" && test -x "$withval"
1616 with_libgcrypt_config="$withval"
1617 with_libgcrypt="yes"
1618 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1620 with_libgcrypt_config="$withval/bin/gcrypt-config"
1621 with_libgcrypt="yes"
1622 else if test -d "$withval"
1624 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1625 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1626 with_libgcrypt="yes"
1628 with_libgcrypt_config="gcrypt-config"
1629 with_libgcrypt="$withval"
1633 with_libgcrypt_config="libgcrypt-config"
1634 with_libgcrypt="yes"
1637 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1639 if test "x$GCRYPT_CPPFLAGS" = "x"
1641 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1644 if test "x$GCRYPT_LDFLAGS" = "x"
1646 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1647 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1650 if test "x$GCRYPT_LIBS" = "x"
1652 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1656 SAVE_CPPFLAGS="$CPPFLAGS"
1657 SAVE_LDFLAGS="$LDFLAGS"
1658 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1659 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1661 if test "x$with_libgcrypt" = "xyes"
1663 if test "x$GCRYPT_CPPFLAGS" != "x"
1665 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1667 AC_CHECK_HEADERS(gcrypt.h,
1668 [with_libgcrypt="yes"],
1669 [with_libgcrypt="no (gcrypt.h not found)"])
1672 if test "x$with_libgcrypt" = "xyes"
1674 if test "x$GCRYPT_LDFLAGS" != "x"
1676 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1678 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1679 [with_libgcrypt="yes"],
1680 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1682 if test "$with_libgcrypt" != "no"; then
1683 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1687 CPPFLAGS="$SAVE_CPPFLAGS"
1688 LDFLAGS="$SAVE_LDFLAGS"
1690 if test "x$with_libgcrypt" = "xyes"
1692 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1695 AC_SUBST(GCRYPT_CPPFLAGS)
1696 AC_SUBST(GCRYPT_LDFLAGS)
1697 AC_SUBST(GCRYPT_LIBS)
1698 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1701 # --with-libiptc {{{
1702 with_own_libiptc="no"
1703 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1705 if test "x$withval" = "xshipped"
1707 with_own_libiptc="yes"
1709 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1711 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1712 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1715 with_libiptc="$withval"
1719 if test "x$ac_system" = "xLinux"
1723 with_libiptc="no (Linux only)"
1726 SAVE_CPPFLAGS="$CPPFLAGS"
1727 SAVE_LDFLAGS="$LDFLAGS"
1728 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1729 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1730 # check whether the header file for libiptc is available.
1731 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1733 AC_CHECK_HEADERS(libiptc/libiptc.h,
1735 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1739 with_own_libiptc="yes"
1742 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1744 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1746 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1750 with_own_libiptc="yes"
1753 # If the header file is available, check for the required type declaractions.
1754 # They may be missing in old versions of libiptc. In that case, they will be
1755 # declared in the iptables plugin.
1756 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1758 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1761 # include "$srcdir/src/owniptc/libiptc.h"
1762 # include "$srcdir/src/owniptc/libip6tc.h"
1764 # include <libiptc/libiptc.h>
1765 # include <libiptc/libip6tc.h>
1769 # Check for the iptc_init symbol in the library.
1770 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1772 AC_CHECK_LIB(iptc, iptc_init,
1774 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1778 with_own_libiptc="yes"
1781 # The system wide version failed for some reason. Check if we have the required
1782 # headers to build the shipped version.
1783 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1785 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1787 with_libiptc="no (Linux iptables headers not found)"
1788 with_own_libiptc="no"
1791 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1794 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1795 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1796 if test "x$with_libiptc" = "xyes"
1798 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1799 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1800 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1801 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1803 if test "x$with_own_libiptc" = "xyes"
1805 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1807 CPPFLAGS="$SAVE_CPPFLAGS"
1808 LDFLAGS="$SAVE_LDFLAGS"
1812 with_java_home="$JAVA_HOME"
1813 with_java_vmtype="client"
1818 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1820 if test "x$withval" = "xno"
1823 else if test "x$withval" = "xyes"
1827 with_java_home="$withval"
1832 if test "x$with_java" = "xyes"
1834 if test -d "$with_java_home"
1836 AC_MSG_CHECKING([for jni.h])
1837 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1838 if test "x$TMPDIR" != "x"
1840 AC_MSG_RESULT([found in $TMPDIR])
1841 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1843 AC_MSG_RESULT([not found])
1846 AC_MSG_CHECKING([for jni_md.h])
1847 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1848 if test "x$TMPDIR" != "x"
1850 AC_MSG_RESULT([found in $TMPDIR])
1851 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1853 AC_MSG_RESULT([not found])
1856 AC_MSG_CHECKING([for libjvm.so])
1857 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1858 if test "x$TMPDIR" != "x"
1860 AC_MSG_RESULT([found in $TMPDIR])
1861 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1863 AC_MSG_RESULT([not found])
1866 if test "x$JAVAC" = "x"
1868 AC_MSG_CHECKING([for javac])
1869 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1870 if test "x$TMPDIR" != "x"
1873 AC_MSG_RESULT([$JAVAC])
1875 AC_MSG_RESULT([not found])
1878 if test "x$JAR" = "x"
1880 AC_MSG_CHECKING([for jar])
1881 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1882 if test "x$TMPDIR" != "x"
1885 AC_MSG_RESULT([$JAR])
1887 AC_MSG_RESULT([not found])
1890 else if test "x$with_java_home" != "x"
1892 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1896 if test "x$JAVA_CPPFLAGS" != "x"
1898 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1900 if test "x$JAVA_CFLAGS" != "x"
1902 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1904 if test "x$JAVA_LDFLAGS" != "x"
1906 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1908 if test "x$JAVAC" = "x"
1910 with_javac_path="$PATH"
1911 if test "x$with_java_home" != "x"
1913 with_javac_path="$with_java_home:with_javac_path"
1914 if test -d "$with_java_home/bin"
1916 with_javac_path="$with_java_home/bin:with_javac_path"
1920 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1922 if test "x$JAVAC" = "x"
1924 with_java="no (javac not found)"
1926 if test "x$JAR" = "x"
1928 with_jar_path="$PATH"
1929 if test "x$with_java_home" != "x"
1931 with_jar_path="$with_java_home:$with_jar_path"
1932 if test -d "$with_java_home/bin"
1934 with_jar_path="$with_java_home/bin:$with_jar_path"
1938 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
1940 if test "x$JAR" = "x"
1942 with_java="no (jar not found)"
1945 SAVE_CPPFLAGS="$CPPFLAGS"
1946 SAVE_CFLAGS="$CFLAGS"
1947 SAVE_LDFLAGS="$LDFLAGS"
1948 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1949 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1950 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1952 if test "x$with_java" = "xyes"
1954 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1956 if test "x$with_java" = "xyes"
1958 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1960 [with_java="no (libjvm not found)"],
1963 if test "x$with_java" = "xyes"
1965 JAVA_LIBS="$JAVA_LIBS -ljvm"
1966 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1969 CPPFLAGS="$SAVE_CPPFLAGS"
1970 CFLAGS="$SAVE_CFLAGS"
1971 LDFLAGS="$SAVE_LDFLAGS"
1973 AC_SUBST(JAVA_CPPFLAGS)
1974 AC_SUBST(JAVA_CFLAGS)
1975 AC_SUBST(JAVA_LDFLAGS)
1977 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1981 with_liblua_cppflags=""
1982 with_liblua_ldflags=""
1986 if test "x$with_liblua" = "xyes"
1988 $PKG_CONFIG --exists lua5.1 2>/dev/null
1989 lua_config_status=$?
1991 if test 0 -ne $lua_config_status
1997 if test "x$with_liblua" = "xyes"
1999 with_liblua_cppflags=`$PKG_CONFIG --cflags-only-I lua5.1` || with_liblua="no"
2000 with_liblua_ldflags=`$PKG_CONFIG --libs-only-L lua5.1` || with_liblua="no"
2001 with_liblua_libs=`$PKG_CONFIG --libs-only-l lua5.1` || with_liblua="no"
2003 if test "x$with_liblua" = "xyes"
2005 SAVE_CPPFLAGS="$CPPFLAGS"
2006 CPPFLAGS="$CPPFLAGS $with_liblua_cppflags"
2008 AC_CHECK_HEADERS(lua.h lauxlib.h lualib.h, [], [with_liblua="no (header not found)"], [])
2010 CPPFLAGS="$SAVE_CPPFLAGS"
2012 if test "x$with_liblua" = "xyes"
2014 SAVE_LDFLAGS="$LDFLAGS"
2016 LDFLAGS="$SAVE_LDFLAGS $with_liblua_ldflags"
2017 LIBS="$LIBS $with_liblua_libs"
2019 AC_CHECK_FUNC(lua_settop, [with_liblua="yes"], [with_liblua="no (symbol 'lua_settop' not found)"])
2021 LDFLAGS="$SAVE_LDFLAGS"
2024 if test "x$with_liblua" = "xyes"
2026 BUILD_WITH_LIBLUA_CPPFLAGS="$with_liblua_cppflags"
2027 BUILD_WITH_LIBLUA_LDFLAGS="$with_liblua_ldflags"
2028 BUILD_WITH_LIBLUA_LIBS="$with_liblua_libs"
2029 AC_SUBST(BUILD_WITH_LIBLUA_CPPFLAGS)
2030 AC_SUBST(BUILD_WITH_LIBLUA_LDFLAGS)
2031 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
2033 AM_CONDITIONAL(BUILD_WITH_LUA, test "x$with_liblua" = "xyes")
2036 # --with-libmemcached {{{
2037 with_libmemcached_cppflags=""
2038 with_libmemcached_ldflags=""
2039 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2041 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2043 with_libmemcached_cppflags="-I$withval/include"
2044 with_libmemcached_ldflags="-L$withval/lib"
2045 with_libmemcached="yes"
2047 with_libmemcached="$withval"
2051 with_libmemcached="yes"
2053 if test "x$with_libmemcached" = "xyes"
2055 SAVE_CPPFLAGS="$CPPFLAGS"
2056 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2058 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2060 CPPFLAGS="$SAVE_CPPFLAGS"
2062 if test "x$with_libmemcached" = "xyes"
2064 SAVE_CPPFLAGS="$CPPFLAGS"
2065 SAVE_LDFLAGS="$LDFLAGS"
2066 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2067 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2069 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2071 CPPFLAGS="$SAVE_CPPFLAGS"
2072 LDFLAGS="$SAVE_LDFLAGS"
2074 if test "x$with_libmemcached" = "xyes"
2076 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2077 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2078 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2079 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2080 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2081 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2082 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2084 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2087 # --with-libmodbus {{{
2088 with_libmodbus_config=""
2089 with_libmodbus_cflags=""
2090 with_libmodbus_libs=""
2091 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2093 if test "x$withval" = "xno"
2096 else if test "x$withval" = "xyes"
2098 with_libmodbus="use_pkgconfig"
2099 else if test -d "$with_libmodbus/lib"
2101 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2102 with_libmodbus_cflags="-I$withval/include"
2103 with_libmodbus_libs="-L$withval/lib -lmodbus"
2104 with_libmodbus="yes"
2107 [with_libmodbus="use_pkgconfig"])
2109 # configure using pkg-config
2110 if test "x$with_libmodbus" = "xuse_pkgconfig"
2112 if test "x$PKG_CONFIG" = "x"
2114 with_libmodbus="no (Don't have pkg-config)"
2117 if test "x$with_libmodbus" = "xuse_pkgconfig"
2119 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
2120 $PKG_CONFIG --exists 'modbus' 2>/dev/null
2123 with_libmodbus="no (pkg-config doesn't know library)"
2126 if test "x$with_libmodbus" = "xuse_pkgconfig"
2128 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
2131 with_libmodbus="no ($PKG_CONFIG failed)"
2133 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
2136 with_libmodbus="no ($PKG_CONFIG failed)"
2139 if test "x$with_libmodbus" = "xuse_pkgconfig"
2141 with_libmodbus="yes"
2144 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2145 # the actual checks.
2146 if test "x$with_libmodbus" = "xyes"
2148 SAVE_CPPFLAGS="$CPPFLAGS"
2149 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2151 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2153 CPPFLAGS="$SAVE_CPPFLAGS"
2155 if test "x$with_libmodbus" = "xyes"
2157 SAVE_CPPFLAGS="$CPPFLAGS"
2158 SAVE_LDFLAGS="$LDFLAGS"
2160 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2161 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2163 AC_CHECK_LIB(modbus, modbus_init_tcp,
2164 [with_libmodbus="yes"],
2165 [with_libmodbus="no (symbol modbus_init_tcp not found)"])
2167 CPPFLAGS="$SAVE_CPPFLAGS"
2168 LDFLAGS="$SAVE_LDFLAGS"
2170 if test "x$with_libmodbus" = "xyes"
2172 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2173 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2174 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2175 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2179 # --with-libmysql {{{
2180 with_mysql_config="mysql_config"
2181 with_mysql_cflags=""
2183 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2185 if test "x$withval" = "xno"
2188 else if test "x$withval" = "xyes"
2192 if test -f "$withval" && test -x "$withval";
2194 with_mysql_config="$withval"
2195 else if test -x "$withval/bin/mysql_config"
2197 with_mysql_config="$withval/bin/mysql_config"
2205 if test "x$with_libmysql" = "xyes"
2207 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2208 mysql_config_status=$?
2210 if test $mysql_config_status -ne 0
2212 with_libmysql="no ($with_mysql_config failed)"
2214 SAVE_CPPFLAGS="$CPPFLAGS"
2215 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2218 have_mysql_mysql_h="no"
2219 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2221 if test "x$have_mysql_h" = "xno"
2223 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2226 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2228 with_libmysql="no (mysql.h not found)"
2231 CPPFLAGS="$SAVE_CPPFLAGS"
2234 if test "x$with_libmysql" = "xyes"
2236 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
2237 mysql_config_status=$?
2239 if test $mysql_config_status -ne 0
2241 with_libmysql="no ($with_mysql_config failed)"
2243 AC_CHECK_LIB(mysqlclient, mysql_init,
2244 [with_libmysql="yes"],
2245 [with_libmysql="no (symbol 'mysql_init' not found)"],
2248 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2249 [with_libmysql="yes"],
2250 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2254 if test "x$with_libmysql" = "xyes"
2256 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2257 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2258 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2259 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2261 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2264 # --with-libnetlink {{{
2265 with_libnetlink_cflags=""
2266 with_libnetlink_libs="-lnetlink"
2267 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2269 echo "libnetlink: withval = $withval"
2270 if test "x$withval" = "xyes"
2272 with_libnetlink="yes"
2273 else if test "x$withval" = "xno"
2275 with_libnetlink="no"
2277 if test -d "$withval/include"
2279 with_libnetlink_cflags="-I$withval/include"
2280 with_libnetlink_libs="-L$withval/lib -lnetlink"
2281 with_libnetlink="yes"
2283 AC_MSG_ERROR("no such directory: $withval/include")
2288 if test "x$ac_system" = "xLinux"
2290 with_libnetlink="yes"
2292 with_libnetlink="no (Linux only library)"
2295 if test "x$with_libnetlink" = "xyes"
2297 SAVE_CFLAGS="$CFLAGS"
2298 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2300 with_libnetlink="no (libnetlink.h not found)"
2302 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2304 with_libnetlink="yes"
2308 #include <sys/types.h>
2309 #include <asm/types.h>
2310 #include <sys/socket.h>
2311 #include <linux/netlink.h>
2312 #include <linux/rtnetlink.h>])
2313 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2315 #include <sys/types.h>
2316 #include <asm/types.h>
2317 #include <sys/socket.h>])
2321 #include <sys/types.h>
2322 #include <asm/types.h>
2323 #include <sys/socket.h>
2324 #include <linux/netlink.h>
2325 #include <linux/rtnetlink.h>
2329 int retval = TCA_STATS2;
2332 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2337 #include <sys/types.h>
2338 #include <asm/types.h>
2339 #include <sys/socket.h>
2340 #include <linux/netlink.h>
2341 #include <linux/rtnetlink.h>
2345 int retval = TCA_STATS;
2348 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2351 CFLAGS="$SAVE_CFLAGS"
2353 if test "x$with_libnetlink" = "xyes"
2355 AC_CHECK_LIB(netlink, rtnl_open,
2356 [with_libnetlink="yes"],
2357 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2358 [$with_libnetlink_libs])
2360 if test "x$with_libnetlink" = "xyes"
2362 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2363 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2364 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2365 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2367 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2370 # --with-libnetapp {{{
2371 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2372 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2373 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2374 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2375 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2376 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2377 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2379 if test -d "$withval"
2381 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2382 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2383 with_libnetapp="yes"
2385 with_libnetapp="$withval"
2389 with_libnetapp="yes"
2392 SAVE_CPPFLAGS="$CPPFLAGS"
2393 SAVE_LDFLAGS="$LDFLAGS"
2394 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2395 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2397 if test "x$with_libnetapp" = "xyes"
2399 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2401 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2403 AC_CHECK_HEADERS(netapp_api.h,
2404 [with_libnetapp="yes"],
2405 [with_libnetapp="no (netapp_api.h not found)"])
2408 if test "x$with_libnetapp" = "xyes"
2410 if test "x$LIBNETAPP_LDFLAGS" != "x"
2412 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2415 if test "x$LIBNETAPP_LIBS" = "x"
2417 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2419 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2421 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2422 [with_libnetapp="yes"],
2423 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2425 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2428 CPPFLAGS="$SAVE_CPPFLAGS"
2429 LDFLAGS="$SAVE_LDFLAGS"
2431 if test "x$with_libnetapp" = "xyes"
2433 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2436 AC_SUBST(LIBNETAPP_CPPFLAGS)
2437 AC_SUBST(LIBNETAPP_LDFLAGS)
2438 AC_SUBST(LIBNETAPP_LIBS)
2439 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2442 # --with-libnetsnmp {{{
2443 with_snmp_config="net-snmp-config"
2446 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2448 if test "x$withval" = "xno"
2450 with_libnetsnmp="no"
2451 else if test "x$withval" = "xyes"
2453 with_libnetsnmp="yes"
2455 if test -x "$withval"
2457 with_snmp_config="$withval"
2458 with_libnetsnmp="yes"
2460 with_snmp_config="$withval/bin/net-snmp-config"
2461 with_libnetsnmp="yes"
2465 [with_libnetsnmp="yes"])
2466 if test "x$with_libnetsnmp" = "xyes"
2468 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2469 snmp_config_status=$?
2471 if test $snmp_config_status -ne 0
2473 with_libnetsnmp="no ($with_snmp_config failed)"
2475 SAVE_CPPFLAGS="$CPPFLAGS"
2476 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2478 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2480 CPPFLAGS="$SAVE_CPPFLAGS"
2483 if test "x$with_libnetsnmp" = "xyes"
2485 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2486 snmp_config_status=$?
2488 if test $snmp_config_status -ne 0
2490 with_libnetsnmp="no ($with_snmp_config failed)"
2492 AC_CHECK_LIB(netsnmp, init_snmp,
2493 [with_libnetsnmp="yes"],
2494 [with_libnetsnmp="no (libnetsnmp not found)"],
2498 if test "x$with_libnetsnmp" = "xyes"
2500 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2501 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2502 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2503 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2505 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2508 # --with-liboconfig {{{
2509 with_own_liboconfig="no"
2510 liboconfig_LDFLAGS="$LDFLAGS"
2511 liboconfig_CPPFLAGS="$CPPFLAGS"
2512 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2514 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2516 if test -d "$withval/lib"
2518 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2520 if test -d "$withval/include"
2522 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2525 if test "x$withval" = "xno"
2527 AC_MSG_ERROR("liboconfig is required")
2531 with_liboconfig="yes"
2534 save_LDFLAGS="$LDFLAGS"
2535 save_CPPFLAGS="$CPPFLAGS"
2536 LDFLAGS="$liboconfig_LDFLAGS"
2537 CPPFLAGS="$liboconfig_CPPFLAGS"
2538 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2540 with_liboconfig="yes"
2541 with_own_liboconfig="no"
2544 with_liboconfig="yes"
2545 with_own_liboconfig="yes"
2546 LDFLAGS="$save_LDFLAGS"
2547 CPPFLAGS="$save_CPPFLAGS"
2550 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2551 if test "x$with_own_liboconfig" = "xyes"
2553 with_liboconfig="yes (shipped version)"
2557 # --with-liboping {{{
2558 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2560 if test "x$withval" = "xyes"
2563 else if test "x$withval" = "xno"
2568 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2569 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2572 [with_liboping="yes"])
2574 SAVE_CPPFLAGS="$CPPFLAGS"
2575 SAVE_LDFLAGS="$LDFLAGS"
2577 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2578 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2580 if test "x$with_liboping" = "xyes"
2582 if test "x$LIBOPING_CPPFLAGS" != "x"
2584 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2586 AC_CHECK_HEADERS(oping.h,
2587 [with_liboping="yes"],
2588 [with_liboping="no ('oping.h' not found)"])
2590 if test "x$with_liboping" = "xyes"
2592 if test "x$LIBOPING_LDFLAGS" != "x"
2594 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2596 AC_CHECK_LIB(oping, ping_construct,
2597 [with_liboping="yes"],
2598 [with_liboping="no (symbol 'ping_construct' not found)"])
2601 CPPFLAGS="$SAVE_CPPFLAGS"
2602 LDFLAGS="$SAVE_LDFLAGS"
2604 if test "x$with_liboping" = "xyes"
2606 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2607 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2608 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2609 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2611 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2615 with_oracle_cppflags=""
2617 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2619 if test "x$withval" = "xyes"
2621 if test "x$ORACLE_HOME" = "x"
2623 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2626 else if test "x$withval" = "xno"
2631 ORACLE_HOME="$withval"
2635 if test "x$ORACLE_HOME" = "x"
2637 with_oracle="no (ORACLE_HOME is not set)"
2642 if test "x$ORACLE_HOME" != "x"
2644 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2646 if test -e "$ORACLE_HOME/lib/ldflags"
2648 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2650 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2651 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2653 if test "x$with_oracle" = "xyes"
2655 SAVE_CPPFLAGS="$CPPFLAGS"
2656 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2658 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2660 CPPFLAGS="$SAVE_CPPFLAGS"
2662 if test "x$with_oracle" = "xyes"
2664 SAVE_CPPFLAGS="$CPPFLAGS"
2665 SAVE_LDFLAGS="$LDFLAGS"
2666 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2667 LDFLAGS="$LDFLAGS $with_oracle_libs"
2669 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2671 CPPFLAGS="$SAVE_CPPFLAGS"
2672 LDFLAGS="$SAVE_LDFLAGS"
2674 if test "x$with_oracle" = "xyes"
2676 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2677 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2678 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2679 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2683 # --with-libowcapi {{{
2684 with_libowcapi_cppflags=""
2685 with_libowcapi_libs="-lowcapi"
2686 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2688 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2690 with_libowcapi_cppflags="-I$withval/include"
2691 with_libowcapi_libs="-L$withval/lib -lowcapi"
2692 with_libowcapi="yes"
2694 with_libowcapi="$withval"
2698 with_libowcapi="yes"
2700 if test "x$with_libowcapi" = "xyes"
2702 SAVE_CPPFLAGS="$CPPFLAGS"
2703 CPPFLAGS="$with_libowcapi_cppflags"
2705 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2707 CPPFLAGS="$SAVE_CPPFLAGS"
2709 if test "x$with_libowcapi" = "xyes"
2711 SAVE_LDFLAGS="$LDFLAGS"
2712 SAVE_CPPFLAGS="$CPPFLAGS"
2713 LDFLAGS="$with_libowcapi_libs"
2714 CPPFLAGS="$with_libowcapi_cppflags"
2716 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2718 LDFLAGS="$SAVE_LDFLAGS"
2719 CPPFLAGS="$SAVE_CPPFLAGS"
2721 if test "x$with_libowcapi" = "xyes"
2723 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2724 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2725 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2726 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2730 # --with-libpcap {{{
2731 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2733 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2735 LDFLAGS="$LDFLAGS -L$withval/lib"
2736 CPPFLAGS="$CPPFLAGS -I$withval/include"
2739 with_libpcap="$withval"
2745 if test "x$with_libpcap" = "xyes"
2747 AC_CHECK_LIB(pcap, pcap_open_live,
2749 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2750 ], [with_libpcap="no (libpcap not found)"])
2752 if test "x$with_libpcap" = "xyes"
2754 AC_CHECK_HEADERS(pcap.h,
2756 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
2757 ], [with_libpcap="no (pcap.h not found)"])
2759 if test "x$with_libpcap" = "xyes"
2765 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
2766 [Wether or not to use the pcap library])
2767 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2770 # --with-libperl {{{
2771 perl_interpreter="perl"
2772 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2774 if test -x "$withval"
2776 perl_interpreter="$withval"
2778 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2780 LDFLAGS="$LDFLAGS -L$withval/lib"
2781 CPPFLAGS="$CPPFLAGS -I$withval/include"
2782 perl_interpreter="$withval/bin/perl"
2785 with_libperl="$withval"
2792 AC_MSG_CHECKING([for perl])
2793 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2794 if test -x "$perl_interpreter"
2796 AC_MSG_RESULT([yes ($perl_interpreter)])
2802 AC_SUBST(PERL, "$perl_interpreter")
2804 if test "x$with_libperl" = "xyes" \
2805 && test -n "$perl_interpreter"
2807 SAVE_CFLAGS="$CFLAGS"
2808 SAVE_LDFLAGS="$LDFLAGS"
2809 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2810 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2811 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2812 CFLAGS="$CFLAGS $PERL_CFLAGS"
2813 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2815 AC_CACHE_CHECK([for libperl],
2816 [c_cv_have_libperl],
2820 #define PERL_NO_GET_CONTEXT
2827 load_module (PERL_LOADMOD_NOIMPORT,
2828 newSVpv ("Collectd::Plugin::FooBar", 24),
2831 [c_cv_have_libperl="yes"],
2832 [c_cv_have_libperl="no"]
2836 if test "x$c_cv_have_libperl" = "xyes"
2838 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2839 AC_SUBST(PERL_CFLAGS)
2840 AC_SUBST(PERL_LDFLAGS)
2845 CFLAGS="$SAVE_CFLAGS"
2846 LDFLAGS="$SAVE_LDFLAGS"
2847 else if test -z "$perl_interpreter"; then
2848 with_libperl="no (no perl interpreter found)"
2849 c_cv_have_libperl="no"
2851 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2853 if test "x$with_libperl" = "xyes"
2855 SAVE_CFLAGS="$CFLAGS"
2856 SAVE_LDFLAGS="$LDFLAGS"
2857 CFLAGS="$CFLAGS $PERL_CFLAGS"
2858 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2860 AC_CACHE_CHECK([if perl supports ithreads],
2861 [c_cv_have_perl_ithreads],
2869 #if !defined(USE_ITHREADS)
2870 # error "Perl does not support ithreads!"
2871 #endif /* !defined(USE_ITHREADS) */
2874 [c_cv_have_perl_ithreads="yes"],
2875 [c_cv_have_perl_ithreads="no"]
2879 if test "x$c_cv_have_perl_ithreads" = "xyes"
2881 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2884 CFLAGS="$SAVE_CFLAGS"
2885 LDFLAGS="$SAVE_LDFLAGS"
2888 if test "x$with_libperl" = "xyes"
2890 SAVE_CFLAGS="$CFLAGS"
2891 SAVE_LDFLAGS="$LDFLAGS"
2892 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2893 # (see issues #41 and #42)
2894 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2895 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2897 AC_CACHE_CHECK([for broken Perl_load_module()],
2898 [c_cv_have_broken_perl_load_module],
2902 #define PERL_NO_GET_CONTEXT
2909 load_module (PERL_LOADMOD_NOIMPORT,
2910 newSVpv ("Collectd::Plugin::FooBar", 24),
2913 [c_cv_have_broken_perl_load_module="no"],
2914 [c_cv_have_broken_perl_load_module="yes"]
2918 CFLAGS="$SAVE_CFLAGS"
2919 LDFLAGS="$SAVE_LDFLAGS"
2921 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2922 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2924 if test "x$with_libperl" = "xyes"
2926 SAVE_CFLAGS="$CFLAGS"
2927 SAVE_LDFLAGS="$LDFLAGS"
2928 CFLAGS="$CFLAGS $PERL_CFLAGS"
2929 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2932 [struct mgvtbl.svt_local],
2933 [have_struct_mgvtbl_svt_local="yes"],
2934 [have_struct_mgvtbl_svt_local="no"],
2941 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2943 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2944 [Define if Perl's struct mgvtbl has member svt_local.])
2947 CFLAGS="$SAVE_CFLAGS"
2948 LDFLAGS="$SAVE_LDFLAGS"
2953 with_pg_config="pg_config"
2954 with_libpq_includedir=""
2955 with_libpq_libdir=""
2956 with_libpq_cppflags=""
2957 with_libpq_ldflags=""
2958 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2961 if test "x$withval" = "xno"
2964 else if test "x$withval" = "xyes"
2968 if test -f "$withval" && test -x "$withval";
2970 with_pg_config="$withval"
2971 else if test -x "$withval/bin/pg_config"
2973 with_pg_config="$withval/bin/pg_config"
2981 if test "x$with_libpq" = "xyes"
2983 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2986 if test $pg_config_status -eq 0
2988 if test -n "$with_libpq_includedir"; then
2989 for dir in $with_libpq_includedir; do
2990 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2994 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2997 SAVE_CPPFLAGS="$CPPFLAGS"
2998 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3000 AC_CHECK_HEADERS(libpq-fe.h, [],
3001 [with_libpq="no (libpq-fe.h not found)"], [])
3003 CPPFLAGS="$SAVE_CPPFLAGS"
3005 if test "x$with_libpq" = "xyes"
3007 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3010 if test $pg_config_status -eq 0
3012 if test -n "$with_libpq_libdir"; then
3013 for dir in $with_libpq_libdir; do
3014 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3018 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3021 SAVE_LDFLAGS="$LDFLAGS"
3022 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3024 AC_CHECK_LIB(pq, PQconnectdb,
3026 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3028 AC_CHECK_LIB(pq, PQserverVersion,
3030 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3032 LDFLAGS="$SAVE_LDFLAGS"
3034 if test "x$with_libpq" = "xyes"
3036 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3037 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3038 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3039 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3041 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3044 # --with-libpthread {{{
3045 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3046 [ if test "x$withval" != "xno" \
3047 && test "x$withval" != "xyes"
3049 LDFLAGS="$LDFLAGS -L$withval/lib"
3050 CPPFLAGS="$CPPFLAGS -I$withval/include"
3051 with_libpthread="yes"
3053 if test "x$withval" = "xno"
3055 with_libpthread="no (disabled)"
3058 ], [with_libpthread="yes"])
3059 if test "x$with_libpthread" = "xyes"
3061 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3064 if test "x$with_libpthread" = "xyes"
3066 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3068 if test "x$with_libpthread" = "xyes"
3074 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3075 [Wether or not to use pthread (POSIX threads) library])
3076 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3081 with_python_path="$PATH"
3082 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3084 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3086 with_python="$withval"
3087 else if test -x "$withval"
3089 with_python_prog="$withval"
3090 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3092 else if test -d "$withval"
3094 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3097 AC_MSG_WARN([Argument not recognized: $withval])
3099 ], [with_python="yes"])
3102 SAVE_CPPFLAGS="$CPPFLAGS"
3103 SAVE_LDFLAGS="$LDFLAGS"
3106 PATH="$with_python_path"
3108 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3110 AC_MSG_CHECKING([for python])
3111 with_python_prog="`which python 2>/dev/null`"
3112 if test "x$with_python_prog" = "x"
3114 AC_MSG_RESULT([not found])
3115 with_python="no (interpreter not found)"
3117 AC_MSG_RESULT([$with_python_prog])
3121 if test "x$with_python" = "xyes"
3123 AC_MSG_CHECKING([for Python CPPFLAGS])
3124 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3125 python_config_status=$?
3127 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3129 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3132 AC_MSG_RESULT([$python_include_path])
3136 if test "x$with_python" = "xyes"
3138 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3139 AC_CHECK_HEADERS(Python.h,
3140 [with_python="yes"],
3141 [with_python="no ('Python.h' not found)"])
3144 if test "x$with_python" = "xyes"
3146 AC_MSG_CHECKING([for Python LDFLAGS])
3147 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`
3148 python_config_status=$?
3150 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3152 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3155 AC_MSG_RESULT([$python_library_path])
3159 if test "x$with_python" = "xyes"
3161 AC_MSG_CHECKING([for Python LIBS])
3162 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`
3163 python_config_status=$?
3165 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3167 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3170 AC_MSG_RESULT([$python_library_flags])
3174 if test "x$with_python" = "xyes"
3176 LDFLAGS="-L$python_library_path $LDFLAGS"
3177 LIBS="$python_library_flags $LIBS"
3179 AC_CHECK_FUNC(PyObject_CallFunction,
3180 [with_python="yes"],
3181 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3185 CPPFLAGS="$SAVE_CPPFLAGS"
3186 LDFLAGS="$SAVE_LDFLAGS"
3189 if test "x$with_python" = "xyes"
3191 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3192 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3193 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3194 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3195 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3196 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3200 # --with-librabbitmq {{{
3201 with_librabbitmq_cppflags=""
3202 with_librabbitmq_ldflags=""
3203 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3205 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3207 with_librabbitmq_cppflags="-I$withval/include"
3208 with_librabbitmq_ldflags="-L$withval/lib"
3209 with_librabbitmq="yes"
3211 with_librabbitmq="$withval"
3215 with_librabbitmq="yes"
3217 if test "x$with_librabbitmq" = "xyes"
3219 SAVE_CPPFLAGS="$CPPFLAGS"
3220 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3222 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3224 CPPFLAGS="$SAVE_CPPFLAGS"
3226 if test "x$with_librabbitmq" = "xyes"
3228 SAVE_CPPFLAGS="$CPPFLAGS"
3229 SAVE_LDFLAGS="$LDFLAGS"
3230 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3231 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3233 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3235 CPPFLAGS="$SAVE_CPPFLAGS"
3236 LDFLAGS="$SAVE_LDFLAGS"
3238 if test "x$with_librabbitmq" = "xyes"
3240 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3241 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3242 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3243 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3244 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3245 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3246 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3248 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3251 # --with-librouteros {{{
3252 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3254 if test "x$withval" = "xyes"
3256 with_librouteros="yes"
3257 else if test "x$withval" = "xno"
3259 with_librouteros="no"
3261 with_librouteros="yes"
3262 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3263 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3266 [with_librouteros="yes"])
3268 SAVE_CPPFLAGS="$CPPFLAGS"
3269 SAVE_LDFLAGS="$LDFLAGS"
3271 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3272 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3274 if test "x$with_librouteros" = "xyes"
3276 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3278 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3280 AC_CHECK_HEADERS(routeros_api.h,
3281 [with_librouteros="yes"],
3282 [with_librouteros="no ('routeros_api.h' not found)"])
3284 if test "x$with_librouteros" = "xyes"
3286 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3288 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3290 AC_CHECK_LIB(routeros, ros_interface,
3291 [with_librouteros="yes"],
3292 [with_librouteros="no (symbol 'ros_interface' not found)"])
3295 CPPFLAGS="$SAVE_CPPFLAGS"
3296 LDFLAGS="$SAVE_LDFLAGS"
3298 if test "x$with_librouteros" = "xyes"
3300 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3301 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3302 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3303 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3305 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3309 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3312 librrd_threadsafe="yes"
3313 librrd_rrdc_update="no"
3314 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3315 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3317 librrd_cflags="-I$withval/include"
3318 librrd_ldflags="-L$withval/lib"
3321 with_librrd="$withval"
3323 ], [with_librrd="yes"])
3324 if test "x$with_librrd" = "xyes"
3326 SAVE_CPPFLAGS="$CPPFLAGS"
3327 SAVE_LDFLAGS="$LDFLAGS"
3329 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3330 LDFLAGS="$LDFLAGS $librrd_ldflags"
3332 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3334 CPPFLAGS="$SAVE_CPPFLAGS"
3335 LDFLAGS="$SAVE_LDFLAGS"
3337 if test "x$with_librrd" = "xyes"
3339 SAVE_CPPFLAGS="$CPPFLAGS"
3340 SAVE_LDFLAGS="$LDFLAGS"
3342 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3343 LDFLAGS="$LDFLAGS $librrd_ldflags"
3345 AC_CHECK_LIB(rrd_th, rrd_update_r,
3347 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3349 [librrd_threadsafe="no"
3350 AC_CHECK_LIB(rrd, rrd_update,
3352 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3354 [with_librrd="no (symbol 'rrd_update' not found)"],
3359 if test "x$librrd_threadsafe" = "xyes"
3361 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3363 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3366 CPPFLAGS="$SAVE_CPPFLAGS"
3367 LDFLAGS="$SAVE_LDFLAGS"
3369 if test "x$with_librrd" = "xyes"
3371 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3372 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3373 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3374 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3376 if test "x$librrd_threadsafe" = "xyes"
3378 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3382 # --with-libsensors {{{
3383 with_sensors_cflags=""
3384 with_sensors_ldflags=""
3385 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3387 if test "x$withval" = "xno"
3389 with_libsensors="no"
3391 with_libsensors="yes"
3392 if test "x$withval" != "xyes"
3394 with_sensors_cflags="-I$withval/include"
3395 with_sensors_ldflags="-L$withval/lib"
3396 with_libsensors="yes"
3401 if test "x$ac_system" = "xLinux"
3403 with_libsensors="yes"
3405 with_libsensors="no (Linux only library)"
3408 if test "x$with_libsensors" = "xyes"
3410 SAVE_CPPFLAGS="$CPPFLAGS"
3411 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3413 # AC_CHECK_HEADERS(sensors/sensors.h,
3415 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3417 # [with_libsensors="no (sensors/sensors.h not found)"])
3418 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3420 CPPFLAGS="$SAVE_CPPFLAGS"
3422 if test "x$with_libsensors" = "xyes"
3424 SAVE_CPPFLAGS="$CPPFLAGS"
3425 SAVE_LDFLAGS="$LDFLAGS"
3426 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3427 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3429 AC_CHECK_LIB(sensors, sensors_init,
3431 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3433 [with_libsensors="no (libsensors not found)"])
3435 CPPFLAGS="$SAVE_CPPFLAGS"
3436 LDFLAGS="$SAVE_LDFLAGS"
3438 if test "x$with_libsensors" = "xyes"
3440 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3441 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3442 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3443 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3445 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3448 # --with-libstatgrab {{{
3449 with_libstatgrab_cflags=""
3450 with_libstatgrab_ldflags=""
3451 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3453 if test "x$withval" != "xno" \
3454 && test "x$withval" != "xyes"
3456 with_libstatgrab_cflags="-I$withval/include"
3457 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3458 with_libstatgrab="yes"
3459 with_libstatgrab_pkg_config="no"
3461 with_libstatgrab="$withval"
3462 with_libstatgrab_pkg_config="yes"
3466 with_libstatgrab="yes"
3467 with_libstatgrab_pkg_config="yes"
3470 if test "x$with_libstatgrab" = "xyes" \
3471 && test "x$with_libstatgrab_pkg_config" = "xyes"
3473 if test "x$PKG_CONFIG" != "x"
3475 AC_MSG_CHECKING([pkg-config for libstatgrab])
3477 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3480 with_libstatgrab_pkg_config="no"
3481 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
3482 temp_result="not found"
3484 AC_MSG_RESULT([$temp_result])
3486 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3487 with_libstatgrab_pkg_config="no"
3488 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3492 if test "x$with_libstatgrab" = "xyes" \
3493 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3494 && test "x$with_libstatgrab_cflags" = "x"
3496 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3497 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3500 with_libstatgrab_cflags="$temp_result"
3502 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3503 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3505 AC_MSG_RESULT([$temp_result])
3508 if test "x$with_libstatgrab" = "xyes" \
3509 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3510 && test "x$with_libstatgrab_ldflags" = "x"
3512 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3513 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3516 with_libstatgrab_ldflags="$temp_result"
3518 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3519 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3521 AC_MSG_RESULT([$temp_result])
3524 if test "x$with_libstatgrab" = "xyes"
3526 SAVE_CPPFLAGS="$CPPFLAGS"
3527 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3529 AC_CHECK_HEADERS(statgrab.h,
3530 [with_libstatgrab="yes"],
3531 [with_libstatgrab="no (statgrab.h not found)"])
3533 CPPFLAGS="$SAVE_CPPFLAGS"
3536 if test "x$with_libstatgrab" = "xyes"
3538 SAVE_CFLAGS="$CFLAGS"
3539 SAVE_LDFLAGS="$LDFLAGS"
3541 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3542 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3544 AC_CHECK_LIB(statgrab, sg_init,
3545 [with_libstatgrab="yes"],
3546 [with_libstatgrab="no (symbol sg_init not found)"])
3548 CFLAGS="$SAVE_CFLAGS"
3549 LDFLAGS="$SAVE_LDFLAGS"
3552 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3553 if test "x$with_libstatgrab" = "xyes"
3555 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3556 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3557 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3558 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3559 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3563 # --with-libtokyotyrant {{{
3564 with_libtokyotyrant_cppflags=""
3565 with_libtokyotyrant_ldflags=""
3566 with_libtokyotyrant_libs=""
3567 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3569 if test "x$withval" = "xno"
3571 with_libtokyotyrant="no"
3572 else if test "x$withval" = "xyes"
3574 with_libtokyotyrant="yes"
3576 with_libtokyotyrant_cppflags="-I$withval/include"
3577 with_libtokyotyrant_ldflags="-L$withval/include"
3578 with_libtokyotyrant_libs="-ltokyotyrant"
3579 with_libtokyotyrant="yes"
3583 with_libtokyotyrant="yes"
3586 if test "x$with_libtokyotyrant" = "xyes"
3588 if $PKG_CONFIG --exists tokyotyrant
3590 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3591 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3592 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3596 SAVE_CPPFLAGS="$CPPFLAGS"
3597 SAVE_LDFLAGS="$LDFLAGS"
3598 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3599 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3601 if test "x$with_libtokyotyrant" = "xyes"
3603 AC_CHECK_HEADERS(tcrdb.h,
3605 AC_DEFINE(HAVE_TCRDB_H, 1,
3606 [Define to 1 if you have the <tcrdb.h> header file.])
3607 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3610 if test "x$with_libtokyotyrant" = "xyes"
3612 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3614 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3615 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3617 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3618 [$with_libtokyotyrant_libs])
3621 CPPFLAGS="$SAVE_CPPFLAGS"
3622 LDFLAGS="$SAVE_LDFLAGS"
3624 if test "x$with_libtokyotyrant" = "xyes"
3626 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3627 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3628 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3629 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3630 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3631 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3633 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3636 # --with-libupsclient {{{
3637 with_libupsclient_config=""
3638 with_libupsclient_cflags=""
3639 with_libupsclient_libs=""
3640 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3642 if test "x$withval" = "xno"
3644 with_libupsclient="no"
3645 else if test "x$withval" = "xyes"
3647 with_libupsclient="use_pkgconfig"
3649 if test -x "$withval"
3651 with_libupsclient_config="$withval"
3652 with_libupsclient="use_libupsclient_config"
3653 else if test -x "$withval/bin/libupsclient-config"
3655 with_libupsclient_config="$withval/bin/libupsclient-config"
3656 with_libupsclient="use_libupsclient_config"
3658 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3659 with_libupsclient_cflags="-I$withval/include"
3660 with_libupsclient_libs="-L$withval/lib -lupsclient"
3661 with_libupsclient="yes"
3665 [with_libupsclient="use_pkgconfig"])
3667 # configure using libupsclient-config
3668 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3670 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3671 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3674 with_libupsclient="no ($with_libupsclient_config failed)"
3676 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3679 with_libupsclient="no ($with_libupsclient_config failed)"
3682 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3684 with_libupsclient="yes"
3687 # configure using pkg-config
3688 if test "x$with_libupsclient" = "xuse_pkgconfig"
3690 if test "x$PKG_CONFIG" = "x"
3692 with_libupsclient="no (Don't have pkg-config)"
3695 if test "x$with_libupsclient" = "xuse_pkgconfig"
3697 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3698 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3701 with_libupsclient="no (pkg-config doesn't know library)"
3704 if test "x$with_libupsclient" = "xuse_pkgconfig"
3706 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3709 with_libupsclient="no ($PKG_CONFIG failed)"
3711 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3714 with_libupsclient="no ($PKG_CONFIG failed)"
3717 if test "x$with_libupsclient" = "xuse_pkgconfig"
3719 with_libupsclient="yes"
3722 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3723 # the actual checks.
3724 if test "x$with_libupsclient" = "xyes"
3726 SAVE_CPPFLAGS="$CPPFLAGS"
3727 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3729 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3731 CPPFLAGS="$SAVE_CPPFLAGS"
3733 if test "x$with_libupsclient" = "xyes"
3735 SAVE_CPPFLAGS="$CPPFLAGS"
3736 SAVE_LDFLAGS="$LDFLAGS"
3738 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3739 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3741 AC_CHECK_LIB(upsclient, upscli_connect,
3742 [with_libupsclient="yes"],
3743 [with_libupsclient="no (symbol upscli_connect not found)"])
3745 CPPFLAGS="$SAVE_CPPFLAGS"
3746 LDFLAGS="$SAVE_LDFLAGS"
3748 if test "x$with_libupsclient" = "xyes"
3750 SAVE_CPPFLAGS="$CPPFLAGS"
3751 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3753 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3754 [#include <stdlib.h>
3756 #include <upsclient.h>])
3758 CPPFLAGS="$SAVE_CPPFLAGS"
3760 if test "x$with_libupsclient" = "xyes"
3762 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3763 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3764 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3765 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3769 # --with-libxmms {{{
3770 with_xmms_config="xmms-config"
3773 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3775 if test "x$withval" != "xno" \
3776 && test "x$withval" != "xyes"
3778 if test -f "$withval" && test -x "$withval";
3780 with_xmms_config="$withval"
3781 else if test -x "$withval/bin/xmms-config"
3783 with_xmms_config="$withval/bin/xmms-config"
3786 else if test "x$withval" = "xno"
3796 if test "x$with_libxmms" = "xyes"
3798 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3799 xmms_config_status=$?
3801 if test $xmms_config_status -ne 0
3806 if test "x$with_libxmms" = "xyes"
3808 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3809 xmms_config_status=$?
3811 if test $xmms_config_status -ne 0
3816 if test "x$with_libxmms" = "xyes"
3818 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3820 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3821 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3822 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3823 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3830 with_libxmms_numeric=0
3831 if test "x$with_libxmms" = "xyes"
3833 with_libxmms_numeric=1
3835 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3836 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3839 # --with-libyajl {{{
3840 with_libyajl_cppflags=""
3841 with_libyajl_ldflags=""
3842 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3844 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3846 with_libyajl_cppflags="-I$withval/include"
3847 with_libyajl_ldflags="-L$withval/lib"
3850 with_libyajl="$withval"
3856 if test "x$with_libyajl" = "xyes"
3858 SAVE_CPPFLAGS="$CPPFLAGS"
3859 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3861 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3863 CPPFLAGS="$SAVE_CPPFLAGS"
3865 if test "x$with_libyajl" = "xyes"
3867 SAVE_CPPFLAGS="$CPPFLAGS"
3868 SAVE_LDFLAGS="$LDFLAGS"
3869 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3870 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3872 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3874 CPPFLAGS="$SAVE_CPPFLAGS"
3875 LDFLAGS="$SAVE_LDFLAGS"
3877 if test "x$with_libyajl" = "xyes"
3879 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3880 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3881 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3882 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3883 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3884 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3885 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3887 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3890 # --with-libvarnish {{{
3891 with_libvarnish_cppflags=""
3892 with_libvarnish_cflags=""
3893 with_libvarnish_libs=""
3894 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
3896 if test "x$withval" = "xno"
3898 with_libvarnish="no"
3899 else if test "x$withval" = "xyes"
3901 with_libvarnish="use_pkgconfig"
3902 else if test -d "$with_libvarnish/lib"
3904 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
3905 with_libvarnish_cflags="-I$withval/include"
3906 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
3907 with_libvarnish="yes"
3910 [with_libvarnish="use_pkgconfig"])
3912 # configure using pkg-config
3913 if test "x$with_libvarnish" = "xuse_pkgconfig"
3915 if test "x$PKG_CONFIG" = "x"
3917 with_libvarnish="no (Don't have pkg-config)"
3920 if test "x$with_libvarnish" = "xuse_pkgconfig"
3922 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
3923 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
3926 with_libvarnish="no (pkg-config doesn't know library)"
3929 if test "x$with_libvarnish" = "xuse_pkgconfig"
3931 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
3934 with_libvarnish="no ($PKG_CONFIG failed)"
3936 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
3939 with_libvarnish="no ($PKG_CONFIG failed)"
3942 if test "x$with_libvarnish" = "xuse_pkgconfig"
3944 with_libvarnish="yes"
3947 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
3948 # the actual checks.
3949 if test "x$with_libvarnish" = "xyes"
3951 SAVE_CPPFLAGS="$CPPFLAGS"
3952 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
3953 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
3955 CPPFLAGS="$SAVE_CPPFLAGS"
3957 if test "x$with_libvarnish" = "xyes"
3959 SAVE_CPPFLAGS="$CPPFLAGS"
3960 #SAVE_LDFLAGS="$LDFLAGS"
3962 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
3963 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
3965 AC_CHECK_LIB(varnishapi, VSL_OpenStats,
3966 [with_libvarnish="yes"],
3967 [with_libvarnish="no (symbol VSL_OpenStats not found)"],
3968 [$with_libvarnish_libs])
3970 CPPFLAGS="$SAVE_CPPFLAGS"
3971 #LDFLAGS="$SAVE_LDFLAGS"
3973 if test "x$with_libvarnish" = "xyes"
3975 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
3976 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
3977 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
3978 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
3982 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3983 with_libxml2="no (pkg-config isn't available)"
3984 with_libxml2_cflags=""
3985 with_libxml2_ldflags=""
3986 with_libvirt="no (pkg-config isn't available)"
3987 with_libvirt_cflags=""
3988 with_libvirt_ldflags=""
3989 if test "x$PKG_CONFIG" != "x"
3991 pkg-config --exists 'libxml-2.0' 2>/dev/null
3996 with_libxml2="no (pkg-config doesn't know library)"
3999 pkg-config --exists libvirt 2>/dev/null
4004 with_libvirt="no (pkg-config doesn't know library)"
4007 if test "x$with_libxml2" = "xyes"
4009 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4014 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4020 if test "x$with_libxml2" = "xyes"
4022 SAVE_CPPFLAGS="$CPPFLAGS"
4023 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4025 AC_CHECK_HEADERS(libxml/parser.h, [],
4026 [with_libxml2="no (libxml/parser.h not found)"])
4028 CPPFLAGS="$SAVE_CPPFLAGS"
4030 if test "x$with_libxml2" = "xyes"
4032 SAVE_CFLAGS="$CFLAGS"
4033 SAVE_LDFLAGS="$LDFLAGS"
4035 CFLAGS="$CFLAGS $with_libxml2_cflags"
4036 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4038 AC_CHECK_LIB(xml2, xmlXPathEval,
4039 [with_libxml2="yes"],
4040 [with_libxml2="no (symbol xmlXPathEval not found)"])
4042 CFLAGS="$SAVE_CFLAGS"
4043 LDFLAGS="$SAVE_LDFLAGS"
4045 dnl Add the right compiler flags and libraries.
4046 if test "x$with_libxml2" = "xyes"; then
4047 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4048 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4049 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4050 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4052 if test "x$with_libvirt" = "xyes"
4054 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4059 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4065 if test "x$with_libvirt" = "xyes"
4067 SAVE_CPPFLAGS="$CPPFLAGS"
4068 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4070 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4071 [with_libvirt="no (libvirt/libvirt.h not found)"])
4073 CPPFLAGS="$SAVE_CPPFLAGS"
4075 if test "x$with_libvirt" = "xyes"
4077 SAVE_CFLAGS="$CFLAGS"
4078 SAVE_LDFLAGS="$LDFLAGS"
4080 CFLAGS="$CFLAGS $with_libvirt_cflags"
4081 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4083 AC_CHECK_LIB(virt, virDomainBlockStats,
4084 [with_libvirt="yes"],
4085 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4087 CFLAGS="$SAVE_CFLAGS"
4088 LDFLAGS="$SAVE_LDFLAGS"
4090 dnl Add the right compiler flags and libraries.
4091 if test "x$with_libvirt" = "xyes"; then
4092 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4093 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4094 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4095 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4099 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4100 with_libopenipmipthread="yes"
4101 with_libopenipmipthread_cflags=""
4102 with_libopenipmipthread_libs=""
4104 AC_MSG_CHECKING([for pkg-config])
4106 if test "x$PKG_CONFIG" = "x"
4108 with_libopenipmipthread="no"
4111 temp_result="$PKG_CONFIG"
4113 AC_MSG_RESULT([$temp_result])
4115 if test "x$with_libopenipmipthread" = "xyes"
4117 AC_MSG_CHECKING([for libOpenIPMIpthread])
4118 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4121 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
4123 AC_MSG_RESULT([$with_libopenipmipthread])
4126 if test "x$with_libopenipmipthread" = "xyes"
4128 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4129 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4132 with_libopenipmipthread_cflags="$temp_result"
4134 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4135 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4137 AC_MSG_RESULT([$temp_result])
4140 if test "x$with_libopenipmipthread" = "xyes"
4142 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4143 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4146 with_libopenipmipthread_ldflags="$temp_result"
4148 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4149 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4151 AC_MSG_RESULT([$temp_result])
4154 if test "x$with_libopenipmipthread" = "xyes"
4156 SAVE_CPPFLAGS="$CPPFLAGS"
4157 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4159 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4160 [with_libopenipmipthread="yes"],
4161 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4162 [#include <OpenIPMI/ipmiif.h>
4163 #include <OpenIPMI/ipmi_err.h>
4164 #include <OpenIPMI/ipmi_posix.h>
4165 #include <OpenIPMI/ipmi_conn.h>
4168 CPPFLAGS="$SAVE_CPPFLAGS"
4171 if test "x$with_libopenipmipthread" = "xyes"
4173 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4174 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4175 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4176 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4180 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4181 [with_libnotify="yes"],
4182 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
4184 # Check for enabled/disabled features
4187 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4188 # ------------------------------------------------------------
4190 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4195 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4200 m4_define([EnDis],[disabled])dnl
4201 m4_define([YesNo],[no])dnl
4207 m4_define([EnDis],[enabled])dnl
4208 m4_define([YesNo],[yes])dnl
4211 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4215 m4_if([$3], [feature], [],
4219 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4225 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4227 enable_$1='[YesNo]'dnl
4229 if test "x$enable_$1" = "xno"
4233 if test "x$enable_$1" = "xyes"
4237 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4242 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4243 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4245 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4247 # AC_PLUGIN(name, default, info)
4248 # ------------------------------------------------------------
4255 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4257 if test "x$enableval" = "xyes"
4260 else if test "x$enableval" = "xforce"
4265 enable_plugin="no (disabled on command line)"
4269 if test "x$enable_all_plugins" = "xauto"
4271 if test "x$2" = "xyes"
4278 enable_plugin="$enable_all_plugins"
4281 if test "x$enable_plugin" = "xyes"
4283 if test "x$2" = "xyes" || test "x$force" = "xyes"
4285 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4286 if test "x$2" != "xyes"
4288 dependency_warning="yes"
4290 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4291 dependency_error="yes"
4292 enable_plugin="no (dependency error)"
4295 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4296 enable_$1="$enable_plugin"
4298 )# AC_PLUGIN(name, default, info)
4300 m4_divert_once([HELP_ENABLE], [
4301 collectd features:])
4302 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4303 AC_COLLECTD([debug], [enable], [feature], [debugging])
4304 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4305 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4307 dependency_warning="no"
4308 dependency_error="no"
4313 plugin_conntrack="no"
4314 plugin_contextswitch="no"
4317 plugin_curl_json="no"
4318 plugin_curl_xml="no"
4322 plugin_interface="no"
4329 plugin_multimeter="no"
4333 plugin_processes="no"
4334 plugin_protocols="no"
4338 plugin_tcpconns="no"
4345 plugin_wireless="no"
4349 if test "x$ac_system" = "xLinux"
4351 plugin_battery="yes"
4352 plugin_conntrack="yes"
4353 plugin_contextswitch="yes"
4355 plugin_cpufreq="yes"
4357 plugin_entropy="yes"
4358 plugin_interface="yes"
4363 plugin_fscache="yes"
4364 plugin_processes="yes"
4365 plugin_protocols="yes"
4368 plugin_tcpconns="yes"
4369 plugin_thermal="yes"
4372 plugin_vserver="yes"
4373 plugin_wireless="yes"
4375 if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4381 if test "x$ac_system" = "xOpenBSD"
4383 plugin_tcpconns="yes"
4387 if test "x$with_libiokit" = "xyes"
4389 plugin_battery="yes"
4394 if test "x$with_perfstat" = "xyes"
4400 plugin_interface="yes"
4404 if test "x$with_procinfo" = "xyes"
4406 plugin_processes="yes"
4410 if test "x$with_kstat" = "xyes"
4413 plugin_zfs_arc="yes"
4416 if test "x$with_devinfo$with_kstat" = "xyesyes"
4420 plugin_interface="yes"
4425 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
4431 if test "x$with_libstatgrab" = "xyes"
4435 plugin_interface="yes"
4442 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4448 if test "x$with_libopenipmipthread" = "xyes"
4453 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4455 plugin_curl_json="yes"
4458 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4460 plugin_curl_xml="yes"
4463 if test "x$have_processor_info" = "xyes"
4467 if test "x$have_sysctl" = "xyes"
4474 if test "x$have_sysctlbyname" = "xyes"
4476 plugin_contextswitch="yes"
4479 plugin_tcpconns="yes"
4482 # Df plugin: Check if we know how to determine mount points first.
4483 #if test "x$have_listmntent" = "xyes"; then
4486 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4490 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4494 #if test "x$have_getmntent" = "xseq"
4498 if test "x$c_cv_have_one_getmntent" = "xyes"
4503 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4504 if test "x$plugin_df" = "xyes"
4507 if test "x$have_statfs" = "xyes"
4511 if test "x$have_statvfs" = "xyes"
4517 if test "x$have_getifaddrs" = "xyes"
4519 plugin_interface="yes"
4522 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4524 plugin_libvirt="yes"
4527 if test "x$have_getloadavg" = "xyes"
4532 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4537 # Mac OS X memory interface
4538 if test "x$have_host_statistics" = "xyes"
4543 if test "x$have_termios_h" = "xyes"
4545 plugin_multimeter="yes"
4549 if test "x$have_thread_info" = "xyes"
4551 plugin_processes="yes"
4554 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4556 plugin_processes="yes"
4559 if test "x$with_kvm_getswapinfo" = "xyes"
4564 if test "x$have_swapctl" = "xyes"
4569 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4571 plugin_tcpconns="yes"
4574 if test "x$have_getutent" = "xyes"
4578 if test "x$have_getutxent" = "xyes"
4583 m4_divert_once([HELP_ENABLE], [
4586 AC_ARG_ENABLE([all-plugins],
4587 AC_HELP_STRING([--enable-all-plugins],
4588 [enable all plugins (auto by def)]),
4590 if test "x$enableval" = "xyes"
4592 enable_all_plugins="yes"
4593 else if test "x$enableval" = "xauto"
4595 enable_all_plugins="auto"
4597 enable_all_plugins="no"
4600 [enable_all_plugins="auto"])
4602 m4_divert_once([HELP_ENABLE], [])
4604 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4605 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4606 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4607 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4608 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4609 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4610 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4611 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4612 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4613 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4614 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4615 AC_PLUGIN([csv], [yes], [CSV output plugin])
4616 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4617 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4618 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4619 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4620 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4621 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4622 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4623 AC_PLUGIN([email], [yes], [EMail statistics])
4624 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4625 AC_PLUGIN([exec], [yes], [Execution of external programs])
4626 AC_PLUGIN([filecount], [yes], [Count files in directories])
4627 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4628 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4629 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4630 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4631 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4632 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4633 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4634 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4635 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4636 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4637 AC_PLUGIN([load], [$plugin_load], [System load])
4638 AC_PLUGIN([logfile], [yes], [File logging plugin])
4639 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4640 AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
4641 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4642 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4643 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4644 AC_PLUGIN([match_regex], [yes], [The regex match])
4645 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4646 AC_PLUGIN([match_value], [yes], [The value match])
4647 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4648 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4649 AC_PLUGIN([memcached], [yes], [memcached statistics])
4650 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4651 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4652 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4653 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4654 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4655 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4656 AC_PLUGIN([network], [yes], [Network communication plugin])
4657 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4658 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4659 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4660 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4661 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4662 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4663 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4664 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4665 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4666 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4667 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4668 # FIXME: Check for libevent, too.
4669 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4670 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4671 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4672 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4673 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4674 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4675 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4676 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4677 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4678 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4679 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4680 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4681 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4682 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4683 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4684 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4685 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4686 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4687 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4688 AC_PLUGIN([target_notification], [yes], [The notification target])
4689 AC_PLUGIN([target_replace], [yes], [The replace target])
4690 AC_PLUGIN([target_scale],[yes], [The scale target])
4691 AC_PLUGIN([target_set], [yes], [The set target])
4692 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4693 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4694 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4695 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4696 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4697 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4698 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4699 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4700 AC_PLUGIN([users], [$plugin_users], [User statistics])
4701 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4702 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4703 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4704 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4705 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4706 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4707 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4708 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4709 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4711 dnl Default configuration file
4712 # Load either syslog or logfile
4713 LOAD_PLUGIN_SYSLOG=""
4714 LOAD_PLUGIN_LOGFILE=""
4716 AC_MSG_CHECKING([which default log plugin to load])
4717 default_log_plugin="none"
4718 if test "x$enable_syslog" = "xyes"
4720 default_log_plugin="syslog"
4722 LOAD_PLUGIN_SYSLOG="##"
4725 if test "x$enable_logfile" = "xyes"
4727 if test "x$default_log_plugin" = "xnone"
4729 default_log_plugin="logfile"
4731 LOAD_PLUGIN_LOGFILE="#"
4734 LOAD_PLUGIN_LOGFILE="##"
4736 AC_MSG_RESULT([$default_log_plugin])
4738 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4739 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4741 DEFAULT_LOG_LEVEL="info"
4742 if test "x$enable_debug" = "xyes"
4744 DEFAULT_LOG_LEVEL="debug"
4746 AC_SUBST(DEFAULT_LOG_LEVEL)
4748 # Load only one of rrdtool, network, csv in the default config.
4749 LOAD_PLUGIN_RRDTOOL=""
4750 LOAD_PLUGIN_NETWORK=""
4753 AC_MSG_CHECKING([which default write plugin to load])
4754 default_write_plugin="none"
4755 if test "x$enable_rrdtool" = "xyes"
4757 default_write_plugin="rrdtool"
4759 LOAD_PLUGIN_RRDTOOL="##"
4762 if test "x$enable_network" = "xyes"
4764 if test "x$default_write_plugin" = "xnone"
4766 default_write_plugin="network"
4768 LOAD_PLUGIN_NETWORK="#"
4771 LOAD_PLUGIN_NETWORK="##"
4774 if test "x$enable_csv" = "xyes"
4776 if test "x$default_write_plugin" = "xnone"
4778 default_write_plugin="csv"
4783 LOAD_PLUGIN_CSV="##"
4785 AC_MSG_RESULT([$default_write_plugin])
4787 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4788 AC_SUBST(LOAD_PLUGIN_NETWORK)
4789 AC_SUBST(LOAD_PLUGIN_CSV)
4792 if test "x$ac_system" = "xLinux" \
4793 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4795 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4799 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4801 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4803 PERL_BINDINGS_OPTIONS="$withval"
4804 with_perl_bindings="yes"
4806 PERL_BINDINGS_OPTIONS=""
4807 with_perl_bindings="$withval"
4811 PERL_BINDINGS_OPTIONS=""
4812 if test -n "$perl_interpreter"
4814 with_perl_bindings="yes"
4816 with_perl_bindings="no (no perl interpreter found)"
4819 if test "x$with_perl_bindings" = "xyes"
4821 PERL_BINDINGS="perl"
4825 AC_SUBST(PERL_BINDINGS)
4826 AC_SUBST(PERL_BINDINGS_OPTIONS)
4828 dnl libcollectdclient
4829 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4830 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4831 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4833 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4835 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4837 AC_SUBST(LCC_VERSION_MAJOR)
4838 AC_SUBST(LCC_VERSION_MINOR)
4839 AC_SUBST(LCC_VERSION_PATCH)
4840 AC_SUBST(LCC_VERSION_EXTRA)
4841 AC_SUBST(LCC_VERSION_STRING)
4843 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4845 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)
4847 if test "x$with_librrd" = "xyes" \
4848 && test "x$librrd_threadsafe" != "xyes"
4850 with_librrd="yes (warning: librrd is not thread-safe)"
4853 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
4855 with_libiptc="yes (shipped version)"
4858 if test "x$with_libperl" = "xyes"
4860 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4862 enable_perl="no (needs libperl)"
4865 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4867 enable_perl="no (libperl doesn't support ithreads)"
4870 if test "x$with_perl_bindings" = "xyes" \
4871 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4873 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4880 libcurl . . . . . . . $with_libcurl
4881 libdbi . . . . . . . $with_libdbi
4882 libcredis . . . . . . $with_libcredis
4883 libesmtp . . . . . . $with_libesmtp
4884 libganglia . . . . . $with_libganglia
4885 libgcrypt . . . . . . $with_libgcrypt
4886 libiokit . . . . . . $with_libiokit
4887 libiptc . . . . . . . $with_libiptc
4888 libjvm . . . . . . . $with_java
4889 libkstat . . . . . . $with_kstat
4890 libkvm . . . . . . . $with_libkvm
4891 liblua . . . . . . . $with_liblua
4892 libmemcached . . . . $with_libmemcached
4893 libmodbus . . . . . . $with_libmodbus
4894 libmysql . . . . . . $with_libmysql
4895 libnetapp . . . . . . $with_libnetapp
4896 libnetlink . . . . . $with_libnetlink
4897 libnetsnmp . . . . . $with_libnetsnmp
4898 libnotify . . . . . . $with_libnotify
4899 liboconfig . . . . . $with_liboconfig
4900 libopenipmi . . . . . $with_libopenipmipthread
4901 liboping . . . . . . $with_liboping
4902 libpcap . . . . . . . $with_libpcap
4903 libperfstat . . . . . $with_perfstat
4904 libperl . . . . . . . $with_libperl
4905 libpq . . . . . . . . $with_libpq
4906 libpthread . . . . . $with_libpthread
4907 librabbitmq . . . . . $with_librabbitmq
4908 librouteros . . . . . $with_librouteros
4909 librrd . . . . . . . $with_librrd
4910 libsensors . . . . . $with_libsensors
4911 libstatgrab . . . . . $with_libstatgrab
4912 libtokyotyrant . . . $with_libtokyotyrant
4913 libupsclient . . . . $with_libupsclient
4914 libvarnish . . . . . $with_libvarnish
4915 libvirt . . . . . . . $with_libvirt
4916 libxml2 . . . . . . . $with_libxml2
4917 libxmms . . . . . . . $with_libxmms
4918 libyajl . . . . . . . $with_libyajl
4919 libevent . . . . . . $with_libevent
4920 protobuf-c . . . . . $have_protoc_c
4921 oracle . . . . . . . $with_oracle
4922 python . . . . . . . $with_python
4925 daemon mode . . . . . $enable_daemon
4926 debug . . . . . . . . $enable_debug
4929 perl . . . . . . . . $with_perl_bindings
4932 amqp . . . . . . . $enable_amqp
4933 apache . . . . . . . $enable_apache
4934 apcups . . . . . . . $enable_apcups
4935 apple_sensors . . . . $enable_apple_sensors
4936 ascent . . . . . . . $enable_ascent
4937 battery . . . . . . . $enable_battery
4938 bind . . . . . . . . $enable_bind
4939 conntrack . . . . . . $enable_conntrack
4940 contextswitch . . . . $enable_contextswitch
4941 cpu . . . . . . . . . $enable_cpu
4942 cpufreq . . . . . . . $enable_cpufreq
4943 csv . . . . . . . . . $enable_csv
4944 curl . . . . . . . . $enable_curl
4945 curl_json . . . . . . $enable_curl_json
4946 curl_xml . . . . . . $enable_curl_xml
4947 dbi . . . . . . . . . $enable_dbi
4948 df . . . . . . . . . $enable_df
4949 disk . . . . . . . . $enable_disk
4950 dns . . . . . . . . . $enable_dns
4951 email . . . . . . . . $enable_email
4952 entropy . . . . . . . $enable_entropy
4953 exec . . . . . . . . $enable_exec
4954 filecount . . . . . . $enable_filecount
4955 fscache . . . . . . . $enable_fscache
4956 gmond . . . . . . . . $enable_gmond
4957 hddtemp . . . . . . . $enable_hddtemp
4958 interface . . . . . . $enable_interface
4959 ipmi . . . . . . . . $enable_ipmi
4960 iptables . . . . . . $enable_iptables
4961 ipvs . . . . . . . . $enable_ipvs
4962 irq . . . . . . . . . $enable_irq
4963 java . . . . . . . . $enable_java
4964 libvirt . . . . . . . $enable_libvirt
4965 load . . . . . . . . $enable_load
4966 logfile . . . . . . . $enable_logfile
4967 lpar... . . . . . . . $enable_lpar
4968 lua . . . . . . . . . $enable_lua
4969 madwifi . . . . . . . $enable_madwifi
4970 match_empty_counter . $enable_match_empty_counter
4971 match_hashed . . . . $enable_match_hashed
4972 match_regex . . . . . $enable_match_regex
4973 match_timediff . . . $enable_match_timediff
4974 match_value . . . . . $enable_match_value
4975 mbmon . . . . . . . . $enable_mbmon
4976 memcachec . . . . . . $enable_memcachec
4977 memcached . . . . . . $enable_memcached
4978 memory . . . . . . . $enable_memory
4979 modbus . . . . . . . $enable_modbus
4980 multimeter . . . . . $enable_multimeter
4981 mysql . . . . . . . . $enable_mysql
4982 netapp . . . . . . . $enable_netapp
4983 netlink . . . . . . . $enable_netlink
4984 network . . . . . . . $enable_network
4985 nfs . . . . . . . . . $enable_nfs
4986 nginx . . . . . . . . $enable_nginx
4987 notify_desktop . . . $enable_notify_desktop
4988 notify_email . . . . $enable_notify_email
4989 ntpd . . . . . . . . $enable_ntpd
4990 nut . . . . . . . . . $enable_nut
4991 olsrd . . . . . . . . $enable_olsrd
4992 onewire . . . . . . . $enable_onewire
4993 openvpn . . . . . . . $enable_openvpn
4994 oracle . . . . . . . $enable_oracle
4995 perl . . . . . . . . $enable_perl
4996 pinba . . . . . . . . $enable_pinba
4997 ping . . . . . . . . $enable_ping
4998 postgresql . . . . . $enable_postgresql
4999 powerdns . . . . . . $enable_powerdns
5000 processes . . . . . . $enable_processes
5001 protocols . . . . . . $enable_protocols
5002 python . . . . . . . $enable_python
5003 redis . . . . . . . . $enable_redis
5004 routeros . . . . . . $enable_routeros
5005 rrdcached . . . . . . $enable_rrdcached
5006 rrdtool . . . . . . . $enable_rrdtool
5007 sensors . . . . . . . $enable_sensors
5008 serial . . . . . . . $enable_serial
5009 snmp . . . . . . . . $enable_snmp
5010 swap . . . . . . . . $enable_swap
5011 syslog . . . . . . . $enable_syslog
5012 table . . . . . . . . $enable_table
5013 tail . . . . . . . . $enable_tail
5014 tape . . . . . . . . $enable_tape
5015 target_notification . $enable_target_notification
5016 target_replace . . . $enable_target_replace
5017 target_scale . . . . $enable_target_scale
5018 target_set . . . . . $enable_target_set
5019 target_v5upgrade . . $enable_target_v5upgrade
5020 tcpconns . . . . . . $enable_tcpconns
5021 teamspeak2 . . . . . $enable_teamspeak2
5022 ted . . . . . . . . . $enable_ted
5023 thermal . . . . . . . $enable_thermal
5024 tokyotyrant . . . . . $enable_tokyotyrant
5025 unixsock . . . . . . $enable_unixsock
5026 uptime . . . . . . . $enable_uptime
5027 users . . . . . . . . $enable_users
5028 uuid . . . . . . . . $enable_uuid
5029 varnish . . . . . . . $enable_varnish
5030 vmem . . . . . . . . $enable_vmem
5031 vserver . . . . . . . $enable_vserver
5032 wireless . . . . . . $enable_wireless
5033 write_http . . . . . $enable_write_http
5034 write_redis . . . . . $enable_write_redis
5035 xmms . . . . . . . . $enable_xmms
5036 zfs_arc . . . . . . . $enable_zfs_arc
5040 if test "x$dependency_error" = "xyes"; then
5041 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5044 if test "x$dependency_warning" = "xyes"; then
5045 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5048 # vim: set fdm=marker :