1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
8 dnl we don't really need the 'u' even in older toolchains. Then there is
9 dnl older libtool, which spelled it AR_FLAGS
10 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
12 m4_ifdef([LT_PACKAGE_VERSION],
15 LT_CONFIG_LTDL_DIR([libltdl])
17 LTDL_INIT([convenience])
18 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
23 AC_LIBLTDL_CONVENIENCE
27 AC_CONFIG_SUBDIRS(libltdl)
28 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
32 AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
34 AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
35 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
38 AC_PREFIX_DEFAULT("/opt/collectd")
43 # Checks for programs.
52 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
59 # Warn when pkg.m4 is missing
60 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
64 AC_CACHE_CHECK([if bison is the parser generator],
65 [collectd_cv_prog_bison],
66 [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
67 [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
71 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
73 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
76 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
77 if test "x$have_protoc_c" = "xno"
79 have_protoc_c="no (protoc-c compiler not found)"
82 if test "x$have_protoc_c" = "xyes"
84 AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
85 [have_protoc_c="yes"; break],
86 [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
88 if test "x$have_protoc_c" = "xyes"
90 AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
91 [have_protoc_c="yes"],
92 [have_protoc_c="no (libprotobuf-c not found)"])
95 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
97 AC_MSG_CHECKING([for kernel type ($host_os)])
100 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
104 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
114 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
118 AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel])
124 AC_MSG_RESULT([$ac_system])
126 if test "x$ac_system" = "xLinux"
128 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
129 if test -z "$KERNEL_DIR"
131 KERNEL_DIR="/lib/modules/`uname -r`/source"
134 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
135 AC_SUBST(KERNEL_CFLAGS)
138 if test "x$ac_system" = "xSolaris"
140 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
141 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
143 if test "x$ac_system" = "xAIX"
145 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
148 # Where to install .pc files.
149 pkgconfigdir="${libdir}/pkgconfig"
150 AC_SUBST(pkgconfigdir)
152 # Check for standards compliance mode
153 AC_ARG_ENABLE(standards,
154 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
155 [enable_standards="$enableval"],
156 [enable_standards="no"])
157 if test "x$enable_standards" = "xyes"
159 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
160 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
161 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
162 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
163 if test "x$GCC" = "xyes"
165 CFLAGS="$CFLAGS -std=c99"
168 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
171 # Checks for header files.
178 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h)
181 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
186 # include <sys/types.h>
189 AC_CHECK_HEADERS(netinet/in.h, [], [],
194 # include <sys/types.h>
196 #if HAVE_NETINET_IN_SYSTM_H
197 # include <netinet/in_systm.h>
200 AC_CHECK_HEADERS(netinet/ip.h, [], [],
205 # include <sys/types.h>
207 #if HAVE_NETINET_IN_SYSTM_H
208 # include <netinet/in_systm.h>
210 #if HAVE_NETINET_IN_H
211 # include <netinet/in.h>
214 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
219 # include <sys/types.h>
221 #if HAVE_NETINET_IN_SYSTM_H
222 # include <netinet/in_systm.h>
224 #if HAVE_NETINET_IN_H
225 # include <netinet/in.h>
227 #if HAVE_NETINET_IP_H
228 # include <netinet/ip.h>
231 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
236 # include <sys/types.h>
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
244 #if HAVE_NETINET_IP_H
245 # include <netinet/ip.h>
248 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
253 # include <sys/types.h>
255 #if HAVE_NETINET_IN_SYSTM_H
256 # include <netinet/in_systm.h>
258 #if HAVE_NETINET_IN_H
259 # include <netinet/in.h>
262 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
267 # include <sys/types.h>
269 #if HAVE_NETINET_IN_SYSTM_H
270 # include <netinet/in_systm.h>
272 #if HAVE_NETINET_IN_H
273 # include <netinet/in.h>
275 #if HAVE_NETINET_IP6_H
276 # include <netinet/ip6.h>
279 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
284 # include <sys/types.h>
286 #if HAVE_NETINET_IN_SYSTM_H
287 # include <netinet/in_systm.h>
289 #if HAVE_NETINET_IN_H
290 # include <netinet/in.h>
292 #if HAVE_NETINET_IP_H
293 # include <netinet/ip.h>
296 AC_CHECK_HEADERS(netinet/udp.h, [], [],
301 # include <sys/types.h>
303 #if HAVE_NETINET_IN_SYSTM_H
304 # include <netinet/in_systm.h>
306 #if HAVE_NETINET_IN_H
307 # include <netinet/in.h>
309 #if HAVE_NETINET_IP_H
310 # include <netinet/ip.h>
315 AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
320 # include <sys/types.h>
322 #if HAVE_NETINET_IN_SYSTM_H
323 # include <netinet/in_systm.h>
325 #if HAVE_NETINET_IN_H
326 # include <netinet/in.h>
328 #if HAVE_NETINET_IP6_H
329 # include <netinet/ip6.h>
333 if test "x$have_ip6_ext" = "xno"; then
334 SAVE_CFLAGS="$CFLAGS"
335 CFLAGS="$CFLAGS -DSOLARIS2=8"
337 AC_CHECK_TYPES([struct ip6_ext],
338 [have_ip6_ext="yes, with -DSOLARIS2=8"],
344 # include <sys/types.h>
346 #if HAVE_NETINET_IN_SYSTM_H
347 # include <netinet/in_systm.h>
349 #if HAVE_NETINET_IN_H
350 # include <netinet/in.h>
352 #if HAVE_NETINET_IP6_H
353 # include <netinet/ip6.h>
357 if test "x$have_ip6_ext" = "xno"; then
358 CFLAGS="$SAVE_CFLAGS"
363 AC_CHECK_HEADERS(sys/dkstat.h)
364 if test "x$ac_system" = "xDarwin"
366 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
367 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
368 # For the battery plugin
369 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
371 #if HAVE_IOKIT_IOKITLIB_H
372 # include <IOKit/IOKitLib.h>
374 #if HAVE_IOKIT_IOTYPES_H
375 # include <IOKit/IOTypes.h>
381 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
384 # include <sys/types.h>
387 # include <sys/param.h>
391 AC_MSG_CHECKING([for sysctl kern.cp_times])
392 if test -x /sbin/sysctl
394 /sbin/sysctl kern.cp_times 2>/dev/null
398 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
399 [Define if sysctl supports kern.cp_times])
408 AC_CHECK_HEADERS(linux/major.h)
410 # For md module (Linux only)
411 if test "x$ac_system" = "xLinux"
413 AC_CHECK_HEADERS(linux/raid/md_u.h,
414 [have_linux_raid_md_u_h="yes"],
415 [have_linux_raid_md_u_h="no"],
417 #include <sys/ioctl.h>
418 #include <linux/major.h>
419 #include <linux/types.h>
421 AC_CHECK_HEADERS([sys/sysmacros.h])
423 have_linux_raid_md_u_h="no"
426 # For the swap module
427 have_linux_wireless_h="no"
428 if test "x$ac_system" = "xLinux"
430 AC_CHECK_HEADERS(linux/wireless.h,
431 [have_linux_wireless_h="yes"],
432 [have_linux_wireless_h="no"],
435 #include <sys/ioctl.h>
436 #include <sys/socket.h>
440 # For the swap module
441 have_sys_swap_h="yes"
442 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
444 #undef _FILE_OFFSET_BITS
445 #undef _LARGEFILE64_SOURCE
447 # include <sys/types.h>
450 # include <sys/param.h>
454 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
457 if test "x$GCC" = "xyes"
459 hint_64="CFLAGS='-m64'"
461 hint_64="CFLAGS='-xarch=v9'"
463 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
467 # For the processes plugin
469 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
471 # For interface plugin
472 AC_CHECK_HEADERS(ifaddrs.h)
473 AC_CHECK_HEADERS(net/if.h, [], [],
476 # include <sys/types.h>
478 #if HAVE_SYS_SOCKET_H
479 # include <sys/socket.h>
482 AC_CHECK_HEADERS(linux/if.h, [], [],
485 # include <sys/types.h>
487 #if HAVE_SYS_SOCKET_H
488 # include <sys/socket.h>
491 AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
494 # include <sys/types.h>
496 #if HAVE_SYS_SOCKET_H
497 # include <sys/socket.h>
499 #if HAVE_LINUX_INET_DIAG_H
500 # include <linux/inet_diag.h>
503 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
506 # include <sys/types.h>
508 #if HAVE_SYS_SOCKET_H
509 # include <sys/socket.h>
512 # include <linux/if.h>
517 AC_CHECK_HEADERS(linux/sockios.h,
518 [have_linux_sockios_h="yes"],
519 [have_linux_sockios_h="no"],
522 # include <sys/ioctl.h>
528 AC_CHECK_HEADERS(linux/ethtool.h,
529 [have_linux_ethtool_h="yes"],
530 [have_linux_ethtool_h="no"],
533 # include <sys/ioctl.h>
538 #if HAVE_LINUX_SOCKIOS_H
539 # include <linux/sockios.h>
544 have_linux_ip_vs_h="no"
545 have_net_ip_vs_h="no"
547 ip_vs_h_needs_kernel_cflags="no"
548 if test "x$ac_system" = "xLinux"
550 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
551 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
552 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
554 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
556 SAVE_CFLAGS="$CFLAGS"
557 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
559 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
561 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
562 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
563 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
565 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
567 ip_vs_h_needs_kernel_cflags="yes"
570 CFLAGS="$SAVE_CFLAGS"
573 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
576 AC_CHECK_HEADERS(sys/ucred.h, [], [],
579 # include <sys/types.h>
582 # include <sys/param.h>
586 # For mount interface
587 AC_CHECK_HEADERS(sys/mount.h, [], [],
590 # include <sys/types.h>
593 # include <sys/param.h>
597 # For the email plugin
598 AC_CHECK_HEADERS(linux/un.h, [], [],
600 #if HAVE_SYS_SOCKET_H
601 # include <sys/socket.h>
628 AC_CHECK_HEADERS([xfs/xqm.h], [], [],
634 AC_CHECK_HEADERS(arpa/nameser.h)
635 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
637 #if HAVE_ARPA_NAMESER_H
638 # include <arpa/nameser.h>
642 AC_CHECK_HEADERS(net/if_arp.h, [], [],
643 [#if HAVE_SYS_SOCKET_H
644 # include <sys/socket.h>
647 AC_CHECK_HEADERS(net/ppp_defs.h)
648 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
649 [#if HAVE_NET_PPP_DEFS_H
650 # include <net/ppp_defs.h>
653 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
658 # include <sys/types.h>
660 #if HAVE_SYS_SOCKET_H
661 # include <sys/socket.h>
666 #if HAVE_NETINET_IN_H
667 # include <netinet/in.h>
671 AC_CHECK_HEADERS(netinet/ip_compat.h)
673 have_net_pfvar_h="no"
674 AC_CHECK_HEADERS(net/pfvar.h,
675 [have_net_pfvar_h="yes"],
676 [have_net_pfvar_h="no"],
679 # include <sys/ioctl.h>
681 #if HAVE_SYS_SOCKET_H
682 # include <sys/socket.h>
687 #if HAVE_NETINET_IN_H
688 # include <netinet/in.h>
692 # For the multimeter plugin
694 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
697 # Checks for typedefs, structures, and compiler characteristics.
706 # Checks for library functions.
708 AC_PROG_GCC_TRADITIONAL
709 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
713 SAVE_CFLAGS="$CFLAGS"
714 # Emulate behavior of src/Makefile.am
715 if test "x$GCC" = "xyes"
717 CFLAGS="$CFLAGS -Wall -Werror"
720 AC_CACHE_CHECK([for strtok_r],
721 [c_cv_have_strtok_r_default],
730 char buffer[] = "foo,bar,baz";
737 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
740 printf ("token = %s;\n", token);
744 [c_cv_have_strtok_r_default="yes"],
745 [c_cv_have_strtok_r_default="no"]
749 if test "x$c_cv_have_strtok_r_default" = "xno"
751 CFLAGS="$CFLAGS -D_REENTRANT=1"
753 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
754 [c_cv_have_strtok_r_reentrant],
763 char buffer[] = "foo,bar,baz";
770 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
773 printf ("token = %s;\n", token);
777 [c_cv_have_strtok_r_reentrant="yes"],
778 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
783 CFLAGS="$SAVE_CFLAGS"
784 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
786 CFLAGS="$CFLAGS -D_REENTRANT=1"
789 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
791 socket_needs_socket="no"
792 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
793 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
795 clock_gettime_needs_rt="no"
796 clock_gettime_needs_posix4="no"
797 have_clock_gettime="no"
798 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
799 if test "x$have_clock_gettime" = "xno"
801 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
802 have_clock_gettime="yes"])
804 if test "x$have_clock_gettime" = "xno"
806 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
807 have_clock_gettime="yes"])
809 if test "x$have_clock_gettime" = "xyes"
811 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
813 AC_MSG_WARN(cannot find clock_gettime)
816 nanosleep_needs_rt="no"
817 nanosleep_needs_posix4="no"
818 AC_CHECK_FUNCS(nanosleep,
820 AC_CHECK_LIB(rt, nanosleep,
821 [nanosleep_needs_rt="yes"],
822 AC_CHECK_LIB(posix4, nanosleep,
823 [nanosleep_needs_posix4="yes"],
824 AC_MSG_ERROR(cannot find nanosleep))))
826 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
827 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
829 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
830 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
831 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
832 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
833 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
834 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
835 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
836 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
837 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
838 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
839 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
840 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
842 # Check for strptime {{{
843 if test "x$GCC" = "xyes"
845 SAVE_CFLAGS="$CFLAGS"
846 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
849 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
850 if test "x$have_strptime" = "xyes"
852 AC_CACHE_CHECK([whether strptime is exported by default],
853 [c_cv_have_strptime_default],
854 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
860 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
863 [c_cv_have_strptime_default="yes"],
864 [c_cv_have_strptime_default="no"]))
866 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
868 AC_CACHE_CHECK([whether strptime needs standards mode],
869 [c_cv_have_strptime_standards],
870 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
872 #ifndef _ISOC99_SOURCE
873 # define _ISOC99_SOURCE 1
875 #ifndef _POSIX_C_SOURCE
876 # define _POSIX_C_SOURCE 200112L
878 #ifndef _XOPEN_SOURCE
879 # define _XOPEN_SOURCE 500
885 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
888 [c_cv_have_strptime_standards="yes"],
889 [c_cv_have_strptime_standards="no"]))
891 if test "x$c_cv_have_strptime_standards" = "xyes"
893 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
899 if test "x$GCC" = "xyes"
901 CFLAGS="$SAVE_CFLAGS"
903 # }}} Check for strptime
905 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
906 if test "x$have_swapctl" = "xyes"; then
907 AC_CACHE_CHECK([whether swapctl takes two arguments],
908 [c_cv_have_swapctl_two_args],
909 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
911 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
912 # undef _FILE_OFFSET_BITS
913 # undef _LARGEFILE64_SOURCE
915 #include <sys/stat.h>
916 #include <sys/swap.h>
919 int num = swapctl(0, NULL);
922 [c_cv_have_swapctl_two_args="yes"],
923 [c_cv_have_swapctl_two_args="no"]
926 AC_CACHE_CHECK([whether swapctl takes three arguments],
927 [c_cv_have_swapctl_three_args],
931 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
932 # undef _FILE_OFFSET_BITS
933 # undef _LARGEFILE64_SOURCE
935 #include <sys/stat.h>
936 #include <sys/swap.h>
939 int num = swapctl(0, NULL, 0);
942 [c_cv_have_swapctl_three_args="yes"],
943 [c_cv_have_swapctl_three_args="no"]
947 # Check for different versions of `swapctl' here..
948 if test "x$have_swapctl" = "xyes"; then
949 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
950 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
951 [Define if the function swapctl exists and takes two arguments.])
953 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
954 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
955 [Define if the function swapctl exists and takes three arguments.])
960 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
962 if test "x$withval" = "xno"; then
964 else if test "x$withval" = "xyes"; then
971 if test "x$nan_type" = "xnone"; then
972 AC_CACHE_CHECK([whether NAN is defined by default],
973 [c_cv_have_nan_default],
974 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
978 static double foo = NAN;
987 [c_cv_have_nan_default="yes"],
988 [c_cv_have_nan_default="no"]
991 if test "x$c_cv_have_nan_default" = "xyes"
996 if test "x$nan_type" = "xnone"; then
997 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
998 [c_cv_have_nan_isoc],
999 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1002 #define __USE_ISOC99 1
1004 static double foo = NAN;
1013 [c_cv_have_nan_isoc="yes"],
1014 [c_cv_have_nan_isoc="no"]
1017 if test "x$c_cv_have_nan_isoc" = "xyes"
1022 if test "x$nan_type" = "xnone"; then
1023 SAVE_LDFLAGS=$LDFLAGS
1024 LDFLAGS="$LDFLAGS -lm"
1025 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1026 [c_cv_have_nan_zero],
1027 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1034 #define NAN (0.0 / 0.0)
1036 # define isnan(f) ((f) != (f))
1038 static double foo = NAN;
1047 [c_cv_have_nan_zero="yes"],
1048 [c_cv_have_nan_zero="no"]
1051 LDFLAGS=$SAVE_LDFLAGS
1052 if test "x$c_cv_have_nan_zero" = "xyes"
1058 if test "x$nan_type" = "xdefault"; then
1059 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
1060 [Define if NAN is defined by default and can initialize static variables.])
1061 else if test "x$nan_type" = "xisoc99"; then
1062 AC_DEFINE(NAN_STATIC_ISOC, 1,
1063 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
1064 else if test "x$nan_type" = "xzero"; then
1065 AC_DEFINE(NAN_ZERO_ZERO, 1,
1066 [Define if NAN can be defined as (0.0 / 0.0)])
1068 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1071 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
1073 if test "x$withval" = "xnothing"; then
1074 fp_layout_type="nothing"
1075 else if test "x$withval" = "xendianflip"; then
1076 fp_layout_type="endianflip"
1077 else if test "x$withval" = "xintswap"; then
1078 fp_layout_type="intswap"
1080 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1083 [fp_layout_type="unknown"])
1085 if test "x$fp_layout_type" = "xunknown"; then
1086 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1087 [c_cv_fp_layout_need_nothing],
1088 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1094 # include <stdint.h>
1097 # include <inttypes.h>
1100 # include <stdbool.h>
1110 memcpy ((void *) &i0, (void *) &d, 8);
1113 memcpy ((void *) c, (void *) &i1, 8);
1115 if ((c[0] == 0x2f) && (c[1] == 0x25)
1116 && (c[2] == 0xc0) && (c[3] == 0xc7)
1117 && (c[4] == 0x43) && (c[5] == 0x2b)
1118 && (c[6] == 0x1f) && (c[7] == 0x5b))
1124 [c_cv_fp_layout_need_nothing="yes"],
1125 [c_cv_fp_layout_need_nothing="no"]
1128 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1129 fp_layout_type="nothing"
1132 if test "x$fp_layout_type" = "xunknown"; then
1133 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1134 [c_cv_fp_layout_need_endianflip],
1135 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1141 # include <stdint.h>
1144 # include <inttypes.h>
1147 # include <stdbool.h>
1149 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1150 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1151 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1152 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1153 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1154 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1155 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1156 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1165 memcpy ((void *) &i0, (void *) &d, 8);
1167 i1 = endianflip (i0);
1168 memcpy ((void *) c, (void *) &i1, 8);
1170 if ((c[0] == 0x2f) && (c[1] == 0x25)
1171 && (c[2] == 0xc0) && (c[3] == 0xc7)
1172 && (c[4] == 0x43) && (c[5] == 0x2b)
1173 && (c[6] == 0x1f) && (c[7] == 0x5b))
1179 [c_cv_fp_layout_need_endianflip="yes"],
1180 [c_cv_fp_layout_need_endianflip="no"]
1183 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1184 fp_layout_type="endianflip"
1187 if test "x$fp_layout_type" = "xunknown"; then
1188 AC_CACHE_CHECK([if intswap converts to x86 representation],
1189 [c_cv_fp_layout_need_intswap],
1190 AC_RUN_IFELSE([AC_LANG_PROGRAM(
1196 # include <stdint.h>
1199 # include <inttypes.h>
1202 # include <stdbool.h>
1204 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1205 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1214 memcpy ((void *) &i0, (void *) &d, 8);
1217 memcpy ((void *) c, (void *) &i1, 8);
1219 if ((c[0] == 0x2f) && (c[1] == 0x25)
1220 && (c[2] == 0xc0) && (c[3] == 0xc7)
1221 && (c[4] == 0x43) && (c[5] == 0x2b)
1222 && (c[6] == 0x1f) && (c[7] == 0x5b))
1228 [c_cv_fp_layout_need_intswap="yes"],
1229 [c_cv_fp_layout_need_intswap="no"]
1232 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1233 fp_layout_type="intswap"
1237 if test "x$fp_layout_type" = "xnothing"; then
1238 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1239 [Define if doubles are stored in x86 representation.])
1240 else if test "x$fp_layout_type" = "xendianflip"; then
1241 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1242 [Define if endianflip is needed to convert to x86 representation.])
1243 else if test "x$fp_layout_type" = "xintswap"; then
1244 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1245 [Define if intswap is needed to convert to x86 representation.])
1247 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1251 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1252 have_getvfsstat="no"
1253 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1254 have_listmntent="no"
1255 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1256 have_getmntent_r="no"
1257 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
1260 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1261 if test "x$have_getmntent" = "xno"; then
1262 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1264 if test "x$have_getmntent" = "xno"; then
1265 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1267 if test "x$have_getmntent" = "xno"; then
1268 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1271 if test "x$have_getmntent" = "xc"; then
1272 AC_CACHE_CHECK([whether getmntent takes one argument],
1273 [c_cv_have_one_getmntent],
1277 #include "$srcdir/src/utils_mount.h"
1282 fh = setmntent ("/etc/mtab", "r");
1283 me = getmntent (fh);
1284 return(me->mnt_passno);
1287 [c_cv_have_one_getmntent="yes"],
1288 [c_cv_have_one_getmntent="no"]
1291 AC_CACHE_CHECK([whether getmntent takes two arguments],
1292 [c_cv_have_two_getmntent],
1296 #include "$srcdir/src/utils_mount.h"
1302 fh = fopen ("/etc/mnttab", "r");
1303 status = getmntent (fh, &mt);
1307 [c_cv_have_two_getmntent="yes"],
1308 [c_cv_have_two_getmntent="no"]
1313 # Check for different versions of `getmntent' here..
1315 if test "x$have_getmntent" = "xc"; then
1316 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1317 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1318 [Define if the function getmntent exists and takes one argument.])
1320 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1321 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1322 [Define if the function getmntent exists and takes two arguments.])
1325 if test "x$have_getmntent" = "xsun"; then
1326 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1327 [Define if the function getmntent exists. It's the version from libsun.])
1329 if test "x$have_getmntent" = "xseq"; then
1330 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1331 [Define if the function getmntent exists. It's the version from libseq.])
1333 if test "x$have_getmntent" = "xgen"; then
1334 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1335 [Define if the function getmntent exists. It's the version from libgen.])
1339 AC_CACHE_CHECK([if have htonll defined],
1341 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1343 #include <sys/types.h>
1344 #include <netinet/in.h>
1346 # include <inttypes.h>
1353 [c_cv_have_htonll="yes"],
1354 [c_cv_have_htonll="no"]
1357 if test "x$c_cv_have_htonll" = "xyes"
1359 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1362 # Check for structures
1363 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1364 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1367 #include <sys/types.h>
1368 #include <sys/socket.h>
1371 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1372 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1375 #include <sys/types.h>
1376 #include <sys/socket.h>
1377 #include <linux/if.h>
1378 #include <linux/netdevice.h>
1380 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1381 [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
1384 #include <linux/inet_diag.h>
1388 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1391 #include <netinet/in.h>
1395 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1397 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1398 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1399 have_struct_kinfo_proc_freebsd="yes"
1402 have_struct_kinfo_proc_freebsd="no"
1406 #include <sys/param.h>
1407 #include <sys/sysctl.h>
1408 #include <sys/user.h>
1411 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1413 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1414 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1415 have_struct_kinfo_proc_openbsd="yes"
1418 have_struct_kinfo_proc_openbsd="no"
1421 #include <sys/param.h>
1422 #include <sys/sysctl.h>
1426 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1427 [#define _BSD_SOURCE
1428 #define _DEFAULT_SOURCE
1430 # include <stdint.h>
1432 #if HAVE_SYS_TYPES_H
1433 # include <sys/types.h>
1435 #if HAVE_NETINET_IN_SYSTM_H
1436 # include <netinet/in_systm.h>
1438 #if HAVE_NETINET_IN_H
1439 # include <netinet/in.h>
1441 #if HAVE_NETINET_IP_H
1442 # include <netinet/ip.h>
1444 #if HAVE_NETINET_UDP_H
1445 # include <netinet/udp.h>
1448 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1449 [#define _BSD_SOURCE
1450 #define _DEFAULT_SOURCE
1452 # include <stdint.h>
1454 #if HAVE_SYS_TYPES_H
1455 # include <sys/types.h>
1457 #if HAVE_NETINET_IN_SYSTM_H
1458 # include <netinet/in_systm.h>
1460 #if HAVE_NETINET_IN_H
1461 # include <netinet/in.h>
1463 #if HAVE_NETINET_IP_H
1464 # include <netinet/ip.h>
1466 #if HAVE_NETINET_UDP_H
1467 # include <netinet/udp.h>
1471 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1481 # Checks for libraries begin here
1484 with_libresolv="yes"
1485 AC_CHECK_LIB(resolv, res_search,
1487 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1489 [with_libresolv="no"])
1490 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1492 dnl Check for HAL (hardware abstraction library)
1494 AC_CHECK_LIB(hal,libhal_device_property_exists,
1495 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1497 if test "x$with_libhal" = "xyes"; then
1498 if test "x$PKG_CONFIG" != "x"; then
1499 BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
1500 BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
1501 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1502 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1506 m4_divert_once([HELP_WITH], [
1507 collectd additional packages:])
1509 AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
1511 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1513 if test "x$ac_system" = "xAIX"
1518 with_perfstat="no (AIX only)"
1519 with_procinfo="no (AIX only)"
1522 if test "x$with_perfstat" = "xyes"
1524 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1525 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1527 if test "x$with_perfstat" = "xyes"
1529 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1530 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1531 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1532 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1534 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1537 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1539 # Processes plugin under AIX.
1540 if test "x$with_procinfo" = "xyes"
1542 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1544 if test "x$with_procinfo" = "xyes"
1546 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1549 if test "x$ac_system" = "xSolaris"
1554 with_kstat="no (Solaris only)"
1555 with_devinfo="no (Solaris only)"
1558 if test "x$with_kstat" = "xyes"
1560 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1562 if test "x$with_kstat" = "xyes"
1564 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1565 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1567 if test "x$with_kstat" = "xyes"
1569 AC_DEFINE(HAVE_LIBKSTAT, 1,
1570 [Define to 1 if you have the 'kstat' library (-lkstat)])
1572 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1573 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1576 if test "x$ac_system" = "xDarwin"
1582 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1585 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1586 if test "x$with_kvm_getprocs" = "xyes"
1588 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1589 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1592 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1594 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1595 if test "x$with_kvm_getswapinfo" = "xyes"
1597 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1598 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1601 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1603 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1604 if test "x$with_kvm_nlist" = "xyes"
1606 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1607 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1608 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1611 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1613 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1614 if test "x$with_kvm_openfiles" = "xyes"
1616 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1617 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1620 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1622 # --with-libaquaero5 {{{
1623 AC_ARG_WITH(libaquaero5, [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
1625 if test "x$withval" = "xyes"
1627 with_libaquaero5="yes"
1628 else if test "x$withval" = "xno"
1630 with_libaquaero5="no"
1632 with_libaquaero5="yes"
1633 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
1634 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
1637 [with_libaquaero5="yes"])
1639 SAVE_CPPFLAGS="$CPPFLAGS"
1640 SAVE_LDFLAGS="$LDFLAGS"
1642 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
1643 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
1645 if test "x$with_libaquaero5" = "xyes"
1647 if test "x$LIBAQUAERO5_CFLAGS" != "x"
1649 AC_MSG_NOTICE([libaquaero5 CPPFLAGS: $LIBAQUAERO5_CFLAGS])
1651 AC_CHECK_HEADERS(libaquaero5.h,
1652 [with_libaquaero5="yes"],
1653 [with_libaquaero5="no (libaquaero5.h not found)"])
1655 if test "x$with_libaquaero5" = "xyes"
1657 if test "x$LIBAQUAERO5_LDFLAGS" != "x"
1659 AC_MSG_NOTICE([libaquaero5 LDFLAGS: $LIBAQUAERO5_LDFLAGS])
1661 AC_CHECK_LIB(aquaero5, libaquaero5_poll,
1662 [with_libaquaero5="yes"],
1663 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"])
1666 CPPFLAGS="$SAVE_CPPFLAGS"
1667 LDFLAGS="$SAVE_LDFLAGS"
1669 if test "x$with_libaquaero5" = "xyes"
1671 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
1672 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
1673 AC_SUBST(BUILD_WITH_LIBAQUAERO5_CFLAGS)
1674 AC_SUBST(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
1676 AM_CONDITIONAL(BUILD_WITH_LIBAQUAERO5, test "x$with_libaquaero5" = "xyes")
1679 # --with-libcredis {{{
1680 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1682 if test "x$withval" = "xyes"
1684 with_libcredis="yes"
1685 else if test "x$withval" = "xno"
1689 with_libcredis="yes"
1690 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1691 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1694 [with_libcredis="yes"])
1696 SAVE_CPPFLAGS="$CPPFLAGS"
1697 SAVE_LDFLAGS="$LDFLAGS"
1699 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1700 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1702 if test "x$with_libcredis" = "xyes"
1704 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1706 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1708 AC_CHECK_HEADERS(credis.h,
1709 [with_libcredis="yes"],
1710 [with_libcredis="no (credis.h not found)"])
1712 if test "x$with_libcredis" = "xyes"
1714 if test "x$LIBCREDIS_LDFLAGS" != "x"
1716 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1718 AC_CHECK_LIB(credis, credis_info,
1719 [with_libcredis="yes"],
1720 [with_libcredis="no (symbol 'credis_info' not found)"])
1724 CPPFLAGS="$SAVE_CPPFLAGS"
1725 LDFLAGS="$SAVE_LDFLAGS"
1727 if test "x$with_libcredis" = "xyes"
1729 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1730 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1731 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1732 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1734 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1737 # --with-libcurl {{{
1738 with_curl_config="curl-config"
1741 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1743 if test "x$withval" = "xno"
1746 else if test "x$withval" = "xyes"
1750 if test -f "$withval" && test -x "$withval"
1752 with_curl_config="$withval"
1754 else if test -x "$withval/bin/curl-config"
1756 with_curl_config="$withval/bin/curl-config"
1765 if test "x$with_libcurl" = "xyes"
1767 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1768 curl_config_status=$?
1770 if test $curl_config_status -ne 0
1772 with_libcurl="no ($with_curl_config failed)"
1774 SAVE_CPPFLAGS="$CPPFLAGS"
1775 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1777 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1779 CPPFLAGS="$SAVE_CPPFLAGS"
1782 if test "x$with_libcurl" = "xyes"
1784 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1785 curl_config_status=$?
1787 if test $curl_config_status -ne 0
1789 with_libcurl="no ($with_curl_config failed)"
1791 AC_CHECK_LIB(curl, curl_easy_init,
1792 [with_libcurl="yes"],
1793 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1797 if test "x$with_libcurl" = "xyes"
1799 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1800 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1801 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1802 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1804 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1808 with_libdbi_cppflags=""
1809 with_libdbi_ldflags=""
1810 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1812 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1814 with_libdbi_cppflags="-I$withval/include"
1815 with_libdbi_ldflags="-L$withval/lib"
1818 with_libdbi="$withval"
1824 if test "x$with_libdbi" = "xyes"
1826 SAVE_CPPFLAGS="$CPPFLAGS"
1827 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1829 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1831 CPPFLAGS="$SAVE_CPPFLAGS"
1833 if test "x$with_libdbi" = "xyes"
1835 SAVE_CPPFLAGS="$CPPFLAGS"
1836 SAVE_LDFLAGS="$LDFLAGS"
1837 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1838 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1840 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1842 CPPFLAGS="$SAVE_CPPFLAGS"
1843 LDFLAGS="$SAVE_LDFLAGS"
1845 if test "x$with_libdbi" = "xyes"
1847 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1848 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1849 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1850 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1851 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1852 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1854 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1857 # --with-libesmtp {{{
1858 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1860 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1862 LDFLAGS="$LDFLAGS -L$withval/lib"
1863 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1866 with_libesmtp="$withval"
1872 if test "x$with_libesmtp" = "xyes"
1874 AC_CHECK_LIB(esmtp, smtp_create_session,
1876 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1877 ], [with_libesmtp="no (libesmtp not found)"])
1879 if test "x$with_libesmtp" = "xyes"
1881 AC_CHECK_HEADERS(libesmtp.h,
1883 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1884 ], [with_libesmtp="no (libesmtp.h not found)"])
1886 if test "x$with_libesmtp" = "xyes"
1892 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1893 [Wether or not to use the esmtp library])
1894 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1897 # --with-libganglia {{{
1898 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1900 if test -f "$withval" && test -x "$withval"
1902 with_libganglia_config="$withval"
1903 with_libganglia="yes"
1904 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1906 with_libganglia_config="$withval/bin/ganglia-config"
1907 with_libganglia="yes"
1908 else if test -d "$withval"
1910 GANGLIA_CPPFLAGS="-I$withval/include"
1911 GANGLIA_LDFLAGS="-L$withval/lib"
1912 with_libganglia="yes"
1914 with_libganglia="$withval"
1918 with_libganglia="yes"
1921 if test "x$with_libganglia" = "xyes"
1923 if test "x$with_libganglia_config" != "x"
1925 if test "x$GANGLIA_CPPFLAGS" = "x"
1927 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1930 if test "x$GANGLIA_LDFLAGS" = "x"
1932 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1935 if test "x$GANGLIA_LIBS" = "x"
1937 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1940 GANGLIA_LIBS="-lganglia"
1944 SAVE_CPPFLAGS="$CPPFLAGS"
1945 SAVE_LDFLAGS="$LDFLAGS"
1946 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1947 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1949 if test "x$with_libganglia" = "xyes"
1951 AC_CHECK_HEADERS(gm_protocol.h,
1953 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1954 [Define to 1 if you have the <gm_protocol.h> header file.])
1955 ], [with_libganglia="no (gm_protocol.h not found)"])
1958 if test "x$with_libganglia" = "xyes"
1960 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1962 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1963 [Define to 1 if you have the ganglia library (-lganglia).])
1964 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1967 CPPFLAGS="$SAVE_CPPFLAGS"
1968 LDFLAGS="$SAVE_LDFLAGS"
1970 AC_SUBST(GANGLIA_CPPFLAGS)
1971 AC_SUBST(GANGLIA_LDFLAGS)
1972 AC_SUBST(GANGLIA_LIBS)
1973 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1976 # --with-libgcrypt {{{
1977 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1978 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1979 GCRYPT_LIBS="$GCRYPT_LIBS"
1980 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1982 if test -f "$withval" && test -x "$withval"
1984 with_libgcrypt_config="$withval"
1985 with_libgcrypt="yes"
1986 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1988 with_libgcrypt_config="$withval/bin/gcrypt-config"
1989 with_libgcrypt="yes"
1990 else if test -d "$withval"
1992 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1993 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1994 with_libgcrypt="yes"
1996 with_libgcrypt_config="gcrypt-config"
1997 with_libgcrypt="$withval"
2001 with_libgcrypt_config="libgcrypt-config"
2002 with_libgcrypt="yes"
2005 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
2007 if test "x$GCRYPT_CPPFLAGS" = "x"
2009 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2012 if test "x$GCRYPT_LIBS" = "x"
2014 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2018 SAVE_CPPFLAGS="$CPPFLAGS"
2019 SAVE_LDFLAGS="$LDFLAGS"
2021 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2022 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2023 LIBS="$LIBS $GCRYPT_LIBS"
2025 if test "x$with_libgcrypt" = "xyes"
2027 if test "x$GCRYPT_CPPFLAGS" != "x"
2029 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
2031 AC_CHECK_HEADERS(gcrypt.h,
2032 [with_libgcrypt="yes"],
2033 [with_libgcrypt="no (gcrypt.h not found)"])
2036 if test "x$with_libgcrypt" = "xyes"
2038 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2039 [with_libgcrypt="yes"],
2040 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
2042 if test "$with_libgcrypt" != "no"; then
2043 m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
2044 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
2045 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
2049 CPPFLAGS="$SAVE_CPPFLAGS"
2050 LDFLAGS="$SAVE_LDFLAGS"
2053 if test "x$with_libgcrypt" = "xyes"
2055 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
2058 AC_SUBST(GCRYPT_CPPFLAGS)
2059 AC_SUBST(GCRYPT_LDFLAGS)
2060 AC_SUBST(GCRYPT_LIBS)
2061 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
2064 # --with-libiptc {{{
2065 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2067 if test "x$withval" = "xshipped"
2070 else if test "x$withval" = "xyes"
2072 with_libiptc="pkgconfig"
2073 else if test "x$withval" = "xno"
2078 with_libiptc_cflags="-I$withval/include"
2079 with_libiptc_libs="-L$withval/lib"
2083 if test "x$ac_system" = "xLinux"
2085 with_libiptc="pkgconfig"
2087 with_libiptc="no (Linux only)"
2091 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
2093 with_libiptc="no (Don't have pkg-config)"
2096 if test "x$with_libiptc" = "xpkgconfig"
2098 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2101 with_libiptc="no (pkg-config doesn't know libiptc)"
2104 if test "x$with_libiptc" = "xpkgconfig"
2106 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2109 with_libiptc="no ($PKG_CONFIG failed)"
2111 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2114 with_libiptc="no ($PKG_CONFIG failed)"
2118 SAVE_CPPFLAGS="$CPPFLAGS"
2119 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2121 # check whether the header file for libiptc is available.
2122 if test "x$with_libiptc" = "xpkgconfig"
2124 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
2125 [with_libiptc="no (header file missing)"])
2127 # If the header file is available, check for the required type declaractions.
2128 # They may be missing in old versions of libiptc. In that case, they will be
2129 # declared in the iptables plugin.
2130 if test "x$with_libiptc" = "xpkgconfig"
2132 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2134 # Check for the iptc_init symbol in the library.
2135 # This could be in iptc or ip4tc
2136 if test "x$with_libiptc" = "xpkgconfig"
2139 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
2140 [with_libiptc="pkgconfig"],
2141 [with_libiptc="no"],
2142 [$with_libiptc_libs])
2145 if test "x$with_libiptc" = "xpkgconfig"
2150 CPPFLAGS="$SAVE_CPPFLAGS"
2152 if test "x$with_libiptc" = "xown"
2154 with_libiptc_cflags=""
2155 with_libiptc_libs=""
2157 if test "x$with_libiptc" = "xown"
2159 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
2161 with_libiptc="no (Linux iptables headers not found)"
2164 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
2167 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
2168 if test "x$with_libiptc" = "xown"
2170 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
2174 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
2175 if test "x$with_libiptc" = "xyes"
2177 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2178 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2179 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
2180 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
2185 with_java_home="$JAVA_HOME"
2186 if test "x$with_java_home" = "x"
2188 with_java_home="/usr/lib/jvm"
2190 with_java_vmtype="client"
2195 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2197 if test "x$withval" = "xno"
2200 else if test "x$withval" = "xyes"
2204 with_java_home="$withval"
2209 if test "x$with_java" = "xyes"
2211 if test -d "$with_java_home"
2213 AC_MSG_CHECKING([for jni.h])
2214 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2215 if test "x$TMPVAR" != "x"
2217 AC_MSG_RESULT([found in $TMPVAR])
2218 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2220 AC_MSG_RESULT([not found])
2223 AC_MSG_CHECKING([for jni_md.h])
2224 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2225 if test "x$TMPVAR" != "x"
2227 AC_MSG_RESULT([found in $TMPVAR])
2228 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2230 AC_MSG_RESULT([not found])
2233 AC_MSG_CHECKING([for libjvm.so])
2234 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2235 if test "x$TMPVAR" != "x"
2237 AC_MSG_RESULT([found in $TMPVAR])
2238 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2240 AC_MSG_RESULT([not found])
2243 if test "x$JAVAC" = "x"
2245 AC_MSG_CHECKING([for javac])
2246 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2247 if test "x$TMPVAR" != "x"
2250 AC_MSG_RESULT([$JAVAC])
2252 AC_MSG_RESULT([not found])
2255 if test "x$JAR" = "x"
2257 AC_MSG_CHECKING([for jar])
2258 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2259 if test "x$TMPVAR" != "x"
2262 AC_MSG_RESULT([$JAR])
2264 AC_MSG_RESULT([not found])
2267 else if test "x$with_java_home" != "x"
2269 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2273 if test "x$JAVA_CPPFLAGS" != "x"
2275 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2277 if test "x$JAVA_CFLAGS" != "x"
2279 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2281 if test "x$JAVA_LDFLAGS" != "x"
2283 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2285 if test "x$JAVAC" = "x"
2287 with_javac_path="$PATH"
2288 if test "x$with_java_home" != "x"
2290 with_javac_path="$with_java_home:with_javac_path"
2291 if test -d "$with_java_home/bin"
2293 with_javac_path="$with_java_home/bin:with_javac_path"
2297 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2299 if test "x$JAVAC" = "x"
2301 with_java="no (javac not found)"
2303 if test "x$JAR" = "x"
2305 with_jar_path="$PATH"
2306 if test "x$with_java_home" != "x"
2308 with_jar_path="$with_java_home:$with_jar_path"
2309 if test -d "$with_java_home/bin"
2311 with_jar_path="$with_java_home/bin:$with_jar_path"
2315 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2317 if test "x$JAR" = "x"
2319 with_java="no (jar not found)"
2322 SAVE_CPPFLAGS="$CPPFLAGS"
2323 SAVE_CFLAGS="$CFLAGS"
2324 SAVE_LDFLAGS="$LDFLAGS"
2325 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2326 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2327 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2329 if test "x$with_java" = "xyes"
2331 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2333 if test "x$with_java" = "xyes"
2335 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2337 [with_java="no (libjvm not found)"],
2340 if test "x$with_java" = "xyes"
2342 JAVA_LIBS="$JAVA_LIBS -ljvm"
2343 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2346 CPPFLAGS="$SAVE_CPPFLAGS"
2347 CFLAGS="$SAVE_CFLAGS"
2348 LDFLAGS="$SAVE_LDFLAGS"
2350 AC_SUBST(JAVA_CPPFLAGS)
2351 AC_SUBST(JAVA_CFLAGS)
2352 AC_SUBST(JAVA_LDFLAGS)
2354 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2357 # --with-liblvm2app {{{
2358 with_liblvm2app_cppflags=""
2359 with_liblvm2app_ldflags=""
2360 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2362 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2364 with_liblvm2app_cppflags="-I$withval/include"
2365 with_liblvm2app_ldflags="-L$withval/lib"
2366 with_liblvm2app="yes"
2368 with_liblvm2app="$withval"
2372 with_liblvm2app="yes"
2374 if test "x$with_liblvm2app" = "xyes"
2376 SAVE_CPPFLAGS="$CPPFLAGS"
2377 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2379 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2381 CPPFLAGS="$SAVE_CPPFLAGS"
2384 if test "x$with_liblvm2app" = "xyes"
2386 SAVE_CPPFLAGS="$CPPFLAGS"
2387 SAVE_LDFLAGS="$LDFLAGS"
2388 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2389 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2391 AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2393 CPPFLAGS="$SAVE_CPPFLAGS"
2394 LDFLAGS="$SAVE_LDFLAGS"
2396 if test "x$with_liblvm2app" = "xyes"
2398 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2399 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2400 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2401 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2402 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2403 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2404 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2406 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2409 # --with-libmemcached {{{
2410 with_libmemcached_cppflags=""
2411 with_libmemcached_ldflags=""
2412 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2414 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2416 with_libmemcached_cppflags="-I$withval/include"
2417 with_libmemcached_ldflags="-L$withval/lib"
2418 with_libmemcached="yes"
2420 with_libmemcached="$withval"
2424 with_libmemcached="yes"
2426 if test "x$with_libmemcached" = "xyes"
2428 SAVE_CPPFLAGS="$CPPFLAGS"
2429 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2431 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2433 CPPFLAGS="$SAVE_CPPFLAGS"
2435 if test "x$with_libmemcached" = "xyes"
2437 SAVE_CPPFLAGS="$CPPFLAGS"
2438 SAVE_LDFLAGS="$LDFLAGS"
2439 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2440 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2442 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2444 CPPFLAGS="$SAVE_CPPFLAGS"
2445 LDFLAGS="$SAVE_LDFLAGS"
2447 if test "x$with_libmemcached" = "xyes"
2449 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2450 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2451 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2452 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2453 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2454 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2455 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2457 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2460 # --with-libmodbus {{{
2461 with_libmodbus_config=""
2462 with_libmodbus_cflags=""
2463 with_libmodbus_libs=""
2464 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2466 if test "x$withval" = "xno"
2469 else if test "x$withval" = "xyes"
2471 with_libmodbus="use_pkgconfig"
2472 else if test -d "$with_libmodbus/lib"
2474 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2475 with_libmodbus_cflags="-I$withval/include"
2476 with_libmodbus_libs="-L$withval/lib -lmodbus"
2477 with_libmodbus="yes"
2480 [with_libmodbus="use_pkgconfig"])
2482 # configure using pkg-config
2483 if test "x$with_libmodbus" = "xuse_pkgconfig"
2485 if test "x$PKG_CONFIG" = "x"
2487 with_libmodbus="no (Don't have pkg-config)"
2490 if test "x$with_libmodbus" = "xuse_pkgconfig"
2492 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2493 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2496 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2499 if test "x$with_libmodbus" = "xuse_pkgconfig"
2501 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2504 with_libmodbus="no ($PKG_CONFIG failed)"
2506 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2509 with_libmodbus="no ($PKG_CONFIG failed)"
2512 if test "x$with_libmodbus" = "xuse_pkgconfig"
2514 with_libmodbus="yes"
2517 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2518 # the actual checks.
2519 if test "x$with_libmodbus" = "xyes"
2521 SAVE_CPPFLAGS="$CPPFLAGS"
2522 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2524 AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
2526 CPPFLAGS="$SAVE_CPPFLAGS"
2528 if test "x$with_libmodbus" = "xyes"
2530 SAVE_CPPFLAGS="$CPPFLAGS"
2531 SAVE_LDFLAGS="$LDFLAGS"
2533 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2534 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2536 AC_CHECK_LIB(modbus, modbus_connect,
2537 [with_libmodbus="yes"],
2538 [with_libmodbus="no (symbol modbus_connect not found)"])
2540 CPPFLAGS="$SAVE_CPPFLAGS"
2541 LDFLAGS="$SAVE_LDFLAGS"
2543 if test "x$with_libmodbus" = "xyes"
2545 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2546 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2547 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2548 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2552 # --with-libmongoc {{{
2553 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2555 if test "x$withval" = "xyes"
2557 with_libmongoc="yes"
2558 else if test "x$withval" = "xno"
2562 with_libmongoc="yes"
2563 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2564 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2567 [with_libmongoc="yes"])
2569 SAVE_CPPFLAGS="$CPPFLAGS"
2570 SAVE_LDFLAGS="$LDFLAGS"
2572 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2573 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2575 if test "x$with_libmongoc" = "xyes"
2577 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2579 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2581 AC_CHECK_HEADERS(mongo.h,
2582 [with_libmongoc="yes"],
2583 [with_libmongoc="no ('mongo.h' not found)"],
2585 # define MONGO_HAVE_STDINT 1
2587 # define MONGO_USE_LONG_LONG_INT 1
2591 if test "x$with_libmongoc" = "xyes"
2593 if test "x$LIBMONGOC_LDFLAGS" != "x"
2595 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2597 AC_CHECK_LIB(mongoc, mongo_run_command,
2598 [with_libmongoc="yes"],
2599 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2602 CPPFLAGS="$SAVE_CPPFLAGS"
2603 LDFLAGS="$SAVE_LDFLAGS"
2605 if test "x$with_libmongoc" = "xyes"
2607 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2608 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2609 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2610 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2612 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2615 # --with-libmysql {{{
2616 with_mysql_config="mysql_config"
2617 with_mysql_cflags=""
2619 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2621 if test "x$withval" = "xno"
2624 else if test "x$withval" = "xyes"
2628 if test -f "$withval" && test -x "$withval";
2630 with_mysql_config="$withval"
2631 else if test -x "$withval/bin/mysql_config"
2633 with_mysql_config="$withval/bin/mysql_config"
2641 if test "x$with_libmysql" = "xyes"
2643 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
2644 mysql_config_status=$?
2646 if test $mysql_config_status -ne 0
2648 with_libmysql="no ($with_mysql_config failed)"
2650 SAVE_CPPFLAGS="$CPPFLAGS"
2651 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2654 have_mysql_mysql_h="no"
2655 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2657 if test "x$have_mysql_h" = "xno"
2659 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2662 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2664 with_libmysql="no (mysql.h not found)"
2667 CPPFLAGS="$SAVE_CPPFLAGS"
2670 if test "x$with_libmysql" = "xyes"
2672 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2673 mysql_config_status=$?
2675 if test $mysql_config_status -ne 0
2677 with_libmysql="no ($with_mysql_config failed)"
2679 SAVE_CPPFLAGS="$CPPFLAGS"
2680 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2682 LIBS="$with_mysql_libs"
2683 AC_SEARCH_LIBS([mysql_get_server_version],
2685 [with_libmysql="yes"],
2686 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2688 CPPFLAGS="$SAVE_CPPFLAGS"
2692 if test "x$with_libmysql" = "xyes"
2694 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2695 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2696 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2697 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2699 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2703 with_libmnl_cflags=""
2705 AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
2707 echo "libmnl: withval = $withval"
2708 if test "x$withval" = "xyes"
2711 else if test "x$withval" = "xno"
2715 if test -d "$withval/include"
2717 with_libmnl_cflags="-I$withval/include"
2718 with_libmnl_libs="-L$withval/lib -lmnl"
2721 AC_MSG_ERROR("no such directory: $withval/include")
2726 if test "x$ac_system" = "xLinux"
2730 with_libmnl="no (Linux only library)"
2733 if test "x$PKG_CONFIG" = "x"
2735 with_libmnl="no (Don't have pkg-config)"
2737 if test "x$with_libmnl" = "xyes"
2739 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
2740 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
2741 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
2744 AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h,
2750 #include <sys/types.h>
2751 #include <asm/types.h>
2752 #include <sys/socket.h>
2753 #include <linux/netlink.h>
2754 #include <linux/rtnetlink.h>])
2755 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2757 #include <sys/types.h>
2758 #include <asm/types.h>
2759 #include <sys/socket.h>])
2761 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2764 #include <sys/types.h>
2765 #include <asm/types.h>
2766 #include <sys/socket.h>
2767 #include <linux/netlink.h>
2768 #include <linux/rtnetlink.h>
2771 int retval = TCA_STATS2;
2775 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2777 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2780 #include <sys/types.h>
2781 #include <asm/types.h>
2782 #include <sys/socket.h>
2783 #include <linux/netlink.h>
2784 #include <linux/rtnetlink.h>
2787 int retval = TCA_STATS;
2791 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2793 if test "x$with_libmnl" = "xyes"
2795 AC_CHECK_LIB(mnl, mnl_nlmsg_get_payload,
2796 [with_libmnl="yes"],
2797 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
2798 [$with_libmnl_libs])
2800 if test "x$with_libmnl" = "xyes"
2802 AC_DEFINE(HAVE_LIBMNL, 1, [Define if libmnl is present and usable.])
2803 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
2804 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
2805 AC_SUBST(BUILD_WITH_LIBMNL_CFLAGS)
2806 AC_SUBST(BUILD_WITH_LIBMNL_LIBS)
2808 AM_CONDITIONAL(BUILD_WITH_LIBMNL, test "x$with_libmnl" = "xyes")
2811 # --with-libnetapp {{{
2812 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2813 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2814 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2815 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2816 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2817 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2818 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2820 if test -d "$withval"
2822 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2823 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2824 with_libnetapp="yes"
2826 with_libnetapp="$withval"
2830 with_libnetapp="yes"
2833 SAVE_CPPFLAGS="$CPPFLAGS"
2834 SAVE_LDFLAGS="$LDFLAGS"
2835 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2836 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2838 if test "x$with_libnetapp" = "xyes"
2840 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2842 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2844 AC_CHECK_HEADERS(netapp_api.h,
2845 [with_libnetapp="yes"],
2846 [with_libnetapp="no (netapp_api.h not found)"])
2849 if test "x$with_libnetapp" = "xyes"
2851 if test "x$LIBNETAPP_LDFLAGS" != "x"
2853 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2856 if test "x$LIBNETAPP_LIBS" = "x"
2858 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2860 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2862 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2863 [with_libnetapp="yes"],
2864 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2866 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2869 CPPFLAGS="$SAVE_CPPFLAGS"
2870 LDFLAGS="$SAVE_LDFLAGS"
2872 if test "x$with_libnetapp" = "xyes"
2874 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2877 AC_SUBST(LIBNETAPP_CPPFLAGS)
2878 AC_SUBST(LIBNETAPP_LDFLAGS)
2879 AC_SUBST(LIBNETAPP_LIBS)
2880 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2883 # --with-libnetsnmp {{{
2884 with_snmp_config="net-snmp-config"
2887 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2889 if test "x$withval" = "xno"
2891 with_libnetsnmp="no"
2892 else if test "x$withval" = "xyes"
2894 with_libnetsnmp="yes"
2896 if test -x "$withval"
2898 with_snmp_config="$withval"
2899 with_libnetsnmp="yes"
2901 with_snmp_config="$withval/bin/net-snmp-config"
2902 with_libnetsnmp="yes"
2906 [with_libnetsnmp="yes"])
2907 if test "x$with_libnetsnmp" = "xyes"
2909 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2910 snmp_config_status=$?
2912 if test $snmp_config_status -ne 0
2914 with_libnetsnmp="no ($with_snmp_config failed)"
2916 SAVE_CPPFLAGS="$CPPFLAGS"
2917 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2919 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2921 CPPFLAGS="$SAVE_CPPFLAGS"
2924 if test "x$with_libnetsnmp" = "xyes"
2926 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2927 snmp_config_status=$?
2929 if test $snmp_config_status -ne 0
2931 with_libnetsnmp="no ($with_snmp_config failed)"
2933 AC_CHECK_LIB(netsnmp, init_snmp,
2934 [with_libnetsnmp="yes"],
2935 [with_libnetsnmp="no (libnetsnmp not found)"],
2939 if test "x$with_libnetsnmp" = "xyes"
2941 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2942 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2943 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2944 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2946 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2949 # --with-liboconfig {{{
2950 with_own_liboconfig="no"
2951 liboconfig_LDFLAGS="$LDFLAGS"
2952 liboconfig_CPPFLAGS="$CPPFLAGS"
2953 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2955 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2957 if test -d "$withval/lib"
2959 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2961 if test -d "$withval/include"
2963 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2966 if test "x$withval" = "xno"
2968 AC_MSG_ERROR("liboconfig is required")
2972 with_liboconfig="yes"
2975 save_LDFLAGS="$LDFLAGS"
2976 save_CPPFLAGS="$CPPFLAGS"
2977 LDFLAGS="$liboconfig_LDFLAGS"
2978 CPPFLAGS="$liboconfig_CPPFLAGS"
2979 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2981 with_liboconfig="yes"
2982 with_own_liboconfig="no"
2985 with_liboconfig="yes"
2986 with_own_liboconfig="yes"
2987 LDFLAGS="$save_LDFLAGS"
2988 CPPFLAGS="$save_CPPFLAGS"
2991 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2992 if test "x$with_own_liboconfig" = "xyes"
2994 with_liboconfig="yes (shipped version)"
2998 # --with-liboping {{{
2999 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3001 if test "x$withval" = "xyes"
3004 else if test "x$withval" = "xno"
3009 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
3010 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
3013 [with_liboping="yes"])
3015 SAVE_CPPFLAGS="$CPPFLAGS"
3016 SAVE_LDFLAGS="$LDFLAGS"
3018 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3019 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3021 if test "x$with_liboping" = "xyes"
3023 if test "x$LIBOPING_CPPFLAGS" != "x"
3025 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
3027 AC_CHECK_HEADERS(oping.h,
3028 [with_liboping="yes"],
3029 [with_liboping="no (oping.h not found)"])
3031 if test "x$with_liboping" = "xyes"
3033 if test "x$LIBOPING_LDFLAGS" != "x"
3035 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
3037 AC_CHECK_LIB(oping, ping_construct,
3038 [with_liboping="yes"],
3039 [with_liboping="no (symbol 'ping_construct' not found)"])
3042 CPPFLAGS="$SAVE_CPPFLAGS"
3043 LDFLAGS="$SAVE_LDFLAGS"
3045 if test "x$with_liboping" = "xyes"
3047 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3048 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3049 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
3050 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
3052 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
3056 with_oracle_cppflags=""
3058 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3060 if test "x$withval" = "xyes"
3062 if test "x$ORACLE_HOME" = "x"
3064 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3067 else if test "x$withval" = "xno"
3072 ORACLE_HOME="$withval"
3076 if test "x$ORACLE_HOME" = "x"
3078 with_oracle="no (ORACLE_HOME is not set)"
3083 if test "x$ORACLE_HOME" != "x"
3085 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
3087 if test -e "$ORACLE_HOME/lib/ldflags"
3089 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
3091 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
3092 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
3094 if test "x$with_oracle" = "xyes"
3096 SAVE_CPPFLAGS="$CPPFLAGS"
3097 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3099 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
3101 CPPFLAGS="$SAVE_CPPFLAGS"
3103 if test "x$with_oracle" = "xyes"
3105 SAVE_CPPFLAGS="$CPPFLAGS"
3107 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
3108 LIBS="$LIBS $with_oracle_libs"
3110 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
3112 CPPFLAGS="$SAVE_CPPFLAGS"
3115 if test "x$with_oracle" = "xyes"
3117 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
3118 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
3119 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
3120 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
3124 # --with-libowcapi {{{
3125 with_libowcapi_cppflags=""
3126 with_libowcapi_libs="-lowcapi"
3127 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
3129 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3131 with_libowcapi_cppflags="-I$withval/include"
3132 with_libowcapi_libs="-L$withval/lib -lowcapi"
3133 with_libowcapi="yes"
3135 with_libowcapi="$withval"
3139 with_libowcapi="yes"
3141 if test "x$with_libowcapi" = "xyes"
3143 SAVE_CPPFLAGS="$CPPFLAGS"
3144 CPPFLAGS="$with_libowcapi_cppflags"
3146 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3148 CPPFLAGS="$SAVE_CPPFLAGS"
3150 if test "x$with_libowcapi" = "xyes"
3152 SAVE_LDFLAGS="$LDFLAGS"
3153 SAVE_CPPFLAGS="$CPPFLAGS"
3154 LDFLAGS="$with_libowcapi_libs"
3155 CPPFLAGS="$with_libowcapi_cppflags"
3157 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3159 LDFLAGS="$SAVE_LDFLAGS"
3160 CPPFLAGS="$SAVE_CPPFLAGS"
3162 if test "x$with_libowcapi" = "xyes"
3164 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3165 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3166 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3167 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3171 # --with-libpcap {{{
3172 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3174 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3176 LDFLAGS="$LDFLAGS -L$withval/lib"
3177 CPPFLAGS="$CPPFLAGS -I$withval/include"
3180 with_libpcap="$withval"
3186 if test "x$with_libpcap" = "xyes"
3188 AC_CHECK_LIB(pcap, pcap_open_live,
3190 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3191 ], [with_libpcap="no (libpcap not found)"])
3193 if test "x$with_libpcap" = "xyes"
3195 AC_CHECK_HEADERS(pcap.h,,
3196 [with_libpcap="no (pcap.h not found)"])
3198 if test "x$with_libpcap" = "xyes"
3200 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
3201 [c_cv_libpcap_have_pcap_error_iface_not_up],
3202 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
3207 int val = PCAP_ERROR_IFACE_NOT_UP;
3211 [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
3212 [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
3214 if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
3216 with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
3218 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3221 # --with-libperl {{{
3222 perl_interpreter="perl"
3223 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3225 if test -f "$withval" && test -x "$withval"
3227 perl_interpreter="$withval"
3229 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3231 LDFLAGS="$LDFLAGS -L$withval/lib"
3232 CPPFLAGS="$CPPFLAGS -I$withval/include"
3233 perl_interpreter="$withval/bin/perl"
3236 with_libperl="$withval"
3243 AC_MSG_CHECKING([for perl])
3244 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3245 if test -x "$perl_interpreter"
3247 AC_MSG_RESULT([yes ($perl_interpreter)])
3253 AC_SUBST(PERL, "$perl_interpreter")
3255 if test "x$with_libperl" = "xyes" \
3256 && test -n "$perl_interpreter"
3258 SAVE_CFLAGS="$CFLAGS"
3260 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3261 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3262 PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3263 CFLAGS="$CFLAGS $PERL_CFLAGS"
3264 LIBS="$LIBS $PERL_LIBS"
3266 AC_CACHE_CHECK([for libperl],
3267 [c_cv_have_libperl],
3268 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3270 #define PERL_NO_GET_CONTEXT
3277 load_module (PERL_LOADMOD_NOIMPORT,
3278 newSVpv ("Collectd::Plugin::FooBar", 24),
3282 [c_cv_have_libperl="yes"],
3283 [c_cv_have_libperl="no"]
3287 if test "x$c_cv_have_libperl" = "xyes"
3289 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3290 AC_SUBST(PERL_CFLAGS)
3296 CFLAGS="$SAVE_CFLAGS"
3298 else if test -z "$perl_interpreter"; then
3299 with_libperl="no (no perl interpreter found)"
3300 c_cv_have_libperl="no"
3302 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3304 if test "x$with_libperl" = "xyes"
3306 SAVE_CFLAGS="$CFLAGS"
3308 CFLAGS="$CFLAGS $PERL_CFLAGS"
3309 LIBS="$LIBS $PERL_LIBS"
3311 AC_CACHE_CHECK([if perl supports ithreads],
3312 [c_cv_have_perl_ithreads],
3313 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3319 #if !defined(USE_ITHREADS)
3320 # error "Perl does not support ithreads!"
3321 #endif /* !defined(USE_ITHREADS) */
3325 [c_cv_have_perl_ithreads="yes"],
3326 [c_cv_have_perl_ithreads="no"]
3330 if test "x$c_cv_have_perl_ithreads" = "xyes"
3332 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3335 CFLAGS="$SAVE_CFLAGS"
3339 if test "x$with_libperl" = "xyes"
3341 SAVE_CFLAGS="$CFLAGS"
3343 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3344 # (see issues #41 and #42)
3345 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3346 LIBS="$LIBS $PERL_LIBS"
3348 AC_CACHE_CHECK([for broken Perl_load_module()],
3349 [c_cv_have_broken_perl_load_module],
3350 AC_LINK_IFELSE([AC_LANG_PROGRAM(
3352 #define PERL_NO_GET_CONTEXT
3359 load_module (PERL_LOADMOD_NOIMPORT,
3360 newSVpv ("Collectd::Plugin::FooBar", 24),
3364 [c_cv_have_broken_perl_load_module="no"],
3365 [c_cv_have_broken_perl_load_module="yes"]
3369 CFLAGS="$SAVE_CFLAGS"
3372 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3373 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3375 if test "x$with_libperl" = "xyes"
3377 SAVE_CFLAGS="$CFLAGS"
3379 CFLAGS="$CFLAGS $PERL_CFLAGS"
3380 LIBS="$LIBS $PERL_LIBS"
3383 [struct mgvtbl.svt_local],
3384 [have_struct_mgvtbl_svt_local="yes"],
3385 [have_struct_mgvtbl_svt_local="no"],
3392 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3394 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3395 [Define if Perl's struct mgvtbl has member svt_local.])
3398 CFLAGS="$SAVE_CFLAGS"
3404 with_pg_config="pg_config"
3405 with_libpq_includedir=""
3406 with_libpq_libdir=""
3407 with_libpq_cppflags=""
3408 with_libpq_ldflags=""
3409 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3412 if test "x$withval" = "xno"
3415 else if test "x$withval" = "xyes"
3419 if test -f "$withval" && test -x "$withval";
3421 with_pg_config="$withval"
3422 else if test -x "$withval/bin/pg_config"
3424 with_pg_config="$withval/bin/pg_config"
3432 if test "x$with_libpq" = "xyes"
3434 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3437 if test $pg_config_status -eq 0
3439 if test -n "$with_libpq_includedir"; then
3440 for dir in $with_libpq_includedir; do
3441 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3445 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3448 SAVE_CPPFLAGS="$CPPFLAGS"
3449 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3451 AC_CHECK_HEADERS(libpq-fe.h, [],
3452 [with_libpq="no (libpq-fe.h not found)"], [])
3454 CPPFLAGS="$SAVE_CPPFLAGS"
3456 if test "x$with_libpq" = "xyes"
3458 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3461 if test $pg_config_status -eq 0
3463 if test -n "$with_libpq_libdir"; then
3464 for dir in $with_libpq_libdir; do
3465 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3469 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3472 SAVE_LDFLAGS="$LDFLAGS"
3473 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3475 AC_CHECK_LIB(pq, PQconnectdb,
3477 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3479 AC_CHECK_LIB(pq, PQserverVersion,
3481 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3483 LDFLAGS="$SAVE_LDFLAGS"
3485 if test "x$with_libpq" = "xyes"
3487 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3488 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3489 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3490 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3492 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3495 # --with-libpthread {{{
3496 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3497 [ if test "x$withval" != "xno" \
3498 && test "x$withval" != "xyes"
3500 LDFLAGS="$LDFLAGS -L$withval/lib"
3501 CPPFLAGS="$CPPFLAGS -I$withval/include"
3502 with_libpthread="yes"
3504 if test "x$withval" = "xno"
3506 with_libpthread="no (disabled)"
3509 ], [with_libpthread="yes"])
3510 if test "x$with_libpthread" = "xyes"
3512 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3515 if test "x$with_libpthread" = "xyes"
3517 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3519 if test "x$with_libpthread" = "xyes"
3525 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3526 [Wether or not to use pthread (POSIX threads) library])
3527 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3532 with_python_path="$PATH"
3533 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3535 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3537 with_python="$withval"
3538 else if test -x "$withval"
3540 with_python_prog="$withval"
3541 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3543 else if test -d "$withval"
3545 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3548 AC_MSG_WARN([Argument not recognized: $withval])
3550 ], [with_python="yes"])
3553 SAVE_CPPFLAGS="$CPPFLAGS"
3554 SAVE_LDFLAGS="$LDFLAGS"
3557 PATH="$with_python_path"
3559 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3561 AC_MSG_CHECKING([for python])
3562 with_python_prog="`which python 2>/dev/null`"
3563 if test "x$with_python_prog" = "x"
3565 AC_MSG_RESULT([not found])
3566 with_python="no (interpreter not found)"
3568 AC_MSG_RESULT([$with_python_prog])
3572 if test "x$with_python" = "xyes"
3574 AC_MSG_CHECKING([for Python CPPFLAGS])
3575 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3576 python_config_status=$?
3578 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3580 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3583 AC_MSG_RESULT([$python_include_path])
3587 if test "x$with_python" = "xyes"
3589 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3590 AC_CHECK_HEADERS(Python.h,
3591 [with_python="yes"],
3592 [with_python="no ('Python.h' not found)"])
3595 if test "x$with_python" = "xyes"
3597 AC_MSG_CHECKING([for Python LDFLAGS])
3598 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`
3599 python_config_status=$?
3601 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3603 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3606 AC_MSG_RESULT([$python_library_path])
3610 if test "x$with_python" = "xyes"
3612 AC_MSG_CHECKING([for Python LIBS])
3613 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`
3614 python_config_status=$?
3616 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3618 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3621 AC_MSG_RESULT([$python_library_flags])
3625 if test "x$with_python" = "xyes"
3627 LDFLAGS="-L$python_library_path $LDFLAGS"
3628 LIBS="$python_library_flags $LIBS"
3630 AC_CHECK_FUNC(PyObject_CallFunction,
3631 [with_python="yes"],
3632 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3636 CPPFLAGS="$SAVE_CPPFLAGS"
3637 LDFLAGS="$SAVE_LDFLAGS"
3640 if test "x$with_python" = "xyes"
3642 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3643 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3644 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3645 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3646 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3647 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3651 # --with-librabbitmq {{{
3652 with_librabbitmq_cppflags=""
3653 with_librabbitmq_ldflags=""
3654 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3656 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3658 with_librabbitmq_cppflags="-I$withval/include"
3659 with_librabbitmq_ldflags="-L$withval/lib"
3660 with_librabbitmq="yes"
3662 with_librabbitmq="$withval"
3666 with_librabbitmq="yes"
3668 SAVE_CPPFLAGS="$CPPFLAGS"
3669 SAVE_LDFLAGS="$LDFLAGS"
3670 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3671 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3672 if test "x$with_librabbitmq" = "xyes"
3674 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3676 if test "x$with_librabbitmq" = "xyes"
3678 # librabbitmq up to version 0.9.1 provides "library_errno", later
3679 # versions use "library_error". The library does not provide a version
3680 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3681 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3684 # include <stdlib.h>
3690 # include <stdint.h>
3693 # include <inttypes.h>
3698 if test "x$with_librabbitmq" = "xyes"
3700 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3702 if test "x$with_librabbitmq" = "xyes"
3704 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3705 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3706 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3707 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3708 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3709 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3710 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3712 CPPFLAGS="$SAVE_CPPFLAGS"
3713 LDFLAGS="$SAVE_LDFLAGS"
3714 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3716 with_amqp_tcp_socket="no"
3717 if test "x$with_librabbitmq" = "xyes"
3719 SAVE_CPPFLAGS="$CPPFLAGS"
3720 SAVE_LDFLAGS="$LDFLAGS"
3722 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3723 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3726 AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
3727 AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
3728 if test "x$with_amqp_tcp_socket" = "xyes"
3730 AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
3731 [Define if librabbitmq provides the new TCP socket interface.])
3734 AC_CHECK_DECLS(amqp_socket_close,
3735 [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
3738 #ifdef HAVE_AMQP_TCP_SOCKET_H
3739 # include <amqp_tcp_socket.h>
3741 #ifdef HAVE_AMQP_SOCKET_H
3742 # include <amqp_socket.h>
3746 CPPFLAGS="$SAVE_CPPFLAGS"
3747 LDFLAGS="$SAVE_LDFLAGS"
3752 # --with-librouteros {{{
3753 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3755 if test "x$withval" = "xyes"
3757 with_librouteros="yes"
3758 else if test "x$withval" = "xno"
3760 with_librouteros="no"
3762 with_librouteros="yes"
3763 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3764 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3767 [with_librouteros="yes"])
3769 SAVE_CPPFLAGS="$CPPFLAGS"
3770 SAVE_LDFLAGS="$LDFLAGS"
3772 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3773 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3775 if test "x$with_librouteros" = "xyes"
3777 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3779 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3781 AC_CHECK_HEADERS(routeros_api.h,
3782 [with_librouteros="yes"],
3783 [with_librouteros="no (routeros_api.h not found)"])
3785 if test "x$with_librouteros" = "xyes"
3787 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3789 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3791 AC_CHECK_LIB(routeros, ros_interface,
3792 [with_librouteros="yes"],
3793 [with_librouteros="no (symbol 'ros_interface' not found)"])
3796 CPPFLAGS="$SAVE_CPPFLAGS"
3797 LDFLAGS="$SAVE_LDFLAGS"
3799 if test "x$with_librouteros" = "xyes"
3801 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3802 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3803 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3804 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3806 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3812 librrd_threadsafe="no"
3813 librrd_rrdc_update="no"
3815 [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3817 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3819 librrd_cflags="-I$withval/include"
3820 librrd_ldflags="-L$withval/lib"
3823 with_librrd="$withval"
3829 if test "x$with_librrd" = "xyes"
3831 SAVE_LDFLAGS="$LDFLAGS"
3832 LDFLAGS="$LDFLAGS $librrd_ldflags"
3833 PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
3835 AC_CHECK_LIB([rrd], [rrd_update_r],
3836 [librrd_threadsafe="yes"],
3839 AC_CHECK_LIB([rrd], [rrdc_update],
3840 [librrd_rrdc_update="yes"],
3845 LDFLAGS="$SAVE_LDFLAGS"
3847 SAVE_CPPFLAGS="$CPPFLAGS"
3848 CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
3850 AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
3852 CPPFLAGS="$SAVE_CPPFLAGS"
3855 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
3857 SAVE_LDFLAGS="$LDFLAGS"
3858 LDFLAGS="$LDFLAGS $librrd_ldflags"
3860 AC_CHECK_LIB([rrd_th], [rrd_update_r],
3862 librrd_ldflags="$librrd_ldflags -lrrd_th"
3863 librrd_threadsafe="yes"
3864 AC_CHECK_LIB([rrd_th], [rrdc_update],
3865 [librrd_rrdc_update="yes"],
3871 LDFLAGS="$SAVE_LDFLAGS"
3874 if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
3876 SAVE_LDFLAGS="$LDFLAGS"
3877 LDFLAGS="$LDFLAGS $librrd_ldflags"
3879 AC_CHECK_LIB([rrd], [rrd_update],
3881 librrd_ldflags="$librrd_ldflags -lrrd"
3882 AC_CHECK_LIB([rrd], [rrdc_update],
3883 [librrd_rrdc_update="yes"],
3887 [with_librrd="no (symbol 'rrd_update' not found)"]
3889 LDFLAGS="$SAVE_LDFLAGS"
3892 if test "x$with_librrd" = "xyes"
3894 BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
3895 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3896 BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
3897 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3898 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3899 AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
3901 if test "x$librrd_threadsafe" = "xyes"
3903 AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
3904 [Define to 1 if the rrd library is thread-safe]
3909 # --with-libsensors {{{
3910 with_sensors_cflags=""
3911 with_sensors_ldflags=""
3912 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3914 if test "x$withval" = "xno"
3916 with_libsensors="no"
3918 with_libsensors="yes"
3919 if test "x$withval" != "xyes"
3921 with_sensors_cflags="-I$withval/include"
3922 with_sensors_ldflags="-L$withval/lib"
3923 with_libsensors="yes"
3928 if test "x$ac_system" = "xLinux"
3930 with_libsensors="yes"
3932 with_libsensors="no (Linux only library)"
3935 if test "x$with_libsensors" = "xyes"
3937 SAVE_CPPFLAGS="$CPPFLAGS"
3938 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3940 # AC_CHECK_HEADERS(sensors/sensors.h,
3942 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3944 # [with_libsensors="no (sensors/sensors.h not found)"])
3945 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3947 CPPFLAGS="$SAVE_CPPFLAGS"
3949 if test "x$with_libsensors" = "xyes"
3951 SAVE_CPPFLAGS="$CPPFLAGS"
3952 SAVE_LDFLAGS="$LDFLAGS"
3953 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3954 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3956 AC_CHECK_LIB(sensors, sensors_init,
3958 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3960 [with_libsensors="no (libsensors not found)"])
3962 CPPFLAGS="$SAVE_CPPFLAGS"
3963 LDFLAGS="$SAVE_LDFLAGS"
3965 if test "x$with_libsensors" = "xyes"
3967 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3968 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3969 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3970 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3972 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3975 # --with-libsigrok {{{
3976 with_libsigrok_cflags=""
3977 with_libsigrok_ldflags=""
3978 AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
3980 if test "x$withval" = "xno"
3984 with_libsigrok="yes"
3985 if test "x$withval" != "xyes"
3987 with_libsigrok_cflags="-I$withval/include"
3988 with_libsigrok_ldflags="-L$withval/lib"
3991 ],[with_libsigrok="yes"])
3993 # libsigrok has a glib dependency
3994 if test "x$with_libsigrok" = "xyes"
3996 m4_ifdef([AM_PATH_GLIB_2_0],
3998 AM_PATH_GLIB_2_0([2.28.0],
3999 [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
4002 with_libsigrok="no (glib not available)"
4008 if test "x$with_libsigrok" = "xyes"
4010 SAVE_CPPFLAGS="$CPPFLAGS"
4011 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
4013 AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
4015 CPPFLAGS="$SAVE_CPPFLAGS"
4019 if test "x$with_libsigrok" = "xyes"
4021 SAVE_CPPFLAGS="$CPPFLAGS"
4022 SAVE_LDFLAGS="$LDFLAGS"
4023 CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
4024 LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
4026 AC_CHECK_LIB(sigrok, sr_init,
4028 AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
4030 [with_libsigrok="no (libsigrok not found)"])
4032 CPPFLAGS="$SAVE_CPPFLAGS"
4033 LDFLAGS="$SAVE_LDFLAGS"
4035 if test "x$with_libsigrok" = "xyes"
4037 BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
4038 BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
4039 AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
4040 AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
4042 AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
4045 # --with-libstatgrab {{{
4046 with_libstatgrab_cflags=""
4047 with_libstatgrab_ldflags=""
4048 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
4050 if test "x$withval" != "xno" \
4051 && test "x$withval" != "xyes"
4053 with_libstatgrab_cflags="-I$withval/include"
4054 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
4055 with_libstatgrab="yes"
4056 with_libstatgrab_pkg_config="no"
4058 with_libstatgrab="$withval"
4059 with_libstatgrab_pkg_config="yes"
4063 with_libstatgrab="yes"
4064 with_libstatgrab_pkg_config="yes"
4067 if test "x$with_libstatgrab" = "xyes" \
4068 && test "x$with_libstatgrab_pkg_config" = "xyes"
4070 if test "x$PKG_CONFIG" != "x"
4072 AC_MSG_CHECKING([pkg-config for libstatgrab])
4074 $PKG_CONFIG --exists libstatgrab 2>/dev/null
4077 with_libstatgrab_pkg_config="no"
4078 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
4079 temp_result="not found"
4081 AC_MSG_RESULT([$temp_result])
4083 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
4084 with_libstatgrab_pkg_config="no"
4085 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
4089 if test "x$with_libstatgrab" = "xyes" \
4090 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4091 && test "x$with_libstatgrab_cflags" = "x"
4093 AC_MSG_CHECKING([for libstatgrab CFLAGS])
4094 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
4097 with_libstatgrab_cflags="$temp_result"
4099 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
4100 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
4102 AC_MSG_RESULT([$temp_result])
4105 if test "x$with_libstatgrab" = "xyes" \
4106 && test "x$with_libstatgrab_pkg_config" = "xyes" \
4107 && test "x$with_libstatgrab_ldflags" = "x"
4109 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
4110 temp_result="`$PKG_CONFIG --libs libstatgrab`"
4113 with_libstatgrab_ldflags="$temp_result"
4115 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
4116 temp_result="$PKG_CONFIG --libs libstatgrab failed"
4118 AC_MSG_RESULT([$temp_result])
4121 if test "x$with_libstatgrab" = "xyes"
4123 SAVE_CPPFLAGS="$CPPFLAGS"
4124 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
4126 AC_CHECK_HEADERS(statgrab.h,
4127 [with_libstatgrab="yes"],
4128 [with_libstatgrab="no (statgrab.h not found)"])
4130 CPPFLAGS="$SAVE_CPPFLAGS"
4133 if test "x$with_libstatgrab" = "xyes"
4135 SAVE_CFLAGS="$CFLAGS"
4136 SAVE_LDFLAGS="$LDFLAGS"
4138 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
4139 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
4141 AC_CHECK_LIB(statgrab, sg_init,
4142 [with_libstatgrab="yes"],
4143 [with_libstatgrab="no (symbol sg_init not found)"])
4145 CFLAGS="$SAVE_CFLAGS"
4146 LDFLAGS="$SAVE_LDFLAGS"
4149 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
4150 if test "x$with_libstatgrab" = "xyes"
4152 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
4153 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
4154 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
4155 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
4156 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
4160 # --with-libtokyotyrant {{{
4161 with_libtokyotyrant_cppflags=""
4162 with_libtokyotyrant_ldflags=""
4163 with_libtokyotyrant_libs=""
4164 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
4166 if test "x$withval" = "xno"
4168 with_libtokyotyrant="no"
4169 else if test "x$withval" = "xyes"
4171 with_libtokyotyrant="yes"
4173 with_libtokyotyrant_cppflags="-I$withval/include"
4174 with_libtokyotyrant_ldflags="-L$withval/include"
4175 with_libtokyotyrant_libs="-ltokyotyrant"
4176 with_libtokyotyrant="yes"
4180 with_libtokyotyrant="yes"
4183 if test "x$with_libtokyotyrant" = "xyes"
4185 if $PKG_CONFIG --exists tokyotyrant
4187 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
4188 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
4189 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
4193 SAVE_CPPFLAGS="$CPPFLAGS"
4194 SAVE_LDFLAGS="$LDFLAGS"
4195 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
4196 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
4198 if test "x$with_libtokyotyrant" = "xyes"
4200 AC_CHECK_HEADERS(tcrdb.h,
4202 AC_DEFINE(HAVE_TCRDB_H, 1,
4203 [Define to 1 if you have the <tcrdb.h> header file.])
4204 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
4207 if test "x$with_libtokyotyrant" = "xyes"
4209 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
4211 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
4212 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
4214 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
4215 [$with_libtokyotyrant_libs])
4218 CPPFLAGS="$SAVE_CPPFLAGS"
4219 LDFLAGS="$SAVE_LDFLAGS"
4221 if test "x$with_libtokyotyrant" = "xyes"
4223 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
4224 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
4225 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
4226 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
4227 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
4228 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
4230 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
4233 # --with-libupsclient {{{
4234 with_libupsclient_config=""
4235 with_libupsclient_cflags=""
4236 with_libupsclient_libs=""
4237 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
4239 if test "x$withval" = "xno"
4241 with_libupsclient="no"
4242 else if test "x$withval" = "xyes"
4244 with_libupsclient="use_pkgconfig"
4246 if test -x "$withval"
4248 with_libupsclient_config="$withval"
4249 with_libupsclient="use_libupsclient_config"
4250 else if test -x "$withval/bin/libupsclient-config"
4252 with_libupsclient_config="$withval/bin/libupsclient-config"
4253 with_libupsclient="use_libupsclient_config"
4255 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
4256 with_libupsclient_cflags="-I$withval/include"
4257 with_libupsclient_libs="-L$withval/lib -lupsclient"
4258 with_libupsclient="yes"
4262 [with_libupsclient="use_pkgconfig"])
4264 # configure using libupsclient-config
4265 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4267 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
4268 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
4271 with_libupsclient="no ($with_libupsclient_config failed)"
4273 with_libupsclient_libs="`$with_libupsclient_config --libs`"
4276 with_libupsclient="no ($with_libupsclient_config failed)"
4279 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4281 with_libupsclient="yes"
4284 # configure using pkg-config
4285 if test "x$with_libupsclient" = "xuse_pkgconfig"
4287 if test "x$PKG_CONFIG" = "x"
4289 with_libupsclient="no (Don't have pkg-config)"
4292 if test "x$with_libupsclient" = "xuse_pkgconfig"
4294 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4295 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4298 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4301 if test "x$with_libupsclient" = "xuse_pkgconfig"
4303 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4306 with_libupsclient="no ($PKG_CONFIG failed)"
4308 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4311 with_libupsclient="no ($PKG_CONFIG failed)"
4314 if test "x$with_libupsclient" = "xuse_pkgconfig"
4316 with_libupsclient="yes"
4319 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4320 # the actual checks.
4321 if test "x$with_libupsclient" = "xyes"
4323 SAVE_CPPFLAGS="$CPPFLAGS"
4324 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4326 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4328 CPPFLAGS="$SAVE_CPPFLAGS"
4330 if test "x$with_libupsclient" = "xyes"
4332 SAVE_CPPFLAGS="$CPPFLAGS"
4333 SAVE_LDFLAGS="$LDFLAGS"
4335 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4336 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4338 AC_CHECK_LIB(upsclient, upscli_connect,
4339 [with_libupsclient="yes"],
4340 [with_libupsclient="no (symbol upscli_connect not found)"])
4342 CPPFLAGS="$SAVE_CPPFLAGS"
4343 LDFLAGS="$SAVE_LDFLAGS"
4345 if test "x$with_libupsclient" = "xyes"
4347 SAVE_CPPFLAGS="$CPPFLAGS"
4348 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4350 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4351 [#include <stdlib.h>
4353 #include <upsclient.h>])
4355 CPPFLAGS="$SAVE_CPPFLAGS"
4357 if test "x$with_libupsclient" = "xyes"
4359 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4360 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4361 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4362 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4366 # --with-libxmms {{{
4367 with_xmms_config="xmms-config"
4370 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4372 if test "x$withval" != "xno" \
4373 && test "x$withval" != "xyes"
4375 if test -f "$withval" && test -x "$withval";
4377 with_xmms_config="$withval"
4378 else if test -x "$withval/bin/xmms-config"
4380 with_xmms_config="$withval/bin/xmms-config"
4383 else if test "x$withval" = "xno"
4393 if test "x$with_libxmms" = "xyes"
4395 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4396 xmms_config_status=$?
4398 if test $xmms_config_status -ne 0
4403 if test "x$with_libxmms" = "xyes"
4405 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4406 xmms_config_status=$?
4408 if test $xmms_config_status -ne 0
4413 if test "x$with_libxmms" = "xyes"
4415 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4417 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4418 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4419 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4420 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4427 with_libxmms_numeric=0
4428 if test "x$with_libxmms" = "xyes"
4430 with_libxmms_numeric=1
4432 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4433 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4436 # --with-libyajl {{{
4437 with_libyajl_cppflags=""
4438 with_libyajl_ldflags=""
4439 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4441 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4443 with_libyajl_cppflags="-I$withval/include"
4444 with_libyajl_ldflags="-L$withval/lib"
4447 with_libyajl="$withval"
4453 if test "x$with_libyajl" = "xyes"
4455 SAVE_CPPFLAGS="$CPPFLAGS"
4456 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4458 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4459 AC_CHECK_HEADERS(yajl/yajl_version.h)
4461 CPPFLAGS="$SAVE_CPPFLAGS"
4463 if test "x$with_libyajl" = "xyes"
4465 SAVE_CPPFLAGS="$CPPFLAGS"
4466 SAVE_LDFLAGS="$LDFLAGS"
4467 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4468 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4470 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4472 CPPFLAGS="$SAVE_CPPFLAGS"
4473 LDFLAGS="$SAVE_LDFLAGS"
4475 if test "x$with_libyajl" = "xyes"
4477 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4478 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4479 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4480 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4481 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4482 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4483 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4485 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4489 with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include"
4490 with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux"
4492 AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])],
4494 if test "x$withval" = "xno"
4497 else if test "x$withval" = "xyes"
4500 else if test -d "$with_mic/lib"
4502 AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
4503 with_mic_cflags="-I$withval/include"
4504 with_mic_ldpath="-L$withval/lib/Linux"
4505 with_mic_libs="-lMicAccessSDK -lscif -lpthread"
4510 if test "x$with_mic" = "xyes"
4512 SAVE_CPPFLAGS="$CPPFLAGS"
4513 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4514 AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"])
4515 CPPFLAGS="$SAVE_CPPFLAGS"
4517 if test "x$with_mic" = "xyes"
4519 SAVE_CPPFLAGS="$CPPFLAGS"
4520 SAVE_LDFLAGS="$LDFLAGS"
4522 CPPFLAGS="$CPPFLAGS $with_mic_cflags"
4523 LDFLAGS="$LDFLAGS $with_mic_ldpath"
4525 AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
4526 [with_mic_ldpath="$with_mic_ldpath"
4527 with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
4528 [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
4530 CPPFLAGS="$SAVE_CPPFLAGS"
4531 LDFLAGS="$SAVE_LDFLAGS"
4534 if test "x$with_mic" = "xyes"
4536 BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags"
4537 BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath"
4538 BUILD_WITH_MIC_LDADD="$with_mic_libs"
4539 AC_SUBST(BUILD_WITH_MIC_CPPFLAGS)
4540 AC_SUBST(BUILD_WITH_MIC_LIBPATH)
4541 AC_SUBST(BUILD_WITH_MIC_LDADD)
4545 # --with-libvarnish {{{
4546 with_libvarnish_cppflags=""
4547 with_libvarnish_cflags=""
4548 with_libvarnish_libs=""
4549 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4551 if test "x$withval" = "xno"
4553 with_libvarnish="no"
4554 else if test "x$withval" = "xyes"
4556 with_libvarnish="use_pkgconfig"
4557 else if test -d "$with_libvarnish/lib"
4559 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4560 with_libvarnish_cflags="-I$withval/include"
4561 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4562 with_libvarnish="yes"
4565 [with_libvarnish="use_pkgconfig"])
4567 # configure using pkg-config
4568 if test "x$with_libvarnish" = "xuse_pkgconfig"
4570 if test "x$PKG_CONFIG" = "x"
4572 with_libvarnish="no (Don't have pkg-config)"
4575 if test "x$with_libvarnish" = "xuse_pkgconfig"
4577 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4578 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4581 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4584 if test "x$with_libvarnish" = "xuse_pkgconfig"
4586 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4589 with_libvarnish="no ($PKG_CONFIG failed)"
4591 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4594 with_libvarnish="no ($PKG_CONFIG failed)"
4597 if test "x$with_libvarnish" = "xuse_pkgconfig"
4599 with_libvarnish="yes"
4602 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4603 # the actual checks.
4604 if test "x$with_libvarnish" = "xyes"
4606 SAVE_CPPFLAGS="$CPPFLAGS"
4607 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4608 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4610 CPPFLAGS="$SAVE_CPPFLAGS"
4612 if test "x$with_libvarnish" = "xyes"
4614 SAVE_CPPFLAGS="$CPPFLAGS"
4615 #SAVE_LDFLAGS="$LDFLAGS"
4617 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4618 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4620 AC_CHECK_HEADERS(varnish/vsc.h,
4621 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4622 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4624 CPPFLAGS="$SAVE_CPPFLAGS"
4625 #LDFLAGS="$SAVE_LDFLAGS"
4627 if test "x$with_libvarnish" = "xyes"
4629 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4630 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4631 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4632 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4636 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4637 with_libxml2="no (pkg-config isn't available)"
4638 with_libxml2_cflags=""
4639 with_libxml2_ldflags=""
4640 with_libvirt="no (pkg-config isn't available)"
4641 with_libvirt_cflags=""
4642 with_libvirt_ldflags=""
4643 if test "x$PKG_CONFIG" != "x"
4645 $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
4650 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4653 $PKG_CONFIG --exists libvirt 2>/dev/null
4658 with_libvirt="no (pkg-config doesn't know libvirt)"
4661 if test "x$with_libxml2" = "xyes"
4663 with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
4668 with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
4674 if test "x$with_libxml2" = "xyes"
4676 SAVE_CPPFLAGS="$CPPFLAGS"
4677 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4679 AC_CHECK_HEADERS(libxml/parser.h, [],
4680 [with_libxml2="no (libxml/parser.h not found)"])
4682 CPPFLAGS="$SAVE_CPPFLAGS"
4684 if test "x$with_libxml2" = "xyes"
4686 SAVE_CFLAGS="$CFLAGS"
4687 SAVE_LDFLAGS="$LDFLAGS"
4689 CFLAGS="$CFLAGS $with_libxml2_cflags"
4690 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4692 AC_CHECK_LIB(xml2, xmlXPathEval,
4693 [with_libxml2="yes"],
4694 [with_libxml2="no (symbol xmlXPathEval not found)"])
4696 CFLAGS="$SAVE_CFLAGS"
4697 LDFLAGS="$SAVE_LDFLAGS"
4699 dnl Add the right compiler flags and libraries.
4700 if test "x$with_libxml2" = "xyes"; then
4701 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4702 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4703 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4704 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4706 if test "x$with_libvirt" = "xyes"
4708 with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
4713 with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
4719 if test "x$with_libvirt" = "xyes"
4721 SAVE_CPPFLAGS="$CPPFLAGS"
4722 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4724 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4725 [with_libvirt="no (libvirt/libvirt.h not found)"])
4727 CPPFLAGS="$SAVE_CPPFLAGS"
4729 if test "x$with_libvirt" = "xyes"
4731 SAVE_CFLAGS="$CFLAGS"
4732 SAVE_LDFLAGS="$LDFLAGS"
4734 CFLAGS="$CFLAGS $with_libvirt_cflags"
4735 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4737 AC_CHECK_LIB(virt, virDomainBlockStats,
4738 [with_libvirt="yes"],
4739 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4741 CFLAGS="$SAVE_CFLAGS"
4742 LDFLAGS="$SAVE_LDFLAGS"
4744 dnl Add the right compiler flags and libraries.
4745 if test "x$with_libvirt" = "xyes"; then
4746 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4747 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4748 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4749 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4753 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4754 with_libopenipmipthread="yes"
4755 with_libopenipmipthread_cflags=""
4756 with_libopenipmipthread_libs=""
4758 AC_MSG_CHECKING([for pkg-config])
4760 if test "x$PKG_CONFIG" = "x"
4762 with_libopenipmipthread="no"
4765 temp_result="$PKG_CONFIG"
4767 AC_MSG_RESULT([$temp_result])
4769 if test "x$with_libopenipmipthread" = "xyes"
4771 AC_MSG_CHECKING([for libOpenIPMIpthread])
4772 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4775 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4777 AC_MSG_RESULT([$with_libopenipmipthread])
4780 if test "x$with_libopenipmipthread" = "xyes"
4782 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4783 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4786 with_libopenipmipthread_cflags="$temp_result"
4788 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4789 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4791 AC_MSG_RESULT([$temp_result])
4794 if test "x$with_libopenipmipthread" = "xyes"
4796 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4797 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4800 with_libopenipmipthread_ldflags="$temp_result"
4802 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4803 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4805 AC_MSG_RESULT([$temp_result])
4808 if test "x$with_libopenipmipthread" = "xyes"
4810 SAVE_CPPFLAGS="$CPPFLAGS"
4811 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4813 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4814 [with_libopenipmipthread="yes"],
4815 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4816 [#include <OpenIPMI/ipmiif.h>
4817 #include <OpenIPMI/ipmi_err.h>
4818 #include <OpenIPMI/ipmi_posix.h>
4819 #include <OpenIPMI/ipmi_conn.h>
4822 CPPFLAGS="$SAVE_CPPFLAGS"
4825 if test "x$with_libopenipmipthread" = "xyes"
4827 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4828 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4829 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4830 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4834 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4835 [with_libnotify="yes"],
4836 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4839 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4842 # Check for enabled/disabled features
4845 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4846 # ------------------------------------------------------------
4848 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4853 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4858 m4_define([EnDis],[disabled])dnl
4859 m4_define([YesNo],[no])dnl
4865 m4_define([EnDis],[enabled])dnl
4866 m4_define([YesNo],[yes])dnl
4869 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4873 m4_if([$3], [feature], [],
4877 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4883 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4885 enable_$1='[YesNo]'dnl
4887 if test "x$enable_$1" = "xno"
4891 if test "x$enable_$1" = "xyes"
4895 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4900 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4901 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4903 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4905 # AC_PLUGIN(name, default, info)
4906 # ------------------------------------------------------------
4913 AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1],[$3]),
4915 if test "x$enableval" = "xyes"
4918 else if test "x$enableval" = "xforce"
4923 enable_plugin="no (disabled on command line)"
4927 if test "x$enable_all_plugins" = "xauto"
4929 if test "x$2" = "xyes"
4936 enable_plugin="$enable_all_plugins"
4939 if test "x$enable_plugin" = "xyes"
4941 if test "x$2" = "xyes" || test "x$force" = "xyes"
4943 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4944 if test "x$2" != "xyes"
4946 dependency_warning="yes"
4948 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4949 dependency_error="yes"
4950 enable_plugin="no (dependency error)"
4953 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4954 enable_$1="$enable_plugin"
4956 )# AC_PLUGIN(name, default, info)
4958 m4_divert_once([HELP_ENABLE], [
4959 collectd features:])
4960 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4961 AC_COLLECTD([debug], [enable], [feature], [debugging])
4962 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4963 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4965 dependency_warning="no"
4966 dependency_error="no"
4972 plugin_conntrack="no"
4973 plugin_contextswitch="no"
4976 plugin_curl_json="no"
4977 plugin_curl_xml="no"
4983 plugin_interface="no"
4990 plugin_multimeter="no"
4994 plugin_processes="no"
4995 plugin_protocols="no"
4999 plugin_tcpconns="no"
5006 plugin_wireless="no"
5010 if test "x$ac_system" = "xLinux"
5012 plugin_battery="yes"
5013 plugin_conntrack="yes"
5014 plugin_contextswitch="yes"
5015 plugin_cgroups="yes"
5017 plugin_cpufreq="yes"
5019 plugin_entropy="yes"
5020 plugin_fscache="yes"
5021 plugin_interface="yes"
5028 plugin_processes="yes"
5029 plugin_protocols="yes"
5032 plugin_tcpconns="yes"
5033 plugin_thermal="yes"
5036 plugin_vserver="yes"
5037 plugin_wireless="yes"
5039 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
5045 if test "x$ac_system" = "xOpenBSD"
5047 plugin_tcpconns="yes"
5051 if test "x$with_libiokit" = "xyes"
5053 plugin_battery="yes"
5059 if test "x$ac_system" = "xAIX"
5061 plugin_tcpconns="yes"
5066 if test "x$ac_system" = "xFreeBSD"
5068 plugin_zfs_arc="yes"
5072 if test "x$with_perfstat" = "xyes"
5075 plugin_contextswitch="yes"
5079 plugin_interface="yes"
5084 if test "x$with_procinfo" = "xyes"
5086 plugin_processes="yes"
5090 if test "x$with_kstat" = "xyes"
5093 plugin_processes="yes"
5095 plugin_zfs_arc="yes"
5098 if test "x$with_devinfo$with_kstat" = "xyesyes"
5102 plugin_interface="yes"
5108 if test "x$with_libstatgrab" = "xyes"
5112 plugin_interface="yes"
5119 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5122 if test "x$have_strptime" = "xyes"
5128 if test "x$with_libopenipmipthread" = "xyes"
5133 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
5135 plugin_curl_json="yes"
5138 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
5140 plugin_curl_xml="yes"
5143 if test "x$have_processor_info" = "xyes"
5147 if test "x$have_sysctl" = "xyes"
5152 if test "x$ac_system" = "xDarwin"
5157 if test "x$have_sysctlbyname" = "xyes"
5159 plugin_contextswitch="yes"
5162 plugin_tcpconns="yes"
5165 # Df plugin: Check if we know how to determine mount points first.
5166 #if test "x$have_listmntent" = "xyes"; then
5169 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
5173 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
5177 #if test "x$have_getmntent" = "xseq"
5181 if test "x$c_cv_have_one_getmntent" = "xyes"
5186 if test "x$c_cv_have_getmntent_r" = "xyes"
5191 # Df plugin: Check if we have either `statfs' or `statvfs' second.
5192 if test "x$plugin_df" = "xyes"
5195 if test "x$have_statfs" = "xyes"
5199 if test "x$have_statvfs" = "xyes"
5205 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
5207 plugin_ethstat="yes"
5210 if test "x$have_getifaddrs" = "xyes"
5212 plugin_interface="yes"
5215 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
5217 plugin_libvirt="yes"
5220 if test "x$have_getloadavg" = "xyes"
5225 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
5230 # Mac OS X memory interface
5231 if test "x$have_host_statistics" = "xyes"
5236 if test "x$have_termios_h" = "xyes"
5238 plugin_multimeter="yes"
5242 if test "x$have_thread_info" = "xyes"
5244 plugin_processes="yes"
5247 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
5249 plugin_processes="yes"
5252 if test "x$with_kvm_getswapinfo" = "xyes"
5257 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
5262 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
5264 plugin_tcpconns="yes"
5267 if test "x$have_getutent" = "xyes"
5271 if test "x$have_getutxent" = "xyes"
5276 m4_divert_once([HELP_ENABLE], [
5279 AC_ARG_ENABLE([all-plugins],
5280 AS_HELP_STRING([--enable-all-plugins],[enable all plugins (auto by def)]),
5282 if test "x$enableval" = "xyes"
5284 enable_all_plugins="yes"
5285 else if test "x$enableval" = "xauto"
5287 enable_all_plugins="auto"
5289 enable_all_plugins="no"
5292 [enable_all_plugins="auto"])
5294 m4_divert_once([HELP_ENABLE], [])
5296 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
5297 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
5298 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
5299 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
5300 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
5301 AC_PLUGIN([aquaero], [$with_libaquaero5], [Aquaero's hardware sensors])
5302 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
5303 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
5304 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
5305 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
5306 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
5307 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
5308 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
5309 AC_PLUGIN([csv], [yes], [CSV output plugin])
5310 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
5311 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
5312 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
5313 AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
5314 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
5315 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
5316 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
5317 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
5318 AC_PLUGIN([email], [yes], [EMail statistics])
5319 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
5320 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
5321 AC_PLUGIN([exec], [yes], [Execution of external programs])
5322 AC_PLUGIN([filecount], [yes], [Count files in directories])
5323 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
5324 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
5325 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
5326 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
5327 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
5328 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
5329 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
5330 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
5331 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
5332 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
5333 AC_PLUGIN([load], [$plugin_load], [System load])
5334 AC_PLUGIN([logfile], [yes], [File logging plugin])
5335 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
5336 AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
5337 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
5338 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
5339 AC_PLUGIN([match_hashed], [yes], [The hashed match])
5340 AC_PLUGIN([match_regex], [yes], [The regex match])
5341 AC_PLUGIN([match_timediff], [yes], [The timediff match])
5342 AC_PLUGIN([match_value], [yes], [The value match])
5343 AC_PLUGIN([mbmon], [yes], [Query mbmond])
5344 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
5345 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
5346 AC_PLUGIN([memcached], [yes], [memcached statistics])
5347 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
5348 AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
5349 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
5350 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
5351 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
5352 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
5353 AC_PLUGIN([netlink], [$with_libmnl], [Enhanced Linux network statistics])
5354 AC_PLUGIN([network], [yes], [Network communication plugin])
5355 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5356 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5357 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5358 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5359 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5360 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5361 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5362 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5363 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5364 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5365 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5366 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5367 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5368 # FIXME: Check for libevent, too.
5369 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5370 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5371 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5372 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5373 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5374 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5375 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5376 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5377 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5378 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5379 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5380 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5381 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5382 AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
5383 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5384 AC_PLUGIN([statsd], [yes], [StatsD plugin])
5385 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5386 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5387 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5388 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5389 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5390 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5391 AC_PLUGIN([target_notification], [yes], [The notification target])
5392 AC_PLUGIN([target_replace], [yes], [The replace target])
5393 AC_PLUGIN([target_scale],[yes], [The scale target])
5394 AC_PLUGIN([target_set], [yes], [The set target])
5395 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5396 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5397 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5398 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5399 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5400 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5401 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5402 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5403 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5404 AC_PLUGIN([users], [$plugin_users], [User statistics])
5405 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5406 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5407 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5408 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5409 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5410 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5411 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5412 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5413 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5414 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5415 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5416 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5418 dnl Default configuration file
5419 # Load either syslog or logfile
5420 LOAD_PLUGIN_SYSLOG=""
5421 LOAD_PLUGIN_LOGFILE=""
5423 AC_MSG_CHECKING([which default log plugin to load])
5424 default_log_plugin="none"
5425 if test "x$enable_syslog" = "xyes"
5427 default_log_plugin="syslog"
5429 LOAD_PLUGIN_SYSLOG="##"
5432 if test "x$enable_logfile" = "xyes"
5434 if test "x$default_log_plugin" = "xnone"
5436 default_log_plugin="logfile"
5438 LOAD_PLUGIN_LOGFILE="#"
5441 LOAD_PLUGIN_LOGFILE="##"
5443 AC_MSG_RESULT([$default_log_plugin])
5445 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5446 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5448 DEFAULT_LOG_LEVEL="info"
5449 if test "x$enable_debug" = "xyes"
5451 DEFAULT_LOG_LEVEL="debug"
5453 AC_SUBST(DEFAULT_LOG_LEVEL)
5455 # Load only one of rrdtool, network, csv in the default config.
5456 LOAD_PLUGIN_RRDTOOL=""
5457 LOAD_PLUGIN_NETWORK=""
5460 AC_MSG_CHECKING([which default write plugin to load])
5461 default_write_plugin="none"
5462 if test "x$enable_rrdtool" = "xyes"
5464 default_write_plugin="rrdtool"
5466 LOAD_PLUGIN_RRDTOOL="##"
5469 if test "x$enable_network" = "xyes"
5471 if test "x$default_write_plugin" = "xnone"
5473 default_write_plugin="network"
5475 LOAD_PLUGIN_NETWORK="#"
5478 LOAD_PLUGIN_NETWORK="##"
5481 if test "x$enable_csv" = "xyes"
5483 if test "x$default_write_plugin" = "xnone"
5485 default_write_plugin="csv"
5490 LOAD_PLUGIN_CSV="##"
5492 AC_MSG_RESULT([$default_write_plugin])
5494 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5495 AC_SUBST(LOAD_PLUGIN_NETWORK)
5496 AC_SUBST(LOAD_PLUGIN_CSV)
5499 if test "x$ac_system" = "xLinux" \
5500 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5502 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5505 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5507 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5511 PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
5512 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5514 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5516 PERL_BINDINGS_OPTIONS="$withval"
5517 with_perl_bindings="yes"
5519 with_perl_bindings="$withval"
5523 if test -n "$perl_interpreter"
5525 with_perl_bindings="yes"
5527 with_perl_bindings="no (no perl interpreter found)"
5530 if test "x$with_perl_bindings" = "xyes"
5532 PERL_BINDINGS="perl"
5536 AC_SUBST(PERL_BINDINGS)
5537 AC_SUBST(PERL_BINDINGS_OPTIONS)
5539 dnl libcollectdclient
5540 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5541 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5542 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5544 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5546 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5548 AC_SUBST(LCC_VERSION_MAJOR)
5549 AC_SUBST(LCC_VERSION_MINOR)
5550 AC_SUBST(LCC_VERSION_PATCH)
5551 AC_SUBST(LCC_VERSION_EXTRA)
5552 AC_SUBST(LCC_VERSION_STRING)
5554 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5556 AC_CONFIG_FILES([Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
5559 if test "x$with_librrd" = "xyes" \
5560 && test "x$librrd_threadsafe" != "xyes"
5562 with_librrd="yes (warning: librrd is not thread-safe)"
5565 if test "x$with_libperl" = "xyes"
5567 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5569 enable_perl="no (needs libperl)"
5572 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5574 enable_perl="no (libperl doesn't support ithreads)"
5577 if test "x$with_perl_bindings" = "xyes" \
5578 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5580 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5587 intel mic . . . . . . $with_mic
5588 libaquaero5 . . . . . $with_libaquaero5
5589 libcredis . . . . . . $with_libcredis
5590 libcurl . . . . . . . $with_libcurl
5591 libdbi . . . . . . . $with_libdbi
5592 libesmtp . . . . . . $with_libesmtp
5593 libganglia . . . . . $with_libganglia
5594 libgcrypt . . . . . . $with_libgcrypt
5595 libhal . . . . . . . $with_libhal
5596 libiokit . . . . . . $with_libiokit
5597 libiptc . . . . . . . $with_libiptc
5598 libjvm . . . . . . . $with_java
5599 libkstat . . . . . . $with_kstat
5600 libkvm . . . . . . . $with_libkvm
5601 liblvm2app . . . . . $with_liblvm2app
5602 libmemcached . . . . $with_libmemcached
5603 libmnl . . . . . . . $with_libmnl
5604 libmodbus . . . . . . $with_libmodbus
5605 libmongoc . . . . . . $with_libmongoc
5606 libmysql . . . . . . $with_libmysql
5607 libnetapp . . . . . . $with_libnetapp
5608 libnetsnmp . . . . . $with_libnetsnmp
5609 libnotify . . . . . . $with_libnotify
5610 liboconfig . . . . . $with_liboconfig
5611 libopenipmi . . . . . $with_libopenipmipthread
5612 liboping . . . . . . $with_liboping
5613 libowcapi . . . . . . $with_libowcapi
5614 libpcap . . . . . . . $with_libpcap
5615 libperfstat . . . . . $with_perfstat
5616 libperl . . . . . . . $with_libperl
5617 libpq . . . . . . . . $with_libpq
5618 libpthread . . . . . $with_libpthread
5619 librabbitmq . . . . . $with_librabbitmq
5620 librouteros . . . . . $with_librouteros
5621 librrd . . . . . . . $with_librrd
5622 libsensors . . . . . $with_libsensors
5623 libsigrok . . . . . $with_libsigrok
5624 libstatgrab . . . . . $with_libstatgrab
5625 libtokyotyrant . . . $with_libtokyotyrant
5626 libupsclient . . . . $with_libupsclient
5627 libvarnish . . . . . $with_libvarnish
5628 libvirt . . . . . . . $with_libvirt
5629 libxml2 . . . . . . . $with_libxml2
5630 libxmms . . . . . . . $with_libxmms
5631 libyajl . . . . . . . $with_libyajl
5632 oracle . . . . . . . $with_oracle
5633 protobuf-c . . . . . $have_protoc_c
5634 python . . . . . . . $with_python
5637 daemon mode . . . . . $enable_daemon
5638 debug . . . . . . . . $enable_debug
5641 perl . . . . . . . . $with_perl_bindings
5644 aggregation . . . . . $enable_aggregation
5645 amqp . . . . . . . $enable_amqp
5646 apache . . . . . . . $enable_apache
5647 apcups . . . . . . . $enable_apcups
5648 aquaero . . . . . . . $enable_aquaero
5649 apple_sensors . . . . $enable_apple_sensors
5650 ascent . . . . . . . $enable_ascent
5651 battery . . . . . . . $enable_battery
5652 bind . . . . . . . . $enable_bind
5653 conntrack . . . . . . $enable_conntrack
5654 contextswitch . . . . $enable_contextswitch
5655 cgroups . . . . . . . $enable_cgroups
5656 cpu . . . . . . . . . $enable_cpu
5657 cpufreq . . . . . . . $enable_cpufreq
5658 csv . . . . . . . . . $enable_csv
5659 curl . . . . . . . . $enable_curl
5660 curl_json . . . . . . $enable_curl_json
5661 curl_xml . . . . . . $enable_curl_xml
5662 dbi . . . . . . . . . $enable_dbi
5663 df . . . . . . . . . $enable_df
5664 disk . . . . . . . . $enable_disk
5665 dns . . . . . . . . . $enable_dns
5666 email . . . . . . . . $enable_email
5667 entropy . . . . . . . $enable_entropy
5668 ethstat . . . . . . . $enable_ethstat
5669 exec . . . . . . . . $enable_exec
5670 filecount . . . . . . $enable_filecount
5671 fscache . . . . . . . $enable_fscache
5672 gmond . . . . . . . . $enable_gmond
5673 hddtemp . . . . . . . $enable_hddtemp
5674 interface . . . . . . $enable_interface
5675 ipmi . . . . . . . . $enable_ipmi
5676 iptables . . . . . . $enable_iptables
5677 ipvs . . . . . . . . $enable_ipvs
5678 irq . . . . . . . . . $enable_irq
5679 java . . . . . . . . $enable_java
5680 libvirt . . . . . . . $enable_libvirt
5681 load . . . . . . . . $enable_load
5682 logfile . . . . . . . $enable_logfile
5683 lpar . . . . . . . . $enable_lpar
5684 lvm . . . . . . . . . $enable_lvm
5685 madwifi . . . . . . . $enable_madwifi
5686 match_empty_counter . $enable_match_empty_counter
5687 match_hashed . . . . $enable_match_hashed
5688 match_regex . . . . . $enable_match_regex
5689 match_timediff . . . $enable_match_timediff
5690 match_value . . . . . $enable_match_value
5691 mbmon . . . . . . . . $enable_mbmon
5692 md . . . . . . . . . $enable_md
5693 memcachec . . . . . . $enable_memcachec
5694 memcached . . . . . . $enable_memcached
5695 memory . . . . . . . $enable_memory
5696 mic . . . . . . . . . $enable_mic
5697 modbus . . . . . . . $enable_modbus
5698 multimeter . . . . . $enable_multimeter
5699 mysql . . . . . . . . $enable_mysql
5700 netapp . . . . . . . $enable_netapp
5701 netlink . . . . . . . $enable_netlink
5702 network . . . . . . . $enable_network
5703 nfs . . . . . . . . . $enable_nfs
5704 nginx . . . . . . . . $enable_nginx
5705 notify_desktop . . . $enable_notify_desktop
5706 notify_email . . . . $enable_notify_email
5707 ntpd . . . . . . . . $enable_ntpd
5708 numa . . . . . . . . $enable_numa
5709 nut . . . . . . . . . $enable_nut
5710 olsrd . . . . . . . . $enable_olsrd
5711 onewire . . . . . . . $enable_onewire
5712 openvpn . . . . . . . $enable_openvpn
5713 oracle . . . . . . . $enable_oracle
5714 perl . . . . . . . . $enable_perl
5715 pf . . . . . . . . . $enable_pf
5716 pinba . . . . . . . . $enable_pinba
5717 ping . . . . . . . . $enable_ping
5718 postgresql . . . . . $enable_postgresql
5719 powerdns . . . . . . $enable_powerdns
5720 processes . . . . . . $enable_processes
5721 protocols . . . . . . $enable_protocols
5722 python . . . . . . . $enable_python
5723 redis . . . . . . . . $enable_redis
5724 routeros . . . . . . $enable_routeros
5725 rrdcached . . . . . . $enable_rrdcached
5726 rrdtool . . . . . . . $enable_rrdtool
5727 sensors . . . . . . . $enable_sensors
5728 serial . . . . . . . $enable_serial
5729 sigrok . . . . . . . $enable_sigrok
5730 snmp . . . . . . . . $enable_snmp
5731 statsd . . . . . . . $enable_statsd
5732 swap . . . . . . . . $enable_swap
5733 syslog . . . . . . . $enable_syslog
5734 table . . . . . . . . $enable_table
5735 tail . . . . . . . . $enable_tail
5736 tail_csv . . . . . . $enable_tail_csv
5737 tape . . . . . . . . $enable_tape
5738 target_notification . $enable_target_notification
5739 target_replace . . . $enable_target_replace
5740 target_scale . . . . $enable_target_scale
5741 target_set . . . . . $enable_target_set
5742 target_v5upgrade . . $enable_target_v5upgrade
5743 tcpconns . . . . . . $enable_tcpconns
5744 teamspeak2 . . . . . $enable_teamspeak2
5745 ted . . . . . . . . . $enable_ted
5746 thermal . . . . . . . $enable_thermal
5747 threshold . . . . . . $enable_threshold
5748 tokyotyrant . . . . . $enable_tokyotyrant
5749 unixsock . . . . . . $enable_unixsock
5750 uptime . . . . . . . $enable_uptime
5751 users . . . . . . . . $enable_users
5752 uuid . . . . . . . . $enable_uuid
5753 varnish . . . . . . . $enable_varnish
5754 vmem . . . . . . . . $enable_vmem
5755 vserver . . . . . . . $enable_vserver
5756 wireless . . . . . . $enable_wireless
5757 write_graphite . . . $enable_write_graphite
5758 write_http . . . . . $enable_write_http
5759 write_mongodb . . . . $enable_write_mongodb
5760 write_redis . . . . . $enable_write_redis
5761 write_riemann . . . . $enable_write_riemann
5762 xmms . . . . . . . . $enable_xmms
5763 zfs_arc . . . . . . . $enable_zfs_arc
5767 if test "x$dependency_error" = "xyes"; then
5768 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5771 if test "x$dependency_warning" = "xyes"; then
5772 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5775 # vim: set fdm=marker :