1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, [m4_esyscmd(./version-gen.sh)])
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 m4_ifdef([LT_PACKAGE_VERSION],
10 LT_CONFIG_LTDL_DIR([libltdl])
12 LTDL_INIT([convenience])
13 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
18 AC_LIBLTDL_CONVENIENCE
22 AC_CONFIG_SUBDIRS(libltdl)
23 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
27 AM_INIT_AUTOMAKE(dist-bzip2)
30 AC_PREFIX_DEFAULT("/opt/collectd")
35 # Checks for programs.
43 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
51 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
52 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
54 AC_MSG_CHECKING([for kernel type ($host_os)])
57 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
61 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
71 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
77 AC_MSG_RESULT([$ac_system])
79 if test "x$ac_system" = "xLinux"
81 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
82 if test -z "$KERNEL_DIR"
84 KERNEL_DIR="/lib/modules/`uname -r`/source"
87 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
88 AC_SUBST(KERNEL_CFLAGS)
91 if test "x$ac_system" = "xSolaris"
93 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
95 if test "x$ac_system" = "xAIX"
97 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
100 # Where to install .pc files.
101 pkgconfigdir="${libdir}/pkgconfig"
102 AC_SUBST(pkgconfigdir)
104 # Check for standards compliance mode
105 AC_ARG_ENABLE(standards,
106 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
107 [enable_standards="$enableval"],
108 [enable_standards="no"])
109 if test "x$enable_standards" = "xyes"
111 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
112 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
113 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
114 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
115 if test "x$GCC" = "xyes"
117 CFLAGS="$CFLAGS -std=c99"
120 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
123 # Checks for header files.
130 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
133 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
138 # include <sys/types.h>
141 AC_CHECK_HEADERS(netinet/in.h, [], [],
146 # include <sys/types.h>
148 #if HAVE_NETINET_IN_SYSTM_H
149 # include <netinet/in_systm.h>
152 AC_CHECK_HEADERS(netinet/ip.h, [], [],
157 # include <sys/types.h>
159 #if HAVE_NETINET_IN_SYSTM_H
160 # include <netinet/in_systm.h>
162 #if HAVE_NETINET_IN_H
163 # include <netinet/in.h>
166 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
171 # include <sys/types.h>
173 #if HAVE_NETINET_IN_SYSTM_H
174 # include <netinet/in_systm.h>
176 #if HAVE_NETINET_IN_H
177 # include <netinet/in.h>
179 #if HAVE_NETINET_IP_H
180 # include <netinet/ip.h>
183 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
188 # include <sys/types.h>
190 #if HAVE_NETINET_IN_SYSTM_H
191 # include <netinet/in_systm.h>
193 #if HAVE_NETINET_IN_H
194 # include <netinet/in.h>
196 #if HAVE_NETINET_IP_H
197 # include <netinet/ip.h>
200 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
205 # include <sys/types.h>
207 #if HAVE_NETINET_IN_SYSTM_H
208 # include <netinet/in_systm.h>
210 #if HAVE_NETINET_IN_H
211 # include <netinet/in.h>
214 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
219 # include <sys/types.h>
221 #if HAVE_NETINET_IN_SYSTM_H
222 # include <netinet/in_systm.h>
224 #if HAVE_NETINET_IN_H
225 # include <netinet/in.h>
227 #if HAVE_NETINET_IP6_H
228 # include <netinet/ip6.h>
231 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
236 # include <sys/types.h>
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
244 #if HAVE_NETINET_IP_H
245 # include <netinet/ip.h>
248 AC_CHECK_HEADERS(netinet/udp.h, [], [],
253 # include <sys/types.h>
255 #if HAVE_NETINET_IN_SYSTM_H
256 # include <netinet/in_systm.h>
258 #if HAVE_NETINET_IN_H
259 # include <netinet/in.h>
261 #if HAVE_NETINET_IP_H
262 # include <netinet/ip.h>
267 AC_CHECK_HEADERS(sys/dkstat.h)
268 if test "x$ac_system" = "xDarwin"
270 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
271 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
273 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
276 # include <sys/types.h>
279 # include <sys/param.h>
283 AC_MSG_CHECKING([for sysctl kern.cp_times])
284 if test -x /sbin/sysctl
286 /sbin/sysctl kern.cp_times 2>/dev/null
290 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
291 [Define if sysctl supports kern.cp_times])
300 AC_CHECK_HEADERS(linux/major.h libgen.h)
302 # For md module (Linux only)
303 if test "x$ac_system" = "xLinux"
305 AC_CHECK_HEADERS(linux/raid/md_u.h,
306 [have_linux_raid_md_u_h="yes"],
307 [have_linux_raid_md_u_h="no"],
309 #include <sys/ioctl.h>
310 #include <linux/major.h>
311 #include <linux/types.h>
314 have_linux_raid_md_u_h="no"
317 # For the battery plugin
318 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
320 #if HAVE_IOKIT_IOKITLIB_H
321 # include <IOKit/IOKitLib.h>
323 #if HAVE_IOKIT_IOTYPES_H
324 # include <IOKit/IOTypes.h>
328 # For the swap module
329 have_linux_wireless_h="no"
330 if test "x$ac_system" = "xLinux"
332 AC_CHECK_HEADERS(linux/wireless.h,
333 [have_linux_wireless_h="yes"],
334 [have_linux_wireless_h="no"],
337 #include <sys/ioctl.h>
338 #include <sys/socket.h>
342 # For the swap module
343 have_sys_swap_h="yes"
344 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
346 #undef _FILE_OFFSET_BITS
347 #undef _LARGEFILE64_SOURCE
349 # include <sys/types.h>
352 # include <sys/param.h>
356 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
359 if test "x$GCC" = "xyes"
361 hint_64="CFLAGS='-m64'"
363 hint_64="CFLAGS='-xarch=v9'"
365 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
369 # For the processes plugin
371 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
373 # For interface plugin
374 AC_CHECK_HEADERS(ifaddrs.h)
375 AC_CHECK_HEADERS(net/if.h, [], [],
378 # include <sys/types.h>
380 #if HAVE_SYS_SOCKET_H
381 # include <sys/socket.h>
384 AC_CHECK_HEADERS(linux/if.h, [], [],
387 # include <sys/types.h>
389 #if HAVE_SYS_SOCKET_H
390 # include <sys/socket.h>
393 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
396 # include <sys/types.h>
398 #if HAVE_SYS_SOCKET_H
399 # include <sys/socket.h>
402 # include <linux/if.h>
407 AC_CHECK_HEADERS(linux/sockios.h,
408 [have_linux_sockios_h="yes"],
409 [have_linux_sockios_h="no"],
412 # include <sys/ioctl.h>
418 AC_CHECK_HEADERS(linux/ethtool.h,
419 [have_linux_ethtool_h="yes"],
420 [have_linux_ethtool_h="no"],
423 # include <sys/ioctl.h>
428 #if HAVE_LINUX_SOCKIOS_H
429 # include <linux/sockios.h>
434 have_linux_ip_vs_h="no"
435 have_net_ip_vs_h="no"
437 ip_vs_h_needs_kernel_cflags="no"
438 if test "x$ac_system" = "xLinux"
440 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
441 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
442 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
444 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
446 SAVE_CFLAGS="$CFLAGS"
447 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
449 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
451 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
452 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
453 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
455 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
457 ip_vs_h_needs_kernel_cflags="yes"
460 CFLAGS="$SAVE_CFLAGS"
463 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
466 AC_CHECK_HEADERS(sys/ucred.h, [], [],
469 # include <sys/types.h>
472 # include <sys/param.h>
476 # For mount interface
477 AC_CHECK_HEADERS(sys/mount.h, [], [],
480 # include <sys/types.h>
483 # include <sys/param.h>
487 # For the email plugin
488 AC_CHECK_HEADERS(linux/un.h, [], [],
490 #if HAVE_SYS_SOCKET_H
491 # include <sys/socket.h>
495 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
498 AC_CHECK_HEADERS(arpa/nameser.h)
499 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
501 #if HAVE_ARPA_NAMESER_H
502 # include <arpa/nameser.h>
506 AC_CHECK_HEADERS(net/if_arp.h, [], [],
507 [#if HAVE_SYS_SOCKET_H
508 # include <sys/socket.h>
511 AC_CHECK_HEADERS(net/ppp_defs.h)
512 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
513 [#if HAVE_NET_PPP_DEFS_H
514 # include <net/ppp_defs.h>
517 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
522 # include <sys/types.h>
524 #if HAVE_SYS_SOCKET_H
525 # include <sys/socket.h>
530 #if HAVE_NETINET_IN_H
531 # include <netinet/in.h>
535 # For the multimeter plugin
537 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
540 # Checks for typedefs, structures, and compiler characteristics.
549 # Checks for library functions.
551 AC_PROG_GCC_TRADITIONAL
552 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
556 SAVE_CFLAGS="$CFLAGS"
557 # Emulate behavior of src/Makefile.am
558 if test "x$GCC" = "xyes"
560 CFLAGS="$CFLAGS -Wall -Werror"
563 AC_CACHE_CHECK([for strtok_r],
564 [c_cv_have_strtok_r_default],
573 char buffer[] = "foo,bar,baz";
580 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
583 printf ("token = %s;\n", token);
586 [c_cv_have_strtok_r_default="yes"],
587 [c_cv_have_strtok_r_default="no"]
591 if test "x$c_cv_have_strtok_r_default" = "xno"
593 CFLAGS="$CFLAGS -D_REENTRANT=1"
595 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
596 [c_cv_have_strtok_r_reentrant],
605 char buffer[] = "foo,bar,baz";
612 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
615 printf ("token = %s;\n", token);
618 [c_cv_have_strtok_r_reentrant="yes"],
619 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
624 CFLAGS="$SAVE_CFLAGS"
625 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
627 CFLAGS="$CFLAGS -D_REENTRANT=1"
630 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
632 socket_needs_socket="no"
633 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
634 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
636 clock_gettime_needs_rt="no"
637 clock_gettime_needs_posix4="no"
638 have_clock_gettime="no"
639 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
640 if test "x$have_clock_gettime" = "xno"
642 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
643 have_clock_gettime="yes"])
645 if test "x$have_clock_gettime" = "xno"
647 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
648 have_clock_gettime="yes"])
650 if test "x$have_clock_gettime" = "xyes"
652 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
654 AC_MSG_WARN(cannot find clock_gettime)
657 nanosleep_needs_rt="no"
658 nanosleep_needs_posix4="no"
659 AC_CHECK_FUNCS(nanosleep,
661 AC_CHECK_LIB(rt, nanosleep,
662 [nanosleep_needs_rt="yes"],
663 AC_CHECK_LIB(posix4, nanosleep,
664 [nanosleep_needs_posix4="yes"],
665 AC_MSG_ERROR(cannot find nanosleep))))
667 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
668 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
670 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
671 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
672 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
673 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
674 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
675 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
676 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
677 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
678 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
679 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
680 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
681 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
683 # Check for strptime {{{
684 if test "x$GCC" = "xyes"
686 SAVE_CFLAGS="$CFLAGS"
687 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
690 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
691 if test "x$have_strptime" = "xyes"
693 AC_CACHE_CHECK([whether strptime is exported by default],
694 [c_cv_have_strptime_default],
703 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
705 [c_cv_have_strptime_default="yes"],
706 [c_cv_have_strptime_default="no"]))
708 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
710 AC_CACHE_CHECK([whether strptime needs standards mode],
711 [c_cv_have_strptime_standards],
715 #ifndef _ISOC99_SOURCE
716 # define _ISOC99_SOURCE 1
718 #ifndef _POSIX_C_SOURCE
719 # define _POSIX_C_SOURCE 200112L
721 #ifndef _XOPEN_SOURCE
722 # define _XOPEN_SOURCE 500
729 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
731 [c_cv_have_strptime_standards="yes"],
732 [c_cv_have_strptime_standards="no"]))
734 if test "x$c_cv_have_strptime_standards" = "xyes"
736 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
742 if test "x$GCC" = "xyes"
744 CFLAGS="$SAVE_CFLAGS"
747 # }}} Check for strptime
749 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
750 if test "x$have_swapctl" = "xyes"; then
751 AC_CACHE_CHECK([whether swapctl takes two arguments],
752 [c_cv_have_swapctl_two_args],
754 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
755 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
756 # undef _FILE_OFFSET_BITS
757 # undef _LARGEFILE64_SOURCE
759 #include <sys/stat.h>
760 #include <sys/swap.h>]],
762 int num = swapctl(0, NULL);
765 [c_cv_have_swapctl_two_args="yes"],
766 [c_cv_have_swapctl_two_args="no"]
769 AC_CACHE_CHECK([whether swapctl takes three arguments],
770 [c_cv_have_swapctl_three_args],
772 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
773 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
774 # undef _FILE_OFFSET_BITS
775 # undef _LARGEFILE64_SOURCE
777 #include <sys/stat.h>
778 #include <sys/swap.h>]],
780 int num = swapctl(0, NULL,0);
783 [c_cv_have_swapctl_three_args="yes"],
784 [c_cv_have_swapctl_three_args="no"]
788 # Check for different versions of `swapctl' here..
789 if test "x$have_swapctl" = "xyes"; then
790 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
791 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
792 [Define if the function swapctl exists and takes two arguments.])
794 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
795 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
796 [Define if the function swapctl exists and takes three arguments.])
801 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
803 if test "x$withval" = "xno"; then
805 else if test "x$withval" = "xyes"; then
812 if test "x$nan_type" = "xnone"; then
813 AC_CACHE_CHECK([whether NAN is defined by default],
814 [c_cv_have_nan_default],
820 static double foo = NAN;
828 [c_cv_have_nan_default="yes"],
829 [c_cv_have_nan_default="no"]
832 if test "x$c_cv_have_nan_default" = "xyes"
837 if test "x$nan_type" = "xnone"; then
838 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
839 [c_cv_have_nan_isoc],
844 #define __USE_ISOC99 1
846 static double foo = NAN;
854 [c_cv_have_nan_isoc="yes"],
855 [c_cv_have_nan_isoc="no"]
858 if test "x$c_cv_have_nan_isoc" = "xyes"
863 if test "x$nan_type" = "xnone"; then
864 SAVE_LDFLAGS=$LDFLAGS
865 LDFLAGS="$LDFLAGS -lm"
866 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
867 [c_cv_have_nan_zero],
876 #define NAN (0.0 / 0.0)
878 # define isnan(f) ((f) != (f))
880 static double foo = NAN;
888 [c_cv_have_nan_zero="yes"],
889 [c_cv_have_nan_zero="no"]
892 LDFLAGS=$SAVE_LDFLAGS
893 if test "x$c_cv_have_nan_zero" = "xyes"
899 if test "x$nan_type" = "xdefault"; then
900 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
901 [Define if NAN is defined by default and can initialize static variables.])
902 else if test "x$nan_type" = "xisoc99"; then
903 AC_DEFINE(NAN_STATIC_ISOC, 1,
904 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
905 else if test "x$nan_type" = "xzero"; then
906 AC_DEFINE(NAN_ZERO_ZERO, 1,
907 [Define if NAN can be defined as (0.0 / 0.0)])
909 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
912 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
914 if test "x$withval" = "xnothing"; then
915 fp_layout_type="nothing"
916 else if test "x$withval" = "xendianflip"; then
917 fp_layout_type="endianflip"
918 else if test "x$withval" = "xintswap"; then
919 fp_layout_type="intswap"
921 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
924 [fp_layout_type="unknown"])
926 if test "x$fp_layout_type" = "xunknown"; then
927 AC_CACHE_CHECK([if doubles are stored in x86 representation],
928 [c_cv_fp_layout_need_nothing],
939 # include <inttypes.h>
942 # include <stdbool.h>
952 memcpy ((void *) &i0, (void *) &d, 8);
955 memcpy ((void *) c, (void *) &i1, 8);
957 if ((c[0] == 0x2f) && (c[1] == 0x25)
958 && (c[2] == 0xc0) && (c[3] == 0xc7)
959 && (c[4] == 0x43) && (c[5] == 0x2b)
960 && (c[6] == 0x1f) && (c[7] == 0x5b))
965 [c_cv_fp_layout_need_nothing="yes"],
966 [c_cv_fp_layout_need_nothing="no"]
969 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
970 fp_layout_type="nothing"
973 if test "x$fp_layout_type" = "xunknown"; then
974 AC_CACHE_CHECK([if endianflip converts to x86 representation],
975 [c_cv_fp_layout_need_endianflip],
986 # include <inttypes.h>
989 # include <stdbool.h>
991 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
992 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
993 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
994 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
995 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
996 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
997 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
998 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1007 memcpy ((void *) &i0, (void *) &d, 8);
1009 i1 = endianflip (i0);
1010 memcpy ((void *) c, (void *) &i1, 8);
1012 if ((c[0] == 0x2f) && (c[1] == 0x25)
1013 && (c[2] == 0xc0) && (c[3] == 0xc7)
1014 && (c[4] == 0x43) && (c[5] == 0x2b)
1015 && (c[6] == 0x1f) && (c[7] == 0x5b))
1020 [c_cv_fp_layout_need_endianflip="yes"],
1021 [c_cv_fp_layout_need_endianflip="no"]
1024 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1025 fp_layout_type="endianflip"
1028 if test "x$fp_layout_type" = "xunknown"; then
1029 AC_CACHE_CHECK([if intswap converts to x86 representation],
1030 [c_cv_fp_layout_need_intswap],
1038 # include <stdint.h>
1041 # include <inttypes.h>
1044 # include <stdbool.h>
1046 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1047 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1056 memcpy ((void *) &i0, (void *) &d, 8);
1059 memcpy ((void *) c, (void *) &i1, 8);
1061 if ((c[0] == 0x2f) && (c[1] == 0x25)
1062 && (c[2] == 0xc0) && (c[3] == 0xc7)
1063 && (c[4] == 0x43) && (c[5] == 0x2b)
1064 && (c[6] == 0x1f) && (c[7] == 0x5b))
1069 [c_cv_fp_layout_need_intswap="yes"],
1070 [c_cv_fp_layout_need_intswap="no"]
1073 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1074 fp_layout_type="intswap"
1078 if test "x$fp_layout_type" = "xnothing"; then
1079 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1080 [Define if doubles are stored in x86 representation.])
1081 else if test "x$fp_layout_type" = "xendianflip"; then
1082 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1083 [Define if endianflip is needed to convert to x86 representation.])
1084 else if test "x$fp_layout_type" = "xintswap"; then
1085 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1086 [Define if intswap is needed to convert to x86 representation.])
1088 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1092 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1093 have_getvfsstat="no"
1094 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1095 have_listmntent="no"
1096 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1099 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1100 if test "x$have_getmntent" = "xno"; then
1101 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1103 if test "x$have_getmntent" = "xno"; then
1104 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1106 if test "x$have_getmntent" = "xno"; then
1107 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1110 if test "x$have_getmntent" = "xc"; then
1111 AC_CACHE_CHECK([whether getmntent takes one argument],
1112 [c_cv_have_one_getmntent],
1114 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1115 #include "$srcdir/src/utils_mount.h"]],
1119 fh = setmntent ("/etc/mtab", "r");
1120 me = getmntent (fh);
1123 [c_cv_have_one_getmntent="yes"],
1124 [c_cv_have_one_getmntent="no"]
1127 AC_CACHE_CHECK([whether getmntent takes two arguments],
1128 [c_cv_have_two_getmntent],
1130 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1131 #include "$srcdir/src/utils_mount.h"]],
1136 fh = fopen ("/etc/mnttab", "r");
1137 status = getmntent (fh, &mt);
1140 [c_cv_have_two_getmntent="yes"],
1141 [c_cv_have_two_getmntent="no"]
1146 # Check for different versions of `getmntent' here..
1148 if test "x$have_getmntent" = "xc"; then
1149 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1150 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1151 [Define if the function getmntent exists and takes one argument.])
1153 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1154 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1155 [Define if the function getmntent exists and takes two arguments.])
1158 if test "x$have_getmntent" = "xsun"; then
1159 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1160 [Define if the function getmntent exists. It's the version from libsun.])
1162 if test "x$have_getmntent" = "xseq"; then
1163 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1164 [Define if the function getmntent exists. It's the version from libseq.])
1166 if test "x$have_getmntent" = "xgen"; then
1167 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1168 [Define if the function getmntent exists. It's the version from libgen.])
1172 AC_MSG_CHECKING([if have htonll defined])
1177 #include <sys/types.h>
1178 #include <netinet/in.h>
1180 # include <inttypes.h>
1187 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1190 AC_MSG_RESULT([$have_htonll])
1192 # Check for structures
1193 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1194 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1197 #include <sys/types.h>
1198 #include <sys/socket.h>
1201 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1202 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1205 #include <sys/types.h>
1206 #include <sys/socket.h>
1207 #include <linux/if.h>
1208 #include <linux/netdevice.h>
1211 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1214 #include <netinet/in.h>
1218 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1220 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1221 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1222 have_struct_kinfo_proc_freebsd="yes"
1225 have_struct_kinfo_proc_freebsd="no"
1229 #include <sys/param.h>
1230 #include <sys/sysctl.h>
1231 #include <sys/user.h>
1234 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1236 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1237 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1238 have_struct_kinfo_proc_openbsd="yes"
1241 have_struct_kinfo_proc_openbsd="no"
1244 #include <sys/param.h>
1245 #include <sys/sysctl.h>
1249 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1250 [#define _BSD_SOURCE
1252 # include <stdint.h>
1254 #if HAVE_SYS_TYPES_H
1255 # include <sys/types.h>
1257 #if HAVE_NETINET_IN_SYSTM_H
1258 # include <netinet/in_systm.h>
1260 #if HAVE_NETINET_IN_H
1261 # include <netinet/in.h>
1263 #if HAVE_NETINET_IP_H
1264 # include <netinet/ip.h>
1266 #if HAVE_NETINET_UDP_H
1267 # include <netinet/udp.h>
1270 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1271 [#define _BSD_SOURCE
1273 # include <stdint.h>
1275 #if HAVE_SYS_TYPES_H
1276 # include <sys/types.h>
1278 #if HAVE_NETINET_IN_SYSTM_H
1279 # include <netinet/in_systm.h>
1281 #if HAVE_NETINET_IN_H
1282 # include <netinet/in.h>
1284 #if HAVE_NETINET_IP_H
1285 # include <netinet/ip.h>
1287 #if HAVE_NETINET_UDP_H
1288 # include <netinet/udp.h>
1292 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1302 # Checks for libraries begin here
1305 with_libresolv="yes"
1306 AC_CHECK_LIB(resolv, res_search,
1308 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1310 [with_libresolv="no"])
1311 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1313 dnl Check for HAL (hardware abstraction library)
1315 AC_CHECK_LIB(hal,libhal_device_property_exists,
1316 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1318 if test "x$with_libhal" = "xyes"; then
1319 if test "x$PKG_CONFIG" != "x"; then
1320 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1321 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1322 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1323 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1327 m4_divert_once([HELP_WITH], [
1328 collectd additional packages:])
1330 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1332 if test "x$ac_system" = "xAIX"
1337 with_perfstat="no (AIX only)"
1338 with_procinfo="no (AIX only)"
1341 if test "x$with_perfstat" = "xyes"
1343 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1344 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1346 if test "x$with_perfstat" = "xyes"
1348 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1349 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1350 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1351 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1353 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1356 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1358 # Processes plugin under AIX.
1359 if test "x$with_procinfo" = "xyes"
1361 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1363 if test "x$with_procinfo" = "xyes"
1365 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1368 if test "x$ac_system" = "xSolaris"
1373 with_kstat="no (Solaris only)"
1374 with_devinfo="no (Solaris only)"
1377 if test "x$with_kstat" = "xyes"
1379 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1381 if test "x$with_kstat" = "xyes"
1383 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1384 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1386 if test "x$with_kstat" = "xyes"
1388 AC_DEFINE(HAVE_LIBKSTAT, 1,
1389 [Define to 1 if you have the 'kstat' library (-lkstat)])
1391 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1392 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1395 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1402 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1405 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1406 if test "x$with_kvm_getprocs" = "xyes"
1408 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1409 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1412 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1414 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1415 if test "x$with_kvm_getswapinfo" = "xyes"
1417 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1418 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1421 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1423 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1424 if test "x$with_kvm_nlist" = "xyes"
1426 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1427 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1428 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1431 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1433 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1434 if test "x$with_kvm_openfiles" = "xyes"
1436 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1437 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1440 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1442 # --with-libcredis {{{
1443 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1445 if test "x$withval" = "xyes"
1447 with_libcredis="yes"
1448 else if test "x$withval" = "xno"
1452 with_libcredis="yes"
1453 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1454 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1457 [with_libcredis="yes"])
1459 SAVE_CPPFLAGS="$CPPFLAGS"
1460 SAVE_LDFLAGS="$LDFLAGS"
1462 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1463 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1465 if test "x$with_libcredis" = "xyes"
1467 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1469 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1471 AC_CHECK_HEADERS(credis.h,
1472 [with_libcredis="yes"],
1473 [with_libcredis="no (credis.h not found)"])
1475 if test "x$with_libcredis" = "xyes"
1477 if test "x$LIBCREDIS_LDFLAGS" != "x"
1479 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1481 AC_CHECK_LIB(credis, credis_info,
1482 [with_libcredis="yes"],
1483 [with_libcredis="no (symbol 'credis_info' not found)"])
1487 CPPFLAGS="$SAVE_CPPFLAGS"
1488 LDFLAGS="$SAVE_LDFLAGS"
1490 if test "x$with_libcredis" = "xyes"
1492 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1493 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1494 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1495 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1497 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1500 # --with-libcurl {{{
1501 with_curl_config="curl-config"
1504 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1506 if test "x$withval" = "xno"
1509 else if test "x$withval" = "xyes"
1513 if test -f "$withval" && test -x "$withval"
1515 with_curl_config="$withval"
1517 else if test -x "$withval/bin/curl-config"
1519 with_curl_config="$withval/bin/curl-config"
1528 if test "x$with_libcurl" = "xyes"
1530 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1531 curl_config_status=$?
1533 if test $curl_config_status -ne 0
1535 with_libcurl="no ($with_curl_config failed)"
1537 SAVE_CPPFLAGS="$CPPFLAGS"
1538 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1540 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1542 CPPFLAGS="$SAVE_CPPFLAGS"
1545 if test "x$with_libcurl" = "xyes"
1547 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1548 curl_config_status=$?
1550 if test $curl_config_status -ne 0
1552 with_libcurl="no ($with_curl_config failed)"
1554 AC_CHECK_LIB(curl, curl_easy_init,
1555 [with_libcurl="yes"],
1556 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1560 if test "x$with_libcurl" = "xyes"
1562 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1563 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1564 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1565 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1567 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1571 with_libdbi_cppflags=""
1572 with_libdbi_ldflags=""
1573 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1575 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1577 with_libdbi_cppflags="-I$withval/include"
1578 with_libdbi_ldflags="-L$withval/lib"
1581 with_libdbi="$withval"
1587 if test "x$with_libdbi" = "xyes"
1589 SAVE_CPPFLAGS="$CPPFLAGS"
1590 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1592 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1594 CPPFLAGS="$SAVE_CPPFLAGS"
1596 if test "x$with_libdbi" = "xyes"
1598 SAVE_CPPFLAGS="$CPPFLAGS"
1599 SAVE_LDFLAGS="$LDFLAGS"
1600 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1601 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1603 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1605 CPPFLAGS="$SAVE_CPPFLAGS"
1606 LDFLAGS="$SAVE_LDFLAGS"
1608 if test "x$with_libdbi" = "xyes"
1610 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1611 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1612 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1613 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1614 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1615 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1617 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1620 # --with-libesmtp {{{
1621 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1623 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1625 LDFLAGS="$LDFLAGS -L$withval/lib"
1626 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1629 with_libesmtp="$withval"
1635 if test "x$with_libesmtp" = "xyes"
1637 AC_CHECK_LIB(esmtp, smtp_create_session,
1639 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1640 ], [with_libesmtp="no (libesmtp not found)"])
1642 if test "x$with_libesmtp" = "xyes"
1644 AC_CHECK_HEADERS(libesmtp.h,
1646 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1647 ], [with_libesmtp="no (libesmtp.h not found)"])
1649 if test "x$with_libesmtp" = "xyes"
1655 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1656 [Wether or not to use the esmtp library])
1657 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1660 # --with-libganglia {{{
1661 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1663 if test -f "$withval" && test -x "$withval"
1665 with_libganglia_config="$withval"
1666 with_libganglia="yes"
1667 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1669 with_libganglia_config="$withval/bin/ganglia-config"
1670 with_libganglia="yes"
1671 else if test -d "$withval"
1673 GANGLIA_CPPFLAGS="-I$withval/include"
1674 GANGLIA_LDFLAGS="-L$withval/lib"
1675 with_libganglia="yes"
1677 with_libganglia_config="ganglia-config"
1678 with_libganglia="$withval"
1682 with_libganglia_config="ganglia-config"
1683 with_libganglia="yes"
1686 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1688 if test "x$GANGLIA_CPPFLAGS" = "x"
1690 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1693 if test "x$GANGLIA_LDFLAGS" = "x"
1695 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1698 if test "x$GANGLIA_LIBS" = "x"
1700 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1704 SAVE_CPPFLAGS="$CPPFLAGS"
1705 SAVE_LDFLAGS="$LDFLAGS"
1706 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1707 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1709 if test "x$with_libganglia" = "xyes"
1711 AC_CHECK_HEADERS(gm_protocol.h,
1713 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1714 [Define to 1 if you have the <gm_protocol.h> header file.])
1715 ], [with_libganglia="no (gm_protocol.h not found)"])
1718 if test "x$with_libganglia" = "xyes"
1720 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1722 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1723 [Define to 1 if you have the ganglia library (-lganglia).])
1724 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1727 CPPFLAGS="$SAVE_CPPFLAGS"
1728 LDFLAGS="$SAVE_LDFLAGS"
1730 AC_SUBST(GANGLIA_CPPFLAGS)
1731 AC_SUBST(GANGLIA_LDFLAGS)
1732 AC_SUBST(GANGLIA_LIBS)
1733 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1736 # --with-libgcrypt {{{
1737 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1738 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1739 GCRYPT_LIBS="$GCRYPT_LIBS"
1740 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1742 if test -f "$withval" && test -x "$withval"
1744 with_libgcrypt_config="$withval"
1745 with_libgcrypt="yes"
1746 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1748 with_libgcrypt_config="$withval/bin/gcrypt-config"
1749 with_libgcrypt="yes"
1750 else if test -d "$withval"
1752 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1753 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1754 with_libgcrypt="yes"
1756 with_libgcrypt_config="gcrypt-config"
1757 with_libgcrypt="$withval"
1761 with_libgcrypt_config="libgcrypt-config"
1762 with_libgcrypt="yes"
1765 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1767 if test "x$GCRYPT_CPPFLAGS" = "x"
1769 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1772 if test "x$GCRYPT_LDFLAGS" = "x"
1774 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1775 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1778 if test "x$GCRYPT_LIBS" = "x"
1780 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1784 SAVE_CPPFLAGS="$CPPFLAGS"
1785 SAVE_LDFLAGS="$LDFLAGS"
1786 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1787 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1789 if test "x$with_libgcrypt" = "xyes"
1791 if test "x$GCRYPT_CPPFLAGS" != "x"
1793 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1795 AC_CHECK_HEADERS(gcrypt.h,
1796 [with_libgcrypt="yes"],
1797 [with_libgcrypt="no (gcrypt.h not found)"])
1800 if test "x$with_libgcrypt" = "xyes"
1802 if test "x$GCRYPT_LDFLAGS" != "x"
1804 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1806 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1807 [with_libgcrypt="yes"],
1808 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1810 if test "$with_libgcrypt" != "no"; then
1811 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1815 CPPFLAGS="$SAVE_CPPFLAGS"
1816 LDFLAGS="$SAVE_LDFLAGS"
1818 if test "x$with_libgcrypt" = "xyes"
1820 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1823 AC_SUBST(GCRYPT_CPPFLAGS)
1824 AC_SUBST(GCRYPT_LDFLAGS)
1825 AC_SUBST(GCRYPT_LIBS)
1826 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1829 # --with-libiptc {{{
1830 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1832 if test "x$withval" = "xshipped"
1835 else if test "x$withval" = "xyes"
1837 with_libiptc="pkgconfig"
1838 else if test "x$withval" = "xno"
1843 with_libiptc_cflags="-I$withval/include"
1844 with_libiptc_libs="-L$withval/lib"
1848 if test "x$ac_system" = "xLinux"
1850 with_libiptc="pkgconfig"
1852 with_libiptc="no (Linux only)"
1856 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1858 with_libiptc="no (Don't have pkg-config)"
1861 if test "x$with_libiptc" = "xpkgconfig"
1863 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
1866 with_libiptc="no (pkg-config doesn't know libiptc)"
1869 if test "x$with_libiptc" = "xpkgconfig"
1871 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
1874 with_libiptc="no ($PKG_CONFIG failed)"
1876 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
1879 with_libiptc="no ($PKG_CONFIG failed)"
1883 SAVE_CPPFLAGS="$CPPFLAGS"
1884 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
1886 # check whether the header file for libiptc is available.
1887 if test "x$with_libiptc" = "xpkgconfig"
1889 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
1890 [with_libiptc="no (header file missing)"])
1892 # If the header file is available, check for the required type declaractions.
1893 # They may be missing in old versions of libiptc. In that case, they will be
1894 # declared in the iptables plugin.
1895 if test "x$with_libiptc" = "xpkgconfig"
1897 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
1899 # Check for the iptc_init symbol in the library.
1900 # This could be in iptc or ip4tc
1901 if test "x$with_libiptc" = "xpkgconfig"
1903 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
1904 [with_libiptc="pkgconfig"],
1905 [with_libiptc="no"],
1906 [$with_libiptc_libs])
1908 if test "x$with_libiptc" = "xpkgconfig"
1913 CPPFLAGS="$SAVE_CPPFLAGS"
1915 if test "x$with_libiptc" = "xown"
1917 with_libiptc_cflags=""
1918 with_libiptc_libs=""
1920 if test "x$with_libiptc" = "xown"
1922 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1924 with_libiptc="no (Linux iptables headers not found)"
1927 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1930 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
1931 if test "x$with_libiptc" = "xown"
1933 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1937 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1938 if test "x$with_libiptc" = "xyes"
1940 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
1941 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
1942 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1943 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1948 with_java_home="$JAVA_HOME"
1949 with_java_vmtype="client"
1954 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1956 if test "x$withval" = "xno"
1959 else if test "x$withval" = "xyes"
1963 with_java_home="$withval"
1968 if test "x$with_java" = "xyes"
1970 if test -d "$with_java_home"
1972 AC_MSG_CHECKING([for jni.h])
1973 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1974 if test "x$TMPDIR" != "x"
1976 AC_MSG_RESULT([found in $TMPDIR])
1977 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1979 AC_MSG_RESULT([not found])
1982 AC_MSG_CHECKING([for jni_md.h])
1983 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1984 if test "x$TMPDIR" != "x"
1986 AC_MSG_RESULT([found in $TMPDIR])
1987 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1989 AC_MSG_RESULT([not found])
1992 AC_MSG_CHECKING([for libjvm.so])
1993 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1994 if test "x$TMPDIR" != "x"
1996 AC_MSG_RESULT([found in $TMPDIR])
1997 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1999 AC_MSG_RESULT([not found])
2002 if test "x$JAVAC" = "x"
2004 AC_MSG_CHECKING([for javac])
2005 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
2006 if test "x$TMPDIR" != "x"
2009 AC_MSG_RESULT([$JAVAC])
2011 AC_MSG_RESULT([not found])
2014 if test "x$JAR" = "x"
2016 AC_MSG_CHECKING([for jar])
2017 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
2018 if test "x$TMPDIR" != "x"
2021 AC_MSG_RESULT([$JAR])
2023 AC_MSG_RESULT([not found])
2026 else if test "x$with_java_home" != "x"
2028 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2032 if test "x$JAVA_CPPFLAGS" != "x"
2034 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2036 if test "x$JAVA_CFLAGS" != "x"
2038 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2040 if test "x$JAVA_LDFLAGS" != "x"
2042 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2044 if test "x$JAVAC" = "x"
2046 with_javac_path="$PATH"
2047 if test "x$with_java_home" != "x"
2049 with_javac_path="$with_java_home:with_javac_path"
2050 if test -d "$with_java_home/bin"
2052 with_javac_path="$with_java_home/bin:with_javac_path"
2056 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2058 if test "x$JAVAC" = "x"
2060 with_java="no (javac not found)"
2062 if test "x$JAR" = "x"
2064 with_jar_path="$PATH"
2065 if test "x$with_java_home" != "x"
2067 with_jar_path="$with_java_home:$with_jar_path"
2068 if test -d "$with_java_home/bin"
2070 with_jar_path="$with_java_home/bin:$with_jar_path"
2074 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2076 if test "x$JAR" = "x"
2078 with_java="no (jar not found)"
2081 SAVE_CPPFLAGS="$CPPFLAGS"
2082 SAVE_CFLAGS="$CFLAGS"
2083 SAVE_LDFLAGS="$LDFLAGS"
2084 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2085 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2086 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2088 if test "x$with_java" = "xyes"
2090 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2092 if test "x$with_java" = "xyes"
2094 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2096 [with_java="no (libjvm not found)"],
2099 if test "x$with_java" = "xyes"
2101 JAVA_LIBS="$JAVA_LIBS -ljvm"
2102 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2105 CPPFLAGS="$SAVE_CPPFLAGS"
2106 CFLAGS="$SAVE_CFLAGS"
2107 LDFLAGS="$SAVE_LDFLAGS"
2109 AC_SUBST(JAVA_CPPFLAGS)
2110 AC_SUBST(JAVA_CFLAGS)
2111 AC_SUBST(JAVA_LDFLAGS)
2113 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2116 # --with-libmemcached {{{
2117 with_libmemcached_cppflags=""
2118 with_libmemcached_ldflags=""
2119 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2121 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2123 with_libmemcached_cppflags="-I$withval/include"
2124 with_libmemcached_ldflags="-L$withval/lib"
2125 with_libmemcached="yes"
2127 with_libmemcached="$withval"
2131 with_libmemcached="yes"
2133 if test "x$with_libmemcached" = "xyes"
2135 SAVE_CPPFLAGS="$CPPFLAGS"
2136 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2138 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2140 CPPFLAGS="$SAVE_CPPFLAGS"
2142 if test "x$with_libmemcached" = "xyes"
2144 SAVE_CPPFLAGS="$CPPFLAGS"
2145 SAVE_LDFLAGS="$LDFLAGS"
2146 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2147 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2149 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2151 CPPFLAGS="$SAVE_CPPFLAGS"
2152 LDFLAGS="$SAVE_LDFLAGS"
2154 if test "x$with_libmemcached" = "xyes"
2156 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2157 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2158 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2159 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2160 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2161 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2162 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2164 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2167 # --with-libmodbus {{{
2168 with_libmodbus_config=""
2169 with_libmodbus_cflags=""
2170 with_libmodbus_libs=""
2171 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2173 if test "x$withval" = "xno"
2176 else if test "x$withval" = "xyes"
2178 with_libmodbus="use_pkgconfig"
2179 else if test -d "$with_libmodbus/lib"
2181 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2182 with_libmodbus_cflags="-I$withval/include"
2183 with_libmodbus_libs="-L$withval/lib -lmodbus"
2184 with_libmodbus="yes"
2187 [with_libmodbus="use_pkgconfig"])
2189 # configure using pkg-config
2190 if test "x$with_libmodbus" = "xuse_pkgconfig"
2192 if test "x$PKG_CONFIG" = "x"
2194 with_libmodbus="no (Don't have pkg-config)"
2197 if test "x$with_libmodbus" = "xuse_pkgconfig"
2199 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2200 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2203 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2206 if test "x$with_libmodbus" = "xuse_pkgconfig"
2208 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2211 with_libmodbus="no ($PKG_CONFIG failed)"
2213 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2216 with_libmodbus="no ($PKG_CONFIG failed)"
2219 if test "x$with_libmodbus" = "xuse_pkgconfig"
2221 with_libmodbus="yes"
2224 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2225 # the actual checks.
2226 if test "x$with_libmodbus" = "xyes"
2228 SAVE_CPPFLAGS="$CPPFLAGS"
2229 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2231 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2233 CPPFLAGS="$SAVE_CPPFLAGS"
2235 if test "x$with_libmodbus" = "xyes"
2237 SAVE_CPPFLAGS="$CPPFLAGS"
2238 SAVE_LDFLAGS="$LDFLAGS"
2240 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2241 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2243 AC_CHECK_LIB(modbus, modbus_connect,
2244 [with_libmodbus="yes"],
2245 [with_libmodbus="no (symbol modbus_connect not found)"])
2247 CPPFLAGS="$SAVE_CPPFLAGS"
2248 LDFLAGS="$SAVE_LDFLAGS"
2250 if test "x$with_libmodbus" = "xyes"
2252 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2253 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2254 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2255 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2259 # --with-libmongoc {{{
2260 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2262 if test "x$withval" = "xyes"
2264 with_libmongoc="yes"
2265 else if test "x$withval" = "xno"
2269 with_libmongoc="yes"
2270 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2271 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2274 [with_libmongoc="yes"])
2276 SAVE_CPPFLAGS="$CPPFLAGS"
2277 SAVE_LDFLAGS="$LDFLAGS"
2279 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2280 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2282 if test "x$with_libmongoc" = "xyes"
2284 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2286 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2288 AC_CHECK_HEADERS(mongo.h,
2289 [with_libmongoc="yes"],
2290 [with_libmongoc="no ('mongo.h' not found)"],
2292 # define MONGO_HAVE_STDINT 1
2294 # define MONGO_USE_LONG_LONG_INT 1
2298 if test "x$with_libmongoc" = "xyes"
2300 if test "x$LIBMONGOC_LDFLAGS" != "x"
2302 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2304 AC_CHECK_LIB(mongoc, mongo_run_command,
2305 [with_libmongoc="yes"],
2306 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2309 CPPFLAGS="$SAVE_CPPFLAGS"
2310 LDFLAGS="$SAVE_LDFLAGS"
2312 if test "x$with_libmongoc" = "xyes"
2314 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2315 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2316 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2317 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2319 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2322 # --with-libmono {{{
2323 AC_ARG_VAR([LIBMONO_PKG_CONFIG_NAME], [Name of libmono used by pkg-config])
2324 if test "x$LIBMONO_PKG_CONFIG_NAME" = "x"
2326 LIBMONO_PKG_CONFIG_NAME="mono"
2329 AC_MSG_CHECKING([pkg-config for $LIBMONO_PKG_CONFIG_NAME])
2330 $PKG_CONFIG --exists "$LIBMONO_PKG_CONFIG_NAME" 2>/dev/null
2331 mono_config_status=$?
2332 if test "x$mono_config_status" = "x0"
2338 AC_MSG_RESULT([$with_libmono])
2340 if test "x$with_libmono" = "xyes"
2342 with_libmono_cppflags=`$PKG_CONFIG --cflags-only-I "$LIBMONO_PKG_CONFIG_NAME"` || with_libmono="no"
2343 with_libmono_cflags=`$PKG_CONFIG --cflags-only-other "$LIBMONO_PKG_CONFIG_NAME"` || with_libmono="no"
2344 with_libmono_ldflags=`$PKG_CONFIG --libs-only-L "$LIBMONO_PKG_CONFIG_NAME"` || with_libmono="no"
2345 with_libmono_libs=`$PKG_CONFIG --libs-only-l "$LIBMONO_PKG_CONFIG_NAME"` || with_libmono="no"
2348 if test "x$with_libmono" = "xyes"
2350 SAVE_CPPFLAGS="$CPPFLAGS"
2351 SAVE_CFLAGS="$CFLAGS"
2352 CPPFLAGS="$CPPFLAGS $with_libmono_cppflags"
2353 CFLAGS="$CFLAGS $with_libmono_cflags"
2355 AC_CHECK_HEADERS(mono/jit/jit.h mono/metadata/object.h,,
2356 [with_libmono="no (missing header file)"])
2359 CPPFLAGS="$SAVE_CPPFLAGS"
2360 CFLAGS="$SAVE_CFLAGS"
2363 if test "x$with_libmono" = "xyes"
2365 SAVE_LDFLAGS="$LDFLAGS"
2367 LDFLAGS="$LDFLAGS $with_libmono_ldflags"
2368 LIBS="$LIBS $with_libmono_libs"
2370 AC_CHECK_FUNC(mono_domain_assembly_open,
2371 [with_libmono="yes"],
2372 [with_libmono="no (symbol 'mono_domain_assembly_open' not found)"])
2374 LDFLAGS="$SAVE_LDFLAGS"
2378 if test "x$with_libmono" = "xyes"
2380 BUILD_WITH_LIBMONO_CPPFLAGS="$with_libmono_cppflags"
2381 BUILD_WITH_LIBMONO_CFLAGS="$with_libmono_cflags"
2382 BUILD_WITH_LIBMONO_LDFLAGS="$with_libmono_ldflags"
2383 BUILD_WITH_LIBMONO_LIBS="$with_libmono_libs"
2384 AC_SUBST(BUILD_WITH_LIBMONO_CPPFLAGS)
2385 AC_SUBST(BUILD_WITH_LIBMONO_CFLAGS)
2386 AC_SUBST(BUILD_WITH_LIBMONO_LDFLAGS)
2387 AC_SUBST(BUILD_WITH_LIBMONO_LIBS)
2389 AM_CONDITIONAL(BUILD_WITH_LIBMONO, test "x$with_libmono" = "xyes")
2392 # --with-libmysql {{{
2393 with_mysql_config="mysql_config"
2394 with_mysql_cflags=""
2396 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2398 if test "x$withval" = "xno"
2401 else if test "x$withval" = "xyes"
2405 if test -f "$withval" && test -x "$withval";
2407 with_mysql_config="$withval"
2408 else if test -x "$withval/bin/mysql_config"
2410 with_mysql_config="$withval/bin/mysql_config"
2418 if test "x$with_libmysql" = "xyes"
2420 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2421 mysql_config_status=$?
2423 if test $mysql_config_status -ne 0
2425 with_libmysql="no ($with_mysql_config failed)"
2427 SAVE_CPPFLAGS="$CPPFLAGS"
2428 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2431 have_mysql_mysql_h="no"
2432 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2434 if test "x$have_mysql_h" = "xno"
2436 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2439 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2441 with_libmysql="no (mysql.h not found)"
2444 CPPFLAGS="$SAVE_CPPFLAGS"
2447 if test "x$with_libmysql" = "xyes"
2449 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2450 mysql_config_status=$?
2452 if test $mysql_config_status -ne 0
2454 with_libmysql="no ($with_mysql_config failed)"
2456 AC_CHECK_LIB(mysqlclient, mysql_init,
2457 [with_libmysql="yes"],
2458 [with_libmysql="no (symbol 'mysql_init' not found)"],
2461 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2462 [with_libmysql="yes"],
2463 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2467 if test "x$with_libmysql" = "xyes"
2469 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2470 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2471 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2472 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2474 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2477 # --with-libnetlink {{{
2478 with_libnetlink_cflags=""
2479 with_libnetlink_libs="-lnetlink"
2480 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2482 echo "libnetlink: withval = $withval"
2483 if test "x$withval" = "xyes"
2485 with_libnetlink="yes"
2486 else if test "x$withval" = "xno"
2488 with_libnetlink="no"
2490 if test -d "$withval/include"
2492 with_libnetlink_cflags="-I$withval/include"
2493 with_libnetlink_libs="-L$withval/lib -lnetlink"
2494 with_libnetlink="yes"
2496 AC_MSG_ERROR("no such directory: $withval/include")
2501 if test "x$ac_system" = "xLinux"
2503 with_libnetlink="yes"
2505 with_libnetlink="no (Linux only library)"
2508 if test "x$with_libnetlink" = "xyes"
2510 SAVE_CFLAGS="$CFLAGS"
2511 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2513 with_libnetlink="no (libnetlink.h not found)"
2515 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2517 with_libnetlink="yes"
2521 #include <sys/types.h>
2522 #include <asm/types.h>
2523 #include <sys/socket.h>
2524 #include <linux/netlink.h>
2525 #include <linux/rtnetlink.h>])
2526 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2528 #include <sys/types.h>
2529 #include <asm/types.h>
2530 #include <sys/socket.h>])
2534 #include <sys/types.h>
2535 #include <asm/types.h>
2536 #include <sys/socket.h>
2537 #include <linux/netlink.h>
2538 #include <linux/rtnetlink.h>
2542 int retval = TCA_STATS2;
2545 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2550 #include <sys/types.h>
2551 #include <asm/types.h>
2552 #include <sys/socket.h>
2553 #include <linux/netlink.h>
2554 #include <linux/rtnetlink.h>
2558 int retval = TCA_STATS;
2561 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2564 CFLAGS="$SAVE_CFLAGS"
2566 if test "x$with_libnetlink" = "xyes"
2568 AC_CHECK_LIB(netlink, rtnl_open,
2569 [with_libnetlink="yes"],
2570 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2571 [$with_libnetlink_libs])
2573 if test "x$with_libnetlink" = "xyes"
2575 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2576 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2577 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2578 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2580 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2583 # --with-libnetapp {{{
2584 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2585 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2586 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2587 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2588 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2589 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2590 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2592 if test -d "$withval"
2594 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2595 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2596 with_libnetapp="yes"
2598 with_libnetapp="$withval"
2602 with_libnetapp="yes"
2605 SAVE_CPPFLAGS="$CPPFLAGS"
2606 SAVE_LDFLAGS="$LDFLAGS"
2607 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2608 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2610 if test "x$with_libnetapp" = "xyes"
2612 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2614 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2616 AC_CHECK_HEADERS(netapp_api.h,
2617 [with_libnetapp="yes"],
2618 [with_libnetapp="no (netapp_api.h not found)"])
2621 if test "x$with_libnetapp" = "xyes"
2623 if test "x$LIBNETAPP_LDFLAGS" != "x"
2625 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2628 if test "x$LIBNETAPP_LIBS" = "x"
2630 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2632 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2634 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2635 [with_libnetapp="yes"],
2636 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2638 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2641 CPPFLAGS="$SAVE_CPPFLAGS"
2642 LDFLAGS="$SAVE_LDFLAGS"
2644 if test "x$with_libnetapp" = "xyes"
2646 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2649 AC_SUBST(LIBNETAPP_CPPFLAGS)
2650 AC_SUBST(LIBNETAPP_LDFLAGS)
2651 AC_SUBST(LIBNETAPP_LIBS)
2652 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2655 # --with-libnetsnmp {{{
2656 with_snmp_config="net-snmp-config"
2659 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2661 if test "x$withval" = "xno"
2663 with_libnetsnmp="no"
2664 else if test "x$withval" = "xyes"
2666 with_libnetsnmp="yes"
2668 if test -x "$withval"
2670 with_snmp_config="$withval"
2671 with_libnetsnmp="yes"
2673 with_snmp_config="$withval/bin/net-snmp-config"
2674 with_libnetsnmp="yes"
2678 [with_libnetsnmp="yes"])
2679 if test "x$with_libnetsnmp" = "xyes"
2681 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2682 snmp_config_status=$?
2684 if test $snmp_config_status -ne 0
2686 with_libnetsnmp="no ($with_snmp_config failed)"
2688 SAVE_CPPFLAGS="$CPPFLAGS"
2689 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2691 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2693 CPPFLAGS="$SAVE_CPPFLAGS"
2696 if test "x$with_libnetsnmp" = "xyes"
2698 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2699 snmp_config_status=$?
2701 if test $snmp_config_status -ne 0
2703 with_libnetsnmp="no ($with_snmp_config failed)"
2705 AC_CHECK_LIB(netsnmp, init_snmp,
2706 [with_libnetsnmp="yes"],
2707 [with_libnetsnmp="no (libnetsnmp not found)"],
2711 if test "x$with_libnetsnmp" = "xyes"
2713 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2714 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2715 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2716 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2718 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2721 # --with-liboconfig {{{
2722 with_own_liboconfig="no"
2723 liboconfig_LDFLAGS="$LDFLAGS"
2724 liboconfig_CPPFLAGS="$CPPFLAGS"
2725 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2727 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2729 if test -d "$withval/lib"
2731 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2733 if test -d "$withval/include"
2735 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2738 if test "x$withval" = "xno"
2740 AC_MSG_ERROR("liboconfig is required")
2744 with_liboconfig="yes"
2747 save_LDFLAGS="$LDFLAGS"
2748 save_CPPFLAGS="$CPPFLAGS"
2749 LDFLAGS="$liboconfig_LDFLAGS"
2750 CPPFLAGS="$liboconfig_CPPFLAGS"
2751 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2753 with_liboconfig="yes"
2754 with_own_liboconfig="no"
2757 with_liboconfig="yes"
2758 with_own_liboconfig="yes"
2759 LDFLAGS="$save_LDFLAGS"
2760 CPPFLAGS="$save_CPPFLAGS"
2763 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2764 if test "x$with_own_liboconfig" = "xyes"
2766 with_liboconfig="yes (shipped version)"
2770 # --with-liboping {{{
2771 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2773 if test "x$withval" = "xyes"
2776 else if test "x$withval" = "xno"
2781 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2782 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2785 [with_liboping="yes"])
2787 SAVE_CPPFLAGS="$CPPFLAGS"
2788 SAVE_LDFLAGS="$LDFLAGS"
2790 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2791 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2793 if test "x$with_liboping" = "xyes"
2795 if test "x$LIBOPING_CPPFLAGS" != "x"
2797 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2799 AC_CHECK_HEADERS(oping.h,
2800 [with_liboping="yes"],
2801 [with_liboping="no (oping.h not found)"])
2803 if test "x$with_liboping" = "xyes"
2805 if test "x$LIBOPING_LDFLAGS" != "x"
2807 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2809 AC_CHECK_LIB(oping, ping_construct,
2810 [with_liboping="yes"],
2811 [with_liboping="no (symbol 'ping_construct' not found)"])
2814 CPPFLAGS="$SAVE_CPPFLAGS"
2815 LDFLAGS="$SAVE_LDFLAGS"
2817 if test "x$with_liboping" = "xyes"
2819 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2820 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2821 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2822 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2824 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2828 with_oracle_cppflags=""
2830 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2832 if test "x$withval" = "xyes"
2834 if test "x$ORACLE_HOME" = "x"
2836 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2839 else if test "x$withval" = "xno"
2844 ORACLE_HOME="$withval"
2848 if test "x$ORACLE_HOME" = "x"
2850 with_oracle="no (ORACLE_HOME is not set)"
2855 if test "x$ORACLE_HOME" != "x"
2857 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2859 if test -e "$ORACLE_HOME/lib/ldflags"
2861 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2863 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2864 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2866 if test "x$with_oracle" = "xyes"
2868 SAVE_CPPFLAGS="$CPPFLAGS"
2869 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2871 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2873 CPPFLAGS="$SAVE_CPPFLAGS"
2875 if test "x$with_oracle" = "xyes"
2877 SAVE_CPPFLAGS="$CPPFLAGS"
2878 SAVE_LDFLAGS="$LDFLAGS"
2879 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2880 LDFLAGS="$LDFLAGS $with_oracle_libs"
2882 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2884 CPPFLAGS="$SAVE_CPPFLAGS"
2885 LDFLAGS="$SAVE_LDFLAGS"
2887 if test "x$with_oracle" = "xyes"
2889 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2890 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2891 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2892 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2896 # --with-libowcapi {{{
2897 with_libowcapi_cppflags=""
2898 with_libowcapi_libs="-lowcapi"
2899 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2901 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2903 with_libowcapi_cppflags="-I$withval/include"
2904 with_libowcapi_libs="-L$withval/lib -lowcapi"
2905 with_libowcapi="yes"
2907 with_libowcapi="$withval"
2911 with_libowcapi="yes"
2913 if test "x$with_libowcapi" = "xyes"
2915 SAVE_CPPFLAGS="$CPPFLAGS"
2916 CPPFLAGS="$with_libowcapi_cppflags"
2918 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2920 CPPFLAGS="$SAVE_CPPFLAGS"
2922 if test "x$with_libowcapi" = "xyes"
2924 SAVE_LDFLAGS="$LDFLAGS"
2925 SAVE_CPPFLAGS="$CPPFLAGS"
2926 LDFLAGS="$with_libowcapi_libs"
2927 CPPFLAGS="$with_libowcapi_cppflags"
2929 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2931 LDFLAGS="$SAVE_LDFLAGS"
2932 CPPFLAGS="$SAVE_CPPFLAGS"
2934 if test "x$with_libowcapi" = "xyes"
2936 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2937 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2938 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2939 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2943 # --with-libpcap {{{
2944 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2946 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2948 LDFLAGS="$LDFLAGS -L$withval/lib"
2949 CPPFLAGS="$CPPFLAGS -I$withval/include"
2952 with_libpcap="$withval"
2958 if test "x$with_libpcap" = "xyes"
2960 AC_CHECK_LIB(pcap, pcap_open_live,
2962 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2963 ], [with_libpcap="no (libpcap not found)"])
2965 if test "x$with_libpcap" = "xyes"
2967 AC_CHECK_HEADERS(pcap.h,,
2968 [with_libpcap="no (pcap.h not found)"])
2970 if test "x$with_libpcap" = "xyes"
2972 AC_CHECK_HEADERS(pcap-bpf.h,,
2973 [with_libpcap="no (pcap-bpf.h not found)"])
2975 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2978 # --with-libperl {{{
2979 perl_interpreter="perl"
2980 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2982 if test -x "$withval"
2984 perl_interpreter="$withval"
2986 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2988 LDFLAGS="$LDFLAGS -L$withval/lib"
2989 CPPFLAGS="$CPPFLAGS -I$withval/include"
2990 perl_interpreter="$withval/bin/perl"
2993 with_libperl="$withval"
3000 AC_MSG_CHECKING([for perl])
3001 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3002 if test -x "$perl_interpreter"
3004 AC_MSG_RESULT([yes ($perl_interpreter)])
3010 AC_SUBST(PERL, "$perl_interpreter")
3012 if test "x$with_libperl" = "xyes" \
3013 && test -n "$perl_interpreter"
3015 SAVE_CFLAGS="$CFLAGS"
3016 SAVE_LDFLAGS="$LDFLAGS"
3017 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3018 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3019 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3020 CFLAGS="$CFLAGS $PERL_CFLAGS"
3021 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3023 AC_CACHE_CHECK([for libperl],
3024 [c_cv_have_libperl],
3028 #define PERL_NO_GET_CONTEXT
3035 load_module (PERL_LOADMOD_NOIMPORT,
3036 newSVpv ("Collectd::Plugin::FooBar", 24),
3039 [c_cv_have_libperl="yes"],
3040 [c_cv_have_libperl="no"]
3044 if test "x$c_cv_have_libperl" = "xyes"
3046 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3047 AC_SUBST(PERL_CFLAGS)
3048 AC_SUBST(PERL_LDFLAGS)
3053 CFLAGS="$SAVE_CFLAGS"
3054 LDFLAGS="$SAVE_LDFLAGS"
3055 else if test -z "$perl_interpreter"; then
3056 with_libperl="no (no perl interpreter found)"
3057 c_cv_have_libperl="no"
3059 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3061 if test "x$with_libperl" = "xyes"
3063 SAVE_CFLAGS="$CFLAGS"
3064 SAVE_LDFLAGS="$LDFLAGS"
3065 CFLAGS="$CFLAGS $PERL_CFLAGS"
3066 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3068 AC_CACHE_CHECK([if perl supports ithreads],
3069 [c_cv_have_perl_ithreads],
3077 #if !defined(USE_ITHREADS)
3078 # error "Perl does not support ithreads!"
3079 #endif /* !defined(USE_ITHREADS) */
3082 [c_cv_have_perl_ithreads="yes"],
3083 [c_cv_have_perl_ithreads="no"]
3087 if test "x$c_cv_have_perl_ithreads" = "xyes"
3089 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3092 CFLAGS="$SAVE_CFLAGS"
3093 LDFLAGS="$SAVE_LDFLAGS"
3096 if test "x$with_libperl" = "xyes"
3098 SAVE_CFLAGS="$CFLAGS"
3099 SAVE_LDFLAGS="$LDFLAGS"
3100 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3101 # (see issues #41 and #42)
3102 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3103 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3105 AC_CACHE_CHECK([for broken Perl_load_module()],
3106 [c_cv_have_broken_perl_load_module],
3110 #define PERL_NO_GET_CONTEXT
3117 load_module (PERL_LOADMOD_NOIMPORT,
3118 newSVpv ("Collectd::Plugin::FooBar", 24),
3121 [c_cv_have_broken_perl_load_module="no"],
3122 [c_cv_have_broken_perl_load_module="yes"]
3126 CFLAGS="$SAVE_CFLAGS"
3127 LDFLAGS="$SAVE_LDFLAGS"
3129 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3130 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3132 if test "x$with_libperl" = "xyes"
3134 SAVE_CFLAGS="$CFLAGS"
3135 SAVE_LDFLAGS="$LDFLAGS"
3136 CFLAGS="$CFLAGS $PERL_CFLAGS"
3137 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3140 [struct mgvtbl.svt_local],
3141 [have_struct_mgvtbl_svt_local="yes"],
3142 [have_struct_mgvtbl_svt_local="no"],
3149 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3151 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3152 [Define if Perl's struct mgvtbl has member svt_local.])
3155 CFLAGS="$SAVE_CFLAGS"
3156 LDFLAGS="$SAVE_LDFLAGS"
3161 with_pg_config="pg_config"
3162 with_libpq_includedir=""
3163 with_libpq_libdir=""
3164 with_libpq_cppflags=""
3165 with_libpq_ldflags=""
3166 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3169 if test "x$withval" = "xno"
3172 else if test "x$withval" = "xyes"
3176 if test -f "$withval" && test -x "$withval";
3178 with_pg_config="$withval"
3179 else if test -x "$withval/bin/pg_config"
3181 with_pg_config="$withval/bin/pg_config"
3189 if test "x$with_libpq" = "xyes"
3191 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3194 if test $pg_config_status -eq 0
3196 if test -n "$with_libpq_includedir"; then
3197 for dir in $with_libpq_includedir; do
3198 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3202 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3205 SAVE_CPPFLAGS="$CPPFLAGS"
3206 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3208 AC_CHECK_HEADERS(libpq-fe.h, [],
3209 [with_libpq="no (libpq-fe.h not found)"], [])
3211 CPPFLAGS="$SAVE_CPPFLAGS"
3213 if test "x$with_libpq" = "xyes"
3215 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3218 if test $pg_config_status -eq 0
3220 if test -n "$with_libpq_libdir"; then
3221 for dir in $with_libpq_libdir; do
3222 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3226 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3229 SAVE_LDFLAGS="$LDFLAGS"
3230 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3232 AC_CHECK_LIB(pq, PQconnectdb,
3234 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3236 AC_CHECK_LIB(pq, PQserverVersion,
3238 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3240 LDFLAGS="$SAVE_LDFLAGS"
3242 if test "x$with_libpq" = "xyes"
3244 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3245 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3246 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3247 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3249 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3252 # --with-libpthread {{{
3253 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3254 [ if test "x$withval" != "xno" \
3255 && test "x$withval" != "xyes"
3257 LDFLAGS="$LDFLAGS -L$withval/lib"
3258 CPPFLAGS="$CPPFLAGS -I$withval/include"
3259 with_libpthread="yes"
3261 if test "x$withval" = "xno"
3263 with_libpthread="no (disabled)"
3266 ], [with_libpthread="yes"])
3267 if test "x$with_libpthread" = "xyes"
3269 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3272 if test "x$with_libpthread" = "xyes"
3274 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3276 if test "x$with_libpthread" = "xyes"
3282 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3283 [Wether or not to use pthread (POSIX threads) library])
3284 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3289 with_python_path="$PATH"
3290 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3292 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3294 with_python="$withval"
3295 else if test -x "$withval"
3297 with_python_prog="$withval"
3298 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3300 else if test -d "$withval"
3302 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3305 AC_MSG_WARN([Argument not recognized: $withval])
3307 ], [with_python="yes"])
3310 SAVE_CPPFLAGS="$CPPFLAGS"
3311 SAVE_LDFLAGS="$LDFLAGS"
3314 PATH="$with_python_path"
3316 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3318 AC_MSG_CHECKING([for python])
3319 with_python_prog="`which python 2>/dev/null`"
3320 if test "x$with_python_prog" = "x"
3322 AC_MSG_RESULT([not found])
3323 with_python="no (interpreter not found)"
3325 AC_MSG_RESULT([$with_python_prog])
3329 if test "x$with_python" = "xyes"
3331 AC_MSG_CHECKING([for Python CPPFLAGS])
3332 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3333 python_config_status=$?
3335 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3337 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3340 AC_MSG_RESULT([$python_include_path])
3344 if test "x$with_python" = "xyes"
3346 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3347 AC_CHECK_HEADERS(Python.h,
3348 [with_python="yes"],
3349 [with_python="no ('Python.h' not found)"])
3352 if test "x$with_python" = "xyes"
3354 AC_MSG_CHECKING([for Python LDFLAGS])
3355 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`
3356 python_config_status=$?
3358 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3360 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3363 AC_MSG_RESULT([$python_library_path])
3367 if test "x$with_python" = "xyes"
3369 AC_MSG_CHECKING([for Python LIBS])
3370 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`
3371 python_config_status=$?
3373 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3375 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3378 AC_MSG_RESULT([$python_library_flags])
3382 if test "x$with_python" = "xyes"
3384 LDFLAGS="-L$python_library_path $LDFLAGS"
3385 LIBS="$python_library_flags $LIBS"
3387 AC_CHECK_FUNC(PyObject_CallFunction,
3388 [with_python="yes"],
3389 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3393 CPPFLAGS="$SAVE_CPPFLAGS"
3394 LDFLAGS="$SAVE_LDFLAGS"
3397 if test "x$with_python" = "xyes"
3399 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3400 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3401 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3402 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3403 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3404 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3408 # --with-librabbitmq {{{
3409 with_librabbitmq_cppflags=""
3410 with_librabbitmq_ldflags=""
3411 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3413 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3415 with_librabbitmq_cppflags="-I$withval/include"
3416 with_librabbitmq_ldflags="-L$withval/lib"
3417 with_librabbitmq="yes"
3419 with_librabbitmq="$withval"
3423 with_librabbitmq="yes"
3425 SAVE_CPPFLAGS="$CPPFLAGS"
3426 SAVE_LDFLAGS="$LDFLAGS"
3427 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3428 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3429 if test "x$with_librabbitmq" = "xyes"
3431 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3433 if test "x$with_librabbitmq" = "xyes"
3435 # librabbitmq up to version 0.9.1 provides "library_errno", later
3436 # versions use "library_error". The library does not provide a version
3437 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3438 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3441 # include <stdlib.h>
3447 # include <stdint.h>
3450 # include <inttypes.h>
3455 if test "x$with_librabbitmq" = "xyes"
3457 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3459 if test "x$with_librabbitmq" = "xyes"
3461 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3462 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3463 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3464 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3465 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3466 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3467 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3469 CPPFLAGS="$SAVE_CPPFLAGS"
3470 LDFLAGS="$SAVE_LDFLAGS"
3471 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3474 # --with-librouteros {{{
3475 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3477 if test "x$withval" = "xyes"
3479 with_librouteros="yes"
3480 else if test "x$withval" = "xno"
3482 with_librouteros="no"
3484 with_librouteros="yes"
3485 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3486 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3489 [with_librouteros="yes"])
3491 SAVE_CPPFLAGS="$CPPFLAGS"
3492 SAVE_LDFLAGS="$LDFLAGS"
3494 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3495 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3497 if test "x$with_librouteros" = "xyes"
3499 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3501 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3503 AC_CHECK_HEADERS(routeros_api.h,
3504 [with_librouteros="yes"],
3505 [with_librouteros="no (routeros_api.h not found)"])
3507 if test "x$with_librouteros" = "xyes"
3509 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3511 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3513 AC_CHECK_LIB(routeros, ros_interface,
3514 [with_librouteros="yes"],
3515 [with_librouteros="no (symbol 'ros_interface' not found)"])
3518 CPPFLAGS="$SAVE_CPPFLAGS"
3519 LDFLAGS="$SAVE_LDFLAGS"
3521 if test "x$with_librouteros" = "xyes"
3523 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3524 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3525 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3526 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3528 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3532 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3535 librrd_threadsafe="yes"
3536 librrd_rrdc_update="no"
3537 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3538 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3540 librrd_cflags="-I$withval/include"
3541 librrd_ldflags="-L$withval/lib"
3544 with_librrd="$withval"
3546 ], [with_librrd="yes"])
3547 if test "x$with_librrd" = "xyes"
3549 SAVE_CPPFLAGS="$CPPFLAGS"
3550 SAVE_LDFLAGS="$LDFLAGS"
3552 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3553 LDFLAGS="$LDFLAGS $librrd_ldflags"
3555 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3557 CPPFLAGS="$SAVE_CPPFLAGS"
3558 LDFLAGS="$SAVE_LDFLAGS"
3560 if test "x$with_librrd" = "xyes"
3562 SAVE_CPPFLAGS="$CPPFLAGS"
3563 SAVE_LDFLAGS="$LDFLAGS"
3565 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3566 LDFLAGS="$LDFLAGS $librrd_ldflags"
3568 AC_CHECK_LIB(rrd_th, rrd_update_r,
3570 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3572 [librrd_threadsafe="no"
3573 AC_CHECK_LIB(rrd, rrd_update,
3575 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3577 [with_librrd="no (symbol 'rrd_update' not found)"],
3582 if test "x$librrd_threadsafe" = "xyes"
3584 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3586 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3589 CPPFLAGS="$SAVE_CPPFLAGS"
3590 LDFLAGS="$SAVE_LDFLAGS"
3592 if test "x$with_librrd" = "xyes"
3594 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3595 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3596 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3597 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3599 if test "x$librrd_threadsafe" = "xyes"
3601 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3605 # --with-libsensors {{{
3606 with_sensors_cflags=""
3607 with_sensors_ldflags=""
3608 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3610 if test "x$withval" = "xno"
3612 with_libsensors="no"
3614 with_libsensors="yes"
3615 if test "x$withval" != "xyes"
3617 with_sensors_cflags="-I$withval/include"
3618 with_sensors_ldflags="-L$withval/lib"
3619 with_libsensors="yes"
3624 if test "x$ac_system" = "xLinux"
3626 with_libsensors="yes"
3628 with_libsensors="no (Linux only library)"
3631 if test "x$with_libsensors" = "xyes"
3633 SAVE_CPPFLAGS="$CPPFLAGS"
3634 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3636 # AC_CHECK_HEADERS(sensors/sensors.h,
3638 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3640 # [with_libsensors="no (sensors/sensors.h not found)"])
3641 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3643 CPPFLAGS="$SAVE_CPPFLAGS"
3645 if test "x$with_libsensors" = "xyes"
3647 SAVE_CPPFLAGS="$CPPFLAGS"
3648 SAVE_LDFLAGS="$LDFLAGS"
3649 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3650 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3652 AC_CHECK_LIB(sensors, sensors_init,
3654 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3656 [with_libsensors="no (libsensors not found)"])
3658 CPPFLAGS="$SAVE_CPPFLAGS"
3659 LDFLAGS="$SAVE_LDFLAGS"
3661 if test "x$with_libsensors" = "xyes"
3663 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3664 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3665 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3666 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3668 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3671 # --with-libstatgrab {{{
3672 with_libstatgrab_cflags=""
3673 with_libstatgrab_ldflags=""
3674 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3676 if test "x$withval" != "xno" \
3677 && test "x$withval" != "xyes"
3679 with_libstatgrab_cflags="-I$withval/include"
3680 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3681 with_libstatgrab="yes"
3682 with_libstatgrab_pkg_config="no"
3684 with_libstatgrab="$withval"
3685 with_libstatgrab_pkg_config="yes"
3689 with_libstatgrab="yes"
3690 with_libstatgrab_pkg_config="yes"
3693 if test "x$with_libstatgrab" = "xyes" \
3694 && test "x$with_libstatgrab_pkg_config" = "xyes"
3696 if test "x$PKG_CONFIG" != "x"
3698 AC_MSG_CHECKING([pkg-config for libstatgrab])
3700 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3703 with_libstatgrab_pkg_config="no"
3704 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3705 temp_result="not found"
3707 AC_MSG_RESULT([$temp_result])
3709 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3710 with_libstatgrab_pkg_config="no"
3711 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3715 if test "x$with_libstatgrab" = "xyes" \
3716 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3717 && test "x$with_libstatgrab_cflags" = "x"
3719 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3720 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3723 with_libstatgrab_cflags="$temp_result"
3725 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3726 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3728 AC_MSG_RESULT([$temp_result])
3731 if test "x$with_libstatgrab" = "xyes" \
3732 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3733 && test "x$with_libstatgrab_ldflags" = "x"
3735 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3736 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3739 with_libstatgrab_ldflags="$temp_result"
3741 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3742 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3744 AC_MSG_RESULT([$temp_result])
3747 if test "x$with_libstatgrab" = "xyes"
3749 SAVE_CPPFLAGS="$CPPFLAGS"
3750 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3752 AC_CHECK_HEADERS(statgrab.h,
3753 [with_libstatgrab="yes"],
3754 [with_libstatgrab="no (statgrab.h not found)"])
3756 CPPFLAGS="$SAVE_CPPFLAGS"
3759 if test "x$with_libstatgrab" = "xyes"
3761 SAVE_CFLAGS="$CFLAGS"
3762 SAVE_LDFLAGS="$LDFLAGS"
3764 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3765 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3767 AC_CHECK_LIB(statgrab, sg_init,
3768 [with_libstatgrab="yes"],
3769 [with_libstatgrab="no (symbol sg_init not found)"])
3771 CFLAGS="$SAVE_CFLAGS"
3772 LDFLAGS="$SAVE_LDFLAGS"
3775 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3776 if test "x$with_libstatgrab" = "xyes"
3778 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3779 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3780 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3781 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3782 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3786 # --with-libtokyotyrant {{{
3787 with_libtokyotyrant_cppflags=""
3788 with_libtokyotyrant_ldflags=""
3789 with_libtokyotyrant_libs=""
3790 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3792 if test "x$withval" = "xno"
3794 with_libtokyotyrant="no"
3795 else if test "x$withval" = "xyes"
3797 with_libtokyotyrant="yes"
3799 with_libtokyotyrant_cppflags="-I$withval/include"
3800 with_libtokyotyrant_ldflags="-L$withval/include"
3801 with_libtokyotyrant_libs="-ltokyotyrant"
3802 with_libtokyotyrant="yes"
3806 with_libtokyotyrant="yes"
3809 if test "x$with_libtokyotyrant" = "xyes"
3811 if $PKG_CONFIG --exists tokyotyrant
3813 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3814 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3815 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3819 SAVE_CPPFLAGS="$CPPFLAGS"
3820 SAVE_LDFLAGS="$LDFLAGS"
3821 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3822 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3824 if test "x$with_libtokyotyrant" = "xyes"
3826 AC_CHECK_HEADERS(tcrdb.h,
3828 AC_DEFINE(HAVE_TCRDB_H, 1,
3829 [Define to 1 if you have the <tcrdb.h> header file.])
3830 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3833 if test "x$with_libtokyotyrant" = "xyes"
3835 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3837 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3838 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3840 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3841 [$with_libtokyotyrant_libs])
3844 CPPFLAGS="$SAVE_CPPFLAGS"
3845 LDFLAGS="$SAVE_LDFLAGS"
3847 if test "x$with_libtokyotyrant" = "xyes"
3849 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3850 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3851 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3852 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3853 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3854 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3856 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3859 # --with-libupsclient {{{
3860 with_libupsclient_config=""
3861 with_libupsclient_cflags=""
3862 with_libupsclient_libs=""
3863 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3865 if test "x$withval" = "xno"
3867 with_libupsclient="no"
3868 else if test "x$withval" = "xyes"
3870 with_libupsclient="use_pkgconfig"
3872 if test -x "$withval"
3874 with_libupsclient_config="$withval"
3875 with_libupsclient="use_libupsclient_config"
3876 else if test -x "$withval/bin/libupsclient-config"
3878 with_libupsclient_config="$withval/bin/libupsclient-config"
3879 with_libupsclient="use_libupsclient_config"
3881 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3882 with_libupsclient_cflags="-I$withval/include"
3883 with_libupsclient_libs="-L$withval/lib -lupsclient"
3884 with_libupsclient="yes"
3888 [with_libupsclient="use_pkgconfig"])
3890 # configure using libupsclient-config
3891 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3893 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3894 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3897 with_libupsclient="no ($with_libupsclient_config failed)"
3899 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3902 with_libupsclient="no ($with_libupsclient_config failed)"
3905 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3907 with_libupsclient="yes"
3910 # configure using pkg-config
3911 if test "x$with_libupsclient" = "xuse_pkgconfig"
3913 if test "x$PKG_CONFIG" = "x"
3915 with_libupsclient="no (Don't have pkg-config)"
3918 if test "x$with_libupsclient" = "xuse_pkgconfig"
3920 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3921 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3924 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3927 if test "x$with_libupsclient" = "xuse_pkgconfig"
3929 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3932 with_libupsclient="no ($PKG_CONFIG failed)"
3934 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3937 with_libupsclient="no ($PKG_CONFIG failed)"
3940 if test "x$with_libupsclient" = "xuse_pkgconfig"
3942 with_libupsclient="yes"
3945 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3946 # the actual checks.
3947 if test "x$with_libupsclient" = "xyes"
3949 SAVE_CPPFLAGS="$CPPFLAGS"
3950 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3952 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3954 CPPFLAGS="$SAVE_CPPFLAGS"
3956 if test "x$with_libupsclient" = "xyes"
3958 SAVE_CPPFLAGS="$CPPFLAGS"
3959 SAVE_LDFLAGS="$LDFLAGS"
3961 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3962 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3964 AC_CHECK_LIB(upsclient, upscli_connect,
3965 [with_libupsclient="yes"],
3966 [with_libupsclient="no (symbol upscli_connect not found)"])
3968 CPPFLAGS="$SAVE_CPPFLAGS"
3969 LDFLAGS="$SAVE_LDFLAGS"
3971 if test "x$with_libupsclient" = "xyes"
3973 SAVE_CPPFLAGS="$CPPFLAGS"
3974 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3976 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3977 [#include <stdlib.h>
3979 #include <upsclient.h>])
3981 CPPFLAGS="$SAVE_CPPFLAGS"
3983 if test "x$with_libupsclient" = "xyes"
3985 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3986 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3987 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3988 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3992 # --with-libxmms {{{
3993 with_xmms_config="xmms-config"
3996 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3998 if test "x$withval" != "xno" \
3999 && test "x$withval" != "xyes"
4001 if test -f "$withval" && test -x "$withval";
4003 with_xmms_config="$withval"
4004 else if test -x "$withval/bin/xmms-config"
4006 with_xmms_config="$withval/bin/xmms-config"
4009 else if test "x$withval" = "xno"
4019 if test "x$with_libxmms" = "xyes"
4021 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4022 xmms_config_status=$?
4024 if test $xmms_config_status -ne 0
4029 if test "x$with_libxmms" = "xyes"
4031 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4032 xmms_config_status=$?
4034 if test $xmms_config_status -ne 0
4039 if test "x$with_libxmms" = "xyes"
4041 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4043 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4044 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4045 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4046 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4053 with_libxmms_numeric=0
4054 if test "x$with_libxmms" = "xyes"
4056 with_libxmms_numeric=1
4058 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4059 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4062 # --with-libyajl {{{
4063 with_libyajl_cppflags=""
4064 with_libyajl_ldflags=""
4065 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4067 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4069 with_libyajl_cppflags="-I$withval/include"
4070 with_libyajl_ldflags="-L$withval/lib"
4073 with_libyajl="$withval"
4079 if test "x$with_libyajl" = "xyes"
4081 SAVE_CPPFLAGS="$CPPFLAGS"
4082 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4084 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4085 AC_CHECK_HEADERS(yajl/yajl_version.h)
4087 CPPFLAGS="$SAVE_CPPFLAGS"
4089 if test "x$with_libyajl" = "xyes"
4091 SAVE_CPPFLAGS="$CPPFLAGS"
4092 SAVE_LDFLAGS="$LDFLAGS"
4093 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4094 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4096 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4098 CPPFLAGS="$SAVE_CPPFLAGS"
4099 LDFLAGS="$SAVE_LDFLAGS"
4101 if test "x$with_libyajl" = "xyes"
4103 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4104 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4105 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4106 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4107 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4108 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4109 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4111 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4114 # --with-libvarnish {{{
4115 with_libvarnish_cppflags=""
4116 with_libvarnish_cflags=""
4117 with_libvarnish_libs=""
4118 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4120 if test "x$withval" = "xno"
4122 with_libvarnish="no"
4123 else if test "x$withval" = "xyes"
4125 with_libvarnish="use_pkgconfig"
4126 else if test -d "$with_libvarnish/lib"
4128 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4129 with_libvarnish_cflags="-I$withval/include"
4130 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
4131 with_libvarnish="yes"
4134 [with_libvarnish="use_pkgconfig"])
4136 # configure using pkg-config
4137 if test "x$with_libvarnish" = "xuse_pkgconfig"
4139 if test "x$PKG_CONFIG" = "x"
4141 with_libvarnish="no (Don't have pkg-config)"
4144 if test "x$with_libvarnish" = "xuse_pkgconfig"
4146 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4147 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4150 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4153 if test "x$with_libvarnish" = "xuse_pkgconfig"
4155 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4158 with_libvarnish="no ($PKG_CONFIG failed)"
4160 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4163 with_libvarnish="no ($PKG_CONFIG failed)"
4166 if test "x$with_libvarnish" = "xuse_pkgconfig"
4168 with_libvarnish="yes"
4171 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4172 # the actual checks.
4173 if test "x$with_libvarnish" = "xyes"
4175 SAVE_CPPFLAGS="$CPPFLAGS"
4176 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4177 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4179 CPPFLAGS="$SAVE_CPPFLAGS"
4181 if test "x$with_libvarnish" = "xyes"
4183 SAVE_CPPFLAGS="$CPPFLAGS"
4184 #SAVE_LDFLAGS="$LDFLAGS"
4186 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4187 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4189 AC_CHECK_HEADERS(varnish/vsc.h,
4190 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4191 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4193 CPPFLAGS="$SAVE_CPPFLAGS"
4194 #LDFLAGS="$SAVE_LDFLAGS"
4196 if test "x$with_libvarnish" = "xyes"
4198 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4199 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4200 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4201 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4205 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4206 with_libxml2="no (pkg-config isn't available)"
4207 with_libxml2_cflags=""
4208 with_libxml2_ldflags=""
4209 with_libvirt="no (pkg-config isn't available)"
4210 with_libvirt_cflags=""
4211 with_libvirt_ldflags=""
4212 if test "x$PKG_CONFIG" != "x"
4214 pkg-config --exists 'libxml-2.0' 2>/dev/null
4219 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4222 pkg-config --exists libvirt 2>/dev/null
4227 with_libvirt="no (pkg-config doesn't know libvirt)"
4230 if test "x$with_libxml2" = "xyes"
4232 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4237 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4243 if test "x$with_libxml2" = "xyes"
4245 SAVE_CPPFLAGS="$CPPFLAGS"
4246 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4248 AC_CHECK_HEADERS(libxml/parser.h, [],
4249 [with_libxml2="no (libxml/parser.h not found)"])
4251 CPPFLAGS="$SAVE_CPPFLAGS"
4253 if test "x$with_libxml2" = "xyes"
4255 SAVE_CFLAGS="$CFLAGS"
4256 SAVE_LDFLAGS="$LDFLAGS"
4258 CFLAGS="$CFLAGS $with_libxml2_cflags"
4259 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4261 AC_CHECK_LIB(xml2, xmlXPathEval,
4262 [with_libxml2="yes"],
4263 [with_libxml2="no (symbol xmlXPathEval not found)"])
4265 CFLAGS="$SAVE_CFLAGS"
4266 LDFLAGS="$SAVE_LDFLAGS"
4268 dnl Add the right compiler flags and libraries.
4269 if test "x$with_libxml2" = "xyes"; then
4270 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4271 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4272 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4273 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4275 if test "x$with_libvirt" = "xyes"
4277 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4282 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4288 if test "x$with_libvirt" = "xyes"
4290 SAVE_CPPFLAGS="$CPPFLAGS"
4291 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4293 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4294 [with_libvirt="no (libvirt/libvirt.h not found)"])
4296 CPPFLAGS="$SAVE_CPPFLAGS"
4298 if test "x$with_libvirt" = "xyes"
4300 SAVE_CFLAGS="$CFLAGS"
4301 SAVE_LDFLAGS="$LDFLAGS"
4303 CFLAGS="$CFLAGS $with_libvirt_cflags"
4304 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4306 AC_CHECK_LIB(virt, virDomainBlockStats,
4307 [with_libvirt="yes"],
4308 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4310 CFLAGS="$SAVE_CFLAGS"
4311 LDFLAGS="$SAVE_LDFLAGS"
4313 dnl Add the right compiler flags and libraries.
4314 if test "x$with_libvirt" = "xyes"; then
4315 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4316 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4317 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4318 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4322 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4323 with_libopenipmipthread="yes"
4324 with_libopenipmipthread_cflags=""
4325 with_libopenipmipthread_libs=""
4327 AC_MSG_CHECKING([for pkg-config])
4329 if test "x$PKG_CONFIG" = "x"
4331 with_libopenipmipthread="no"
4334 temp_result="$PKG_CONFIG"
4336 AC_MSG_RESULT([$temp_result])
4338 if test "x$with_libopenipmipthread" = "xyes"
4340 AC_MSG_CHECKING([for libOpenIPMIpthread])
4341 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4344 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4346 AC_MSG_RESULT([$with_libopenipmipthread])
4349 if test "x$with_libopenipmipthread" = "xyes"
4351 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4352 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4355 with_libopenipmipthread_cflags="$temp_result"
4357 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4358 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4360 AC_MSG_RESULT([$temp_result])
4363 if test "x$with_libopenipmipthread" = "xyes"
4365 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4366 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4369 with_libopenipmipthread_ldflags="$temp_result"
4371 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4372 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4374 AC_MSG_RESULT([$temp_result])
4377 if test "x$with_libopenipmipthread" = "xyes"
4379 SAVE_CPPFLAGS="$CPPFLAGS"
4380 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4382 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4383 [with_libopenipmipthread="yes"],
4384 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4385 [#include <OpenIPMI/ipmiif.h>
4386 #include <OpenIPMI/ipmi_err.h>
4387 #include <OpenIPMI/ipmi_posix.h>
4388 #include <OpenIPMI/ipmi_conn.h>
4391 CPPFLAGS="$SAVE_CPPFLAGS"
4394 if test "x$with_libopenipmipthread" = "xyes"
4396 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4397 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4398 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4399 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4403 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4404 [with_libnotify="yes"],
4405 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4408 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4411 # Check for enabled/disabled features
4414 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4415 # ------------------------------------------------------------
4417 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4422 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4427 m4_define([EnDis],[disabled])dnl
4428 m4_define([YesNo],[no])dnl
4434 m4_define([EnDis],[enabled])dnl
4435 m4_define([YesNo],[yes])dnl
4438 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4442 m4_if([$3], [feature], [],
4446 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4452 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4454 enable_$1='[YesNo]'dnl
4456 if test "x$enable_$1" = "xno"
4460 if test "x$enable_$1" = "xyes"
4464 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4469 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4470 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4472 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4474 # AC_PLUGIN(name, default, info)
4475 # ------------------------------------------------------------
4482 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4484 if test "x$enableval" = "xyes"
4487 else if test "x$enableval" = "xforce"
4492 enable_plugin="no (disabled on command line)"
4496 if test "x$enable_all_plugins" = "xauto"
4498 if test "x$2" = "xyes"
4505 enable_plugin="$enable_all_plugins"
4508 if test "x$enable_plugin" = "xyes"
4510 if test "x$2" = "xyes" || test "x$force" = "xyes"
4512 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4513 if test "x$2" != "xyes"
4515 dependency_warning="yes"
4517 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4518 dependency_error="yes"
4519 enable_plugin="no (dependency error)"
4522 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4523 enable_$1="$enable_plugin"
4525 )# AC_PLUGIN(name, default, info)
4527 m4_divert_once([HELP_ENABLE], [
4528 collectd features:])
4529 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4530 AC_COLLECTD([debug], [enable], [feature], [debugging])
4531 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4532 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4534 dependency_warning="no"
4535 dependency_error="no"
4540 plugin_conntrack="no"
4541 plugin_contextswitch="no"
4544 plugin_curl_json="no"
4545 plugin_curl_xml="no"
4551 plugin_interface="no"
4558 plugin_multimeter="no"
4562 plugin_processes="no"
4563 plugin_protocols="no"
4567 plugin_tcpconns="no"
4574 plugin_wireless="no"
4578 if test "x$ac_system" = "xLinux"
4580 plugin_battery="yes"
4581 plugin_conntrack="yes"
4582 plugin_contextswitch="yes"
4584 plugin_cpufreq="yes"
4586 plugin_entropy="yes"
4587 plugin_fscache="yes"
4588 plugin_interface="yes"
4594 plugin_processes="yes"
4595 plugin_protocols="yes"
4598 plugin_tcpconns="yes"
4599 plugin_thermal="yes"
4602 plugin_vserver="yes"
4603 plugin_wireless="yes"
4605 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4611 if test "x$ac_system" = "xOpenBSD"
4613 plugin_tcpconns="yes"
4617 if test "x$with_libiokit" = "xyes"
4619 plugin_battery="yes"
4625 if test "x$ac_system" = "xAIX"
4627 plugin_tcpconns="yes"
4630 if test "x$with_perfstat" = "xyes"
4636 plugin_interface="yes"
4640 if test "x$with_procinfo" = "xyes"
4642 plugin_processes="yes"
4646 if test "x$with_kstat" = "xyes"
4650 plugin_zfs_arc="yes"
4653 if test "x$with_devinfo$with_kstat" = "xyesyes"
4657 plugin_interface="yes"
4663 if test "x$with_libstatgrab" = "xyes"
4667 plugin_interface="yes"
4674 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4677 if test "x$have_strptime" = "xyes"
4683 if test "x$with_libopenipmipthread" = "xyes"
4688 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4690 plugin_curl_json="yes"
4693 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4695 plugin_curl_xml="yes"
4698 if test "x$have_processor_info" = "xyes"
4702 if test "x$have_sysctl" = "xyes"
4707 if test "x$ac_system" = "xDarwin"
4712 if test "x$have_sysctlbyname" = "xyes"
4714 plugin_contextswitch="yes"
4717 plugin_tcpconns="yes"
4720 # Df plugin: Check if we know how to determine mount points first.
4721 #if test "x$have_listmntent" = "xyes"; then
4724 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4728 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4732 #if test "x$have_getmntent" = "xseq"
4736 if test "x$c_cv_have_one_getmntent" = "xyes"
4741 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4742 if test "x$plugin_df" = "xyes"
4745 if test "x$have_statfs" = "xyes"
4749 if test "x$have_statvfs" = "xyes"
4755 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
4757 plugin_ethstat="yes"
4760 if test "x$have_getifaddrs" = "xyes"
4762 plugin_interface="yes"
4765 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4767 plugin_libvirt="yes"
4770 if test "x$have_getloadavg" = "xyes"
4775 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4780 # Mac OS X memory interface
4781 if test "x$have_host_statistics" = "xyes"
4786 if test "x$have_termios_h" = "xyes"
4788 plugin_multimeter="yes"
4792 if test "x$have_thread_info" = "xyes"
4794 plugin_processes="yes"
4797 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4799 plugin_processes="yes"
4802 if test "x$with_kvm_getswapinfo" = "xyes"
4807 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4812 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4814 plugin_tcpconns="yes"
4817 if test "x$have_getutent" = "xyes"
4821 if test "x$have_getutxent" = "xyes"
4826 m4_divert_once([HELP_ENABLE], [
4829 AC_ARG_ENABLE([all-plugins],
4830 AC_HELP_STRING([--enable-all-plugins],
4831 [enable all plugins (auto by def)]),
4833 if test "x$enableval" = "xyes"
4835 enable_all_plugins="yes"
4836 else if test "x$enableval" = "xauto"
4838 enable_all_plugins="auto"
4840 enable_all_plugins="no"
4843 [enable_all_plugins="auto"])
4845 m4_divert_once([HELP_ENABLE], [])
4847 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4848 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4849 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4850 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4851 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4852 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4853 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4854 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4855 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4856 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4857 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4858 AC_PLUGIN([csv], [yes], [CSV output plugin])
4859 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4860 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4861 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4862 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4863 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4864 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4865 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4866 AC_PLUGIN([dotnet], [$with_libmono], [.NET language bindings])
4867 AC_PLUGIN([email], [yes], [EMail statistics])
4868 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4869 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
4870 AC_PLUGIN([exec], [yes], [Execution of external programs])
4871 AC_PLUGIN([filecount], [yes], [Count files in directories])
4872 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4873 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4874 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4875 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4876 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4877 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4878 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4879 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4880 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4881 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4882 AC_PLUGIN([load], [$plugin_load], [System load])
4883 AC_PLUGIN([logfile], [yes], [File logging plugin])
4884 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4885 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4886 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4887 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4888 AC_PLUGIN([match_regex], [yes], [The regex match])
4889 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4890 AC_PLUGIN([match_value], [yes], [The value match])
4891 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4892 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
4893 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4894 AC_PLUGIN([memcached], [yes], [memcached statistics])
4895 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4896 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4897 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4898 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4899 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4900 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4901 AC_PLUGIN([network], [yes], [Network communication plugin])
4902 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4903 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4904 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4905 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4906 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4907 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
4908 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4909 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4910 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4911 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4912 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4913 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4914 # FIXME: Check for libevent, too.
4915 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4916 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4917 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4918 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4919 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4920 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4921 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4922 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4923 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4924 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4925 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4926 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4927 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4928 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4929 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4930 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4931 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4932 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4933 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4934 AC_PLUGIN([target_notification], [yes], [The notification target])
4935 AC_PLUGIN([target_replace], [yes], [The replace target])
4936 AC_PLUGIN([target_scale],[yes], [The scale target])
4937 AC_PLUGIN([target_set], [yes], [The set target])
4938 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4939 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4940 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4941 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4942 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4943 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4944 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4945 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4946 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4947 AC_PLUGIN([users], [$plugin_users], [User statistics])
4948 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4949 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4950 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4951 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4952 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4953 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
4954 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4955 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4956 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
4957 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4958 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4960 dnl Default configuration file
4961 # Load either syslog or logfile
4962 LOAD_PLUGIN_SYSLOG=""
4963 LOAD_PLUGIN_LOGFILE=""
4965 AC_MSG_CHECKING([which default log plugin to load])
4966 default_log_plugin="none"
4967 if test "x$enable_syslog" = "xyes"
4969 default_log_plugin="syslog"
4971 LOAD_PLUGIN_SYSLOG="##"
4974 if test "x$enable_logfile" = "xyes"
4976 if test "x$default_log_plugin" = "xnone"
4978 default_log_plugin="logfile"
4980 LOAD_PLUGIN_LOGFILE="#"
4983 LOAD_PLUGIN_LOGFILE="##"
4985 AC_MSG_RESULT([$default_log_plugin])
4987 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4988 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4990 DEFAULT_LOG_LEVEL="info"
4991 if test "x$enable_debug" = "xyes"
4993 DEFAULT_LOG_LEVEL="debug"
4995 AC_SUBST(DEFAULT_LOG_LEVEL)
4997 # Load only one of rrdtool, network, csv in the default config.
4998 LOAD_PLUGIN_RRDTOOL=""
4999 LOAD_PLUGIN_NETWORK=""
5002 AC_MSG_CHECKING([which default write plugin to load])
5003 default_write_plugin="none"
5004 if test "x$enable_rrdtool" = "xyes"
5006 default_write_plugin="rrdtool"
5008 LOAD_PLUGIN_RRDTOOL="##"
5011 if test "x$enable_network" = "xyes"
5013 if test "x$default_write_plugin" = "xnone"
5015 default_write_plugin="network"
5017 LOAD_PLUGIN_NETWORK="#"
5020 LOAD_PLUGIN_NETWORK="##"
5023 if test "x$enable_csv" = "xyes"
5025 if test "x$default_write_plugin" = "xnone"
5027 default_write_plugin="csv"
5032 LOAD_PLUGIN_CSV="##"
5034 AC_MSG_RESULT([$default_write_plugin])
5036 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5037 AC_SUBST(LOAD_PLUGIN_NETWORK)
5038 AC_SUBST(LOAD_PLUGIN_CSV)
5041 if test "x$ac_system" = "xLinux" \
5042 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5044 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5047 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5049 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5053 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5055 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5057 PERL_BINDINGS_OPTIONS="$withval"
5058 with_perl_bindings="yes"
5060 PERL_BINDINGS_OPTIONS=""
5061 with_perl_bindings="$withval"
5065 PERL_BINDINGS_OPTIONS=""
5066 if test -n "$perl_interpreter"
5068 with_perl_bindings="yes"
5070 with_perl_bindings="no (no perl interpreter found)"
5073 if test "x$with_perl_bindings" = "xyes"
5075 PERL_BINDINGS="perl"
5079 AC_SUBST(PERL_BINDINGS)
5080 AC_SUBST(PERL_BINDINGS_OPTIONS)
5082 dnl libcollectdclient
5083 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5084 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5085 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5087 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5089 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5091 AC_SUBST(LCC_VERSION_MAJOR)
5092 AC_SUBST(LCC_VERSION_MINOR)
5093 AC_SUBST(LCC_VERSION_PATCH)
5094 AC_SUBST(LCC_VERSION_EXTRA)
5095 AC_SUBST(LCC_VERSION_STRING)
5097 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
5099 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
5101 if test "x$with_librrd" = "xyes" \
5102 && test "x$librrd_threadsafe" != "xyes"
5104 with_librrd="yes (warning: librrd is not thread-safe)"
5107 if test "x$with_libperl" = "xyes"
5109 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5111 enable_perl="no (needs libperl)"
5114 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5116 enable_perl="no (libperl doesn't support ithreads)"
5119 if test "x$with_perl_bindings" = "xyes" \
5120 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5122 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5129 libcurl . . . . . . . $with_libcurl
5130 libdbi . . . . . . . $with_libdbi
5131 libcredis . . . . . . $with_libcredis
5132 libesmtp . . . . . . $with_libesmtp
5133 libganglia . . . . . $with_libganglia
5134 libgcrypt . . . . . . $with_libgcrypt
5135 libiokit . . . . . . $with_libiokit
5136 libiptc . . . . . . . $with_libiptc
5137 libjvm . . . . . . . $with_java
5138 libkstat . . . . . . $with_kstat
5139 libkvm . . . . . . . $with_libkvm
5140 libmemcached . . . . $with_libmemcached
5141 libmodbus . . . . . . $with_libmodbus
5142 libmono . . . . . . . $with_libmono
5143 libmysql . . . . . . $with_libmysql
5144 libnetapp . . . . . . $with_libnetapp
5145 libnetlink . . . . . $with_libnetlink
5146 libnetsnmp . . . . . $with_libnetsnmp
5147 libnotify . . . . . . $with_libnotify
5148 liboconfig . . . . . $with_liboconfig
5149 libopenipmi . . . . . $with_libopenipmipthread
5150 liboping . . . . . . $with_liboping
5151 libpcap . . . . . . . $with_libpcap
5152 libperfstat . . . . . $with_perfstat
5153 libperl . . . . . . . $with_libperl
5154 libpq . . . . . . . . $with_libpq
5155 libpthread . . . . . $with_libpthread
5156 librabbitmq . . . . . $with_librabbitmq
5157 librouteros . . . . . $with_librouteros
5158 librrd . . . . . . . $with_librrd
5159 libsensors . . . . . $with_libsensors
5160 libstatgrab . . . . . $with_libstatgrab
5161 libtokyotyrant . . . $with_libtokyotyrant
5162 libupsclient . . . . $with_libupsclient
5163 libvarnish . . . . . $with_libvarnish
5164 libvirt . . . . . . . $with_libvirt
5165 libxml2 . . . . . . . $with_libxml2
5166 libxmms . . . . . . . $with_libxmms
5167 libyajl . . . . . . . $with_libyajl
5168 libevent . . . . . . $with_libevent
5169 protobuf-c . . . . . $have_protoc_c
5170 oracle . . . . . . . $with_oracle
5171 python . . . . . . . $with_python
5174 daemon mode . . . . . $enable_daemon
5175 debug . . . . . . . . $enable_debug
5178 perl . . . . . . . . $with_perl_bindings
5181 amqp . . . . . . . $enable_amqp
5182 apache . . . . . . . $enable_apache
5183 apcups . . . . . . . $enable_apcups
5184 apple_sensors . . . . $enable_apple_sensors
5185 ascent . . . . . . . $enable_ascent
5186 battery . . . . . . . $enable_battery
5187 bind . . . . . . . . $enable_bind
5188 conntrack . . . . . . $enable_conntrack
5189 contextswitch . . . . $enable_contextswitch
5190 cpu . . . . . . . . . $enable_cpu
5191 cpufreq . . . . . . . $enable_cpufreq
5192 csv . . . . . . . . . $enable_csv
5193 curl . . . . . . . . $enable_curl
5194 curl_json . . . . . . $enable_curl_json
5195 curl_xml . . . . . . $enable_curl_xml
5196 dbi . . . . . . . . . $enable_dbi
5197 df . . . . . . . . . $enable_df
5198 disk . . . . . . . . $enable_disk
5199 dns . . . . . . . . . $enable_dns
5200 dotnet . . . . . . . $enable_dotnet
5201 email . . . . . . . . $enable_email
5202 entropy . . . . . . . $enable_entropy
5203 ethstat . . . . . . . $enable_ethstat
5204 exec . . . . . . . . $enable_exec
5205 filecount . . . . . . $enable_filecount
5206 fscache . . . . . . . $enable_fscache
5207 gmond . . . . . . . . $enable_gmond
5208 hddtemp . . . . . . . $enable_hddtemp
5209 interface . . . . . . $enable_interface
5210 ipmi . . . . . . . . $enable_ipmi
5211 iptables . . . . . . $enable_iptables
5212 ipvs . . . . . . . . $enable_ipvs
5213 irq . . . . . . . . . $enable_irq
5214 java . . . . . . . . $enable_java
5215 libvirt . . . . . . . $enable_libvirt
5216 load . . . . . . . . $enable_load
5217 logfile . . . . . . . $enable_logfile
5218 lpar... . . . . . . . $enable_lpar
5219 madwifi . . . . . . . $enable_madwifi
5220 match_empty_counter . $enable_match_empty_counter
5221 match_hashed . . . . $enable_match_hashed
5222 match_regex . . . . . $enable_match_regex
5223 match_timediff . . . $enable_match_timediff
5224 match_value . . . . . $enable_match_value
5225 mbmon . . . . . . . . $enable_mbmon
5226 md . . . . . . . . . $enable_md
5227 memcachec . . . . . . $enable_memcachec
5228 memcached . . . . . . $enable_memcached
5229 memory . . . . . . . $enable_memory
5230 modbus . . . . . . . $enable_modbus
5231 multimeter . . . . . $enable_multimeter
5232 mysql . . . . . . . . $enable_mysql
5233 netapp . . . . . . . $enable_netapp
5234 netlink . . . . . . . $enable_netlink
5235 network . . . . . . . $enable_network
5236 nfs . . . . . . . . . $enable_nfs
5237 nginx . . . . . . . . $enable_nginx
5238 notify_desktop . . . $enable_notify_desktop
5239 notify_email . . . . $enable_notify_email
5240 ntpd . . . . . . . . $enable_ntpd
5241 numa . . . . . . . . $enable_numa
5242 nut . . . . . . . . . $enable_nut
5243 olsrd . . . . . . . . $enable_olsrd
5244 onewire . . . . . . . $enable_onewire
5245 openvpn . . . . . . . $enable_openvpn
5246 oracle . . . . . . . $enable_oracle
5247 perl . . . . . . . . $enable_perl
5248 pinba . . . . . . . . $enable_pinba
5249 ping . . . . . . . . $enable_ping
5250 postgresql . . . . . $enable_postgresql
5251 powerdns . . . . . . $enable_powerdns
5252 processes . . . . . . $enable_processes
5253 protocols . . . . . . $enable_protocols
5254 python . . . . . . . $enable_python
5255 redis . . . . . . . . $enable_redis
5256 routeros . . . . . . $enable_routeros
5257 rrdcached . . . . . . $enable_rrdcached
5258 rrdtool . . . . . . . $enable_rrdtool
5259 sensors . . . . . . . $enable_sensors
5260 serial . . . . . . . $enable_serial
5261 snmp . . . . . . . . $enable_snmp
5262 swap . . . . . . . . $enable_swap
5263 syslog . . . . . . . $enable_syslog
5264 table . . . . . . . . $enable_table
5265 tail . . . . . . . . $enable_tail
5266 tape . . . . . . . . $enable_tape
5267 target_notification . $enable_target_notification
5268 target_replace . . . $enable_target_replace
5269 target_scale . . . . $enable_target_scale
5270 target_set . . . . . $enable_target_set
5271 target_v5upgrade . . $enable_target_v5upgrade
5272 tcpconns . . . . . . $enable_tcpconns
5273 teamspeak2 . . . . . $enable_teamspeak2
5274 ted . . . . . . . . . $enable_ted
5275 thermal . . . . . . . $enable_thermal
5276 threshold . . . . . . $enable_threshold
5277 tokyotyrant . . . . . $enable_tokyotyrant
5278 unixsock . . . . . . $enable_unixsock
5279 uptime . . . . . . . $enable_uptime
5280 users . . . . . . . . $enable_users
5281 uuid . . . . . . . . $enable_uuid
5282 varnish . . . . . . . $enable_varnish
5283 vmem . . . . . . . . $enable_vmem
5284 vserver . . . . . . . $enable_vserver
5285 wireless . . . . . . $enable_wireless
5286 write_graphite . . . $enable_write_graphite
5287 write_http . . . . . $enable_write_http
5288 write_redis . . . . . $enable_write_redis
5289 write_mongodb . . . . $enable_write_mongodb
5290 xmms . . . . . . . . $enable_xmms
5291 zfs_arc . . . . . . . $enable_zfs_arc
5295 if test "x$dependency_error" = "xyes"; then
5296 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5299 if test "x$dependency_warning" = "xyes"; then
5300 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5303 # vim: set fdm=marker :