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([tar-pax 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 if test "x$have_protoc_c" = "xyes"
54 AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
55 [have_protobuf_c_h="yes"],
56 [have_protobuf_c_h="no"])
58 if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
60 have_protoc_c="no (unable to find protobuf-c.h)"
62 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
64 AC_MSG_CHECKING([for kernel type ($host_os)])
67 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
71 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
81 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
87 AC_MSG_RESULT([$ac_system])
89 if test "x$ac_system" = "xLinux"
91 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
92 if test -z "$KERNEL_DIR"
94 KERNEL_DIR="/lib/modules/`uname -r`/source"
97 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
98 AC_SUBST(KERNEL_CFLAGS)
101 if test "x$ac_system" = "xSolaris"
103 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
104 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
106 if test "x$ac_system" = "xAIX"
108 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
111 # Where to install .pc files.
112 pkgconfigdir="${libdir}/pkgconfig"
113 AC_SUBST(pkgconfigdir)
115 # Check for standards compliance mode
116 AC_ARG_ENABLE(standards,
117 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
118 [enable_standards="$enableval"],
119 [enable_standards="no"])
120 if test "x$enable_standards" = "xyes"
122 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
123 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
124 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
125 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
126 if test "x$GCC" = "xyes"
128 CFLAGS="$CFLAGS -std=c99"
131 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
134 # Checks for header files.
141 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h)
144 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
149 # include <sys/types.h>
152 AC_CHECK_HEADERS(netinet/in.h, [], [],
157 # include <sys/types.h>
159 #if HAVE_NETINET_IN_SYSTM_H
160 # include <netinet/in_systm.h>
163 AC_CHECK_HEADERS(netinet/ip.h, [], [],
168 # include <sys/types.h>
170 #if HAVE_NETINET_IN_SYSTM_H
171 # include <netinet/in_systm.h>
173 #if HAVE_NETINET_IN_H
174 # include <netinet/in.h>
177 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
182 # include <sys/types.h>
184 #if HAVE_NETINET_IN_SYSTM_H
185 # include <netinet/in_systm.h>
187 #if HAVE_NETINET_IN_H
188 # include <netinet/in.h>
190 #if HAVE_NETINET_IP_H
191 # include <netinet/ip.h>
194 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
199 # include <sys/types.h>
201 #if HAVE_NETINET_IN_SYSTM_H
202 # include <netinet/in_systm.h>
204 #if HAVE_NETINET_IN_H
205 # include <netinet/in.h>
207 #if HAVE_NETINET_IP_H
208 # include <netinet/ip.h>
211 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
216 # include <sys/types.h>
218 #if HAVE_NETINET_IN_SYSTM_H
219 # include <netinet/in_systm.h>
221 #if HAVE_NETINET_IN_H
222 # include <netinet/in.h>
225 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
230 # include <sys/types.h>
232 #if HAVE_NETINET_IN_SYSTM_H
233 # include <netinet/in_systm.h>
235 #if HAVE_NETINET_IN_H
236 # include <netinet/in.h>
238 #if HAVE_NETINET_IP6_H
239 # include <netinet/ip6.h>
242 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
247 # include <sys/types.h>
249 #if HAVE_NETINET_IN_SYSTM_H
250 # include <netinet/in_systm.h>
252 #if HAVE_NETINET_IN_H
253 # include <netinet/in.h>
255 #if HAVE_NETINET_IP_H
256 # include <netinet/ip.h>
259 AC_CHECK_HEADERS(netinet/udp.h, [], [],
264 # include <sys/types.h>
266 #if HAVE_NETINET_IN_SYSTM_H
267 # include <netinet/in_systm.h>
269 #if HAVE_NETINET_IN_H
270 # include <netinet/in.h>
272 #if HAVE_NETINET_IP_H
273 # include <netinet/ip.h>
278 AC_CHECK_HEADERS(sys/dkstat.h)
279 if test "x$ac_system" = "xDarwin"
281 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)
282 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
283 # For the battery plugin
284 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
286 #if HAVE_IOKIT_IOKITLIB_H
287 # include <IOKit/IOKitLib.h>
289 #if HAVE_IOKIT_IOTYPES_H
290 # include <IOKit/IOTypes.h>
296 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
299 # include <sys/types.h>
302 # include <sys/param.h>
306 AC_MSG_CHECKING([for sysctl kern.cp_times])
307 if test -x /sbin/sysctl
309 /sbin/sysctl kern.cp_times 2>/dev/null
313 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
314 [Define if sysctl supports kern.cp_times])
323 AC_CHECK_HEADERS(linux/major.h)
325 # For md module (Linux only)
326 if test "x$ac_system" = "xLinux"
328 AC_CHECK_HEADERS(linux/raid/md_u.h,
329 [have_linux_raid_md_u_h="yes"],
330 [have_linux_raid_md_u_h="no"],
332 #include <sys/ioctl.h>
333 #include <linux/major.h>
334 #include <linux/types.h>
337 have_linux_raid_md_u_h="no"
340 # For the swap module
341 have_linux_wireless_h="no"
342 if test "x$ac_system" = "xLinux"
344 AC_CHECK_HEADERS(linux/wireless.h,
345 [have_linux_wireless_h="yes"],
346 [have_linux_wireless_h="no"],
349 #include <sys/ioctl.h>
350 #include <sys/socket.h>
354 # For the swap module
355 have_sys_swap_h="yes"
356 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
358 #undef _FILE_OFFSET_BITS
359 #undef _LARGEFILE64_SOURCE
361 # include <sys/types.h>
364 # include <sys/param.h>
368 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
371 if test "x$GCC" = "xyes"
373 hint_64="CFLAGS='-m64'"
375 hint_64="CFLAGS='-xarch=v9'"
377 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
381 # For the processes plugin
383 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
385 # For interface plugin
386 AC_CHECK_HEADERS(ifaddrs.h)
387 AC_CHECK_HEADERS(net/if.h, [], [],
390 # include <sys/types.h>
392 #if HAVE_SYS_SOCKET_H
393 # include <sys/socket.h>
396 AC_CHECK_HEADERS(linux/if.h, [], [],
399 # include <sys/types.h>
401 #if HAVE_SYS_SOCKET_H
402 # include <sys/socket.h>
405 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
408 # include <sys/types.h>
410 #if HAVE_SYS_SOCKET_H
411 # include <sys/socket.h>
414 # include <linux/if.h>
419 AC_CHECK_HEADERS(linux/sockios.h,
420 [have_linux_sockios_h="yes"],
421 [have_linux_sockios_h="no"],
424 # include <sys/ioctl.h>
430 AC_CHECK_HEADERS(linux/ethtool.h,
431 [have_linux_ethtool_h="yes"],
432 [have_linux_ethtool_h="no"],
435 # include <sys/ioctl.h>
440 #if HAVE_LINUX_SOCKIOS_H
441 # include <linux/sockios.h>
446 have_linux_ip_vs_h="no"
447 have_net_ip_vs_h="no"
449 ip_vs_h_needs_kernel_cflags="no"
450 if test "x$ac_system" = "xLinux"
452 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
453 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
454 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
456 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
458 SAVE_CFLAGS="$CFLAGS"
459 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
461 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
463 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
464 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
465 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
467 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
469 ip_vs_h_needs_kernel_cflags="yes"
472 CFLAGS="$SAVE_CFLAGS"
475 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
478 AC_CHECK_HEADERS(sys/ucred.h, [], [],
481 # include <sys/types.h>
484 # include <sys/param.h>
488 # For mount interface
489 AC_CHECK_HEADERS(sys/mount.h, [], [],
492 # include <sys/types.h>
495 # include <sys/param.h>
499 # For the email plugin
500 AC_CHECK_HEADERS(linux/un.h, [], [],
502 #if HAVE_SYS_SOCKET_H
503 # include <sys/socket.h>
507 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)
510 AC_CHECK_HEADERS(arpa/nameser.h)
511 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
513 #if HAVE_ARPA_NAMESER_H
514 # include <arpa/nameser.h>
518 AC_CHECK_HEADERS(net/if_arp.h, [], [],
519 [#if HAVE_SYS_SOCKET_H
520 # include <sys/socket.h>
523 AC_CHECK_HEADERS(net/ppp_defs.h)
524 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
525 [#if HAVE_NET_PPP_DEFS_H
526 # include <net/ppp_defs.h>
529 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
534 # include <sys/types.h>
536 #if HAVE_SYS_SOCKET_H
537 # include <sys/socket.h>
542 #if HAVE_NETINET_IN_H
543 # include <netinet/in.h>
547 AC_CHECK_HEADERS(netinet/ip_compat.h)
549 have_net_pfvar_h="no"
550 AC_CHECK_HEADERS(net/pfvar.h,
551 [have_net_pfvar_h="yes"],
552 [have_net_pfvar_h="no"],
555 # include <sys/ioctl.h>
557 #if HAVE_SYS_SOCKET_H
558 # include <sys/socket.h>
565 # For the multimeter plugin
567 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
570 # Checks for typedefs, structures, and compiler characteristics.
579 # Checks for library functions.
581 AC_PROG_GCC_TRADITIONAL
582 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
586 SAVE_CFLAGS="$CFLAGS"
587 # Emulate behavior of src/Makefile.am
588 if test "x$GCC" = "xyes"
590 CFLAGS="$CFLAGS -Wall -Werror"
593 AC_CACHE_CHECK([for strtok_r],
594 [c_cv_have_strtok_r_default],
603 char buffer[] = "foo,bar,baz";
610 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
613 printf ("token = %s;\n", token);
616 [c_cv_have_strtok_r_default="yes"],
617 [c_cv_have_strtok_r_default="no"]
621 if test "x$c_cv_have_strtok_r_default" = "xno"
623 CFLAGS="$CFLAGS -D_REENTRANT=1"
625 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
626 [c_cv_have_strtok_r_reentrant],
635 char buffer[] = "foo,bar,baz";
642 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
645 printf ("token = %s;\n", token);
648 [c_cv_have_strtok_r_reentrant="yes"],
649 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
654 CFLAGS="$SAVE_CFLAGS"
655 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
657 CFLAGS="$CFLAGS -D_REENTRANT=1"
660 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
662 socket_needs_socket="no"
663 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
664 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
666 clock_gettime_needs_rt="no"
667 clock_gettime_needs_posix4="no"
668 have_clock_gettime="no"
669 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
670 if test "x$have_clock_gettime" = "xno"
672 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
673 have_clock_gettime="yes"])
675 if test "x$have_clock_gettime" = "xno"
677 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
678 have_clock_gettime="yes"])
680 if test "x$have_clock_gettime" = "xyes"
682 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
684 AC_MSG_WARN(cannot find clock_gettime)
687 nanosleep_needs_rt="no"
688 nanosleep_needs_posix4="no"
689 AC_CHECK_FUNCS(nanosleep,
691 AC_CHECK_LIB(rt, nanosleep,
692 [nanosleep_needs_rt="yes"],
693 AC_CHECK_LIB(posix4, nanosleep,
694 [nanosleep_needs_posix4="yes"],
695 AC_MSG_ERROR(cannot find nanosleep))))
697 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
698 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
700 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
701 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
702 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
703 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
704 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
705 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
706 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
707 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
708 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
709 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
710 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
711 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
713 # Check for strptime {{{
714 if test "x$GCC" = "xyes"
716 SAVE_CFLAGS="$CFLAGS"
717 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
720 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
721 if test "x$have_strptime" = "xyes"
723 AC_CACHE_CHECK([whether strptime is exported by default],
724 [c_cv_have_strptime_default],
732 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
734 [c_cv_have_strptime_default="yes"],
735 [c_cv_have_strptime_default="no"]))
737 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
739 AC_CACHE_CHECK([whether strptime needs standards mode],
740 [c_cv_have_strptime_standards],
744 #ifndef _ISOC99_SOURCE
745 # define _ISOC99_SOURCE 1
747 #ifndef _POSIX_C_SOURCE
748 # define _POSIX_C_SOURCE 200112L
750 #ifndef _XOPEN_SOURCE
751 # define _XOPEN_SOURCE 500
758 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
760 [c_cv_have_strptime_standards="yes"],
761 [c_cv_have_strptime_standards="no"]))
763 if test "x$c_cv_have_strptime_standards" = "xyes"
765 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
771 if test "x$GCC" = "xyes"
773 CFLAGS="$SAVE_CFLAGS"
776 # }}} Check for strptime
778 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
779 if test "x$have_swapctl" = "xyes"; then
780 AC_CACHE_CHECK([whether swapctl takes two arguments],
781 [c_cv_have_swapctl_two_args],
782 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
784 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
785 # undef _FILE_OFFSET_BITS
786 # undef _LARGEFILE64_SOURCE
788 #include <sys/stat.h>
789 #include <sys/swap.h>
792 int num = swapctl(0, NULL);
795 [c_cv_have_swapctl_two_args="yes"],
796 [c_cv_have_swapctl_two_args="no"]
799 AC_CACHE_CHECK([whether swapctl takes three arguments],
800 [c_cv_have_swapctl_three_args],
804 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
805 # undef _FILE_OFFSET_BITS
806 # undef _LARGEFILE64_SOURCE
808 #include <sys/stat.h>
809 #include <sys/swap.h>
812 int num = swapctl(0, NULL, 0);
815 [c_cv_have_swapctl_three_args="yes"],
816 [c_cv_have_swapctl_three_args="no"]
820 # Check for different versions of `swapctl' here..
821 if test "x$have_swapctl" = "xyes"; then
822 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
823 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
824 [Define if the function swapctl exists and takes two arguments.])
826 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
827 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
828 [Define if the function swapctl exists and takes three arguments.])
833 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
835 if test "x$withval" = "xno"; then
837 else if test "x$withval" = "xyes"; then
844 if test "x$nan_type" = "xnone"; then
845 AC_CACHE_CHECK([whether NAN is defined by default],
846 [c_cv_have_nan_default],
852 static double foo = NAN;
860 [c_cv_have_nan_default="yes"],
861 [c_cv_have_nan_default="no"]
864 if test "x$c_cv_have_nan_default" = "xyes"
869 if test "x$nan_type" = "xnone"; then
870 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
871 [c_cv_have_nan_isoc],
876 #define __USE_ISOC99 1
878 static double foo = NAN;
886 [c_cv_have_nan_isoc="yes"],
887 [c_cv_have_nan_isoc="no"]
890 if test "x$c_cv_have_nan_isoc" = "xyes"
895 if test "x$nan_type" = "xnone"; then
896 SAVE_LDFLAGS=$LDFLAGS
897 LDFLAGS="$LDFLAGS -lm"
898 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
899 [c_cv_have_nan_zero],
908 #define NAN (0.0 / 0.0)
910 # define isnan(f) ((f) != (f))
912 static double foo = NAN;
920 [c_cv_have_nan_zero="yes"],
921 [c_cv_have_nan_zero="no"]
924 LDFLAGS=$SAVE_LDFLAGS
925 if test "x$c_cv_have_nan_zero" = "xyes"
931 if test "x$nan_type" = "xdefault"; then
932 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
933 [Define if NAN is defined by default and can initialize static variables.])
934 else if test "x$nan_type" = "xisoc99"; then
935 AC_DEFINE(NAN_STATIC_ISOC, 1,
936 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
937 else if test "x$nan_type" = "xzero"; then
938 AC_DEFINE(NAN_ZERO_ZERO, 1,
939 [Define if NAN can be defined as (0.0 / 0.0)])
941 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
944 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
946 if test "x$withval" = "xnothing"; then
947 fp_layout_type="nothing"
948 else if test "x$withval" = "xendianflip"; then
949 fp_layout_type="endianflip"
950 else if test "x$withval" = "xintswap"; then
951 fp_layout_type="intswap"
953 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
956 [fp_layout_type="unknown"])
958 if test "x$fp_layout_type" = "xunknown"; then
959 AC_CACHE_CHECK([if doubles are stored in x86 representation],
960 [c_cv_fp_layout_need_nothing],
971 # include <inttypes.h>
974 # include <stdbool.h>
984 memcpy ((void *) &i0, (void *) &d, 8);
987 memcpy ((void *) c, (void *) &i1, 8);
989 if ((c[0] == 0x2f) && (c[1] == 0x25)
990 && (c[2] == 0xc0) && (c[3] == 0xc7)
991 && (c[4] == 0x43) && (c[5] == 0x2b)
992 && (c[6] == 0x1f) && (c[7] == 0x5b))
997 [c_cv_fp_layout_need_nothing="yes"],
998 [c_cv_fp_layout_need_nothing="no"]
1001 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1002 fp_layout_type="nothing"
1005 if test "x$fp_layout_type" = "xunknown"; then
1006 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1007 [c_cv_fp_layout_need_endianflip],
1015 # include <stdint.h>
1018 # include <inttypes.h>
1021 # include <stdbool.h>
1023 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1024 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1025 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1026 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1027 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1028 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1029 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1030 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1039 memcpy ((void *) &i0, (void *) &d, 8);
1041 i1 = endianflip (i0);
1042 memcpy ((void *) c, (void *) &i1, 8);
1044 if ((c[0] == 0x2f) && (c[1] == 0x25)
1045 && (c[2] == 0xc0) && (c[3] == 0xc7)
1046 && (c[4] == 0x43) && (c[5] == 0x2b)
1047 && (c[6] == 0x1f) && (c[7] == 0x5b))
1052 [c_cv_fp_layout_need_endianflip="yes"],
1053 [c_cv_fp_layout_need_endianflip="no"]
1056 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1057 fp_layout_type="endianflip"
1060 if test "x$fp_layout_type" = "xunknown"; then
1061 AC_CACHE_CHECK([if intswap converts to x86 representation],
1062 [c_cv_fp_layout_need_intswap],
1070 # include <stdint.h>
1073 # include <inttypes.h>
1076 # include <stdbool.h>
1078 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1079 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1088 memcpy ((void *) &i0, (void *) &d, 8);
1091 memcpy ((void *) c, (void *) &i1, 8);
1093 if ((c[0] == 0x2f) && (c[1] == 0x25)
1094 && (c[2] == 0xc0) && (c[3] == 0xc7)
1095 && (c[4] == 0x43) && (c[5] == 0x2b)
1096 && (c[6] == 0x1f) && (c[7] == 0x5b))
1101 [c_cv_fp_layout_need_intswap="yes"],
1102 [c_cv_fp_layout_need_intswap="no"]
1105 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1106 fp_layout_type="intswap"
1110 if test "x$fp_layout_type" = "xnothing"; then
1111 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1112 [Define if doubles are stored in x86 representation.])
1113 else if test "x$fp_layout_type" = "xendianflip"; then
1114 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1115 [Define if endianflip is needed to convert to x86 representation.])
1116 else if test "x$fp_layout_type" = "xintswap"; then
1117 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1118 [Define if intswap is needed to convert to x86 representation.])
1120 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1124 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1125 have_getvfsstat="no"
1126 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1127 have_listmntent="no"
1128 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1131 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1132 if test "x$have_getmntent" = "xno"; then
1133 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1135 if test "x$have_getmntent" = "xno"; then
1136 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1138 if test "x$have_getmntent" = "xno"; then
1139 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1142 if test "x$have_getmntent" = "xc"; then
1143 AC_CACHE_CHECK([whether getmntent takes one argument],
1144 [c_cv_have_one_getmntent],
1148 #include "$srcdir/src/utils_mount.h"
1153 fh = setmntent ("/etc/mtab", "r");
1154 me = getmntent (fh);
1157 [c_cv_have_one_getmntent="yes"],
1158 [c_cv_have_one_getmntent="no"]
1161 AC_CACHE_CHECK([whether getmntent takes two arguments],
1162 [c_cv_have_two_getmntent],
1166 #include "$srcdir/src/utils_mount.h"
1172 fh = fopen ("/etc/mnttab", "r");
1173 status = getmntent (fh, &mt);
1176 [c_cv_have_two_getmntent="yes"],
1177 [c_cv_have_two_getmntent="no"]
1182 # Check for different versions of `getmntent' here..
1184 if test "x$have_getmntent" = "xc"; then
1185 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1186 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1187 [Define if the function getmntent exists and takes one argument.])
1189 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1190 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1191 [Define if the function getmntent exists and takes two arguments.])
1194 if test "x$have_getmntent" = "xsun"; then
1195 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1196 [Define if the function getmntent exists. It's the version from libsun.])
1198 if test "x$have_getmntent" = "xseq"; then
1199 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1200 [Define if the function getmntent exists. It's the version from libseq.])
1202 if test "x$have_getmntent" = "xgen"; then
1203 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1204 [Define if the function getmntent exists. It's the version from libgen.])
1208 AC_MSG_CHECKING([if have htonll defined])
1213 #include <sys/types.h>
1214 #include <netinet/in.h>
1216 # include <inttypes.h>
1223 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1226 AC_MSG_RESULT([$have_htonll])
1228 # Check for structures
1229 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1230 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1233 #include <sys/types.h>
1234 #include <sys/socket.h>
1237 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1238 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1241 #include <sys/types.h>
1242 #include <sys/socket.h>
1243 #include <linux/if.h>
1244 #include <linux/netdevice.h>
1247 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1250 #include <netinet/in.h>
1254 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1256 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1257 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1258 have_struct_kinfo_proc_freebsd="yes"
1261 have_struct_kinfo_proc_freebsd="no"
1265 #include <sys/param.h>
1266 #include <sys/sysctl.h>
1267 #include <sys/user.h>
1270 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1272 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1273 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1274 have_struct_kinfo_proc_openbsd="yes"
1277 have_struct_kinfo_proc_openbsd="no"
1280 #include <sys/param.h>
1281 #include <sys/sysctl.h>
1285 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1286 [#define _BSD_SOURCE
1288 # include <stdint.h>
1290 #if HAVE_SYS_TYPES_H
1291 # include <sys/types.h>
1293 #if HAVE_NETINET_IN_SYSTM_H
1294 # include <netinet/in_systm.h>
1296 #if HAVE_NETINET_IN_H
1297 # include <netinet/in.h>
1299 #if HAVE_NETINET_IP_H
1300 # include <netinet/ip.h>
1302 #if HAVE_NETINET_UDP_H
1303 # include <netinet/udp.h>
1306 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1307 [#define _BSD_SOURCE
1309 # include <stdint.h>
1311 #if HAVE_SYS_TYPES_H
1312 # include <sys/types.h>
1314 #if HAVE_NETINET_IN_SYSTM_H
1315 # include <netinet/in_systm.h>
1317 #if HAVE_NETINET_IN_H
1318 # include <netinet/in.h>
1320 #if HAVE_NETINET_IP_H
1321 # include <netinet/ip.h>
1323 #if HAVE_NETINET_UDP_H
1324 # include <netinet/udp.h>
1328 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1338 # Checks for libraries begin here
1341 with_libresolv="yes"
1342 AC_CHECK_LIB(resolv, res_search,
1344 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1346 [with_libresolv="no"])
1347 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1349 dnl Check for HAL (hardware abstraction library)
1351 AC_CHECK_LIB(hal,libhal_device_property_exists,
1352 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1354 if test "x$with_libhal" = "xyes"; then
1355 if test "x$PKG_CONFIG" != "x"; then
1356 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1357 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1358 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1359 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1363 m4_divert_once([HELP_WITH], [
1364 collectd additional packages:])
1366 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1368 if test "x$ac_system" = "xAIX"
1373 with_perfstat="no (AIX only)"
1374 with_procinfo="no (AIX only)"
1377 if test "x$with_perfstat" = "xyes"
1379 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1380 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1382 if test "x$with_perfstat" = "xyes"
1384 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1385 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1386 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1387 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1389 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1392 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1394 # Processes plugin under AIX.
1395 if test "x$with_procinfo" = "xyes"
1397 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1399 if test "x$with_procinfo" = "xyes"
1401 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1404 if test "x$ac_system" = "xSolaris"
1409 with_kstat="no (Solaris only)"
1410 with_devinfo="no (Solaris only)"
1413 if test "x$with_kstat" = "xyes"
1415 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1417 if test "x$with_kstat" = "xyes"
1419 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1420 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1422 if test "x$with_kstat" = "xyes"
1424 AC_DEFINE(HAVE_LIBKSTAT, 1,
1425 [Define to 1 if you have the 'kstat' library (-lkstat)])
1427 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1428 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1431 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1438 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1441 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1442 if test "x$with_kvm_getprocs" = "xyes"
1444 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1445 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1448 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1450 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1451 if test "x$with_kvm_getswapinfo" = "xyes"
1453 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1454 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1457 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1459 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1460 if test "x$with_kvm_nlist" = "xyes"
1462 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1463 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1464 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1467 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1469 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1470 if test "x$with_kvm_openfiles" = "xyes"
1472 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1473 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1476 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1478 # --with-libcredis {{{
1479 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1481 if test "x$withval" = "xyes"
1483 with_libcredis="yes"
1484 else if test "x$withval" = "xno"
1488 with_libcredis="yes"
1489 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1490 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1493 [with_libcredis="yes"])
1495 SAVE_CPPFLAGS="$CPPFLAGS"
1496 SAVE_LDFLAGS="$LDFLAGS"
1498 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1499 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1501 if test "x$with_libcredis" = "xyes"
1503 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1505 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1507 AC_CHECK_HEADERS(credis.h,
1508 [with_libcredis="yes"],
1509 [with_libcredis="no (credis.h not found)"])
1511 if test "x$with_libcredis" = "xyes"
1513 if test "x$LIBCREDIS_LDFLAGS" != "x"
1515 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1517 AC_CHECK_LIB(credis, credis_info,
1518 [with_libcredis="yes"],
1519 [with_libcredis="no (symbol 'credis_info' not found)"])
1523 CPPFLAGS="$SAVE_CPPFLAGS"
1524 LDFLAGS="$SAVE_LDFLAGS"
1526 if test "x$with_libcredis" = "xyes"
1528 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1529 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1530 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1531 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1533 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1536 # --with-libcurl {{{
1537 with_curl_config="curl-config"
1540 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1542 if test "x$withval" = "xno"
1545 else if test "x$withval" = "xyes"
1549 if test -f "$withval" && test -x "$withval"
1551 with_curl_config="$withval"
1553 else if test -x "$withval/bin/curl-config"
1555 with_curl_config="$withval/bin/curl-config"
1564 if test "x$with_libcurl" = "xyes"
1566 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1567 curl_config_status=$?
1569 if test $curl_config_status -ne 0
1571 with_libcurl="no ($with_curl_config failed)"
1573 SAVE_CPPFLAGS="$CPPFLAGS"
1574 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1576 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1578 CPPFLAGS="$SAVE_CPPFLAGS"
1581 if test "x$with_libcurl" = "xyes"
1583 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1584 curl_config_status=$?
1586 if test $curl_config_status -ne 0
1588 with_libcurl="no ($with_curl_config failed)"
1590 AC_CHECK_LIB(curl, curl_easy_init,
1591 [with_libcurl="yes"],
1592 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1596 if test "x$with_libcurl" = "xyes"
1598 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1599 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1600 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1601 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1603 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1607 with_libdbi_cppflags=""
1608 with_libdbi_ldflags=""
1609 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1611 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1613 with_libdbi_cppflags="-I$withval/include"
1614 with_libdbi_ldflags="-L$withval/lib"
1617 with_libdbi="$withval"
1623 if test "x$with_libdbi" = "xyes"
1625 SAVE_CPPFLAGS="$CPPFLAGS"
1626 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1628 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1630 CPPFLAGS="$SAVE_CPPFLAGS"
1632 if test "x$with_libdbi" = "xyes"
1634 SAVE_CPPFLAGS="$CPPFLAGS"
1635 SAVE_LDFLAGS="$LDFLAGS"
1636 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1637 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1639 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1641 CPPFLAGS="$SAVE_CPPFLAGS"
1642 LDFLAGS="$SAVE_LDFLAGS"
1644 if test "x$with_libdbi" = "xyes"
1646 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1647 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1648 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1649 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1650 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1651 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1653 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1656 # --with-libesmtp {{{
1657 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1659 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1661 LDFLAGS="$LDFLAGS -L$withval/lib"
1662 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1665 with_libesmtp="$withval"
1671 if test "x$with_libesmtp" = "xyes"
1673 AC_CHECK_LIB(esmtp, smtp_create_session,
1675 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1676 ], [with_libesmtp="no (libesmtp not found)"])
1678 if test "x$with_libesmtp" = "xyes"
1680 AC_CHECK_HEADERS(libesmtp.h,
1682 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1683 ], [with_libesmtp="no (libesmtp.h not found)"])
1685 if test "x$with_libesmtp" = "xyes"
1691 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1692 [Wether or not to use the esmtp library])
1693 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1696 # --with-libganglia {{{
1697 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1699 if test -f "$withval" && test -x "$withval"
1701 with_libganglia_config="$withval"
1702 with_libganglia="yes"
1703 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1705 with_libganglia_config="$withval/bin/ganglia-config"
1706 with_libganglia="yes"
1707 else if test -d "$withval"
1709 GANGLIA_CPPFLAGS="-I$withval/include"
1710 GANGLIA_LDFLAGS="-L$withval/lib"
1711 with_libganglia="yes"
1713 with_libganglia_config="ganglia-config"
1714 with_libganglia="$withval"
1718 with_libganglia_config="ganglia-config"
1719 with_libganglia="yes"
1722 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1724 if test "x$GANGLIA_CPPFLAGS" = "x"
1726 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1729 if test "x$GANGLIA_LDFLAGS" = "x"
1731 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1734 if test "x$GANGLIA_LIBS" = "x"
1736 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1740 SAVE_CPPFLAGS="$CPPFLAGS"
1741 SAVE_LDFLAGS="$LDFLAGS"
1742 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1743 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1745 if test "x$with_libganglia" = "xyes"
1747 AC_CHECK_HEADERS(gm_protocol.h,
1749 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1750 [Define to 1 if you have the <gm_protocol.h> header file.])
1751 ], [with_libganglia="no (gm_protocol.h not found)"])
1754 if test "x$with_libganglia" = "xyes"
1756 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1758 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1759 [Define to 1 if you have the ganglia library (-lganglia).])
1760 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1763 CPPFLAGS="$SAVE_CPPFLAGS"
1764 LDFLAGS="$SAVE_LDFLAGS"
1766 AC_SUBST(GANGLIA_CPPFLAGS)
1767 AC_SUBST(GANGLIA_LDFLAGS)
1768 AC_SUBST(GANGLIA_LIBS)
1769 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1772 # --with-libgcrypt {{{
1773 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1774 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1775 GCRYPT_LIBS="$GCRYPT_LIBS"
1776 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1778 if test -f "$withval" && test -x "$withval"
1780 with_libgcrypt_config="$withval"
1781 with_libgcrypt="yes"
1782 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1784 with_libgcrypt_config="$withval/bin/gcrypt-config"
1785 with_libgcrypt="yes"
1786 else if test -d "$withval"
1788 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1789 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1790 with_libgcrypt="yes"
1792 with_libgcrypt_config="gcrypt-config"
1793 with_libgcrypt="$withval"
1797 with_libgcrypt_config="libgcrypt-config"
1798 with_libgcrypt="yes"
1801 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1803 if test "x$GCRYPT_CPPFLAGS" = "x"
1805 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1808 if test "x$GCRYPT_LDFLAGS" = "x"
1810 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1811 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1814 if test "x$GCRYPT_LIBS" = "x"
1816 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1820 SAVE_CPPFLAGS="$CPPFLAGS"
1821 SAVE_LDFLAGS="$LDFLAGS"
1822 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1823 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1825 if test "x$with_libgcrypt" = "xyes"
1827 if test "x$GCRYPT_CPPFLAGS" != "x"
1829 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1831 AC_CHECK_HEADERS(gcrypt.h,
1832 [with_libgcrypt="yes"],
1833 [with_libgcrypt="no (gcrypt.h not found)"])
1836 if test "x$with_libgcrypt" = "xyes"
1838 if test "x$GCRYPT_LDFLAGS" != "x"
1840 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1842 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1843 [with_libgcrypt="yes"],
1844 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1846 if test "$with_libgcrypt" != "no"; then
1847 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1848 GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS"
1849 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
1853 CPPFLAGS="$SAVE_CPPFLAGS"
1854 LDFLAGS="$SAVE_LDFLAGS"
1856 if test "x$with_libgcrypt" = "xyes"
1858 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1861 AC_SUBST(GCRYPT_CPPFLAGS)
1862 AC_SUBST(GCRYPT_LDFLAGS)
1863 AC_SUBST(GCRYPT_LIBS)
1864 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1867 # --with-libiptc {{{
1868 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1870 if test "x$withval" = "xshipped"
1873 else if test "x$withval" = "xyes"
1875 with_libiptc="pkgconfig"
1876 else if test "x$withval" = "xno"
1881 with_libiptc_cflags="-I$withval/include"
1882 with_libiptc_libs="-L$withval/lib"
1886 if test "x$ac_system" = "xLinux"
1888 with_libiptc="pkgconfig"
1890 with_libiptc="no (Linux only)"
1894 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1896 with_libiptc="no (Don't have pkg-config)"
1899 if test "x$with_libiptc" = "xpkgconfig"
1901 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
1904 with_libiptc="no (pkg-config doesn't know libiptc)"
1907 if test "x$with_libiptc" = "xpkgconfig"
1909 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
1912 with_libiptc="no ($PKG_CONFIG failed)"
1914 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
1917 with_libiptc="no ($PKG_CONFIG failed)"
1921 SAVE_CPPFLAGS="$CPPFLAGS"
1922 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
1924 # check whether the header file for libiptc is available.
1925 if test "x$with_libiptc" = "xpkgconfig"
1927 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
1928 [with_libiptc="no (header file missing)"])
1930 # If the header file is available, check for the required type declaractions.
1931 # They may be missing in old versions of libiptc. In that case, they will be
1932 # declared in the iptables plugin.
1933 if test "x$with_libiptc" = "xpkgconfig"
1935 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
1937 # Check for the iptc_init symbol in the library.
1938 # This could be in iptc or ip4tc
1939 if test "x$with_libiptc" = "xpkgconfig"
1942 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
1943 [with_libiptc="pkgconfig"],
1944 [with_libiptc="no"],
1945 [$with_libiptc_libs])
1948 if test "x$with_libiptc" = "xpkgconfig"
1953 CPPFLAGS="$SAVE_CPPFLAGS"
1955 if test "x$with_libiptc" = "xown"
1957 with_libiptc_cflags=""
1958 with_libiptc_libs=""
1960 if test "x$with_libiptc" = "xown"
1962 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1964 with_libiptc="no (Linux iptables headers not found)"
1967 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1970 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
1971 if test "x$with_libiptc" = "xown"
1973 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1977 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1978 if test "x$with_libiptc" = "xyes"
1980 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
1981 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
1982 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1983 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1988 with_java_home="$JAVA_HOME"
1989 with_java_vmtype="client"
1994 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1996 if test "x$withval" = "xno"
1999 else if test "x$withval" = "xyes"
2003 with_java_home="$withval"
2008 if test "x$with_java" = "xyes"
2010 if test -d "$with_java_home"
2012 AC_MSG_CHECKING([for jni.h])
2013 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2014 if test "x$TMPDIR" != "x"
2016 AC_MSG_RESULT([found in $TMPDIR])
2017 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
2019 AC_MSG_RESULT([not found])
2022 AC_MSG_CHECKING([for jni_md.h])
2023 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2024 if test "x$TMPDIR" != "x"
2026 AC_MSG_RESULT([found in $TMPDIR])
2027 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
2029 AC_MSG_RESULT([not found])
2032 AC_MSG_CHECKING([for libjvm.so])
2033 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
2034 if test "x$TMPDIR" != "x"
2036 AC_MSG_RESULT([found in $TMPDIR])
2037 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
2039 AC_MSG_RESULT([not found])
2042 if test "x$JAVAC" = "x"
2044 AC_MSG_CHECKING([for javac])
2045 TMPDIR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
2046 if test "x$TMPDIR" != "x"
2049 AC_MSG_RESULT([$JAVAC])
2051 AC_MSG_RESULT([not found])
2054 if test "x$JAR" = "x"
2056 AC_MSG_CHECKING([for jar])
2057 TMPDIR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
2058 if test "x$TMPDIR" != "x"
2061 AC_MSG_RESULT([$JAR])
2063 AC_MSG_RESULT([not found])
2066 else if test "x$with_java_home" != "x"
2068 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2072 if test "x$JAVA_CPPFLAGS" != "x"
2074 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2076 if test "x$JAVA_CFLAGS" != "x"
2078 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2080 if test "x$JAVA_LDFLAGS" != "x"
2082 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2084 if test "x$JAVAC" = "x"
2086 with_javac_path="$PATH"
2087 if test "x$with_java_home" != "x"
2089 with_javac_path="$with_java_home:with_javac_path"
2090 if test -d "$with_java_home/bin"
2092 with_javac_path="$with_java_home/bin:with_javac_path"
2096 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2098 if test "x$JAVAC" = "x"
2100 with_java="no (javac not found)"
2102 if test "x$JAR" = "x"
2104 with_jar_path="$PATH"
2105 if test "x$with_java_home" != "x"
2107 with_jar_path="$with_java_home:$with_jar_path"
2108 if test -d "$with_java_home/bin"
2110 with_jar_path="$with_java_home/bin:$with_jar_path"
2114 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2116 if test "x$JAR" = "x"
2118 with_java="no (jar not found)"
2121 SAVE_CPPFLAGS="$CPPFLAGS"
2122 SAVE_CFLAGS="$CFLAGS"
2123 SAVE_LDFLAGS="$LDFLAGS"
2124 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2125 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2126 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2128 if test "x$with_java" = "xyes"
2130 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2132 if test "x$with_java" = "xyes"
2134 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2136 [with_java="no (libjvm not found)"],
2139 if test "x$with_java" = "xyes"
2141 JAVA_LIBS="$JAVA_LIBS -ljvm"
2142 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2145 CPPFLAGS="$SAVE_CPPFLAGS"
2146 CFLAGS="$SAVE_CFLAGS"
2147 LDFLAGS="$SAVE_LDFLAGS"
2149 AC_SUBST(JAVA_CPPFLAGS)
2150 AC_SUBST(JAVA_CFLAGS)
2151 AC_SUBST(JAVA_LDFLAGS)
2153 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2156 # --with-liblvm2app {{{
2157 with_liblvm2app_cppflags=""
2158 with_liblvm2app_ldflags=""
2159 AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
2161 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2163 with_liblvm2app_cppflags="-I$withval/include"
2164 with_liblvm2app_ldflags="-L$withval/lib"
2165 with_liblvm2app="yes"
2167 with_liblvm2app="$withval"
2171 with_liblvm2app="yes"
2173 if test "x$with_liblvm2app" = "xyes"
2175 SAVE_CPPFLAGS="$CPPFLAGS"
2176 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2178 AC_CHECK_HEADERS(lvm2app.h, [with_liblvm2app="yes"], [with_liblvm2app="no (lvm2app.h not found)"])
2180 CPPFLAGS="$SAVE_CPPFLAGS"
2183 if test "x$with_liblvm2app" = "xyes"
2185 SAVE_CPPFLAGS="$CPPFLAGS"
2186 SAVE_LDFLAGS="$LDFLAGS"
2187 CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
2188 LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
2190 AC_CHECK_LIB(liblvm2app, lvm_init[with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
2192 CPPFLAGS="$SAVE_CPPFLAGS"
2193 LDFLAGS="$SAVE_LDFLAGS"
2195 if test "x$with_liblvm2app" = "xyes"
2197 BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
2198 BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
2199 BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
2200 AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
2201 AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS)
2202 AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS)
2203 AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.])
2205 AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes")
2208 # --with-libmemcached {{{
2209 with_libmemcached_cppflags=""
2210 with_libmemcached_ldflags=""
2211 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2213 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2215 with_libmemcached_cppflags="-I$withval/include"
2216 with_libmemcached_ldflags="-L$withval/lib"
2217 with_libmemcached="yes"
2219 with_libmemcached="$withval"
2223 with_libmemcached="yes"
2225 if test "x$with_libmemcached" = "xyes"
2227 SAVE_CPPFLAGS="$CPPFLAGS"
2228 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2230 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2232 CPPFLAGS="$SAVE_CPPFLAGS"
2234 if test "x$with_libmemcached" = "xyes"
2236 SAVE_CPPFLAGS="$CPPFLAGS"
2237 SAVE_LDFLAGS="$LDFLAGS"
2238 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2239 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2241 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2243 CPPFLAGS="$SAVE_CPPFLAGS"
2244 LDFLAGS="$SAVE_LDFLAGS"
2246 if test "x$with_libmemcached" = "xyes"
2248 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2249 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2250 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2251 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2252 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2253 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2254 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2256 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2259 # --with-libmodbus {{{
2260 with_libmodbus_config=""
2261 with_libmodbus_cflags=""
2262 with_libmodbus_libs=""
2263 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2265 if test "x$withval" = "xno"
2268 else if test "x$withval" = "xyes"
2270 with_libmodbus="use_pkgconfig"
2271 else if test -d "$with_libmodbus/lib"
2273 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2274 with_libmodbus_cflags="-I$withval/include"
2275 with_libmodbus_libs="-L$withval/lib -lmodbus"
2276 with_libmodbus="yes"
2279 [with_libmodbus="use_pkgconfig"])
2281 # configure using pkg-config
2282 if test "x$with_libmodbus" = "xuse_pkgconfig"
2284 if test "x$PKG_CONFIG" = "x"
2286 with_libmodbus="no (Don't have pkg-config)"
2289 if test "x$with_libmodbus" = "xuse_pkgconfig"
2291 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2292 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2295 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2298 if test "x$with_libmodbus" = "xuse_pkgconfig"
2300 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2303 with_libmodbus="no ($PKG_CONFIG failed)"
2305 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2308 with_libmodbus="no ($PKG_CONFIG failed)"
2311 if test "x$with_libmodbus" = "xuse_pkgconfig"
2313 with_libmodbus="yes"
2316 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2317 # the actual checks.
2318 if test "x$with_libmodbus" = "xyes"
2320 SAVE_CPPFLAGS="$CPPFLAGS"
2321 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2323 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2325 CPPFLAGS="$SAVE_CPPFLAGS"
2327 if test "x$with_libmodbus" = "xyes"
2329 SAVE_CPPFLAGS="$CPPFLAGS"
2330 SAVE_LDFLAGS="$LDFLAGS"
2332 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2333 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2335 AC_CHECK_LIB(modbus, modbus_connect,
2336 [with_libmodbus="yes"],
2337 [with_libmodbus="no (symbol modbus_connect not found)"])
2339 CPPFLAGS="$SAVE_CPPFLAGS"
2340 LDFLAGS="$SAVE_LDFLAGS"
2342 if test "x$with_libmodbus" = "xyes"
2344 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2345 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2346 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2347 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2351 # --with-libmongoc {{{
2352 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2354 if test "x$withval" = "xyes"
2356 with_libmongoc="yes"
2357 else if test "x$withval" = "xno"
2361 with_libmongoc="yes"
2362 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2363 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2366 [with_libmongoc="yes"])
2368 SAVE_CPPFLAGS="$CPPFLAGS"
2369 SAVE_LDFLAGS="$LDFLAGS"
2371 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2372 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2374 if test "x$with_libmongoc" = "xyes"
2376 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2378 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2380 AC_CHECK_HEADERS(mongo.h,
2381 [with_libmongoc="yes"],
2382 [with_libmongoc="no ('mongo.h' not found)"],
2384 # define MONGO_HAVE_STDINT 1
2386 # define MONGO_USE_LONG_LONG_INT 1
2390 if test "x$with_libmongoc" = "xyes"
2392 if test "x$LIBMONGOC_LDFLAGS" != "x"
2394 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2396 AC_CHECK_LIB(mongoc, mongo_run_command,
2397 [with_libmongoc="yes"],
2398 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2401 CPPFLAGS="$SAVE_CPPFLAGS"
2402 LDFLAGS="$SAVE_LDFLAGS"
2404 if test "x$with_libmongoc" = "xyes"
2406 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2407 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2408 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2409 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2411 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2414 # --with-libmysql {{{
2415 with_mysql_config="mysql_config"
2416 with_mysql_cflags=""
2418 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2420 if test "x$withval" = "xno"
2423 else if test "x$withval" = "xyes"
2427 if test -f "$withval" && test -x "$withval";
2429 with_mysql_config="$withval"
2430 else if test -x "$withval/bin/mysql_config"
2432 with_mysql_config="$withval/bin/mysql_config"
2440 if test "x$with_libmysql" = "xyes"
2442 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2443 mysql_config_status=$?
2445 if test $mysql_config_status -ne 0
2447 with_libmysql="no ($with_mysql_config failed)"
2449 SAVE_CPPFLAGS="$CPPFLAGS"
2450 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2453 have_mysql_mysql_h="no"
2454 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2456 if test "x$have_mysql_h" = "xno"
2458 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2461 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2463 with_libmysql="no (mysql.h not found)"
2466 CPPFLAGS="$SAVE_CPPFLAGS"
2469 if test "x$with_libmysql" = "xyes"
2471 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2472 mysql_config_status=$?
2474 if test $mysql_config_status -ne 0
2476 with_libmysql="no ($with_mysql_config failed)"
2478 AC_CHECK_LIB(mysqlclient, mysql_init,
2479 [with_libmysql="yes"],
2480 [with_libmysql="no (symbol 'mysql_init' not found)"],
2483 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2484 [with_libmysql="yes"],
2485 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2489 if test "x$with_libmysql" = "xyes"
2491 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2492 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2493 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2494 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2496 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2499 # --with-libnetlink {{{
2500 with_libnetlink_cflags=""
2501 with_libnetlink_libs="-lnetlink"
2502 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2504 echo "libnetlink: withval = $withval"
2505 if test "x$withval" = "xyes"
2507 with_libnetlink="yes"
2508 else if test "x$withval" = "xno"
2510 with_libnetlink="no"
2512 if test -d "$withval/include"
2514 with_libnetlink_cflags="-I$withval/include"
2515 with_libnetlink_libs="-L$withval/lib -lnetlink"
2516 with_libnetlink="yes"
2518 AC_MSG_ERROR("no such directory: $withval/include")
2523 if test "x$ac_system" = "xLinux"
2525 with_libnetlink="yes"
2527 with_libnetlink="no (Linux only library)"
2530 if test "x$with_libnetlink" = "xyes"
2532 SAVE_CFLAGS="$CFLAGS"
2533 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2535 with_libnetlink="no (libnetlink.h not found)"
2537 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2539 with_libnetlink="yes"
2543 #include <sys/types.h>
2544 #include <asm/types.h>
2545 #include <sys/socket.h>
2546 #include <linux/netlink.h>
2547 #include <linux/rtnetlink.h>])
2548 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2550 #include <sys/types.h>
2551 #include <asm/types.h>
2552 #include <sys/socket.h>])
2554 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2557 #include <sys/types.h>
2558 #include <asm/types.h>
2559 #include <sys/socket.h>
2560 #include <linux/netlink.h>
2561 #include <linux/rtnetlink.h>
2564 int retval = TCA_STATS2;
2568 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2570 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2573 #include <sys/types.h>
2574 #include <asm/types.h>
2575 #include <sys/socket.h>
2576 #include <linux/netlink.h>
2577 #include <linux/rtnetlink.h>
2580 int retval = TCA_STATS;
2584 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])])
2586 CFLAGS="$SAVE_CFLAGS"
2588 if test "x$with_libnetlink" = "xyes"
2590 AC_CHECK_LIB(netlink, rtnl_open,
2591 [with_libnetlink="yes"],
2592 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2593 [$with_libnetlink_libs])
2595 if test "x$with_libnetlink" = "xyes"
2597 SAVE_CFLAGS="$CFLAGS"
2598 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2601 [if function 'rtnl_dump_filter' expects five arguments],
2602 [c_cv_rtnl_dump_filter_five_args],
2603 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2606 #include <sys/types.h>
2607 #include <asm/types.h>
2608 #include <sys/socket.h>
2609 #if HAVE_LIBNETLINK_H
2610 # include <libnetlink.h>
2611 #elif HAVE_IPROUTE_LIBNETLINK_H
2612 # include <iproute/libnetlink.h>
2613 #elif HAVE_LINUX_LIBNETLINK_H
2614 # include <linux/libnetlink.h>
2618 if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL))
2623 [c_cv_rtnl_dump_filter_five_args="yes"],
2624 [c_cv_rtnl_dump_filter_five_args="no"]
2629 [if function 'rtnl_dump_filter' expects three arguments],
2630 [c_cv_rtnl_dump_filter_three_args],
2631 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2634 #include <sys/types.h>
2635 #include <asm/types.h>
2636 #include <sys/socket.h>
2637 #if HAVE_LIBNETLINK_H
2638 # include <libnetlink.h>
2639 #elif HAVE_IPROUTE_LIBNETLINK_H
2640 # include <iproute/libnetlink.h>
2641 #elif HAVE_LINUX_LIBNETLINK_H
2642 # include <linux/libnetlink.h>
2646 if (rtnl_dump_filter(NULL, NULL, NULL))
2651 [c_cv_rtnl_dump_filter_three_args="yes"],
2652 [c_cv_rtnl_dump_filter_three_args="no"]
2656 CFLAGS="$SAVE_CFLAGS"
2658 if test "x$c_cv_rtnl_dump_filter_five_args" = "xyes"
2660 AC_DEFINE(RTNL_DUMP_FILTER_FIVE_ARGS, 1,
2661 [Define to 1 if function 'rtnl_dump_filter' expects five arguments.])
2663 if test "x$c_cv_rtnl_dump_filter_three_args" = "xyes"
2665 AC_DEFINE(RTNL_DUMP_FILTER_THREE_ARGS, 1,
2666 [Define to 1 if function 'rtnl_dump_filter' expects three arguments.])
2669 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2670 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2671 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2672 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2674 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2677 # --with-libnetapp {{{
2678 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2679 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2680 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2681 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2682 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2683 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2684 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2686 if test -d "$withval"
2688 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2689 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2690 with_libnetapp="yes"
2692 with_libnetapp="$withval"
2696 with_libnetapp="yes"
2699 SAVE_CPPFLAGS="$CPPFLAGS"
2700 SAVE_LDFLAGS="$LDFLAGS"
2701 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2702 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2704 if test "x$with_libnetapp" = "xyes"
2706 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2708 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2710 AC_CHECK_HEADERS(netapp_api.h,
2711 [with_libnetapp="yes"],
2712 [with_libnetapp="no (netapp_api.h not found)"])
2715 if test "x$with_libnetapp" = "xyes"
2717 if test "x$LIBNETAPP_LDFLAGS" != "x"
2719 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2722 if test "x$LIBNETAPP_LIBS" = "x"
2724 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2726 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2728 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2729 [with_libnetapp="yes"],
2730 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2732 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2735 CPPFLAGS="$SAVE_CPPFLAGS"
2736 LDFLAGS="$SAVE_LDFLAGS"
2738 if test "x$with_libnetapp" = "xyes"
2740 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2743 AC_SUBST(LIBNETAPP_CPPFLAGS)
2744 AC_SUBST(LIBNETAPP_LDFLAGS)
2745 AC_SUBST(LIBNETAPP_LIBS)
2746 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2749 # --with-libnetsnmp {{{
2750 with_snmp_config="net-snmp-config"
2753 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2755 if test "x$withval" = "xno"
2757 with_libnetsnmp="no"
2758 else if test "x$withval" = "xyes"
2760 with_libnetsnmp="yes"
2762 if test -x "$withval"
2764 with_snmp_config="$withval"
2765 with_libnetsnmp="yes"
2767 with_snmp_config="$withval/bin/net-snmp-config"
2768 with_libnetsnmp="yes"
2772 [with_libnetsnmp="yes"])
2773 if test "x$with_libnetsnmp" = "xyes"
2775 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2776 snmp_config_status=$?
2778 if test $snmp_config_status -ne 0
2780 with_libnetsnmp="no ($with_snmp_config failed)"
2782 SAVE_CPPFLAGS="$CPPFLAGS"
2783 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2785 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2787 CPPFLAGS="$SAVE_CPPFLAGS"
2790 if test "x$with_libnetsnmp" = "xyes"
2792 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2793 snmp_config_status=$?
2795 if test $snmp_config_status -ne 0
2797 with_libnetsnmp="no ($with_snmp_config failed)"
2799 AC_CHECK_LIB(netsnmp, init_snmp,
2800 [with_libnetsnmp="yes"],
2801 [with_libnetsnmp="no (libnetsnmp not found)"],
2805 if test "x$with_libnetsnmp" = "xyes"
2807 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2808 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2809 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2810 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2812 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2815 # --with-liboconfig {{{
2816 with_own_liboconfig="no"
2817 liboconfig_LDFLAGS="$LDFLAGS"
2818 liboconfig_CPPFLAGS="$CPPFLAGS"
2819 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2821 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2823 if test -d "$withval/lib"
2825 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2827 if test -d "$withval/include"
2829 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2832 if test "x$withval" = "xno"
2834 AC_MSG_ERROR("liboconfig is required")
2838 with_liboconfig="yes"
2841 save_LDFLAGS="$LDFLAGS"
2842 save_CPPFLAGS="$CPPFLAGS"
2843 LDFLAGS="$liboconfig_LDFLAGS"
2844 CPPFLAGS="$liboconfig_CPPFLAGS"
2845 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2847 with_liboconfig="yes"
2848 with_own_liboconfig="no"
2851 with_liboconfig="yes"
2852 with_own_liboconfig="yes"
2853 LDFLAGS="$save_LDFLAGS"
2854 CPPFLAGS="$save_CPPFLAGS"
2857 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2858 if test "x$with_own_liboconfig" = "xyes"
2860 with_liboconfig="yes (shipped version)"
2864 # --with-liboping {{{
2865 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2867 if test "x$withval" = "xyes"
2870 else if test "x$withval" = "xno"
2875 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2876 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2879 [with_liboping="yes"])
2881 SAVE_CPPFLAGS="$CPPFLAGS"
2882 SAVE_LDFLAGS="$LDFLAGS"
2884 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2885 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2887 if test "x$with_liboping" = "xyes"
2889 if test "x$LIBOPING_CPPFLAGS" != "x"
2891 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2893 AC_CHECK_HEADERS(oping.h,
2894 [with_liboping="yes"],
2895 [with_liboping="no (oping.h not found)"])
2897 if test "x$with_liboping" = "xyes"
2899 if test "x$LIBOPING_LDFLAGS" != "x"
2901 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2903 AC_CHECK_LIB(oping, ping_construct,
2904 [with_liboping="yes"],
2905 [with_liboping="no (symbol 'ping_construct' not found)"])
2908 CPPFLAGS="$SAVE_CPPFLAGS"
2909 LDFLAGS="$SAVE_LDFLAGS"
2911 if test "x$with_liboping" = "xyes"
2913 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2914 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2915 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2916 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2918 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2922 with_oracle_cppflags=""
2924 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2926 if test "x$withval" = "xyes"
2928 if test "x$ORACLE_HOME" = "x"
2930 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2933 else if test "x$withval" = "xno"
2938 ORACLE_HOME="$withval"
2942 if test "x$ORACLE_HOME" = "x"
2944 with_oracle="no (ORACLE_HOME is not set)"
2949 if test "x$ORACLE_HOME" != "x"
2951 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2953 if test -e "$ORACLE_HOME/lib/ldflags"
2955 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2957 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2958 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2960 if test "x$with_oracle" = "xyes"
2962 SAVE_CPPFLAGS="$CPPFLAGS"
2963 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2965 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2967 CPPFLAGS="$SAVE_CPPFLAGS"
2969 if test "x$with_oracle" = "xyes"
2971 SAVE_CPPFLAGS="$CPPFLAGS"
2972 SAVE_LDFLAGS="$LDFLAGS"
2973 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2974 LDFLAGS="$LDFLAGS $with_oracle_libs"
2976 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2978 CPPFLAGS="$SAVE_CPPFLAGS"
2979 LDFLAGS="$SAVE_LDFLAGS"
2981 if test "x$with_oracle" = "xyes"
2983 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2984 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2985 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2986 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2990 # --with-libowcapi {{{
2991 with_libowcapi_cppflags=""
2992 with_libowcapi_libs="-lowcapi"
2993 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2995 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2997 with_libowcapi_cppflags="-I$withval/include"
2998 with_libowcapi_libs="-L$withval/lib -lowcapi"
2999 with_libowcapi="yes"
3001 with_libowcapi="$withval"
3005 with_libowcapi="yes"
3007 if test "x$with_libowcapi" = "xyes"
3009 SAVE_CPPFLAGS="$CPPFLAGS"
3010 CPPFLAGS="$with_libowcapi_cppflags"
3012 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
3014 CPPFLAGS="$SAVE_CPPFLAGS"
3016 if test "x$with_libowcapi" = "xyes"
3018 SAVE_LDFLAGS="$LDFLAGS"
3019 SAVE_CPPFLAGS="$CPPFLAGS"
3020 LDFLAGS="$with_libowcapi_libs"
3021 CPPFLAGS="$with_libowcapi_cppflags"
3023 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
3025 LDFLAGS="$SAVE_LDFLAGS"
3026 CPPFLAGS="$SAVE_CPPFLAGS"
3028 if test "x$with_libowcapi" = "xyes"
3030 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
3031 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
3032 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
3033 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
3037 # --with-libpcap {{{
3038 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
3040 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3042 LDFLAGS="$LDFLAGS -L$withval/lib"
3043 CPPFLAGS="$CPPFLAGS -I$withval/include"
3046 with_libpcap="$withval"
3052 if test "x$with_libpcap" = "xyes"
3054 AC_CHECK_LIB(pcap, pcap_open_live,
3056 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
3057 ], [with_libpcap="no (libpcap not found)"])
3059 if test "x$with_libpcap" = "xyes"
3061 AC_CHECK_HEADERS(pcap.h,,
3062 [with_libpcap="no (pcap.h not found)"])
3064 if test "x$with_libpcap" = "xyes"
3066 AC_CHECK_HEADERS(pcap-bpf.h,,
3067 [with_libpcap="no (pcap-bpf.h not found)"])
3069 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
3072 # --with-libperl {{{
3073 perl_interpreter="perl"
3074 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
3076 if test -f "$withval" && test -x "$withval"
3078 perl_interpreter="$withval"
3080 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
3082 LDFLAGS="$LDFLAGS -L$withval/lib"
3083 CPPFLAGS="$CPPFLAGS -I$withval/include"
3084 perl_interpreter="$withval/bin/perl"
3087 with_libperl="$withval"
3094 AC_MSG_CHECKING([for perl])
3095 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
3096 if test -x "$perl_interpreter"
3098 AC_MSG_RESULT([yes ($perl_interpreter)])
3104 AC_SUBST(PERL, "$perl_interpreter")
3106 if test "x$with_libperl" = "xyes" \
3107 && test -n "$perl_interpreter"
3109 SAVE_CFLAGS="$CFLAGS"
3110 SAVE_LDFLAGS="$LDFLAGS"
3111 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
3112 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
3113 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
3114 CFLAGS="$CFLAGS $PERL_CFLAGS"
3115 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3117 AC_CACHE_CHECK([for libperl],
3118 [c_cv_have_libperl],
3122 #define PERL_NO_GET_CONTEXT
3129 load_module (PERL_LOADMOD_NOIMPORT,
3130 newSVpv ("Collectd::Plugin::FooBar", 24),
3133 [c_cv_have_libperl="yes"],
3134 [c_cv_have_libperl="no"]
3138 if test "x$c_cv_have_libperl" = "xyes"
3140 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
3141 AC_SUBST(PERL_CFLAGS)
3142 AC_SUBST(PERL_LDFLAGS)
3147 CFLAGS="$SAVE_CFLAGS"
3148 LDFLAGS="$SAVE_LDFLAGS"
3149 else if test -z "$perl_interpreter"; then
3150 with_libperl="no (no perl interpreter found)"
3151 c_cv_have_libperl="no"
3153 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
3155 if test "x$with_libperl" = "xyes"
3157 SAVE_CFLAGS="$CFLAGS"
3158 SAVE_LDFLAGS="$LDFLAGS"
3159 CFLAGS="$CFLAGS $PERL_CFLAGS"
3160 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3162 AC_CACHE_CHECK([if perl supports ithreads],
3163 [c_cv_have_perl_ithreads],
3171 #if !defined(USE_ITHREADS)
3172 # error "Perl does not support ithreads!"
3173 #endif /* !defined(USE_ITHREADS) */
3176 [c_cv_have_perl_ithreads="yes"],
3177 [c_cv_have_perl_ithreads="no"]
3181 if test "x$c_cv_have_perl_ithreads" = "xyes"
3183 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3186 CFLAGS="$SAVE_CFLAGS"
3187 LDFLAGS="$SAVE_LDFLAGS"
3190 if test "x$with_libperl" = "xyes"
3192 SAVE_CFLAGS="$CFLAGS"
3193 SAVE_LDFLAGS="$LDFLAGS"
3194 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3195 # (see issues #41 and #42)
3196 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3197 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3199 AC_CACHE_CHECK([for broken Perl_load_module()],
3200 [c_cv_have_broken_perl_load_module],
3204 #define PERL_NO_GET_CONTEXT
3211 load_module (PERL_LOADMOD_NOIMPORT,
3212 newSVpv ("Collectd::Plugin::FooBar", 24),
3215 [c_cv_have_broken_perl_load_module="no"],
3216 [c_cv_have_broken_perl_load_module="yes"]
3220 CFLAGS="$SAVE_CFLAGS"
3221 LDFLAGS="$SAVE_LDFLAGS"
3223 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3224 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3226 if test "x$with_libperl" = "xyes"
3228 SAVE_CFLAGS="$CFLAGS"
3229 SAVE_LDFLAGS="$LDFLAGS"
3230 CFLAGS="$CFLAGS $PERL_CFLAGS"
3231 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3234 [struct mgvtbl.svt_local],
3235 [have_struct_mgvtbl_svt_local="yes"],
3236 [have_struct_mgvtbl_svt_local="no"],
3243 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3245 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3246 [Define if Perl's struct mgvtbl has member svt_local.])
3249 CFLAGS="$SAVE_CFLAGS"
3250 LDFLAGS="$SAVE_LDFLAGS"
3255 with_pg_config="pg_config"
3256 with_libpq_includedir=""
3257 with_libpq_libdir=""
3258 with_libpq_cppflags=""
3259 with_libpq_ldflags=""
3260 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3263 if test "x$withval" = "xno"
3266 else if test "x$withval" = "xyes"
3270 if test -f "$withval" && test -x "$withval";
3272 with_pg_config="$withval"
3273 else if test -x "$withval/bin/pg_config"
3275 with_pg_config="$withval/bin/pg_config"
3283 if test "x$with_libpq" = "xyes"
3285 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3288 if test $pg_config_status -eq 0
3290 if test -n "$with_libpq_includedir"; then
3291 for dir in $with_libpq_includedir; do
3292 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3296 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3299 SAVE_CPPFLAGS="$CPPFLAGS"
3300 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3302 AC_CHECK_HEADERS(libpq-fe.h, [],
3303 [with_libpq="no (libpq-fe.h not found)"], [])
3305 CPPFLAGS="$SAVE_CPPFLAGS"
3307 if test "x$with_libpq" = "xyes"
3309 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3312 if test $pg_config_status -eq 0
3314 if test -n "$with_libpq_libdir"; then
3315 for dir in $with_libpq_libdir; do
3316 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3320 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3323 SAVE_LDFLAGS="$LDFLAGS"
3324 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3326 AC_CHECK_LIB(pq, PQconnectdb,
3328 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3330 AC_CHECK_LIB(pq, PQserverVersion,
3332 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3334 LDFLAGS="$SAVE_LDFLAGS"
3336 if test "x$with_libpq" = "xyes"
3338 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3339 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3340 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3341 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3343 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3346 # --with-libpthread {{{
3347 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3348 [ if test "x$withval" != "xno" \
3349 && test "x$withval" != "xyes"
3351 LDFLAGS="$LDFLAGS -L$withval/lib"
3352 CPPFLAGS="$CPPFLAGS -I$withval/include"
3353 with_libpthread="yes"
3355 if test "x$withval" = "xno"
3357 with_libpthread="no (disabled)"
3360 ], [with_libpthread="yes"])
3361 if test "x$with_libpthread" = "xyes"
3363 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3366 if test "x$with_libpthread" = "xyes"
3368 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3370 if test "x$with_libpthread" = "xyes"
3376 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3377 [Wether or not to use pthread (POSIX threads) library])
3378 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3383 with_python_path="$PATH"
3384 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3386 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3388 with_python="$withval"
3389 else if test -x "$withval"
3391 with_python_prog="$withval"
3392 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3394 else if test -d "$withval"
3396 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3399 AC_MSG_WARN([Argument not recognized: $withval])
3401 ], [with_python="yes"])
3404 SAVE_CPPFLAGS="$CPPFLAGS"
3405 SAVE_LDFLAGS="$LDFLAGS"
3408 PATH="$with_python_path"
3410 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3412 AC_MSG_CHECKING([for python])
3413 with_python_prog="`which python 2>/dev/null`"
3414 if test "x$with_python_prog" = "x"
3416 AC_MSG_RESULT([not found])
3417 with_python="no (interpreter not found)"
3419 AC_MSG_RESULT([$with_python_prog])
3423 if test "x$with_python" = "xyes"
3425 AC_MSG_CHECKING([for Python CPPFLAGS])
3426 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3427 python_config_status=$?
3429 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3431 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3434 AC_MSG_RESULT([$python_include_path])
3438 if test "x$with_python" = "xyes"
3440 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3441 AC_CHECK_HEADERS(Python.h,
3442 [with_python="yes"],
3443 [with_python="no ('Python.h' not found)"])
3446 if test "x$with_python" = "xyes"
3448 AC_MSG_CHECKING([for Python LDFLAGS])
3449 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`
3450 python_config_status=$?
3452 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3454 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3457 AC_MSG_RESULT([$python_library_path])
3461 if test "x$with_python" = "xyes"
3463 AC_MSG_CHECKING([for Python LIBS])
3464 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`
3465 python_config_status=$?
3467 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3469 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3472 AC_MSG_RESULT([$python_library_flags])
3476 if test "x$with_python" = "xyes"
3478 LDFLAGS="-L$python_library_path $LDFLAGS"
3479 LIBS="$python_library_flags $LIBS"
3481 AC_CHECK_FUNC(PyObject_CallFunction,
3482 [with_python="yes"],
3483 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3487 CPPFLAGS="$SAVE_CPPFLAGS"
3488 LDFLAGS="$SAVE_LDFLAGS"
3491 if test "x$with_python" = "xyes"
3493 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3494 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3495 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3496 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3497 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3498 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3502 # --with-librabbitmq {{{
3503 with_librabbitmq_cppflags=""
3504 with_librabbitmq_ldflags=""
3505 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3507 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3509 with_librabbitmq_cppflags="-I$withval/include"
3510 with_librabbitmq_ldflags="-L$withval/lib"
3511 with_librabbitmq="yes"
3513 with_librabbitmq="$withval"
3517 with_librabbitmq="yes"
3519 SAVE_CPPFLAGS="$CPPFLAGS"
3520 SAVE_LDFLAGS="$LDFLAGS"
3521 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3522 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3523 if test "x$with_librabbitmq" = "xyes"
3525 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3527 if test "x$with_librabbitmq" = "xyes"
3529 # librabbitmq up to version 0.9.1 provides "library_errno", later
3530 # versions use "library_error". The library does not provide a version
3531 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3532 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3535 # include <stdlib.h>
3541 # include <stdint.h>
3544 # include <inttypes.h>
3549 if test "x$with_librabbitmq" = "xyes"
3551 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3553 if test "x$with_librabbitmq" = "xyes"
3555 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3556 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3557 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3558 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3559 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3560 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3561 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3563 CPPFLAGS="$SAVE_CPPFLAGS"
3564 LDFLAGS="$SAVE_LDFLAGS"
3565 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3568 # --with-librouteros {{{
3569 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3571 if test "x$withval" = "xyes"
3573 with_librouteros="yes"
3574 else if test "x$withval" = "xno"
3576 with_librouteros="no"
3578 with_librouteros="yes"
3579 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3580 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3583 [with_librouteros="yes"])
3585 SAVE_CPPFLAGS="$CPPFLAGS"
3586 SAVE_LDFLAGS="$LDFLAGS"
3588 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3589 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3591 if test "x$with_librouteros" = "xyes"
3593 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3595 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3597 AC_CHECK_HEADERS(routeros_api.h,
3598 [with_librouteros="yes"],
3599 [with_librouteros="no (routeros_api.h not found)"])
3601 if test "x$with_librouteros" = "xyes"
3603 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3605 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3607 AC_CHECK_LIB(routeros, ros_interface,
3608 [with_librouteros="yes"],
3609 [with_librouteros="no (symbol 'ros_interface' not found)"])
3612 CPPFLAGS="$SAVE_CPPFLAGS"
3613 LDFLAGS="$SAVE_LDFLAGS"
3615 if test "x$with_librouteros" = "xyes"
3617 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3618 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3619 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3620 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3622 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3626 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3629 librrd_threadsafe="yes"
3630 librrd_rrdc_update="no"
3631 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3632 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3634 librrd_cflags="-I$withval/include"
3635 librrd_ldflags="-L$withval/lib"
3638 with_librrd="$withval"
3640 ], [with_librrd="yes"])
3641 if test "x$with_librrd" = "xyes"
3643 SAVE_CPPFLAGS="$CPPFLAGS"
3644 SAVE_LDFLAGS="$LDFLAGS"
3646 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3647 LDFLAGS="$LDFLAGS $librrd_ldflags"
3649 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3651 CPPFLAGS="$SAVE_CPPFLAGS"
3652 LDFLAGS="$SAVE_LDFLAGS"
3654 if test "x$with_librrd" = "xyes"
3656 SAVE_CPPFLAGS="$CPPFLAGS"
3657 SAVE_LDFLAGS="$LDFLAGS"
3659 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3660 LDFLAGS="$LDFLAGS $librrd_ldflags"
3662 AC_CHECK_LIB(rrd_th, rrd_update_r,
3664 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3666 [librrd_threadsafe="no"
3667 AC_CHECK_LIB(rrd, rrd_update,
3669 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3671 [with_librrd="no (symbol 'rrd_update' not found)"],
3676 if test "x$librrd_threadsafe" = "xyes"
3678 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3680 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3683 CPPFLAGS="$SAVE_CPPFLAGS"
3684 LDFLAGS="$SAVE_LDFLAGS"
3686 if test "x$with_librrd" = "xyes"
3688 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3689 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3690 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3691 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3693 if test "x$librrd_threadsafe" = "xyes"
3695 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3699 # --with-libsensors {{{
3700 with_sensors_cflags=""
3701 with_sensors_ldflags=""
3702 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3704 if test "x$withval" = "xno"
3706 with_libsensors="no"
3708 with_libsensors="yes"
3709 if test "x$withval" != "xyes"
3711 with_sensors_cflags="-I$withval/include"
3712 with_sensors_ldflags="-L$withval/lib"
3713 with_libsensors="yes"
3718 if test "x$ac_system" = "xLinux"
3720 with_libsensors="yes"
3722 with_libsensors="no (Linux only library)"
3725 if test "x$with_libsensors" = "xyes"
3727 SAVE_CPPFLAGS="$CPPFLAGS"
3728 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3730 # AC_CHECK_HEADERS(sensors/sensors.h,
3732 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3734 # [with_libsensors="no (sensors/sensors.h not found)"])
3735 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3737 CPPFLAGS="$SAVE_CPPFLAGS"
3739 if test "x$with_libsensors" = "xyes"
3741 SAVE_CPPFLAGS="$CPPFLAGS"
3742 SAVE_LDFLAGS="$LDFLAGS"
3743 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3744 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3746 AC_CHECK_LIB(sensors, sensors_init,
3748 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3750 [with_libsensors="no (libsensors not found)"])
3752 CPPFLAGS="$SAVE_CPPFLAGS"
3753 LDFLAGS="$SAVE_LDFLAGS"
3755 if test "x$with_libsensors" = "xyes"
3757 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3758 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3759 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3760 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3762 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3765 # --with-libstatgrab {{{
3766 with_libstatgrab_cflags=""
3767 with_libstatgrab_ldflags=""
3768 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3770 if test "x$withval" != "xno" \
3771 && test "x$withval" != "xyes"
3773 with_libstatgrab_cflags="-I$withval/include"
3774 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3775 with_libstatgrab="yes"
3776 with_libstatgrab_pkg_config="no"
3778 with_libstatgrab="$withval"
3779 with_libstatgrab_pkg_config="yes"
3783 with_libstatgrab="yes"
3784 with_libstatgrab_pkg_config="yes"
3787 if test "x$with_libstatgrab" = "xyes" \
3788 && test "x$with_libstatgrab_pkg_config" = "xyes"
3790 if test "x$PKG_CONFIG" != "x"
3792 AC_MSG_CHECKING([pkg-config for libstatgrab])
3794 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3797 with_libstatgrab_pkg_config="no"
3798 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3799 temp_result="not found"
3801 AC_MSG_RESULT([$temp_result])
3803 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3804 with_libstatgrab_pkg_config="no"
3805 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3809 if test "x$with_libstatgrab" = "xyes" \
3810 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3811 && test "x$with_libstatgrab_cflags" = "x"
3813 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3814 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3817 with_libstatgrab_cflags="$temp_result"
3819 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3820 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3822 AC_MSG_RESULT([$temp_result])
3825 if test "x$with_libstatgrab" = "xyes" \
3826 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3827 && test "x$with_libstatgrab_ldflags" = "x"
3829 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3830 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3833 with_libstatgrab_ldflags="$temp_result"
3835 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3836 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3838 AC_MSG_RESULT([$temp_result])
3841 if test "x$with_libstatgrab" = "xyes"
3843 SAVE_CPPFLAGS="$CPPFLAGS"
3844 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3846 AC_CHECK_HEADERS(statgrab.h,
3847 [with_libstatgrab="yes"],
3848 [with_libstatgrab="no (statgrab.h not found)"])
3850 CPPFLAGS="$SAVE_CPPFLAGS"
3853 if test "x$with_libstatgrab" = "xyes"
3855 SAVE_CFLAGS="$CFLAGS"
3856 SAVE_LDFLAGS="$LDFLAGS"
3858 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3859 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3861 AC_CHECK_LIB(statgrab, sg_init,
3862 [with_libstatgrab="yes"],
3863 [with_libstatgrab="no (symbol sg_init not found)"])
3865 CFLAGS="$SAVE_CFLAGS"
3866 LDFLAGS="$SAVE_LDFLAGS"
3869 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3870 if test "x$with_libstatgrab" = "xyes"
3872 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3873 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3874 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3875 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3876 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3880 # --with-libtokyotyrant {{{
3881 with_libtokyotyrant_cppflags=""
3882 with_libtokyotyrant_ldflags=""
3883 with_libtokyotyrant_libs=""
3884 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3886 if test "x$withval" = "xno"
3888 with_libtokyotyrant="no"
3889 else if test "x$withval" = "xyes"
3891 with_libtokyotyrant="yes"
3893 with_libtokyotyrant_cppflags="-I$withval/include"
3894 with_libtokyotyrant_ldflags="-L$withval/include"
3895 with_libtokyotyrant_libs="-ltokyotyrant"
3896 with_libtokyotyrant="yes"
3900 with_libtokyotyrant="yes"
3903 if test "x$with_libtokyotyrant" = "xyes"
3905 if $PKG_CONFIG --exists tokyotyrant
3907 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3908 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3909 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3913 SAVE_CPPFLAGS="$CPPFLAGS"
3914 SAVE_LDFLAGS="$LDFLAGS"
3915 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3916 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3918 if test "x$with_libtokyotyrant" = "xyes"
3920 AC_CHECK_HEADERS(tcrdb.h,
3922 AC_DEFINE(HAVE_TCRDB_H, 1,
3923 [Define to 1 if you have the <tcrdb.h> header file.])
3924 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3927 if test "x$with_libtokyotyrant" = "xyes"
3929 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3931 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3932 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3934 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3935 [$with_libtokyotyrant_libs])
3938 CPPFLAGS="$SAVE_CPPFLAGS"
3939 LDFLAGS="$SAVE_LDFLAGS"
3941 if test "x$with_libtokyotyrant" = "xyes"
3943 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3944 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3945 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3946 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3947 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3948 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3950 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3953 # --with-libupsclient {{{
3954 with_libupsclient_config=""
3955 with_libupsclient_cflags=""
3956 with_libupsclient_libs=""
3957 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3959 if test "x$withval" = "xno"
3961 with_libupsclient="no"
3962 else if test "x$withval" = "xyes"
3964 with_libupsclient="use_pkgconfig"
3966 if test -x "$withval"
3968 with_libupsclient_config="$withval"
3969 with_libupsclient="use_libupsclient_config"
3970 else if test -x "$withval/bin/libupsclient-config"
3972 with_libupsclient_config="$withval/bin/libupsclient-config"
3973 with_libupsclient="use_libupsclient_config"
3975 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3976 with_libupsclient_cflags="-I$withval/include"
3977 with_libupsclient_libs="-L$withval/lib -lupsclient"
3978 with_libupsclient="yes"
3982 [with_libupsclient="use_pkgconfig"])
3984 # configure using libupsclient-config
3985 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3987 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3988 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3991 with_libupsclient="no ($with_libupsclient_config failed)"
3993 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3996 with_libupsclient="no ($with_libupsclient_config failed)"
3999 if test "x$with_libupsclient" = "xuse_libupsclient_config"
4001 with_libupsclient="yes"
4004 # configure using pkg-config
4005 if test "x$with_libupsclient" = "xuse_pkgconfig"
4007 if test "x$PKG_CONFIG" = "x"
4009 with_libupsclient="no (Don't have pkg-config)"
4012 if test "x$with_libupsclient" = "xuse_pkgconfig"
4014 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
4015 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
4018 with_libupsclient="no (pkg-config doesn't know libupsclient)"
4021 if test "x$with_libupsclient" = "xuse_pkgconfig"
4023 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
4026 with_libupsclient="no ($PKG_CONFIG failed)"
4028 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
4031 with_libupsclient="no ($PKG_CONFIG failed)"
4034 if test "x$with_libupsclient" = "xuse_pkgconfig"
4036 with_libupsclient="yes"
4039 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
4040 # the actual checks.
4041 if test "x$with_libupsclient" = "xyes"
4043 SAVE_CPPFLAGS="$CPPFLAGS"
4044 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4046 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
4048 CPPFLAGS="$SAVE_CPPFLAGS"
4050 if test "x$with_libupsclient" = "xyes"
4052 SAVE_CPPFLAGS="$CPPFLAGS"
4053 SAVE_LDFLAGS="$LDFLAGS"
4055 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4056 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
4058 AC_CHECK_LIB(upsclient, upscli_connect,
4059 [with_libupsclient="yes"],
4060 [with_libupsclient="no (symbol upscli_connect not found)"])
4062 CPPFLAGS="$SAVE_CPPFLAGS"
4063 LDFLAGS="$SAVE_LDFLAGS"
4065 if test "x$with_libupsclient" = "xyes"
4067 SAVE_CPPFLAGS="$CPPFLAGS"
4068 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
4070 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
4071 [#include <stdlib.h>
4073 #include <upsclient.h>])
4075 CPPFLAGS="$SAVE_CPPFLAGS"
4077 if test "x$with_libupsclient" = "xyes"
4079 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
4080 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
4081 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
4082 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
4086 # --with-libxmms {{{
4087 with_xmms_config="xmms-config"
4090 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
4092 if test "x$withval" != "xno" \
4093 && test "x$withval" != "xyes"
4095 if test -f "$withval" && test -x "$withval";
4097 with_xmms_config="$withval"
4098 else if test -x "$withval/bin/xmms-config"
4100 with_xmms_config="$withval/bin/xmms-config"
4103 else if test "x$withval" = "xno"
4113 if test "x$with_libxmms" = "xyes"
4115 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
4116 xmms_config_status=$?
4118 if test $xmms_config_status -ne 0
4123 if test "x$with_libxmms" = "xyes"
4125 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
4126 xmms_config_status=$?
4128 if test $xmms_config_status -ne 0
4133 if test "x$with_libxmms" = "xyes"
4135 AC_CHECK_LIB(xmms, xmms_remote_get_info,
4137 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
4138 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
4139 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
4140 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
4147 with_libxmms_numeric=0
4148 if test "x$with_libxmms" = "xyes"
4150 with_libxmms_numeric=1
4152 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
4153 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
4156 # --with-libyajl {{{
4157 with_libyajl_cppflags=""
4158 with_libyajl_ldflags=""
4159 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
4161 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4163 with_libyajl_cppflags="-I$withval/include"
4164 with_libyajl_ldflags="-L$withval/lib"
4167 with_libyajl="$withval"
4173 if test "x$with_libyajl" = "xyes"
4175 SAVE_CPPFLAGS="$CPPFLAGS"
4176 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4178 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
4179 AC_CHECK_HEADERS(yajl/yajl_version.h)
4181 CPPFLAGS="$SAVE_CPPFLAGS"
4183 if test "x$with_libyajl" = "xyes"
4185 SAVE_CPPFLAGS="$CPPFLAGS"
4186 SAVE_LDFLAGS="$LDFLAGS"
4187 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4188 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4190 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4192 CPPFLAGS="$SAVE_CPPFLAGS"
4193 LDFLAGS="$SAVE_LDFLAGS"
4195 if test "x$with_libyajl" = "xyes"
4197 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4198 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4199 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4200 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4201 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4202 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4203 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4205 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4208 # --with-libvarnish {{{
4209 with_libvarnish_cppflags=""
4210 with_libvarnish_cflags=""
4211 with_libvarnish_libs=""
4212 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4214 if test "x$withval" = "xno"
4216 with_libvarnish="no"
4217 else if test "x$withval" = "xyes"
4219 with_libvarnish="use_pkgconfig"
4220 else if test -d "$with_libvarnish/lib"
4222 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4223 with_libvarnish_cflags="-I$withval/include"
4224 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4225 with_libvarnish="yes"
4228 [with_libvarnish="use_pkgconfig"])
4230 # configure using pkg-config
4231 if test "x$with_libvarnish" = "xuse_pkgconfig"
4233 if test "x$PKG_CONFIG" = "x"
4235 with_libvarnish="no (Don't have pkg-config)"
4238 if test "x$with_libvarnish" = "xuse_pkgconfig"
4240 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4241 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4244 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4247 if test "x$with_libvarnish" = "xuse_pkgconfig"
4249 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4252 with_libvarnish="no ($PKG_CONFIG failed)"
4254 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4257 with_libvarnish="no ($PKG_CONFIG failed)"
4260 if test "x$with_libvarnish" = "xuse_pkgconfig"
4262 with_libvarnish="yes"
4265 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4266 # the actual checks.
4267 if test "x$with_libvarnish" = "xyes"
4269 SAVE_CPPFLAGS="$CPPFLAGS"
4270 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4271 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4273 CPPFLAGS="$SAVE_CPPFLAGS"
4275 if test "x$with_libvarnish" = "xyes"
4277 SAVE_CPPFLAGS="$CPPFLAGS"
4278 #SAVE_LDFLAGS="$LDFLAGS"
4280 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4281 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4283 AC_CHECK_HEADERS(varnish/vsc.h,
4284 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4285 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4287 CPPFLAGS="$SAVE_CPPFLAGS"
4288 #LDFLAGS="$SAVE_LDFLAGS"
4290 if test "x$with_libvarnish" = "xyes"
4292 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4293 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4294 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4295 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4299 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4300 with_libxml2="no (pkg-config isn't available)"
4301 with_libxml2_cflags=""
4302 with_libxml2_ldflags=""
4303 with_libvirt="no (pkg-config isn't available)"
4304 with_libvirt_cflags=""
4305 with_libvirt_ldflags=""
4306 if test "x$PKG_CONFIG" != "x"
4308 pkg-config --exists 'libxml-2.0' 2>/dev/null
4313 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4316 pkg-config --exists libvirt 2>/dev/null
4321 with_libvirt="no (pkg-config doesn't know libvirt)"
4324 if test "x$with_libxml2" = "xyes"
4326 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4331 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4337 if test "x$with_libxml2" = "xyes"
4339 SAVE_CPPFLAGS="$CPPFLAGS"
4340 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4342 AC_CHECK_HEADERS(libxml/parser.h, [],
4343 [with_libxml2="no (libxml/parser.h not found)"])
4345 CPPFLAGS="$SAVE_CPPFLAGS"
4347 if test "x$with_libxml2" = "xyes"
4349 SAVE_CFLAGS="$CFLAGS"
4350 SAVE_LDFLAGS="$LDFLAGS"
4352 CFLAGS="$CFLAGS $with_libxml2_cflags"
4353 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4355 AC_CHECK_LIB(xml2, xmlXPathEval,
4356 [with_libxml2="yes"],
4357 [with_libxml2="no (symbol xmlXPathEval not found)"])
4359 CFLAGS="$SAVE_CFLAGS"
4360 LDFLAGS="$SAVE_LDFLAGS"
4362 dnl Add the right compiler flags and libraries.
4363 if test "x$with_libxml2" = "xyes"; then
4364 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4365 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4366 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4367 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4369 if test "x$with_libvirt" = "xyes"
4371 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4376 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4382 if test "x$with_libvirt" = "xyes"
4384 SAVE_CPPFLAGS="$CPPFLAGS"
4385 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4387 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4388 [with_libvirt="no (libvirt/libvirt.h not found)"])
4390 CPPFLAGS="$SAVE_CPPFLAGS"
4392 if test "x$with_libvirt" = "xyes"
4394 SAVE_CFLAGS="$CFLAGS"
4395 SAVE_LDFLAGS="$LDFLAGS"
4397 CFLAGS="$CFLAGS $with_libvirt_cflags"
4398 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4400 AC_CHECK_LIB(virt, virDomainBlockStats,
4401 [with_libvirt="yes"],
4402 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4404 CFLAGS="$SAVE_CFLAGS"
4405 LDFLAGS="$SAVE_LDFLAGS"
4407 dnl Add the right compiler flags and libraries.
4408 if test "x$with_libvirt" = "xyes"; then
4409 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4410 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4411 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4412 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4416 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4417 with_libopenipmipthread="yes"
4418 with_libopenipmipthread_cflags=""
4419 with_libopenipmipthread_libs=""
4421 AC_MSG_CHECKING([for pkg-config])
4423 if test "x$PKG_CONFIG" = "x"
4425 with_libopenipmipthread="no"
4428 temp_result="$PKG_CONFIG"
4430 AC_MSG_RESULT([$temp_result])
4432 if test "x$with_libopenipmipthread" = "xyes"
4434 AC_MSG_CHECKING([for libOpenIPMIpthread])
4435 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4438 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4440 AC_MSG_RESULT([$with_libopenipmipthread])
4443 if test "x$with_libopenipmipthread" = "xyes"
4445 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4446 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4449 with_libopenipmipthread_cflags="$temp_result"
4451 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4452 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4454 AC_MSG_RESULT([$temp_result])
4457 if test "x$with_libopenipmipthread" = "xyes"
4459 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4460 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4463 with_libopenipmipthread_ldflags="$temp_result"
4465 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4466 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4468 AC_MSG_RESULT([$temp_result])
4471 if test "x$with_libopenipmipthread" = "xyes"
4473 SAVE_CPPFLAGS="$CPPFLAGS"
4474 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4476 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4477 [with_libopenipmipthread="yes"],
4478 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4479 [#include <OpenIPMI/ipmiif.h>
4480 #include <OpenIPMI/ipmi_err.h>
4481 #include <OpenIPMI/ipmi_posix.h>
4482 #include <OpenIPMI/ipmi_conn.h>
4485 CPPFLAGS="$SAVE_CPPFLAGS"
4488 if test "x$with_libopenipmipthread" = "xyes"
4490 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4491 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4492 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4493 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4497 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4498 [with_libnotify="yes"],
4499 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4502 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4505 # Check for enabled/disabled features
4508 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4509 # ------------------------------------------------------------
4511 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4516 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4521 m4_define([EnDis],[disabled])dnl
4522 m4_define([YesNo],[no])dnl
4528 m4_define([EnDis],[enabled])dnl
4529 m4_define([YesNo],[yes])dnl
4532 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4536 m4_if([$3], [feature], [],
4540 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4546 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4548 enable_$1='[YesNo]'dnl
4550 if test "x$enable_$1" = "xno"
4554 if test "x$enable_$1" = "xyes"
4558 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4563 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4564 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4566 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4568 # AC_PLUGIN(name, default, info)
4569 # ------------------------------------------------------------
4576 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4578 if test "x$enableval" = "xyes"
4581 else if test "x$enableval" = "xforce"
4586 enable_plugin="no (disabled on command line)"
4590 if test "x$enable_all_plugins" = "xauto"
4592 if test "x$2" = "xyes"
4599 enable_plugin="$enable_all_plugins"
4602 if test "x$enable_plugin" = "xyes"
4604 if test "x$2" = "xyes" || test "x$force" = "xyes"
4606 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4607 if test "x$2" != "xyes"
4609 dependency_warning="yes"
4611 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4612 dependency_error="yes"
4613 enable_plugin="no (dependency error)"
4616 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4617 enable_$1="$enable_plugin"
4619 )# AC_PLUGIN(name, default, info)
4621 m4_divert_once([HELP_ENABLE], [
4622 collectd features:])
4623 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4624 AC_COLLECTD([debug], [enable], [feature], [debugging])
4625 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4626 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4628 dependency_warning="no"
4629 dependency_error="no"
4634 plugin_conntrack="no"
4635 plugin_contextswitch="no"
4638 plugin_curl_json="no"
4639 plugin_curl_xml="no"
4645 plugin_interface="no"
4652 plugin_multimeter="no"
4656 plugin_processes="no"
4657 plugin_protocols="no"
4661 plugin_tcpconns="no"
4668 plugin_wireless="no"
4672 if test "x$ac_system" = "xLinux"
4674 plugin_battery="yes"
4675 plugin_conntrack="yes"
4676 plugin_contextswitch="yes"
4678 plugin_cpufreq="yes"
4680 plugin_entropy="yes"
4681 plugin_fscache="yes"
4682 plugin_interface="yes"
4688 plugin_processes="yes"
4689 plugin_protocols="yes"
4692 plugin_tcpconns="yes"
4693 plugin_thermal="yes"
4697 plugin_vserver="yes"
4698 plugin_wireless="yes"
4700 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4706 if test "x$ac_system" = "xOpenBSD"
4708 plugin_tcpconns="yes"
4712 if test "x$with_libiokit" = "xyes"
4714 plugin_battery="yes"
4720 if test "x$ac_system" = "xAIX"
4722 plugin_tcpconns="yes"
4725 if test "x$with_perfstat" = "xyes"
4728 plugin_contextswitch="yes"
4732 plugin_interface="yes"
4737 if test "x$with_procinfo" = "xyes"
4739 plugin_processes="yes"
4743 if test "x$with_kstat" = "xyes"
4747 plugin_zfs_arc="yes"
4750 if test "x$with_devinfo$with_kstat" = "xyesyes"
4754 plugin_interface="yes"
4760 if test "x$with_libstatgrab" = "xyes"
4764 plugin_interface="yes"
4771 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4774 if test "x$have_strptime" = "xyes"
4780 if test "x$with_libopenipmipthread" = "xyes"
4785 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4787 plugin_curl_json="yes"
4790 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4792 plugin_curl_xml="yes"
4795 if test "x$have_processor_info" = "xyes"
4799 if test "x$have_sysctl" = "xyes"
4804 if test "x$ac_system" = "xDarwin"
4809 if test "x$have_sysctlbyname" = "xyes"
4811 plugin_contextswitch="yes"
4814 plugin_tcpconns="yes"
4817 # Df plugin: Check if we know how to determine mount points first.
4818 #if test "x$have_listmntent" = "xyes"; then
4821 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4825 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4829 #if test "x$have_getmntent" = "xseq"
4833 if test "x$c_cv_have_one_getmntent" = "xyes"
4838 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4839 if test "x$plugin_df" = "xyes"
4842 if test "x$have_statfs" = "xyes"
4846 if test "x$have_statvfs" = "xyes"
4852 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
4854 plugin_ethstat="yes"
4857 if test "x$have_getifaddrs" = "xyes"
4859 plugin_interface="yes"
4862 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4864 plugin_libvirt="yes"
4867 if test "x$have_getloadavg" = "xyes"
4872 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4877 # Mac OS X memory interface
4878 if test "x$have_host_statistics" = "xyes"
4883 if test "x$have_termios_h" = "xyes"
4885 plugin_multimeter="yes"
4889 if test "x$have_thread_info" = "xyes"
4891 plugin_processes="yes"
4894 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4896 plugin_processes="yes"
4899 if test "x$with_kvm_getswapinfo" = "xyes"
4904 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4909 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4911 plugin_tcpconns="yes"
4914 if test "x$have_getutent" = "xyes"
4918 if test "x$have_getutxent" = "xyes"
4923 m4_divert_once([HELP_ENABLE], [
4926 AC_ARG_ENABLE([all-plugins],
4927 AC_HELP_STRING([--enable-all-plugins],
4928 [enable all plugins (auto by def)]),
4930 if test "x$enableval" = "xyes"
4932 enable_all_plugins="yes"
4933 else if test "x$enableval" = "xauto"
4935 enable_all_plugins="auto"
4937 enable_all_plugins="no"
4940 [enable_all_plugins="auto"])
4942 m4_divert_once([HELP_ENABLE], [])
4944 AC_PLUGIN([aggregation], [yes], [Aggregation plugin])
4945 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4946 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4947 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4948 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4949 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4950 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4951 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4952 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4953 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4954 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4955 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4956 AC_PLUGIN([csv], [yes], [CSV output plugin])
4957 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4958 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4959 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4960 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4961 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4962 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4963 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4964 AC_PLUGIN([email], [yes], [EMail statistics])
4965 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4966 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
4967 AC_PLUGIN([exec], [yes], [Execution of external programs])
4968 AC_PLUGIN([filecount], [yes], [Count files in directories])
4969 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4970 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4971 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4972 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4973 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4974 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4975 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4976 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4977 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4978 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4979 AC_PLUGIN([load], [$plugin_load], [System load])
4980 AC_PLUGIN([logfile], [yes], [File logging plugin])
4981 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4982 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4983 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4984 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4985 AC_PLUGIN([match_regex], [yes], [The regex match])
4986 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4987 AC_PLUGIN([match_value], [yes], [The value match])
4988 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4989 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
4990 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4991 AC_PLUGIN([memcached], [yes], [memcached statistics])
4992 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4993 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4994 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4995 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4996 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4997 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4998 AC_PLUGIN([network], [yes], [Network communication plugin])
4999 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
5000 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
5001 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
5002 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
5003 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
5004 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
5005 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
5006 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
5007 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
5008 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
5009 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
5010 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
5011 AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
5012 # FIXME: Check for libevent, too.
5013 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
5014 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
5015 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
5016 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
5017 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
5018 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
5019 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
5020 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
5021 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
5022 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
5023 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
5024 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
5025 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
5026 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
5027 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
5028 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
5029 AC_PLUGIN([table], [yes], [Parsing of tabular data])
5030 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
5031 AC_PLUGIN([tail_csv], [yes], [Parsing of CSV files])
5032 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
5033 AC_PLUGIN([target_notification], [yes], [The notification target])
5034 AC_PLUGIN([target_replace], [yes], [The replace target])
5035 AC_PLUGIN([target_scale],[yes], [The scale target])
5036 AC_PLUGIN([target_set], [yes], [The set target])
5037 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
5038 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
5039 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
5040 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
5041 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
5042 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
5043 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
5044 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
5045 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
5046 AC_PLUGIN([users], [$plugin_users], [User statistics])
5047 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
5048 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
5049 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
5050 AC_PLUGIN([volume], [$with_liblvm2app], [Volume statistics])
5051 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
5052 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
5053 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
5054 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
5055 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
5056 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
5057 AC_PLUGIN([write_riemann], [$have_protoc_c], [Riemann output plugin])
5058 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
5059 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
5061 dnl Default configuration file
5062 # Load either syslog or logfile
5063 LOAD_PLUGIN_SYSLOG=""
5064 LOAD_PLUGIN_LOGFILE=""
5066 AC_MSG_CHECKING([which default log plugin to load])
5067 default_log_plugin="none"
5068 if test "x$enable_syslog" = "xyes"
5070 default_log_plugin="syslog"
5072 LOAD_PLUGIN_SYSLOG="##"
5075 if test "x$enable_logfile" = "xyes"
5077 if test "x$default_log_plugin" = "xnone"
5079 default_log_plugin="logfile"
5081 LOAD_PLUGIN_LOGFILE="#"
5084 LOAD_PLUGIN_LOGFILE="##"
5086 AC_MSG_RESULT([$default_log_plugin])
5088 AC_SUBST(LOAD_PLUGIN_SYSLOG)
5089 AC_SUBST(LOAD_PLUGIN_LOGFILE)
5091 DEFAULT_LOG_LEVEL="info"
5092 if test "x$enable_debug" = "xyes"
5094 DEFAULT_LOG_LEVEL="debug"
5096 AC_SUBST(DEFAULT_LOG_LEVEL)
5098 # Load only one of rrdtool, network, csv in the default config.
5099 LOAD_PLUGIN_RRDTOOL=""
5100 LOAD_PLUGIN_NETWORK=""
5103 AC_MSG_CHECKING([which default write plugin to load])
5104 default_write_plugin="none"
5105 if test "x$enable_rrdtool" = "xyes"
5107 default_write_plugin="rrdtool"
5109 LOAD_PLUGIN_RRDTOOL="##"
5112 if test "x$enable_network" = "xyes"
5114 if test "x$default_write_plugin" = "xnone"
5116 default_write_plugin="network"
5118 LOAD_PLUGIN_NETWORK="#"
5121 LOAD_PLUGIN_NETWORK="##"
5124 if test "x$enable_csv" = "xyes"
5126 if test "x$default_write_plugin" = "xnone"
5128 default_write_plugin="csv"
5133 LOAD_PLUGIN_CSV="##"
5135 AC_MSG_RESULT([$default_write_plugin])
5137 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
5138 AC_SUBST(LOAD_PLUGIN_NETWORK)
5139 AC_SUBST(LOAD_PLUGIN_CSV)
5142 if test "x$ac_system" = "xLinux" \
5143 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
5145 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
5148 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
5150 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
5154 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
5156 if test "x$withval" != "xno" && test "x$withval" != "xyes"
5158 PERL_BINDINGS_OPTIONS="$withval"
5159 with_perl_bindings="yes"
5161 PERL_BINDINGS_OPTIONS=""
5162 with_perl_bindings="$withval"
5166 PERL_BINDINGS_OPTIONS=""
5167 if test -n "$perl_interpreter"
5169 with_perl_bindings="yes"
5171 with_perl_bindings="no (no perl interpreter found)"
5174 if test "x$with_perl_bindings" = "xyes"
5176 PERL_BINDINGS="perl"
5180 AC_SUBST(PERL_BINDINGS)
5181 AC_SUBST(PERL_BINDINGS_OPTIONS)
5183 dnl libcollectdclient
5184 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
5185 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
5186 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
5188 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5190 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5192 AC_SUBST(LCC_VERSION_MAJOR)
5193 AC_SUBST(LCC_VERSION_MINOR)
5194 AC_SUBST(LCC_VERSION_PATCH)
5195 AC_SUBST(LCC_VERSION_EXTRA)
5196 AC_SUBST(LCC_VERSION_STRING)
5198 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
5200 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
5202 if test "x$with_librrd" = "xyes" \
5203 && test "x$librrd_threadsafe" != "xyes"
5205 with_librrd="yes (warning: librrd is not thread-safe)"
5208 if test "x$with_libperl" = "xyes"
5210 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5212 enable_perl="no (needs libperl)"
5215 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5217 enable_perl="no (libperl doesn't support ithreads)"
5220 if test "x$with_perl_bindings" = "xyes" \
5221 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5223 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5230 libcurl . . . . . . . $with_libcurl
5231 libdbi . . . . . . . $with_libdbi
5232 libcredis . . . . . . $with_libcredis
5233 libesmtp . . . . . . $with_libesmtp
5234 libganglia . . . . . $with_libganglia
5235 libgcrypt . . . . . . $with_libgcrypt
5236 libiokit . . . . . . $with_libiokit
5237 libiptc . . . . . . . $with_libiptc
5238 libjvm . . . . . . . $with_java
5239 libkstat . . . . . . $with_kstat
5240 libkvm . . . . . . . $with_libkvm
5241 libmemcached . . . . $with_libmemcached
5242 libmodbus . . . . . . $with_libmodbus
5243 libmysql . . . . . . $with_libmysql
5244 libnetapp . . . . . . $with_libnetapp
5245 libnetlink . . . . . $with_libnetlink
5246 libnetsnmp . . . . . $with_libnetsnmp
5247 libnotify . . . . . . $with_libnotify
5248 liboconfig . . . . . $with_liboconfig
5249 libopenipmi . . . . . $with_libopenipmipthread
5250 liboping . . . . . . $with_liboping
5251 libpcap . . . . . . . $with_libpcap
5252 libperfstat . . . . . $with_perfstat
5253 libperl . . . . . . . $with_libperl
5254 libpq . . . . . . . . $with_libpq
5255 libpthread . . . . . $with_libpthread
5256 librabbitmq . . . . . $with_librabbitmq
5257 librouteros . . . . . $with_librouteros
5258 librrd . . . . . . . $with_librrd
5259 libsensors . . . . . $with_libsensors
5260 libstatgrab . . . . . $with_libstatgrab
5261 libtokyotyrant . . . $with_libtokyotyrant
5262 libupsclient . . . . $with_libupsclient
5263 libvarnish . . . . . $with_libvarnish
5264 libvirt . . . . . . . $with_libvirt
5265 libxml2 . . . . . . . $with_libxml2
5266 libxmms . . . . . . . $with_libxmms
5267 libyajl . . . . . . . $with_libyajl
5268 libevent . . . . . . $with_libevent
5269 protobuf-c . . . . . $have_protoc_c
5270 oracle . . . . . . . $with_oracle
5271 python . . . . . . . $with_python
5274 daemon mode . . . . . $enable_daemon
5275 debug . . . . . . . . $enable_debug
5278 perl . . . . . . . . $with_perl_bindings
5281 aggregation . . . . . $enable_aggregation
5282 amqp . . . . . . . $enable_amqp
5283 apache . . . . . . . $enable_apache
5284 apcups . . . . . . . $enable_apcups
5285 apple_sensors . . . . $enable_apple_sensors
5286 ascent . . . . . . . $enable_ascent
5287 battery . . . . . . . $enable_battery
5288 bind . . . . . . . . $enable_bind
5289 conntrack . . . . . . $enable_conntrack
5290 contextswitch . . . . $enable_contextswitch
5291 cpu . . . . . . . . . $enable_cpu
5292 cpufreq . . . . . . . $enable_cpufreq
5293 csv . . . . . . . . . $enable_csv
5294 curl . . . . . . . . $enable_curl
5295 curl_json . . . . . . $enable_curl_json
5296 curl_xml . . . . . . $enable_curl_xml
5297 dbi . . . . . . . . . $enable_dbi
5298 df . . . . . . . . . $enable_df
5299 disk . . . . . . . . $enable_disk
5300 dns . . . . . . . . . $enable_dns
5301 email . . . . . . . . $enable_email
5302 entropy . . . . . . . $enable_entropy
5303 ethstat . . . . . . . $enable_ethstat
5304 exec . . . . . . . . $enable_exec
5305 filecount . . . . . . $enable_filecount
5306 fscache . . . . . . . $enable_fscache
5307 gmond . . . . . . . . $enable_gmond
5308 hddtemp . . . . . . . $enable_hddtemp
5309 interface . . . . . . $enable_interface
5310 ipmi . . . . . . . . $enable_ipmi
5311 iptables . . . . . . $enable_iptables
5312 ipvs . . . . . . . . $enable_ipvs
5313 irq . . . . . . . . . $enable_irq
5314 java . . . . . . . . $enable_java
5315 libvirt . . . . . . . $enable_libvirt
5316 load . . . . . . . . $enable_load
5317 logfile . . . . . . . $enable_logfile
5318 lpar... . . . . . . . $enable_lpar
5319 madwifi . . . . . . . $enable_madwifi
5320 match_empty_counter . $enable_match_empty_counter
5321 match_hashed . . . . $enable_match_hashed
5322 match_regex . . . . . $enable_match_regex
5323 match_timediff . . . $enable_match_timediff
5324 match_value . . . . . $enable_match_value
5325 mbmon . . . . . . . . $enable_mbmon
5326 md . . . . . . . . . $enable_md
5327 memcachec . . . . . . $enable_memcachec
5328 memcached . . . . . . $enable_memcached
5329 memory . . . . . . . $enable_memory
5330 modbus . . . . . . . $enable_modbus
5331 multimeter . . . . . $enable_multimeter
5332 mysql . . . . . . . . $enable_mysql
5333 netapp . . . . . . . $enable_netapp
5334 netlink . . . . . . . $enable_netlink
5335 network . . . . . . . $enable_network
5336 nfs . . . . . . . . . $enable_nfs
5337 nginx . . . . . . . . $enable_nginx
5338 notify_desktop . . . $enable_notify_desktop
5339 notify_email . . . . $enable_notify_email
5340 ntpd . . . . . . . . $enable_ntpd
5341 numa . . . . . . . . $enable_numa
5342 nut . . . . . . . . . $enable_nut
5343 olsrd . . . . . . . . $enable_olsrd
5344 onewire . . . . . . . $enable_onewire
5345 openvpn . . . . . . . $enable_openvpn
5346 oracle . . . . . . . $enable_oracle
5347 perl . . . . . . . . $enable_perl
5348 pf . . . . . . . . . $enable_pf
5349 pinba . . . . . . . . $enable_pinba
5350 ping . . . . . . . . $enable_ping
5351 postgresql . . . . . $enable_postgresql
5352 powerdns . . . . . . $enable_powerdns
5353 processes . . . . . . $enable_processes
5354 protocols . . . . . . $enable_protocols
5355 python . . . . . . . $enable_python
5356 redis . . . . . . . . $enable_redis
5357 routeros . . . . . . $enable_routeros
5358 rrdcached . . . . . . $enable_rrdcached
5359 rrdtool . . . . . . . $enable_rrdtool
5360 sensors . . . . . . . $enable_sensors
5361 serial . . . . . . . $enable_serial
5362 snmp . . . . . . . . $enable_snmp
5363 swap . . . . . . . . $enable_swap
5364 syslog . . . . . . . $enable_syslog
5365 table . . . . . . . . $enable_table
5366 tail . . . . . . . . $enable_tail
5367 tail_csv . . . . . . $enable_tail_csv
5368 tape . . . . . . . . $enable_tape
5369 target_notification . $enable_target_notification
5370 target_replace . . . $enable_target_replace
5371 target_scale . . . . $enable_target_scale
5372 target_set . . . . . $enable_target_set
5373 target_v5upgrade . . $enable_target_v5upgrade
5374 tcpconns . . . . . . $enable_tcpconns
5375 teamspeak2 . . . . . $enable_teamspeak2
5376 ted . . . . . . . . . $enable_ted
5377 thermal . . . . . . . $enable_thermal
5378 threshold . . . . . . $enable_threshold
5379 tokyotyrant . . . . . $enable_tokyotyrant
5380 unixsock . . . . . . $enable_unixsock
5381 uptime . . . . . . . $enable_uptime
5382 users . . . . . . . . $enable_users
5383 uuid . . . . . . . . $enable_uuid
5384 varnish . . . . . . . $enable_varnish
5385 vmem . . . . . . . . $enable_vmem
5386 volume . . . . . . . $enable_volume
5387 vserver . . . . . . . $enable_vserver
5388 wireless . . . . . . $enable_wireless
5389 write_graphite . . . $enable_write_graphite
5390 write_http . . . . . $enable_write_http
5391 write_mongodb . . . . $enable_write_mongodb
5392 write_redis . . . . . $enable_write_redis
5393 write_riemann . . . . $enable_write_riemann
5394 xmms . . . . . . . . $enable_xmms
5395 zfs_arc . . . . . . . $enable_zfs_arc
5399 if test "x$dependency_error" = "xyes"; then
5400 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5403 if test "x$dependency_warning" = "xyes"; then
5404 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5407 # vim: set fdm=marker :