1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 m4_ifdef([LT_PACKAGE_VERSION],
10 LT_CONFIG_LTDL_DIR([libltdl])
12 LTDL_INIT([convenience])
13 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
18 AC_LIBLTDL_CONVENIENCE
22 AC_CONFIG_SUBDIRS(libltdl)
23 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
27 AM_INIT_AUTOMAKE(dist-bzip2)
30 AC_PREFIX_DEFAULT("/opt/collectd")
35 # Checks for programs.
43 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
51 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
52 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
54 AC_MSG_CHECKING([for kernel type ($host_os)])
57 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
61 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
71 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
77 AC_MSG_RESULT([$ac_system])
79 if test "x$ac_system" = "xLinux"
81 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
82 if test -z "$KERNEL_DIR"
84 KERNEL_DIR="/lib/modules/`uname -r`/source"
87 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
88 AC_SUBST(KERNEL_CFLAGS)
91 if test "x$ac_system" = "xSolaris"
93 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
95 if test "x$ac_system" = "xAIX"
97 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
100 # Where to install .pc files.
101 pkgconfigdir="${libdir}/pkgconfig"
102 AC_SUBST(pkgconfigdir)
104 # Check for standards compliance mode
105 AC_ARG_ENABLE(standards,
106 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
107 [enable_standards="$enableval"],
108 [enable_standards="no"])
109 if test "x$enable_standards" = "xyes"
111 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
112 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
113 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
114 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
115 if test "x$GCC" = "xyes"
117 CFLAGS="$CFLAGS -std=c99"
120 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
123 # Checks for header files.
130 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
133 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
138 # include <sys/types.h>
141 AC_CHECK_HEADERS(netinet/in.h, [], [],
146 # include <sys/types.h>
148 #if HAVE_NETINET_IN_SYSTM_H
149 # include <netinet/in_systm.h>
152 AC_CHECK_HEADERS(netinet/ip.h, [], [],
157 # include <sys/types.h>
159 #if HAVE_NETINET_IN_SYSTM_H
160 # include <netinet/in_systm.h>
162 #if HAVE_NETINET_IN_H
163 # include <netinet/in.h>
166 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
171 # include <sys/types.h>
173 #if HAVE_NETINET_IN_SYSTM_H
174 # include <netinet/in_systm.h>
176 #if HAVE_NETINET_IN_H
177 # include <netinet/in.h>
179 #if HAVE_NETINET_IP_H
180 # include <netinet/ip.h>
183 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
188 # include <sys/types.h>
190 #if HAVE_NETINET_IN_SYSTM_H
191 # include <netinet/in_systm.h>
193 #if HAVE_NETINET_IN_H
194 # include <netinet/in.h>
196 #if HAVE_NETINET_IP_H
197 # include <netinet/ip.h>
200 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
205 # include <sys/types.h>
207 #if HAVE_NETINET_IN_SYSTM_H
208 # include <netinet/in_systm.h>
210 #if HAVE_NETINET_IN_H
211 # include <netinet/in.h>
214 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
219 # include <sys/types.h>
221 #if HAVE_NETINET_IN_SYSTM_H
222 # include <netinet/in_systm.h>
224 #if HAVE_NETINET_IN_H
225 # include <netinet/in.h>
227 #if HAVE_NETINET_IP6_H
228 # include <netinet/ip6.h>
231 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
236 # include <sys/types.h>
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
244 #if HAVE_NETINET_IP_H
245 # include <netinet/ip.h>
248 AC_CHECK_HEADERS(netinet/udp.h, [], [],
253 # include <sys/types.h>
255 #if HAVE_NETINET_IN_SYSTM_H
256 # include <netinet/in_systm.h>
258 #if HAVE_NETINET_IN_H
259 # include <netinet/in.h>
261 #if HAVE_NETINET_IP_H
262 # include <netinet/ip.h>
267 AC_CHECK_HEADERS(sys/dkstat.h)
268 if test "x$ac_system" = "xDarwin"
270 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
271 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
273 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
276 # include <sys/types.h>
279 # include <sys/param.h>
283 AC_MSG_CHECKING([for sysctl kern.cp_times])
284 if test -x /sbin/sysctl
286 /sbin/sysctl kern.cp_times 2>/dev/null
290 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
291 [Define if sysctl supports kern.cp_times])
300 AC_CHECK_HEADERS(linux/major.h libgen.h)
302 # For md module (Linux only)
303 if test "x$ac_system" = "xLinux"
305 AC_CHECK_HEADERS(linux/raid/md_u.h,
306 [have_linux_raid_md_u_h="yes"],
307 [have_linux_raid_md_u_h="no"],
309 #include <sys/ioctl.h>
310 #include <linux/major.h>
311 #include <linux/types.h>
314 have_linux_raid_md_u_h="no"
317 # For the battery plugin
318 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
320 #if HAVE_IOKIT_IOKITLIB_H
321 # include <IOKit/IOKitLib.h>
323 #if HAVE_IOKIT_IOTYPES_H
324 # include <IOKit/IOTypes.h>
328 # For the swap module
329 have_linux_wireless_h="no"
330 if test "x$ac_system" = "xLinux"
332 AC_CHECK_HEADERS(linux/wireless.h,
333 [have_linux_wireless_h="yes"],
334 [have_linux_wireless_h="no"],
337 #include <sys/ioctl.h>
338 #include <sys/socket.h>
342 # For the swap module
343 have_sys_swap_h="yes"
344 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
346 #undef _FILE_OFFSET_BITS
347 #undef _LARGEFILE64_SOURCE
349 # include <sys/types.h>
352 # include <sys/param.h>
356 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
359 if test "x$GCC" = "xyes"
361 hint_64="CFLAGS='-m64'"
363 hint_64="CFLAGS='-xarch=v9'"
365 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
369 # For the processes plugin
371 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
373 # For interface plugin
374 AC_CHECK_HEADERS(ifaddrs.h)
375 AC_CHECK_HEADERS(net/if.h, [], [],
378 # include <sys/types.h>
380 #if HAVE_SYS_SOCKET_H
381 # include <sys/socket.h>
384 AC_CHECK_HEADERS(linux/if.h, [], [],
387 # include <sys/types.h>
389 #if HAVE_SYS_SOCKET_H
390 # include <sys/socket.h>
393 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
396 # include <sys/types.h>
398 #if HAVE_SYS_SOCKET_H
399 # include <sys/socket.h>
402 # include <linux/if.h>
407 AC_CHECK_HEADERS(linux/sockios.h,
408 [have_linux_sockios_h="yes"],
409 [have_linux_sockios_h="no"],
412 # include <sys/ioctl.h>
418 AC_CHECK_HEADERS(linux/ethtool.h,
419 [have_linux_ethtool_h="yes"],
420 [have_linux_ethtool_h="no"],
423 # include <sys/ioctl.h>
428 #if HAVE_LINUX_SOCKIOS_H
429 # include <linux/sockios.h>
434 have_linux_ip_vs_h="no"
435 have_net_ip_vs_h="no"
437 ip_vs_h_needs_kernel_cflags="no"
438 if test "x$ac_system" = "xLinux"
440 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
441 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
442 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
444 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
446 SAVE_CFLAGS="$CFLAGS"
447 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
449 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
451 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
452 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
453 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
455 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
457 ip_vs_h_needs_kernel_cflags="yes"
460 CFLAGS="$SAVE_CFLAGS"
463 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
466 AC_CHECK_HEADERS(sys/ucred.h, [], [],
469 # include <sys/types.h>
472 # include <sys/param.h>
476 # For mount interface
477 AC_CHECK_HEADERS(sys/mount.h, [], [],
480 # include <sys/types.h>
483 # include <sys/param.h>
487 # For the email plugin
488 AC_CHECK_HEADERS(linux/un.h, [], [],
490 #if HAVE_SYS_SOCKET_H
491 # include <sys/socket.h>
495 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h)
498 AC_CHECK_HEADERS(arpa/nameser.h)
499 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
501 #if HAVE_ARPA_NAMESER_H
502 # include <arpa/nameser.h>
506 AC_CHECK_HEADERS(net/if_arp.h, [], [],
507 [#if HAVE_SYS_SOCKET_H
508 # include <sys/socket.h>
511 AC_CHECK_HEADERS(net/ppp_defs.h)
512 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
513 [#if HAVE_NET_PPP_DEFS_H
514 # include <net/ppp_defs.h>
517 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
522 # include <sys/types.h>
524 #if HAVE_SYS_SOCKET_H
525 # include <sys/socket.h>
530 #if HAVE_NETINET_IN_H
531 # include <netinet/in.h>
535 # For the multimeter plugin
537 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
540 # Checks for typedefs, structures, and compiler characteristics.
549 # Checks for library functions.
551 AC_PROG_GCC_TRADITIONAL
552 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
556 SAVE_CFLAGS="$CFLAGS"
557 # Emulate behavior of src/Makefile.am
558 if test "x$GCC" = "xyes"
560 CFLAGS="$CFLAGS -Wall -Werror"
563 AC_CACHE_CHECK([for strtok_r],
564 [c_cv_have_strtok_r_default],
573 char buffer[] = "foo,bar,baz";
580 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
583 printf ("token = %s;\n", token);
586 [c_cv_have_strtok_r_default="yes"],
587 [c_cv_have_strtok_r_default="no"]
591 if test "x$c_cv_have_strtok_r_default" = "xno"
593 CFLAGS="$CFLAGS -D_REENTRANT=1"
595 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
596 [c_cv_have_strtok_r_reentrant],
605 char buffer[] = "foo,bar,baz";
612 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
615 printf ("token = %s;\n", token);
618 [c_cv_have_strtok_r_reentrant="yes"],
619 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
624 CFLAGS="$SAVE_CFLAGS"
625 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
627 CFLAGS="$CFLAGS -D_REENTRANT=1"
630 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
632 socket_needs_socket="no"
633 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
634 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
636 clock_gettime_needs_rt="no"
637 clock_gettime_needs_posix4="no"
638 have_clock_gettime="no"
639 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
640 if test "x$have_clock_gettime" = "xno"
642 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
643 have_clock_gettime="yes"])
645 if test "x$have_clock_gettime" = "xno"
647 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
648 have_clock_gettime="yes"])
650 if test "x$have_clock_gettime" = "xyes"
652 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
654 AC_MSG_WARN(cannot find clock_gettime)
657 nanosleep_needs_rt="no"
658 nanosleep_needs_posix4="no"
659 AC_CHECK_FUNCS(nanosleep,
661 AC_CHECK_LIB(rt, nanosleep,
662 [nanosleep_needs_rt="yes"],
663 AC_CHECK_LIB(posix4, nanosleep,
664 [nanosleep_needs_posix4="yes"],
665 AC_MSG_ERROR(cannot find nanosleep))))
667 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
668 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
670 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
671 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
672 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
673 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
674 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
675 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
676 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
677 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
678 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
679 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
680 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
681 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
683 # Check for strptime {{{
684 if test "x$GCC" = "xyes"
686 SAVE_CFLAGS="$CFLAGS"
687 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
690 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
691 if test "x$have_strptime" = "xyes"
693 AC_CACHE_CHECK([whether strptime is exported by default],
694 [c_cv_have_strptime_default],
703 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
705 [c_cv_have_strptime_default="yes"],
706 [c_cv_have_strptime_default="no"]))
708 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
710 AC_CACHE_CHECK([whether strptime needs standards mode],
711 [c_cv_have_strptime_standards],
715 #ifndef _ISOC99_SOURCE
716 # define _ISOC99_SOURCE 1
718 #ifndef _POSIX_C_SOURCE
719 # define _POSIX_C_SOURCE 200112L
721 #ifndef _XOPEN_SOURCE
722 # define _XOPEN_SOURCE 500
729 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
731 [c_cv_have_strptime_standards="yes"],
732 [c_cv_have_strptime_standards="no"]))
734 if test "x$c_cv_have_strptime_standards" = "xyes"
736 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
742 if test "x$GCC" = "xyes"
744 CFLAGS="$SAVE_CFLAGS"
747 # }}} Check for strptime
749 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
750 if test "x$have_swapctl" = "xyes"; then
751 AC_CACHE_CHECK([whether swapctl takes two arguments],
752 [c_cv_have_swapctl_two_args],
754 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
755 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
756 # undef _FILE_OFFSET_BITS
757 # undef _LARGEFILE64_SOURCE
759 #include <sys/stat.h>
760 #include <sys/swap.h>]],
762 int num = swapctl(0, NULL);
765 [c_cv_have_swapctl_two_args="yes"],
766 [c_cv_have_swapctl_two_args="no"]
769 AC_CACHE_CHECK([whether swapctl takes three arguments],
770 [c_cv_have_swapctl_three_args],
772 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
773 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
774 # undef _FILE_OFFSET_BITS
775 # undef _LARGEFILE64_SOURCE
777 #include <sys/stat.h>
778 #include <sys/swap.h>]],
780 int num = swapctl(0, NULL,0);
783 [c_cv_have_swapctl_three_args="yes"],
784 [c_cv_have_swapctl_three_args="no"]
788 # Check for different versions of `swapctl' here..
789 if test "x$have_swapctl" = "xyes"; then
790 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
791 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
792 [Define if the function swapctl exists and takes two arguments.])
794 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
795 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
796 [Define if the function swapctl exists and takes three arguments.])
801 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
803 if test "x$withval" = "xno"; then
805 else if test "x$withval" = "xyes"; then
812 if test "x$nan_type" = "xnone"; then
813 AC_CACHE_CHECK([whether NAN is defined by default],
814 [c_cv_have_nan_default],
820 static double foo = NAN;
828 [c_cv_have_nan_default="yes"],
829 [c_cv_have_nan_default="no"]
832 if test "x$c_cv_have_nan_default" = "xyes"
837 if test "x$nan_type" = "xnone"; then
838 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
839 [c_cv_have_nan_isoc],
844 #define __USE_ISOC99 1
846 static double foo = NAN;
854 [c_cv_have_nan_isoc="yes"],
855 [c_cv_have_nan_isoc="no"]
858 if test "x$c_cv_have_nan_isoc" = "xyes"
863 if test "x$nan_type" = "xnone"; then
864 SAVE_LDFLAGS=$LDFLAGS
865 LDFLAGS="$LDFLAGS -lm"
866 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
867 [c_cv_have_nan_zero],
876 #define NAN (0.0 / 0.0)
878 # define isnan(f) ((f) != (f))
880 static double foo = NAN;
888 [c_cv_have_nan_zero="yes"],
889 [c_cv_have_nan_zero="no"]
892 LDFLAGS=$SAVE_LDFLAGS
893 if test "x$c_cv_have_nan_zero" = "xyes"
899 if test "x$nan_type" = "xdefault"; then
900 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
901 [Define if NAN is defined by default and can initialize static variables.])
902 else if test "x$nan_type" = "xisoc99"; then
903 AC_DEFINE(NAN_STATIC_ISOC, 1,
904 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
905 else if test "x$nan_type" = "xzero"; then
906 AC_DEFINE(NAN_ZERO_ZERO, 1,
907 [Define if NAN can be defined as (0.0 / 0.0)])
909 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
912 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
914 if test "x$withval" = "xnothing"; then
915 fp_layout_type="nothing"
916 else if test "x$withval" = "xendianflip"; then
917 fp_layout_type="endianflip"
918 else if test "x$withval" = "xintswap"; then
919 fp_layout_type="intswap"
921 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
924 [fp_layout_type="unknown"])
926 if test "x$fp_layout_type" = "xunknown"; then
927 AC_CACHE_CHECK([if doubles are stored in x86 representation],
928 [c_cv_fp_layout_need_nothing],
939 # include <inttypes.h>
942 # include <stdbool.h>
952 memcpy ((void *) &i0, (void *) &d, 8);
955 memcpy ((void *) c, (void *) &i1, 8);
957 if ((c[0] == 0x2f) && (c[1] == 0x25)
958 && (c[2] == 0xc0) && (c[3] == 0xc7)
959 && (c[4] == 0x43) && (c[5] == 0x2b)
960 && (c[6] == 0x1f) && (c[7] == 0x5b))
965 [c_cv_fp_layout_need_nothing="yes"],
966 [c_cv_fp_layout_need_nothing="no"]
969 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
970 fp_layout_type="nothing"
973 if test "x$fp_layout_type" = "xunknown"; then
974 AC_CACHE_CHECK([if endianflip converts to x86 representation],
975 [c_cv_fp_layout_need_endianflip],
986 # include <inttypes.h>
989 # include <stdbool.h>
991 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
992 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
993 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
994 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
995 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
996 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
997 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
998 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1007 memcpy ((void *) &i0, (void *) &d, 8);
1009 i1 = endianflip (i0);
1010 memcpy ((void *) c, (void *) &i1, 8);
1012 if ((c[0] == 0x2f) && (c[1] == 0x25)
1013 && (c[2] == 0xc0) && (c[3] == 0xc7)
1014 && (c[4] == 0x43) && (c[5] == 0x2b)
1015 && (c[6] == 0x1f) && (c[7] == 0x5b))
1020 [c_cv_fp_layout_need_endianflip="yes"],
1021 [c_cv_fp_layout_need_endianflip="no"]
1024 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1025 fp_layout_type="endianflip"
1028 if test "x$fp_layout_type" = "xunknown"; then
1029 AC_CACHE_CHECK([if intswap converts to x86 representation],
1030 [c_cv_fp_layout_need_intswap],
1038 # include <stdint.h>
1041 # include <inttypes.h>
1044 # include <stdbool.h>
1046 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1047 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1056 memcpy ((void *) &i0, (void *) &d, 8);
1059 memcpy ((void *) c, (void *) &i1, 8);
1061 if ((c[0] == 0x2f) && (c[1] == 0x25)
1062 && (c[2] == 0xc0) && (c[3] == 0xc7)
1063 && (c[4] == 0x43) && (c[5] == 0x2b)
1064 && (c[6] == 0x1f) && (c[7] == 0x5b))
1069 [c_cv_fp_layout_need_intswap="yes"],
1070 [c_cv_fp_layout_need_intswap="no"]
1073 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1074 fp_layout_type="intswap"
1078 if test "x$fp_layout_type" = "xnothing"; then
1079 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1080 [Define if doubles are stored in x86 representation.])
1081 else if test "x$fp_layout_type" = "xendianflip"; then
1082 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1083 [Define if endianflip is needed to convert to x86 representation.])
1084 else if test "x$fp_layout_type" = "xintswap"; then
1085 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1086 [Define if intswap is needed to convert to x86 representation.])
1088 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1092 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1093 have_getvfsstat="no"
1094 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1095 have_listmntent="no"
1096 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1099 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1100 if test "x$have_getmntent" = "xno"; then
1101 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1103 if test "x$have_getmntent" = "xno"; then
1104 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1106 if test "x$have_getmntent" = "xno"; then
1107 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1110 if test "x$have_getmntent" = "xc"; then
1111 AC_CACHE_CHECK([whether getmntent takes one argument],
1112 [c_cv_have_one_getmntent],
1114 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1115 #include "$srcdir/src/utils_mount.h"]],
1119 fh = setmntent ("/etc/mtab", "r");
1120 me = getmntent (fh);
1123 [c_cv_have_one_getmntent="yes"],
1124 [c_cv_have_one_getmntent="no"]
1127 AC_CACHE_CHECK([whether getmntent takes two arguments],
1128 [c_cv_have_two_getmntent],
1130 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1131 #include "$srcdir/src/utils_mount.h"]],
1136 fh = fopen ("/etc/mnttab", "r");
1137 status = getmntent (fh, &mt);
1140 [c_cv_have_two_getmntent="yes"],
1141 [c_cv_have_two_getmntent="no"]
1146 # Check for different versions of `getmntent' here..
1148 if test "x$have_getmntent" = "xc"; then
1149 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1150 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1151 [Define if the function getmntent exists and takes one argument.])
1153 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1154 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1155 [Define if the function getmntent exists and takes two arguments.])
1158 if test "x$have_getmntent" = "xsun"; then
1159 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1160 [Define if the function getmntent exists. It's the version from libsun.])
1162 if test "x$have_getmntent" = "xseq"; then
1163 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1164 [Define if the function getmntent exists. It's the version from libseq.])
1166 if test "x$have_getmntent" = "xgen"; then
1167 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1168 [Define if the function getmntent exists. It's the version from libgen.])
1172 AC_MSG_CHECKING([if have htonll defined])
1177 #include <sys/types.h>
1178 #include <netinet/in.h>
1180 # include <inttypes.h>
1187 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1190 AC_MSG_RESULT([$have_htonll])
1192 # Check for structures
1193 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1194 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1197 #include <sys/types.h>
1198 #include <sys/socket.h>
1201 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1202 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1205 #include <sys/types.h>
1206 #include <sys/socket.h>
1207 #include <linux/if.h>
1208 #include <linux/netdevice.h>
1211 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1214 #include <netinet/in.h>
1218 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1220 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1221 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1222 have_struct_kinfo_proc_freebsd="yes"
1225 have_struct_kinfo_proc_freebsd="no"
1229 #include <sys/param.h>
1230 #include <sys/sysctl.h>
1231 #include <sys/user.h>
1234 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1236 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1237 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1238 have_struct_kinfo_proc_openbsd="yes"
1241 have_struct_kinfo_proc_openbsd="no"
1244 #include <sys/param.h>
1245 #include <sys/sysctl.h>
1249 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1250 [#define _BSD_SOURCE
1252 # include <stdint.h>
1254 #if HAVE_SYS_TYPES_H
1255 # include <sys/types.h>
1257 #if HAVE_NETINET_IN_SYSTM_H
1258 # include <netinet/in_systm.h>
1260 #if HAVE_NETINET_IN_H
1261 # include <netinet/in.h>
1263 #if HAVE_NETINET_IP_H
1264 # include <netinet/ip.h>
1266 #if HAVE_NETINET_UDP_H
1267 # include <netinet/udp.h>
1270 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1271 [#define _BSD_SOURCE
1273 # include <stdint.h>
1275 #if HAVE_SYS_TYPES_H
1276 # include <sys/types.h>
1278 #if HAVE_NETINET_IN_SYSTM_H
1279 # include <netinet/in_systm.h>
1281 #if HAVE_NETINET_IN_H
1282 # include <netinet/in.h>
1284 #if HAVE_NETINET_IP_H
1285 # include <netinet/ip.h>
1287 #if HAVE_NETINET_UDP_H
1288 # include <netinet/udp.h>
1292 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1302 # Checks for libraries begin here
1305 with_libresolv="yes"
1306 AC_CHECK_LIB(resolv, res_search,
1308 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1310 [with_libresolv="no"])
1311 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1313 dnl Check for HAL (hardware abstraction library)
1315 AC_CHECK_LIB(hal,libhal_device_property_exists,
1316 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1318 if test "x$with_libhal" = "xyes"; then
1319 if test "x$PKG_CONFIG" != "x"; then
1320 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1321 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1322 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1323 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1327 m4_divert_once([HELP_WITH], [
1328 collectd additional packages:])
1330 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1332 if test "x$ac_system" = "xAIX"
1337 with_perfstat="no (AIX only)"
1338 with_procinfo="no (AIX only)"
1341 if test "x$with_perfstat" = "xyes"
1343 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1344 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1346 if test "x$with_perfstat" = "xyes"
1348 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1349 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1350 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1351 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1353 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1356 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1358 # Processes plugin under AIX.
1359 if test "x$with_procinfo" = "xyes"
1361 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1363 if test "x$with_procinfo" = "xyes"
1365 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1368 if test "x$ac_system" = "xSolaris"
1373 with_kstat="no (Solaris only)"
1374 with_devinfo="no (Solaris only)"
1377 if test "x$with_kstat" = "xyes"
1379 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1381 if test "x$with_kstat" = "xyes"
1383 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1384 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1386 if test "x$with_kstat" = "xyes"
1388 AC_DEFINE(HAVE_LIBKSTAT, 1,
1389 [Define to 1 if you have the 'kstat' library (-lkstat)])
1391 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1392 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1395 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1402 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1405 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1406 if test "x$with_kvm_getprocs" = "xyes"
1408 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1409 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1412 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1414 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1415 if test "x$with_kvm_getswapinfo" = "xyes"
1417 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1418 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1421 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1423 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1424 if test "x$with_kvm_nlist" = "xyes"
1426 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1427 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1430 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1432 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1433 if test "x$with_kvm_openfiles" = "xyes"
1435 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1436 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1439 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1441 # --with-libcredis {{{
1442 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1444 if test "x$withval" = "xyes"
1446 with_libcredis="yes"
1447 else if test "x$withval" = "xno"
1451 with_libcredis="yes"
1452 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1453 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1456 [with_libcredis="yes"])
1458 SAVE_CPPFLAGS="$CPPFLAGS"
1459 SAVE_LDFLAGS="$LDFLAGS"
1461 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1462 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1464 if test "x$with_libcredis" = "xyes"
1466 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1468 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1470 AC_CHECK_HEADERS(credis.h,
1471 [with_libcredis="yes"],
1472 [with_libcredis="no (credis.h not found)"])
1474 if test "x$with_libcredis" = "xyes"
1476 if test "x$LIBCREDIS_LDFLAGS" != "x"
1478 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1480 AC_CHECK_LIB(credis, credis_info,
1481 [with_libcredis="yes"],
1482 [with_libcredis="no (symbol 'credis_info' not found)"])
1486 CPPFLAGS="$SAVE_CPPFLAGS"
1487 LDFLAGS="$SAVE_LDFLAGS"
1489 if test "x$with_libcredis" = "xyes"
1491 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1492 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1493 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1494 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1496 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1499 # --with-libcurl {{{
1500 with_curl_config="curl-config"
1503 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1505 if test "x$withval" = "xno"
1508 else if test "x$withval" = "xyes"
1512 if test -f "$withval" && test -x "$withval"
1514 with_curl_config="$withval"
1516 else if test -x "$withval/bin/curl-config"
1518 with_curl_config="$withval/bin/curl-config"
1527 if test "x$with_libcurl" = "xyes"
1529 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1530 curl_config_status=$?
1532 if test $curl_config_status -ne 0
1534 with_libcurl="no ($with_curl_config failed)"
1536 SAVE_CPPFLAGS="$CPPFLAGS"
1537 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1539 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1541 CPPFLAGS="$SAVE_CPPFLAGS"
1544 if test "x$with_libcurl" = "xyes"
1546 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1547 curl_config_status=$?
1549 if test $curl_config_status -ne 0
1551 with_libcurl="no ($with_curl_config failed)"
1553 AC_CHECK_LIB(curl, curl_easy_init,
1554 [with_libcurl="yes"],
1555 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1559 if test "x$with_libcurl" = "xyes"
1561 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1562 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1563 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1564 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1566 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1570 with_libdbi_cppflags=""
1571 with_libdbi_ldflags=""
1572 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1574 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1576 with_libdbi_cppflags="-I$withval/include"
1577 with_libdbi_ldflags="-L$withval/lib"
1580 with_libdbi="$withval"
1586 if test "x$with_libdbi" = "xyes"
1588 SAVE_CPPFLAGS="$CPPFLAGS"
1589 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1591 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1593 CPPFLAGS="$SAVE_CPPFLAGS"
1595 if test "x$with_libdbi" = "xyes"
1597 SAVE_CPPFLAGS="$CPPFLAGS"
1598 SAVE_LDFLAGS="$LDFLAGS"
1599 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1600 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1602 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1604 CPPFLAGS="$SAVE_CPPFLAGS"
1605 LDFLAGS="$SAVE_LDFLAGS"
1607 if test "x$with_libdbi" = "xyes"
1609 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1610 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1611 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1612 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1613 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1614 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1616 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1619 # --with-libesmtp {{{
1620 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1622 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1624 LDFLAGS="$LDFLAGS -L$withval/lib"
1625 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1628 with_libesmtp="$withval"
1634 if test "x$with_libesmtp" = "xyes"
1636 AC_CHECK_LIB(esmtp, smtp_create_session,
1638 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1639 ], [with_libesmtp="no (libesmtp not found)"])
1641 if test "x$with_libesmtp" = "xyes"
1643 AC_CHECK_HEADERS(libesmtp.h,
1645 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1646 ], [with_libesmtp="no (libesmtp.h not found)"])
1648 if test "x$with_libesmtp" = "xyes"
1654 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1655 [Wether or not to use the esmtp library])
1656 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1659 # --with-libganglia {{{
1660 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1662 if test -f "$withval" && test -x "$withval"
1664 with_libganglia_config="$withval"
1665 with_libganglia="yes"
1666 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1668 with_libganglia_config="$withval/bin/ganglia-config"
1669 with_libganglia="yes"
1670 else if test -d "$withval"
1672 GANGLIA_CPPFLAGS="-I$withval/include"
1673 GANGLIA_LDFLAGS="-L$withval/lib"
1674 with_libganglia="yes"
1676 with_libganglia_config="ganglia-config"
1677 with_libganglia="$withval"
1681 with_libganglia_config="ganglia-config"
1682 with_libganglia="yes"
1685 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1687 if test "x$GANGLIA_CPPFLAGS" = "x"
1689 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1692 if test "x$GANGLIA_LDFLAGS" = "x"
1694 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1697 if test "x$GANGLIA_LIBS" = "x"
1699 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1703 SAVE_CPPFLAGS="$CPPFLAGS"
1704 SAVE_LDFLAGS="$LDFLAGS"
1705 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1706 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1708 if test "x$with_libganglia" = "xyes"
1710 AC_CHECK_HEADERS(gm_protocol.h,
1712 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1713 [Define to 1 if you have the <gm_protocol.h> header file.])
1714 ], [with_libganglia="no (gm_protocol.h not found)"])
1717 if test "x$with_libganglia" = "xyes"
1719 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1721 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1722 [Define to 1 if you have the ganglia library (-lganglia).])
1723 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1726 CPPFLAGS="$SAVE_CPPFLAGS"
1727 LDFLAGS="$SAVE_LDFLAGS"
1729 AC_SUBST(GANGLIA_CPPFLAGS)
1730 AC_SUBST(GANGLIA_LDFLAGS)
1731 AC_SUBST(GANGLIA_LIBS)
1732 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1735 # --with-libgcrypt {{{
1736 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1737 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1738 GCRYPT_LIBS="$GCRYPT_LIBS"
1739 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1741 if test -f "$withval" && test -x "$withval"
1743 with_libgcrypt_config="$withval"
1744 with_libgcrypt="yes"
1745 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1747 with_libgcrypt_config="$withval/bin/gcrypt-config"
1748 with_libgcrypt="yes"
1749 else if test -d "$withval"
1751 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1752 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1753 with_libgcrypt="yes"
1755 with_libgcrypt_config="gcrypt-config"
1756 with_libgcrypt="$withval"
1760 with_libgcrypt_config="libgcrypt-config"
1761 with_libgcrypt="yes"
1764 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1766 if test "x$GCRYPT_CPPFLAGS" = "x"
1768 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1771 if test "x$GCRYPT_LDFLAGS" = "x"
1773 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1774 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1777 if test "x$GCRYPT_LIBS" = "x"
1779 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1783 SAVE_CPPFLAGS="$CPPFLAGS"
1784 SAVE_LDFLAGS="$LDFLAGS"
1785 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1786 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1788 if test "x$with_libgcrypt" = "xyes"
1790 if test "x$GCRYPT_CPPFLAGS" != "x"
1792 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1794 AC_CHECK_HEADERS(gcrypt.h,
1795 [with_libgcrypt="yes"],
1796 [with_libgcrypt="no (gcrypt.h not found)"])
1799 if test "x$with_libgcrypt" = "xyes"
1801 if test "x$GCRYPT_LDFLAGS" != "x"
1803 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1805 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1806 [with_libgcrypt="yes"],
1807 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1809 if test "$with_libgcrypt" != "no"; then
1810 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1814 CPPFLAGS="$SAVE_CPPFLAGS"
1815 LDFLAGS="$SAVE_LDFLAGS"
1817 if test "x$with_libgcrypt" = "xyes"
1819 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1822 AC_SUBST(GCRYPT_CPPFLAGS)
1823 AC_SUBST(GCRYPT_LDFLAGS)
1824 AC_SUBST(GCRYPT_LIBS)
1825 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1828 # --with-libiptc {{{
1829 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1831 if test "x$withval" = "xshipped"
1834 else if test "x$withval" = "xyes"
1836 with_libiptc="pkgconfig"
1837 else if test "x$withval" = "xno"
1842 with_libiptc_cflags="-I$withval/include"
1843 with_libiptc_libs="-L$withval/lib"
1847 if test "x$ac_system" = "xLinux"
1849 with_libiptc="pkgconfig"
1851 with_libiptc="no (Linux only)"
1855 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1857 with_libiptc="no (Don't have pkg-config)"
1860 if test "x$with_libiptc" = "xpkgconfig"
1862 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
1865 with_libiptc="no (pkg-config doesn't know libiptc)"
1868 if test "x$with_libiptc" = "xpkgconfig"
1870 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
1873 with_libiptc="no ($PKG_CONFIG failed)"
1875 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
1878 with_libiptc="no ($PKG_CONFIG failed)"
1882 SAVE_CPPFLAGS="$CPPFLAGS"
1883 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
1885 # check whether the header file for libiptc is available.
1886 if test "x$with_libiptc" = "xpkgconfig"
1888 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
1889 [with_libiptc="no (header file missing)"])
1891 # If the header file is available, check for the required type declaractions.
1892 # They may be missing in old versions of libiptc. In that case, they will be
1893 # declared in the iptables plugin.
1894 if test "x$with_libiptc" = "xpkgconfig"
1896 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
1898 # Check for the iptc_init symbol in the library.
1899 if test "x$with_libiptc" = "xpkgconfig"
1901 AC_CHECK_LIB(iptc, iptc_init,
1902 [with_libiptc="pkgconfig"],
1903 [with_libiptc="no"],
1904 [$with_libiptc_libs])
1906 if test "x$with_libiptc" = "xpkgconfig"
1911 CPPFLAGS="$SAVE_CPPFLAGS"
1913 if test "x$with_libiptc" = "xown"
1915 with_libiptc_cflags=""
1916 with_libiptc_libs=""
1918 if test "x$with_libiptc" = "xown"
1920 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1922 with_libiptc="no (Linux iptables headers not found)"
1925 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1928 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
1929 if test "x$with_libiptc" = "xown"
1931 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1935 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1936 if test "x$with_libiptc" = "xyes"
1938 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
1939 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
1940 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1941 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1946 with_java_home="$JAVA_HOME"
1947 with_java_vmtype="client"
1952 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1954 if test "x$withval" = "xno"
1957 else if test "x$withval" = "xyes"
1961 with_java_home="$withval"
1966 if test "x$with_java" = "xyes"
1968 if test -d "$with_java_home"
1970 AC_MSG_CHECKING([for jni.h])
1971 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1972 if test "x$TMPDIR" != "x"
1974 AC_MSG_RESULT([found in $TMPDIR])
1975 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1977 AC_MSG_RESULT([not found])
1980 AC_MSG_CHECKING([for jni_md.h])
1981 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1982 if test "x$TMPDIR" != "x"
1984 AC_MSG_RESULT([found in $TMPDIR])
1985 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1987 AC_MSG_RESULT([not found])
1990 AC_MSG_CHECKING([for libjvm.so])
1991 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1992 if test "x$TMPDIR" != "x"
1994 AC_MSG_RESULT([found in $TMPDIR])
1995 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1997 AC_MSG_RESULT([not found])
2000 if test "x$JAVAC" = "x"
2002 AC_MSG_CHECKING([for javac])
2003 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
2004 if test "x$TMPDIR" != "x"
2007 AC_MSG_RESULT([$JAVAC])
2009 AC_MSG_RESULT([not found])
2012 if test "x$JAR" = "x"
2014 AC_MSG_CHECKING([for jar])
2015 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
2016 if test "x$TMPDIR" != "x"
2019 AC_MSG_RESULT([$JAR])
2021 AC_MSG_RESULT([not found])
2024 else if test "x$with_java_home" != "x"
2026 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2030 if test "x$JAVA_CPPFLAGS" != "x"
2032 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2034 if test "x$JAVA_CFLAGS" != "x"
2036 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2038 if test "x$JAVA_LDFLAGS" != "x"
2040 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2042 if test "x$JAVAC" = "x"
2044 with_javac_path="$PATH"
2045 if test "x$with_java_home" != "x"
2047 with_javac_path="$with_java_home:with_javac_path"
2048 if test -d "$with_java_home/bin"
2050 with_javac_path="$with_java_home/bin:with_javac_path"
2054 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2056 if test "x$JAVAC" = "x"
2058 with_java="no (javac not found)"
2060 if test "x$JAR" = "x"
2062 with_jar_path="$PATH"
2063 if test "x$with_java_home" != "x"
2065 with_jar_path="$with_java_home:$with_jar_path"
2066 if test -d "$with_java_home/bin"
2068 with_jar_path="$with_java_home/bin:$with_jar_path"
2072 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2074 if test "x$JAR" = "x"
2076 with_java="no (jar not found)"
2079 SAVE_CPPFLAGS="$CPPFLAGS"
2080 SAVE_CFLAGS="$CFLAGS"
2081 SAVE_LDFLAGS="$LDFLAGS"
2082 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2083 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2084 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2086 if test "x$with_java" = "xyes"
2088 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2090 if test "x$with_java" = "xyes"
2092 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2094 [with_java="no (libjvm not found)"],
2097 if test "x$with_java" = "xyes"
2099 JAVA_LIBS="$JAVA_LIBS -ljvm"
2100 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2103 CPPFLAGS="$SAVE_CPPFLAGS"
2104 CFLAGS="$SAVE_CFLAGS"
2105 LDFLAGS="$SAVE_LDFLAGS"
2107 AC_SUBST(JAVA_CPPFLAGS)
2108 AC_SUBST(JAVA_CFLAGS)
2109 AC_SUBST(JAVA_LDFLAGS)
2111 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2114 # --with-libmemcached {{{
2115 with_libmemcached_cppflags=""
2116 with_libmemcached_ldflags=""
2117 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2119 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2121 with_libmemcached_cppflags="-I$withval/include"
2122 with_libmemcached_ldflags="-L$withval/lib"
2123 with_libmemcached="yes"
2125 with_libmemcached="$withval"
2129 with_libmemcached="yes"
2131 if test "x$with_libmemcached" = "xyes"
2133 SAVE_CPPFLAGS="$CPPFLAGS"
2134 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2136 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2138 CPPFLAGS="$SAVE_CPPFLAGS"
2140 if test "x$with_libmemcached" = "xyes"
2142 SAVE_CPPFLAGS="$CPPFLAGS"
2143 SAVE_LDFLAGS="$LDFLAGS"
2144 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2145 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2147 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2149 CPPFLAGS="$SAVE_CPPFLAGS"
2150 LDFLAGS="$SAVE_LDFLAGS"
2152 if test "x$with_libmemcached" = "xyes"
2154 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2155 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2156 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2157 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2158 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2159 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2160 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2162 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2165 # --with-libmodbus {{{
2166 with_libmodbus_config=""
2167 with_libmodbus_cflags=""
2168 with_libmodbus_libs=""
2169 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2171 if test "x$withval" = "xno"
2174 else if test "x$withval" = "xyes"
2176 with_libmodbus="use_pkgconfig"
2177 else if test -d "$with_libmodbus/lib"
2179 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2180 with_libmodbus_cflags="-I$withval/include"
2181 with_libmodbus_libs="-L$withval/lib -lmodbus"
2182 with_libmodbus="yes"
2185 [with_libmodbus="use_pkgconfig"])
2187 # configure using pkg-config
2188 if test "x$with_libmodbus" = "xuse_pkgconfig"
2190 if test "x$PKG_CONFIG" = "x"
2192 with_libmodbus="no (Don't have pkg-config)"
2195 if test "x$with_libmodbus" = "xuse_pkgconfig"
2197 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2198 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2201 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2204 if test "x$with_libmodbus" = "xuse_pkgconfig"
2206 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2209 with_libmodbus="no ($PKG_CONFIG failed)"
2211 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2214 with_libmodbus="no ($PKG_CONFIG failed)"
2217 if test "x$with_libmodbus" = "xuse_pkgconfig"
2219 with_libmodbus="yes"
2222 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2223 # the actual checks.
2224 if test "x$with_libmodbus" = "xyes"
2226 SAVE_CPPFLAGS="$CPPFLAGS"
2227 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2229 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2231 CPPFLAGS="$SAVE_CPPFLAGS"
2233 if test "x$with_libmodbus" = "xyes"
2235 SAVE_CPPFLAGS="$CPPFLAGS"
2236 SAVE_LDFLAGS="$LDFLAGS"
2238 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2239 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2241 AC_CHECK_LIB(modbus, modbus_connect,
2242 [with_libmodbus="yes"],
2243 [with_libmodbus="no (symbol modbus_connect not found)"])
2245 CPPFLAGS="$SAVE_CPPFLAGS"
2246 LDFLAGS="$SAVE_LDFLAGS"
2248 if test "x$with_libmodbus" = "xyes"
2250 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2251 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2252 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2253 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2257 # --with-libmongoc {{{
2258 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2260 if test "x$withval" = "xyes"
2262 with_libmongoc="yes"
2263 else if test "x$withval" = "xno"
2267 with_libmongoc="yes"
2268 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2269 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2272 [with_libmongoc="yes"])
2274 SAVE_CPPFLAGS="$CPPFLAGS"
2275 SAVE_LDFLAGS="$LDFLAGS"
2277 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2278 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2280 if test "x$with_libmongoc" = "xyes"
2282 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2284 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2286 AC_CHECK_HEADERS(mongo.h,
2287 [with_libmongoc="yes"],
2288 [with_libmongoc="no ('mongo.h' not found)"],
2290 # define MONGO_HAVE_STDINT 1
2292 # define MONGO_USE_LONG_LONG_INT 1
2296 if test "x$with_libmongoc" = "xyes"
2298 if test "x$LIBMONGOC_LDFLAGS" != "x"
2300 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2302 AC_CHECK_LIB(mongoc, mongo_run_command,
2303 [with_libmongoc="yes"],
2304 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2307 CPPFLAGS="$SAVE_CPPFLAGS"
2308 LDFLAGS="$SAVE_LDFLAGS"
2310 if test "x$with_libmongoc" = "xyes"
2312 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2313 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2314 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2315 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2317 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2320 # --with-libmysql {{{
2321 with_mysql_config="mysql_config"
2322 with_mysql_cflags=""
2324 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2326 if test "x$withval" = "xno"
2329 else if test "x$withval" = "xyes"
2333 if test -f "$withval" && test -x "$withval";
2335 with_mysql_config="$withval"
2336 else if test -x "$withval/bin/mysql_config"
2338 with_mysql_config="$withval/bin/mysql_config"
2346 if test "x$with_libmysql" = "xyes"
2348 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2349 mysql_config_status=$?
2351 if test $mysql_config_status -ne 0
2353 with_libmysql="no ($with_mysql_config failed)"
2355 SAVE_CPPFLAGS="$CPPFLAGS"
2356 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2359 have_mysql_mysql_h="no"
2360 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2362 if test "x$have_mysql_h" = "xno"
2364 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2367 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2369 with_libmysql="no (mysql.h not found)"
2372 CPPFLAGS="$SAVE_CPPFLAGS"
2375 if test "x$with_libmysql" = "xyes"
2377 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2378 mysql_config_status=$?
2380 if test $mysql_config_status -ne 0
2382 with_libmysql="no ($with_mysql_config failed)"
2384 AC_CHECK_LIB(mysqlclient, mysql_init,
2385 [with_libmysql="yes"],
2386 [with_libmysql="no (symbol 'mysql_init' not found)"],
2389 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2390 [with_libmysql="yes"],
2391 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2395 if test "x$with_libmysql" = "xyes"
2397 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2398 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2399 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2400 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2402 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2405 # --with-libnetlink {{{
2406 with_libnetlink_cflags=""
2407 with_libnetlink_libs="-lnetlink"
2408 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2410 echo "libnetlink: withval = $withval"
2411 if test "x$withval" = "xyes"
2413 with_libnetlink="yes"
2414 else if test "x$withval" = "xno"
2416 with_libnetlink="no"
2418 if test -d "$withval/include"
2420 with_libnetlink_cflags="-I$withval/include"
2421 with_libnetlink_libs="-L$withval/lib -lnetlink"
2422 with_libnetlink="yes"
2424 AC_MSG_ERROR("no such directory: $withval/include")
2429 if test "x$ac_system" = "xLinux"
2431 with_libnetlink="yes"
2433 with_libnetlink="no (Linux only library)"
2436 if test "x$with_libnetlink" = "xyes"
2438 SAVE_CFLAGS="$CFLAGS"
2439 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2441 with_libnetlink="no (libnetlink.h not found)"
2443 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2445 with_libnetlink="yes"
2449 #include <sys/types.h>
2450 #include <asm/types.h>
2451 #include <sys/socket.h>
2452 #include <linux/netlink.h>
2453 #include <linux/rtnetlink.h>])
2454 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2456 #include <sys/types.h>
2457 #include <asm/types.h>
2458 #include <sys/socket.h>])
2462 #include <sys/types.h>
2463 #include <asm/types.h>
2464 #include <sys/socket.h>
2465 #include <linux/netlink.h>
2466 #include <linux/rtnetlink.h>
2470 int retval = TCA_STATS2;
2473 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2478 #include <sys/types.h>
2479 #include <asm/types.h>
2480 #include <sys/socket.h>
2481 #include <linux/netlink.h>
2482 #include <linux/rtnetlink.h>
2486 int retval = TCA_STATS;
2489 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2492 CFLAGS="$SAVE_CFLAGS"
2494 if test "x$with_libnetlink" = "xyes"
2496 AC_CHECK_LIB(netlink, rtnl_open,
2497 [with_libnetlink="yes"],
2498 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2499 [$with_libnetlink_libs])
2501 if test "x$with_libnetlink" = "xyes"
2503 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2504 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2505 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2506 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2508 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2511 # --with-libnetapp {{{
2512 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2513 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2514 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2515 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2516 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2517 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2518 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2520 if test -d "$withval"
2522 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2523 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2524 with_libnetapp="yes"
2526 with_libnetapp="$withval"
2530 with_libnetapp="yes"
2533 SAVE_CPPFLAGS="$CPPFLAGS"
2534 SAVE_LDFLAGS="$LDFLAGS"
2535 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2536 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2538 if test "x$with_libnetapp" = "xyes"
2540 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2542 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2544 AC_CHECK_HEADERS(netapp_api.h,
2545 [with_libnetapp="yes"],
2546 [with_libnetapp="no (netapp_api.h not found)"])
2549 if test "x$with_libnetapp" = "xyes"
2551 if test "x$LIBNETAPP_LDFLAGS" != "x"
2553 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2556 if test "x$LIBNETAPP_LIBS" = "x"
2558 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2560 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2562 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2563 [with_libnetapp="yes"],
2564 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2566 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2569 CPPFLAGS="$SAVE_CPPFLAGS"
2570 LDFLAGS="$SAVE_LDFLAGS"
2572 if test "x$with_libnetapp" = "xyes"
2574 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2577 AC_SUBST(LIBNETAPP_CPPFLAGS)
2578 AC_SUBST(LIBNETAPP_LDFLAGS)
2579 AC_SUBST(LIBNETAPP_LIBS)
2580 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2583 # --with-libnetsnmp {{{
2584 with_snmp_config="net-snmp-config"
2587 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2589 if test "x$withval" = "xno"
2591 with_libnetsnmp="no"
2592 else if test "x$withval" = "xyes"
2594 with_libnetsnmp="yes"
2596 if test -x "$withval"
2598 with_snmp_config="$withval"
2599 with_libnetsnmp="yes"
2601 with_snmp_config="$withval/bin/net-snmp-config"
2602 with_libnetsnmp="yes"
2606 [with_libnetsnmp="yes"])
2607 if test "x$with_libnetsnmp" = "xyes"
2609 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2610 snmp_config_status=$?
2612 if test $snmp_config_status -ne 0
2614 with_libnetsnmp="no ($with_snmp_config failed)"
2616 SAVE_CPPFLAGS="$CPPFLAGS"
2617 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2619 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2621 CPPFLAGS="$SAVE_CPPFLAGS"
2624 if test "x$with_libnetsnmp" = "xyes"
2626 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2627 snmp_config_status=$?
2629 if test $snmp_config_status -ne 0
2631 with_libnetsnmp="no ($with_snmp_config failed)"
2633 AC_CHECK_LIB(netsnmp, init_snmp,
2634 [with_libnetsnmp="yes"],
2635 [with_libnetsnmp="no (libnetsnmp not found)"],
2639 if test "x$with_libnetsnmp" = "xyes"
2641 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2642 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2643 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2644 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2646 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2649 # --with-liboconfig {{{
2650 with_own_liboconfig="no"
2651 liboconfig_LDFLAGS="$LDFLAGS"
2652 liboconfig_CPPFLAGS="$CPPFLAGS"
2653 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2655 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2657 if test -d "$withval/lib"
2659 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2661 if test -d "$withval/include"
2663 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2666 if test "x$withval" = "xno"
2668 AC_MSG_ERROR("liboconfig is required")
2672 with_liboconfig="yes"
2675 save_LDFLAGS="$LDFLAGS"
2676 save_CPPFLAGS="$CPPFLAGS"
2677 LDFLAGS="$liboconfig_LDFLAGS"
2678 CPPFLAGS="$liboconfig_CPPFLAGS"
2679 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2681 with_liboconfig="yes"
2682 with_own_liboconfig="no"
2685 with_liboconfig="yes"
2686 with_own_liboconfig="yes"
2687 LDFLAGS="$save_LDFLAGS"
2688 CPPFLAGS="$save_CPPFLAGS"
2691 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2692 if test "x$with_own_liboconfig" = "xyes"
2694 with_liboconfig="yes (shipped version)"
2698 # --with-liboping {{{
2699 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2701 if test "x$withval" = "xyes"
2704 else if test "x$withval" = "xno"
2709 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2710 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2713 [with_liboping="yes"])
2715 SAVE_CPPFLAGS="$CPPFLAGS"
2716 SAVE_LDFLAGS="$LDFLAGS"
2718 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2719 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2721 if test "x$with_liboping" = "xyes"
2723 if test "x$LIBOPING_CPPFLAGS" != "x"
2725 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2727 AC_CHECK_HEADERS(oping.h,
2728 [with_liboping="yes"],
2729 [with_liboping="no (oping.h not found)"])
2731 if test "x$with_liboping" = "xyes"
2733 if test "x$LIBOPING_LDFLAGS" != "x"
2735 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2737 AC_CHECK_LIB(oping, ping_construct,
2738 [with_liboping="yes"],
2739 [with_liboping="no (symbol 'ping_construct' not found)"])
2742 CPPFLAGS="$SAVE_CPPFLAGS"
2743 LDFLAGS="$SAVE_LDFLAGS"
2745 if test "x$with_liboping" = "xyes"
2747 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2748 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2749 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2750 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2752 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2756 with_oracle_cppflags=""
2758 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2760 if test "x$withval" = "xyes"
2762 if test "x$ORACLE_HOME" = "x"
2764 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2767 else if test "x$withval" = "xno"
2772 ORACLE_HOME="$withval"
2776 if test "x$ORACLE_HOME" = "x"
2778 with_oracle="no (ORACLE_HOME is not set)"
2783 if test "x$ORACLE_HOME" != "x"
2785 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2787 if test -e "$ORACLE_HOME/lib/ldflags"
2789 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2791 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2792 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2794 if test "x$with_oracle" = "xyes"
2796 SAVE_CPPFLAGS="$CPPFLAGS"
2797 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2799 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2801 CPPFLAGS="$SAVE_CPPFLAGS"
2803 if test "x$with_oracle" = "xyes"
2805 SAVE_CPPFLAGS="$CPPFLAGS"
2806 SAVE_LDFLAGS="$LDFLAGS"
2807 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2808 LDFLAGS="$LDFLAGS $with_oracle_libs"
2810 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2812 CPPFLAGS="$SAVE_CPPFLAGS"
2813 LDFLAGS="$SAVE_LDFLAGS"
2815 if test "x$with_oracle" = "xyes"
2817 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2818 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2819 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2820 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2824 # --with-libowcapi {{{
2825 with_libowcapi_cppflags=""
2826 with_libowcapi_libs="-lowcapi"
2827 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2829 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2831 with_libowcapi_cppflags="-I$withval/include"
2832 with_libowcapi_libs="-L$withval/lib -lowcapi"
2833 with_libowcapi="yes"
2835 with_libowcapi="$withval"
2839 with_libowcapi="yes"
2841 if test "x$with_libowcapi" = "xyes"
2843 SAVE_CPPFLAGS="$CPPFLAGS"
2844 CPPFLAGS="$with_libowcapi_cppflags"
2846 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2848 CPPFLAGS="$SAVE_CPPFLAGS"
2850 if test "x$with_libowcapi" = "xyes"
2852 SAVE_LDFLAGS="$LDFLAGS"
2853 SAVE_CPPFLAGS="$CPPFLAGS"
2854 LDFLAGS="$with_libowcapi_libs"
2855 CPPFLAGS="$with_libowcapi_cppflags"
2857 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2859 LDFLAGS="$SAVE_LDFLAGS"
2860 CPPFLAGS="$SAVE_CPPFLAGS"
2862 if test "x$with_libowcapi" = "xyes"
2864 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2865 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2866 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2867 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2871 # --with-libpcap {{{
2872 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2874 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2876 LDFLAGS="$LDFLAGS -L$withval/lib"
2877 CPPFLAGS="$CPPFLAGS -I$withval/include"
2880 with_libpcap="$withval"
2886 if test "x$with_libpcap" = "xyes"
2888 AC_CHECK_LIB(pcap, pcap_open_live,
2890 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2891 ], [with_libpcap="no (libpcap not found)"])
2893 if test "x$with_libpcap" = "xyes"
2895 AC_CHECK_HEADERS(pcap.h,,
2896 [with_libpcap="no (pcap.h not found)"])
2898 if test "x$with_libpcap" = "xyes"
2900 AC_CHECK_HEADERS(pcap-bpf.h,,
2901 [with_libpcap="no (pcap-bpf.h not found)"])
2903 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2906 # --with-libperl {{{
2907 perl_interpreter="perl"
2908 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2910 if test -x "$withval"
2912 perl_interpreter="$withval"
2914 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2916 LDFLAGS="$LDFLAGS -L$withval/lib"
2917 CPPFLAGS="$CPPFLAGS -I$withval/include"
2918 perl_interpreter="$withval/bin/perl"
2921 with_libperl="$withval"
2928 AC_MSG_CHECKING([for perl])
2929 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2930 if test -x "$perl_interpreter"
2932 AC_MSG_RESULT([yes ($perl_interpreter)])
2938 AC_SUBST(PERL, "$perl_interpreter")
2940 if test "x$with_libperl" = "xyes" \
2941 && test -n "$perl_interpreter"
2943 SAVE_CFLAGS="$CFLAGS"
2944 SAVE_LDFLAGS="$LDFLAGS"
2945 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2946 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2947 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2948 CFLAGS="$CFLAGS $PERL_CFLAGS"
2949 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2951 AC_CACHE_CHECK([for libperl],
2952 [c_cv_have_libperl],
2956 #define PERL_NO_GET_CONTEXT
2963 load_module (PERL_LOADMOD_NOIMPORT,
2964 newSVpv ("Collectd::Plugin::FooBar", 24),
2967 [c_cv_have_libperl="yes"],
2968 [c_cv_have_libperl="no"]
2972 if test "x$c_cv_have_libperl" = "xyes"
2974 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2975 AC_SUBST(PERL_CFLAGS)
2976 AC_SUBST(PERL_LDFLAGS)
2981 CFLAGS="$SAVE_CFLAGS"
2982 LDFLAGS="$SAVE_LDFLAGS"
2983 else if test -z "$perl_interpreter"; then
2984 with_libperl="no (no perl interpreter found)"
2985 c_cv_have_libperl="no"
2987 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2989 if test "x$with_libperl" = "xyes"
2991 SAVE_CFLAGS="$CFLAGS"
2992 SAVE_LDFLAGS="$LDFLAGS"
2993 CFLAGS="$CFLAGS $PERL_CFLAGS"
2994 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2996 AC_CACHE_CHECK([if perl supports ithreads],
2997 [c_cv_have_perl_ithreads],
3005 #if !defined(USE_ITHREADS)
3006 # error "Perl does not support ithreads!"
3007 #endif /* !defined(USE_ITHREADS) */
3010 [c_cv_have_perl_ithreads="yes"],
3011 [c_cv_have_perl_ithreads="no"]
3015 if test "x$c_cv_have_perl_ithreads" = "xyes"
3017 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
3020 CFLAGS="$SAVE_CFLAGS"
3021 LDFLAGS="$SAVE_LDFLAGS"
3024 if test "x$with_libperl" = "xyes"
3026 SAVE_CFLAGS="$CFLAGS"
3027 SAVE_LDFLAGS="$LDFLAGS"
3028 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3029 # (see issues #41 and #42)
3030 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3031 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3033 AC_CACHE_CHECK([for broken Perl_load_module()],
3034 [c_cv_have_broken_perl_load_module],
3038 #define PERL_NO_GET_CONTEXT
3045 load_module (PERL_LOADMOD_NOIMPORT,
3046 newSVpv ("Collectd::Plugin::FooBar", 24),
3049 [c_cv_have_broken_perl_load_module="no"],
3050 [c_cv_have_broken_perl_load_module="yes"]
3054 CFLAGS="$SAVE_CFLAGS"
3055 LDFLAGS="$SAVE_LDFLAGS"
3057 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3058 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3060 if test "x$with_libperl" = "xyes"
3062 SAVE_CFLAGS="$CFLAGS"
3063 SAVE_LDFLAGS="$LDFLAGS"
3064 CFLAGS="$CFLAGS $PERL_CFLAGS"
3065 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3068 [struct mgvtbl.svt_local],
3069 [have_struct_mgvtbl_svt_local="yes"],
3070 [have_struct_mgvtbl_svt_local="no"],
3077 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3079 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3080 [Define if Perl's struct mgvtbl has member svt_local.])
3083 CFLAGS="$SAVE_CFLAGS"
3084 LDFLAGS="$SAVE_LDFLAGS"
3089 with_pg_config="pg_config"
3090 with_libpq_includedir=""
3091 with_libpq_libdir=""
3092 with_libpq_cppflags=""
3093 with_libpq_ldflags=""
3094 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3097 if test "x$withval" = "xno"
3100 else if test "x$withval" = "xyes"
3104 if test -f "$withval" && test -x "$withval";
3106 with_pg_config="$withval"
3107 else if test -x "$withval/bin/pg_config"
3109 with_pg_config="$withval/bin/pg_config"
3117 if test "x$with_libpq" = "xyes"
3119 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3122 if test $pg_config_status -eq 0
3124 if test -n "$with_libpq_includedir"; then
3125 for dir in $with_libpq_includedir; do
3126 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3130 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3133 SAVE_CPPFLAGS="$CPPFLAGS"
3134 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3136 AC_CHECK_HEADERS(libpq-fe.h, [],
3137 [with_libpq="no (libpq-fe.h not found)"], [])
3139 CPPFLAGS="$SAVE_CPPFLAGS"
3141 if test "x$with_libpq" = "xyes"
3143 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3146 if test $pg_config_status -eq 0
3148 if test -n "$with_libpq_libdir"; then
3149 for dir in $with_libpq_libdir; do
3150 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3154 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3157 SAVE_LDFLAGS="$LDFLAGS"
3158 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3160 AC_CHECK_LIB(pq, PQconnectdb,
3162 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3164 AC_CHECK_LIB(pq, PQserverVersion,
3166 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3168 LDFLAGS="$SAVE_LDFLAGS"
3170 if test "x$with_libpq" = "xyes"
3172 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3173 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3174 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3175 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3177 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3180 # --with-libpthread {{{
3181 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3182 [ if test "x$withval" != "xno" \
3183 && test "x$withval" != "xyes"
3185 LDFLAGS="$LDFLAGS -L$withval/lib"
3186 CPPFLAGS="$CPPFLAGS -I$withval/include"
3187 with_libpthread="yes"
3189 if test "x$withval" = "xno"
3191 with_libpthread="no (disabled)"
3194 ], [with_libpthread="yes"])
3195 if test "x$with_libpthread" = "xyes"
3197 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3200 if test "x$with_libpthread" = "xyes"
3202 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3204 if test "x$with_libpthread" = "xyes"
3210 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3211 [Wether or not to use pthread (POSIX threads) library])
3212 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3217 with_python_path="$PATH"
3218 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3220 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3222 with_python="$withval"
3223 else if test -x "$withval"
3225 with_python_prog="$withval"
3226 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3228 else if test -d "$withval"
3230 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3233 AC_MSG_WARN([Argument not recognized: $withval])
3235 ], [with_python="yes"])
3238 SAVE_CPPFLAGS="$CPPFLAGS"
3239 SAVE_LDFLAGS="$LDFLAGS"
3242 PATH="$with_python_path"
3244 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3246 AC_MSG_CHECKING([for python])
3247 with_python_prog="`which python 2>/dev/null`"
3248 if test "x$with_python_prog" = "x"
3250 AC_MSG_RESULT([not found])
3251 with_python="no (interpreter not found)"
3253 AC_MSG_RESULT([$with_python_prog])
3257 if test "x$with_python" = "xyes"
3259 AC_MSG_CHECKING([for Python CPPFLAGS])
3260 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3261 python_config_status=$?
3263 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3265 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3268 AC_MSG_RESULT([$python_include_path])
3272 if test "x$with_python" = "xyes"
3274 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3275 AC_CHECK_HEADERS(Python.h,
3276 [with_python="yes"],
3277 [with_python="no ('Python.h' not found)"])
3280 if test "x$with_python" = "xyes"
3282 AC_MSG_CHECKING([for Python LDFLAGS])
3283 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`
3284 python_config_status=$?
3286 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3288 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3291 AC_MSG_RESULT([$python_library_path])
3295 if test "x$with_python" = "xyes"
3297 AC_MSG_CHECKING([for Python LIBS])
3298 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`
3299 python_config_status=$?
3301 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3303 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3306 AC_MSG_RESULT([$python_library_flags])
3310 if test "x$with_python" = "xyes"
3312 LDFLAGS="-L$python_library_path $LDFLAGS"
3313 LIBS="$python_library_flags $LIBS"
3315 AC_CHECK_FUNC(PyObject_CallFunction,
3316 [with_python="yes"],
3317 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3321 CPPFLAGS="$SAVE_CPPFLAGS"
3322 LDFLAGS="$SAVE_LDFLAGS"
3325 if test "x$with_python" = "xyes"
3327 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3328 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3329 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3330 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3331 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3332 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3336 # --with-librabbitmq {{{
3337 with_librabbitmq_cppflags=""
3338 with_librabbitmq_ldflags=""
3339 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3341 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3343 with_librabbitmq_cppflags="-I$withval/include"
3344 with_librabbitmq_ldflags="-L$withval/lib"
3345 with_librabbitmq="yes"
3347 with_librabbitmq="$withval"
3351 with_librabbitmq="yes"
3353 if test "x$with_librabbitmq" = "xyes"
3355 SAVE_CPPFLAGS="$CPPFLAGS"
3356 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3358 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3360 CPPFLAGS="$SAVE_CPPFLAGS"
3362 if test "x$with_librabbitmq" = "xyes"
3364 SAVE_CPPFLAGS="$CPPFLAGS"
3365 SAVE_LDFLAGS="$LDFLAGS"
3366 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3367 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3369 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3371 CPPFLAGS="$SAVE_CPPFLAGS"
3372 LDFLAGS="$SAVE_LDFLAGS"
3374 if test "x$with_librabbitmq" = "xyes"
3376 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3377 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3378 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3379 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3380 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3381 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3382 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3384 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3387 # --with-librouteros {{{
3388 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3390 if test "x$withval" = "xyes"
3392 with_librouteros="yes"
3393 else if test "x$withval" = "xno"
3395 with_librouteros="no"
3397 with_librouteros="yes"
3398 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3399 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3402 [with_librouteros="yes"])
3404 SAVE_CPPFLAGS="$CPPFLAGS"
3405 SAVE_LDFLAGS="$LDFLAGS"
3407 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3408 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3410 if test "x$with_librouteros" = "xyes"
3412 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3414 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3416 AC_CHECK_HEADERS(routeros_api.h,
3417 [with_librouteros="yes"],
3418 [with_librouteros="no (routeros_api.h not found)"])
3420 if test "x$with_librouteros" = "xyes"
3422 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3424 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3426 AC_CHECK_LIB(routeros, ros_interface,
3427 [with_librouteros="yes"],
3428 [with_librouteros="no (symbol 'ros_interface' not found)"])
3431 CPPFLAGS="$SAVE_CPPFLAGS"
3432 LDFLAGS="$SAVE_LDFLAGS"
3434 if test "x$with_librouteros" = "xyes"
3436 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3437 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3438 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3439 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3441 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3445 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3448 librrd_threadsafe="yes"
3449 librrd_rrdc_update="no"
3450 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3451 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3453 librrd_cflags="-I$withval/include"
3454 librrd_ldflags="-L$withval/lib"
3457 with_librrd="$withval"
3459 ], [with_librrd="yes"])
3460 if test "x$with_librrd" = "xyes"
3462 SAVE_CPPFLAGS="$CPPFLAGS"
3463 SAVE_LDFLAGS="$LDFLAGS"
3465 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3466 LDFLAGS="$LDFLAGS $librrd_ldflags"
3468 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3470 CPPFLAGS="$SAVE_CPPFLAGS"
3471 LDFLAGS="$SAVE_LDFLAGS"
3473 if test "x$with_librrd" = "xyes"
3475 SAVE_CPPFLAGS="$CPPFLAGS"
3476 SAVE_LDFLAGS="$LDFLAGS"
3478 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3479 LDFLAGS="$LDFLAGS $librrd_ldflags"
3481 AC_CHECK_LIB(rrd_th, rrd_update_r,
3483 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3485 [librrd_threadsafe="no"
3486 AC_CHECK_LIB(rrd, rrd_update,
3488 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3490 [with_librrd="no (symbol 'rrd_update' not found)"],
3495 if test "x$librrd_threadsafe" = "xyes"
3497 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3499 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3502 CPPFLAGS="$SAVE_CPPFLAGS"
3503 LDFLAGS="$SAVE_LDFLAGS"
3505 if test "x$with_librrd" = "xyes"
3507 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3508 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3509 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3510 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3512 if test "x$librrd_threadsafe" = "xyes"
3514 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3518 # --with-libsensors {{{
3519 with_sensors_cflags=""
3520 with_sensors_ldflags=""
3521 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3523 if test "x$withval" = "xno"
3525 with_libsensors="no"
3527 with_libsensors="yes"
3528 if test "x$withval" != "xyes"
3530 with_sensors_cflags="-I$withval/include"
3531 with_sensors_ldflags="-L$withval/lib"
3532 with_libsensors="yes"
3537 if test "x$ac_system" = "xLinux"
3539 with_libsensors="yes"
3541 with_libsensors="no (Linux only library)"
3544 if test "x$with_libsensors" = "xyes"
3546 SAVE_CPPFLAGS="$CPPFLAGS"
3547 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3549 # AC_CHECK_HEADERS(sensors/sensors.h,
3551 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3553 # [with_libsensors="no (sensors/sensors.h not found)"])
3554 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3556 CPPFLAGS="$SAVE_CPPFLAGS"
3558 if test "x$with_libsensors" = "xyes"
3560 SAVE_CPPFLAGS="$CPPFLAGS"
3561 SAVE_LDFLAGS="$LDFLAGS"
3562 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3563 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3565 AC_CHECK_LIB(sensors, sensors_init,
3567 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3569 [with_libsensors="no (libsensors not found)"])
3571 CPPFLAGS="$SAVE_CPPFLAGS"
3572 LDFLAGS="$SAVE_LDFLAGS"
3574 if test "x$with_libsensors" = "xyes"
3576 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3577 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3578 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3579 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3581 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3584 # --with-libstatgrab {{{
3585 with_libstatgrab_cflags=""
3586 with_libstatgrab_ldflags=""
3587 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3589 if test "x$withval" != "xno" \
3590 && test "x$withval" != "xyes"
3592 with_libstatgrab_cflags="-I$withval/include"
3593 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3594 with_libstatgrab="yes"
3595 with_libstatgrab_pkg_config="no"
3597 with_libstatgrab="$withval"
3598 with_libstatgrab_pkg_config="yes"
3602 with_libstatgrab="yes"
3603 with_libstatgrab_pkg_config="yes"
3606 if test "x$with_libstatgrab" = "xyes" \
3607 && test "x$with_libstatgrab_pkg_config" = "xyes"
3609 if test "x$PKG_CONFIG" != "x"
3611 AC_MSG_CHECKING([pkg-config for libstatgrab])
3613 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3616 with_libstatgrab_pkg_config="no"
3617 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3618 temp_result="not found"
3620 AC_MSG_RESULT([$temp_result])
3622 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3623 with_libstatgrab_pkg_config="no"
3624 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3628 if test "x$with_libstatgrab" = "xyes" \
3629 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3630 && test "x$with_libstatgrab_cflags" = "x"
3632 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3633 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3636 with_libstatgrab_cflags="$temp_result"
3638 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3639 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3641 AC_MSG_RESULT([$temp_result])
3644 if test "x$with_libstatgrab" = "xyes" \
3645 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3646 && test "x$with_libstatgrab_ldflags" = "x"
3648 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3649 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3652 with_libstatgrab_ldflags="$temp_result"
3654 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3655 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3657 AC_MSG_RESULT([$temp_result])
3660 if test "x$with_libstatgrab" = "xyes"
3662 SAVE_CPPFLAGS="$CPPFLAGS"
3663 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3665 AC_CHECK_HEADERS(statgrab.h,
3666 [with_libstatgrab="yes"],
3667 [with_libstatgrab="no (statgrab.h not found)"])
3669 CPPFLAGS="$SAVE_CPPFLAGS"
3672 if test "x$with_libstatgrab" = "xyes"
3674 SAVE_CFLAGS="$CFLAGS"
3675 SAVE_LDFLAGS="$LDFLAGS"
3677 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3678 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3680 AC_CHECK_LIB(statgrab, sg_init,
3681 [with_libstatgrab="yes"],
3682 [with_libstatgrab="no (symbol sg_init not found)"])
3684 CFLAGS="$SAVE_CFLAGS"
3685 LDFLAGS="$SAVE_LDFLAGS"
3688 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3689 if test "x$with_libstatgrab" = "xyes"
3691 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3692 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3693 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3694 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3695 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3699 # --with-libtokyotyrant {{{
3700 with_libtokyotyrant_cppflags=""
3701 with_libtokyotyrant_ldflags=""
3702 with_libtokyotyrant_libs=""
3703 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3705 if test "x$withval" = "xno"
3707 with_libtokyotyrant="no"
3708 else if test "x$withval" = "xyes"
3710 with_libtokyotyrant="yes"
3712 with_libtokyotyrant_cppflags="-I$withval/include"
3713 with_libtokyotyrant_ldflags="-L$withval/include"
3714 with_libtokyotyrant_libs="-ltokyotyrant"
3715 with_libtokyotyrant="yes"
3719 with_libtokyotyrant="yes"
3722 if test "x$with_libtokyotyrant" = "xyes"
3724 if $PKG_CONFIG --exists tokyotyrant
3726 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3727 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3728 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3732 SAVE_CPPFLAGS="$CPPFLAGS"
3733 SAVE_LDFLAGS="$LDFLAGS"
3734 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3735 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3737 if test "x$with_libtokyotyrant" = "xyes"
3739 AC_CHECK_HEADERS(tcrdb.h,
3741 AC_DEFINE(HAVE_TCRDB_H, 1,
3742 [Define to 1 if you have the <tcrdb.h> header file.])
3743 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3746 if test "x$with_libtokyotyrant" = "xyes"
3748 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3750 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3751 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3753 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3754 [$with_libtokyotyrant_libs])
3757 CPPFLAGS="$SAVE_CPPFLAGS"
3758 LDFLAGS="$SAVE_LDFLAGS"
3760 if test "x$with_libtokyotyrant" = "xyes"
3762 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3763 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3764 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3765 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3766 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3767 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3769 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3772 # --with-libupsclient {{{
3773 with_libupsclient_config=""
3774 with_libupsclient_cflags=""
3775 with_libupsclient_libs=""
3776 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3778 if test "x$withval" = "xno"
3780 with_libupsclient="no"
3781 else if test "x$withval" = "xyes"
3783 with_libupsclient="use_pkgconfig"
3785 if test -x "$withval"
3787 with_libupsclient_config="$withval"
3788 with_libupsclient="use_libupsclient_config"
3789 else if test -x "$withval/bin/libupsclient-config"
3791 with_libupsclient_config="$withval/bin/libupsclient-config"
3792 with_libupsclient="use_libupsclient_config"
3794 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3795 with_libupsclient_cflags="-I$withval/include"
3796 with_libupsclient_libs="-L$withval/lib -lupsclient"
3797 with_libupsclient="yes"
3801 [with_libupsclient="use_pkgconfig"])
3803 # configure using libupsclient-config
3804 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3806 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3807 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3810 with_libupsclient="no ($with_libupsclient_config failed)"
3812 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3815 with_libupsclient="no ($with_libupsclient_config failed)"
3818 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3820 with_libupsclient="yes"
3823 # configure using pkg-config
3824 if test "x$with_libupsclient" = "xuse_pkgconfig"
3826 if test "x$PKG_CONFIG" = "x"
3828 with_libupsclient="no (Don't have pkg-config)"
3831 if test "x$with_libupsclient" = "xuse_pkgconfig"
3833 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3834 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3837 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3840 if test "x$with_libupsclient" = "xuse_pkgconfig"
3842 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3845 with_libupsclient="no ($PKG_CONFIG failed)"
3847 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3850 with_libupsclient="no ($PKG_CONFIG failed)"
3853 if test "x$with_libupsclient" = "xuse_pkgconfig"
3855 with_libupsclient="yes"
3858 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3859 # the actual checks.
3860 if test "x$with_libupsclient" = "xyes"
3862 SAVE_CPPFLAGS="$CPPFLAGS"
3863 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3865 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3867 CPPFLAGS="$SAVE_CPPFLAGS"
3869 if test "x$with_libupsclient" = "xyes"
3871 SAVE_CPPFLAGS="$CPPFLAGS"
3872 SAVE_LDFLAGS="$LDFLAGS"
3874 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3875 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3877 AC_CHECK_LIB(upsclient, upscli_connect,
3878 [with_libupsclient="yes"],
3879 [with_libupsclient="no (symbol upscli_connect not found)"])
3881 CPPFLAGS="$SAVE_CPPFLAGS"
3882 LDFLAGS="$SAVE_LDFLAGS"
3884 if test "x$with_libupsclient" = "xyes"
3886 SAVE_CPPFLAGS="$CPPFLAGS"
3887 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3889 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3890 [#include <stdlib.h>
3892 #include <upsclient.h>])
3894 CPPFLAGS="$SAVE_CPPFLAGS"
3896 if test "x$with_libupsclient" = "xyes"
3898 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3899 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3900 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3901 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3905 # --with-libxmms {{{
3906 with_xmms_config="xmms-config"
3909 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3911 if test "x$withval" != "xno" \
3912 && test "x$withval" != "xyes"
3914 if test -f "$withval" && test -x "$withval";
3916 with_xmms_config="$withval"
3917 else if test -x "$withval/bin/xmms-config"
3919 with_xmms_config="$withval/bin/xmms-config"
3922 else if test "x$withval" = "xno"
3932 if test "x$with_libxmms" = "xyes"
3934 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3935 xmms_config_status=$?
3937 if test $xmms_config_status -ne 0
3942 if test "x$with_libxmms" = "xyes"
3944 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3945 xmms_config_status=$?
3947 if test $xmms_config_status -ne 0
3952 if test "x$with_libxmms" = "xyes"
3954 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3956 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3957 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3958 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3959 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3966 with_libxmms_numeric=0
3967 if test "x$with_libxmms" = "xyes"
3969 with_libxmms_numeric=1
3971 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3972 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3975 # --with-libyajl {{{
3976 with_libyajl_cppflags=""
3977 with_libyajl_ldflags=""
3978 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3980 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3982 with_libyajl_cppflags="-I$withval/include"
3983 with_libyajl_ldflags="-L$withval/lib"
3986 with_libyajl="$withval"
3992 if test "x$with_libyajl" = "xyes"
3994 SAVE_CPPFLAGS="$CPPFLAGS"
3995 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3997 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3998 AC_CHECK_HEADERS(yajl/yajl_version.h)
4000 CPPFLAGS="$SAVE_CPPFLAGS"
4002 if test "x$with_libyajl" = "xyes"
4004 SAVE_CPPFLAGS="$CPPFLAGS"
4005 SAVE_LDFLAGS="$LDFLAGS"
4006 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
4007 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
4009 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
4011 CPPFLAGS="$SAVE_CPPFLAGS"
4012 LDFLAGS="$SAVE_LDFLAGS"
4014 if test "x$with_libyajl" = "xyes"
4016 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4017 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4018 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4019 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4020 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4021 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4022 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4024 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4027 # --with-libvarnish {{{
4028 with_libvarnish_cppflags=""
4029 with_libvarnish_cflags=""
4030 with_libvarnish_libs=""
4031 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4033 if test "x$withval" = "xno"
4035 with_libvarnish="no"
4036 else if test "x$withval" = "xyes"
4038 with_libvarnish="use_pkgconfig"
4039 else if test -d "$with_libvarnish/lib"
4041 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4042 with_libvarnish_cflags="-I$withval/include"
4043 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
4044 with_libvarnish="yes"
4047 [with_libvarnish="use_pkgconfig"])
4049 # configure using pkg-config
4050 if test "x$with_libvarnish" = "xuse_pkgconfig"
4052 if test "x$PKG_CONFIG" = "x"
4054 with_libvarnish="no (Don't have pkg-config)"
4057 if test "x$with_libvarnish" = "xuse_pkgconfig"
4059 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4060 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4063 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4066 if test "x$with_libvarnish" = "xuse_pkgconfig"
4068 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4071 with_libvarnish="no ($PKG_CONFIG failed)"
4073 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4076 with_libvarnish="no ($PKG_CONFIG failed)"
4079 if test "x$with_libvarnish" = "xuse_pkgconfig"
4081 with_libvarnish="yes"
4084 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4085 # the actual checks.
4086 if test "x$with_libvarnish" = "xyes"
4088 SAVE_CPPFLAGS="$CPPFLAGS"
4089 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4090 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4092 CPPFLAGS="$SAVE_CPPFLAGS"
4094 if test "x$with_libvarnish" = "xyes"
4096 SAVE_CPPFLAGS="$CPPFLAGS"
4097 #SAVE_LDFLAGS="$LDFLAGS"
4099 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4100 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4102 AC_CHECK_HEADERS(varnish/vsc.h,
4103 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
4104 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])])
4106 CPPFLAGS="$SAVE_CPPFLAGS"
4107 #LDFLAGS="$SAVE_LDFLAGS"
4109 if test "x$with_libvarnish" = "xyes"
4111 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4112 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4113 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4114 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4118 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4119 with_libxml2="no (pkg-config isn't available)"
4120 with_libxml2_cflags=""
4121 with_libxml2_ldflags=""
4122 with_libvirt="no (pkg-config isn't available)"
4123 with_libvirt_cflags=""
4124 with_libvirt_ldflags=""
4125 if test "x$PKG_CONFIG" != "x"
4127 pkg-config --exists 'libxml-2.0' 2>/dev/null
4132 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4135 pkg-config --exists libvirt 2>/dev/null
4140 with_libvirt="no (pkg-config doesn't know libvirt)"
4143 if test "x$with_libxml2" = "xyes"
4145 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4150 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4156 if test "x$with_libxml2" = "xyes"
4158 SAVE_CPPFLAGS="$CPPFLAGS"
4159 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4161 AC_CHECK_HEADERS(libxml/parser.h, [],
4162 [with_libxml2="no (libxml/parser.h not found)"])
4164 CPPFLAGS="$SAVE_CPPFLAGS"
4166 if test "x$with_libxml2" = "xyes"
4168 SAVE_CFLAGS="$CFLAGS"
4169 SAVE_LDFLAGS="$LDFLAGS"
4171 CFLAGS="$CFLAGS $with_libxml2_cflags"
4172 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4174 AC_CHECK_LIB(xml2, xmlXPathEval,
4175 [with_libxml2="yes"],
4176 [with_libxml2="no (symbol xmlXPathEval not found)"])
4178 CFLAGS="$SAVE_CFLAGS"
4179 LDFLAGS="$SAVE_LDFLAGS"
4181 dnl Add the right compiler flags and libraries.
4182 if test "x$with_libxml2" = "xyes"; then
4183 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4184 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4185 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4186 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4188 if test "x$with_libvirt" = "xyes"
4190 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4195 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4201 if test "x$with_libvirt" = "xyes"
4203 SAVE_CPPFLAGS="$CPPFLAGS"
4204 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4206 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4207 [with_libvirt="no (libvirt/libvirt.h not found)"])
4209 CPPFLAGS="$SAVE_CPPFLAGS"
4211 if test "x$with_libvirt" = "xyes"
4213 SAVE_CFLAGS="$CFLAGS"
4214 SAVE_LDFLAGS="$LDFLAGS"
4216 CFLAGS="$CFLAGS $with_libvirt_cflags"
4217 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4219 AC_CHECK_LIB(virt, virDomainBlockStats,
4220 [with_libvirt="yes"],
4221 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4223 CFLAGS="$SAVE_CFLAGS"
4224 LDFLAGS="$SAVE_LDFLAGS"
4226 dnl Add the right compiler flags and libraries.
4227 if test "x$with_libvirt" = "xyes"; then
4228 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4229 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4230 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4231 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4235 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4236 with_libopenipmipthread="yes"
4237 with_libopenipmipthread_cflags=""
4238 with_libopenipmipthread_libs=""
4240 AC_MSG_CHECKING([for pkg-config])
4242 if test "x$PKG_CONFIG" = "x"
4244 with_libopenipmipthread="no"
4247 temp_result="$PKG_CONFIG"
4249 AC_MSG_RESULT([$temp_result])
4251 if test "x$with_libopenipmipthread" = "xyes"
4253 AC_MSG_CHECKING([for libOpenIPMIpthread])
4254 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4257 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4259 AC_MSG_RESULT([$with_libopenipmipthread])
4262 if test "x$with_libopenipmipthread" = "xyes"
4264 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4265 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4268 with_libopenipmipthread_cflags="$temp_result"
4270 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4271 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4273 AC_MSG_RESULT([$temp_result])
4276 if test "x$with_libopenipmipthread" = "xyes"
4278 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4279 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4282 with_libopenipmipthread_ldflags="$temp_result"
4284 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4285 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4287 AC_MSG_RESULT([$temp_result])
4290 if test "x$with_libopenipmipthread" = "xyes"
4292 SAVE_CPPFLAGS="$CPPFLAGS"
4293 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4295 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4296 [with_libopenipmipthread="yes"],
4297 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4298 [#include <OpenIPMI/ipmiif.h>
4299 #include <OpenIPMI/ipmi_err.h>
4300 #include <OpenIPMI/ipmi_posix.h>
4301 #include <OpenIPMI/ipmi_conn.h>
4304 CPPFLAGS="$SAVE_CPPFLAGS"
4307 if test "x$with_libopenipmipthread" = "xyes"
4309 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4310 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4311 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4312 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4316 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4317 [with_libnotify="yes"],
4318 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4321 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4324 # Check for enabled/disabled features
4327 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4328 # ------------------------------------------------------------
4330 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4335 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4340 m4_define([EnDis],[disabled])dnl
4341 m4_define([YesNo],[no])dnl
4347 m4_define([EnDis],[enabled])dnl
4348 m4_define([YesNo],[yes])dnl
4351 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4355 m4_if([$3], [feature], [],
4359 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4365 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4367 enable_$1='[YesNo]'dnl
4369 if test "x$enable_$1" = "xno"
4373 if test "x$enable_$1" = "xyes"
4377 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4382 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4383 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4385 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4387 # AC_PLUGIN(name, default, info)
4388 # ------------------------------------------------------------
4395 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4397 if test "x$enableval" = "xyes"
4400 else if test "x$enableval" = "xforce"
4405 enable_plugin="no (disabled on command line)"
4409 if test "x$enable_all_plugins" = "xauto"
4411 if test "x$2" = "xyes"
4418 enable_plugin="$enable_all_plugins"
4421 if test "x$enable_plugin" = "xyes"
4423 if test "x$2" = "xyes" || test "x$force" = "xyes"
4425 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4426 if test "x$2" != "xyes"
4428 dependency_warning="yes"
4430 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4431 dependency_error="yes"
4432 enable_plugin="no (dependency error)"
4435 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4436 enable_$1="$enable_plugin"
4438 )# AC_PLUGIN(name, default, info)
4440 m4_divert_once([HELP_ENABLE], [
4441 collectd features:])
4442 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4443 AC_COLLECTD([debug], [enable], [feature], [debugging])
4444 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4445 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4447 dependency_warning="no"
4448 dependency_error="no"
4453 plugin_conntrack="no"
4454 plugin_contextswitch="no"
4457 plugin_curl_json="no"
4458 plugin_curl_xml="no"
4464 plugin_interface="no"
4471 plugin_multimeter="no"
4475 plugin_processes="no"
4476 plugin_protocols="no"
4480 plugin_tcpconns="no"
4487 plugin_wireless="no"
4491 if test "x$ac_system" = "xLinux"
4493 plugin_battery="yes"
4494 plugin_conntrack="yes"
4495 plugin_contextswitch="yes"
4497 plugin_cpufreq="yes"
4499 plugin_entropy="yes"
4500 plugin_fscache="yes"
4501 plugin_interface="yes"
4507 plugin_processes="yes"
4508 plugin_protocols="yes"
4511 plugin_tcpconns="yes"
4512 plugin_thermal="yes"
4515 plugin_vserver="yes"
4516 plugin_wireless="yes"
4518 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4524 if test "x$ac_system" = "xOpenBSD"
4526 plugin_tcpconns="yes"
4530 if test "x$with_libiokit" = "xyes"
4532 plugin_battery="yes"
4538 if test "x$ac_system" = "xAIX"
4540 plugin_tcpconns="yes"
4543 if test "x$with_perfstat" = "xyes"
4549 plugin_interface="yes"
4553 if test "x$with_procinfo" = "xyes"
4555 plugin_processes="yes"
4559 if test "x$with_kstat" = "xyes"
4562 plugin_zfs_arc="yes"
4565 if test "x$with_devinfo$with_kstat" = "xyesyes"
4569 plugin_interface="yes"
4575 if test "x$with_libstatgrab" = "xyes"
4579 plugin_interface="yes"
4586 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4589 if test "x$have_strptime" = "xyes"
4595 if test "x$with_libopenipmipthread" = "xyes"
4600 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4602 plugin_curl_json="yes"
4605 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4607 plugin_curl_xml="yes"
4610 if test "x$have_processor_info" = "xyes"
4614 if test "x$have_sysctl" = "xyes"
4619 if test "x$ac_system" = "xDarwin"
4624 if test "x$have_sysctlbyname" = "xyes"
4626 plugin_contextswitch="yes"
4629 plugin_tcpconns="yes"
4632 # Df plugin: Check if we know how to determine mount points first.
4633 #if test "x$have_listmntent" = "xyes"; then
4636 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4640 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4644 #if test "x$have_getmntent" = "xseq"
4648 if test "x$c_cv_have_one_getmntent" = "xyes"
4653 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4654 if test "x$plugin_df" = "xyes"
4657 if test "x$have_statfs" = "xyes"
4661 if test "x$have_statvfs" = "xyes"
4667 if test "x$have_linux_sockios_h$have_linux_ethtool_h" = "xyesyes"
4669 plugin_ethstat="yes"
4672 if test "x$have_getifaddrs" = "xyes"
4674 plugin_interface="yes"
4677 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4679 plugin_libvirt="yes"
4682 if test "x$have_getloadavg" = "xyes"
4687 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4692 # Mac OS X memory interface
4693 if test "x$have_host_statistics" = "xyes"
4698 if test "x$have_termios_h" = "xyes"
4700 plugin_multimeter="yes"
4704 if test "x$have_thread_info" = "xyes"
4706 plugin_processes="yes"
4709 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4711 plugin_processes="yes"
4714 if test "x$with_kvm_getswapinfo" = "xyes"
4719 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4724 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4726 plugin_tcpconns="yes"
4729 if test "x$have_getutent" = "xyes"
4733 if test "x$have_getutxent" = "xyes"
4738 m4_divert_once([HELP_ENABLE], [
4741 AC_ARG_ENABLE([all-plugins],
4742 AC_HELP_STRING([--enable-all-plugins],
4743 [enable all plugins (auto by def)]),
4745 if test "x$enableval" = "xyes"
4747 enable_all_plugins="yes"
4748 else if test "x$enableval" = "xauto"
4750 enable_all_plugins="auto"
4752 enable_all_plugins="no"
4755 [enable_all_plugins="auto"])
4757 m4_divert_once([HELP_ENABLE], [])
4759 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4760 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4761 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4762 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4763 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4764 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4765 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4766 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4767 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4768 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4769 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4770 AC_PLUGIN([csv], [yes], [CSV output plugin])
4771 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4772 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4773 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4774 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4775 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4776 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4777 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4778 AC_PLUGIN([email], [yes], [EMail statistics])
4779 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4780 AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
4781 AC_PLUGIN([exec], [yes], [Execution of external programs])
4782 AC_PLUGIN([filecount], [yes], [Count files in directories])
4783 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4784 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4785 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4786 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4787 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4788 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4789 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4790 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4791 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4792 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4793 AC_PLUGIN([load], [$plugin_load], [System load])
4794 AC_PLUGIN([logfile], [yes], [File logging plugin])
4795 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4796 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4797 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4798 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4799 AC_PLUGIN([match_regex], [yes], [The regex match])
4800 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4801 AC_PLUGIN([match_value], [yes], [The value match])
4802 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4803 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
4804 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4805 AC_PLUGIN([memcached], [yes], [memcached statistics])
4806 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4807 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4808 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4809 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4810 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4811 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4812 AC_PLUGIN([network], [yes], [Network communication plugin])
4813 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4814 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4815 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4816 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4817 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4818 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
4819 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4820 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4821 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4822 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4823 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4824 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4825 # FIXME: Check for libevent, too.
4826 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4827 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4828 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4829 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4830 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4831 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4832 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4833 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4834 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4835 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4836 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4837 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4838 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4839 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4840 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4841 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4842 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4843 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4844 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4845 AC_PLUGIN([target_notification], [yes], [The notification target])
4846 AC_PLUGIN([target_replace], [yes], [The replace target])
4847 AC_PLUGIN([target_scale],[yes], [The scale target])
4848 AC_PLUGIN([target_set], [yes], [The set target])
4849 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4850 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4851 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4852 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4853 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4854 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4855 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4856 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4857 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4858 AC_PLUGIN([users], [$plugin_users], [User statistics])
4859 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4860 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4861 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4862 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4863 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4864 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
4865 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4866 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4867 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
4868 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4869 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4871 dnl Default configuration file
4872 # Load either syslog or logfile
4873 LOAD_PLUGIN_SYSLOG=""
4874 LOAD_PLUGIN_LOGFILE=""
4876 AC_MSG_CHECKING([which default log plugin to load])
4877 default_log_plugin="none"
4878 if test "x$enable_syslog" = "xyes"
4880 default_log_plugin="syslog"
4882 LOAD_PLUGIN_SYSLOG="##"
4885 if test "x$enable_logfile" = "xyes"
4887 if test "x$default_log_plugin" = "xnone"
4889 default_log_plugin="logfile"
4891 LOAD_PLUGIN_LOGFILE="#"
4894 LOAD_PLUGIN_LOGFILE="##"
4896 AC_MSG_RESULT([$default_log_plugin])
4898 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4899 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4901 DEFAULT_LOG_LEVEL="info"
4902 if test "x$enable_debug" = "xyes"
4904 DEFAULT_LOG_LEVEL="debug"
4906 AC_SUBST(DEFAULT_LOG_LEVEL)
4908 # Load only one of rrdtool, network, csv in the default config.
4909 LOAD_PLUGIN_RRDTOOL=""
4910 LOAD_PLUGIN_NETWORK=""
4913 AC_MSG_CHECKING([which default write plugin to load])
4914 default_write_plugin="none"
4915 if test "x$enable_rrdtool" = "xyes"
4917 default_write_plugin="rrdtool"
4919 LOAD_PLUGIN_RRDTOOL="##"
4922 if test "x$enable_network" = "xyes"
4924 if test "x$default_write_plugin" = "xnone"
4926 default_write_plugin="network"
4928 LOAD_PLUGIN_NETWORK="#"
4931 LOAD_PLUGIN_NETWORK="##"
4934 if test "x$enable_csv" = "xyes"
4936 if test "x$default_write_plugin" = "xnone"
4938 default_write_plugin="csv"
4943 LOAD_PLUGIN_CSV="##"
4945 AC_MSG_RESULT([$default_write_plugin])
4947 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4948 AC_SUBST(LOAD_PLUGIN_NETWORK)
4949 AC_SUBST(LOAD_PLUGIN_CSV)
4952 if test "x$ac_system" = "xLinux" \
4953 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
4955 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4958 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
4960 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
4964 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4966 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4968 PERL_BINDINGS_OPTIONS="$withval"
4969 with_perl_bindings="yes"
4971 PERL_BINDINGS_OPTIONS=""
4972 with_perl_bindings="$withval"
4976 PERL_BINDINGS_OPTIONS=""
4977 if test -n "$perl_interpreter"
4979 with_perl_bindings="yes"
4981 with_perl_bindings="no (no perl interpreter found)"
4984 if test "x$with_perl_bindings" = "xyes"
4986 PERL_BINDINGS="perl"
4990 AC_SUBST(PERL_BINDINGS)
4991 AC_SUBST(PERL_BINDINGS_OPTIONS)
4993 dnl libcollectdclient
4994 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4995 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4996 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4998 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
5000 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
5002 AC_SUBST(LCC_VERSION_MAJOR)
5003 AC_SUBST(LCC_VERSION_MINOR)
5004 AC_SUBST(LCC_VERSION_PATCH)
5005 AC_SUBST(LCC_VERSION_EXTRA)
5006 AC_SUBST(LCC_VERSION_STRING)
5008 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
5010 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
5012 if test "x$with_librrd" = "xyes" \
5013 && test "x$librrd_threadsafe" != "xyes"
5015 with_librrd="yes (warning: librrd is not thread-safe)"
5018 if test "x$with_libperl" = "xyes"
5020 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
5022 enable_perl="no (needs libperl)"
5025 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
5027 enable_perl="no (libperl doesn't support ithreads)"
5030 if test "x$with_perl_bindings" = "xyes" \
5031 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5033 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5040 libcurl . . . . . . . $with_libcurl
5041 libdbi . . . . . . . $with_libdbi
5042 libcredis . . . . . . $with_libcredis
5043 libesmtp . . . . . . $with_libesmtp
5044 libganglia . . . . . $with_libganglia
5045 libgcrypt . . . . . . $with_libgcrypt
5046 libiokit . . . . . . $with_libiokit
5047 libiptc . . . . . . . $with_libiptc
5048 libjvm . . . . . . . $with_java
5049 libkstat . . . . . . $with_kstat
5050 libkvm . . . . . . . $with_libkvm
5051 libmemcached . . . . $with_libmemcached
5052 libmodbus . . . . . . $with_libmodbus
5053 libmysql . . . . . . $with_libmysql
5054 libnetapp . . . . . . $with_libnetapp
5055 libnetlink . . . . . $with_libnetlink
5056 libnetsnmp . . . . . $with_libnetsnmp
5057 libnotify . . . . . . $with_libnotify
5058 liboconfig . . . . . $with_liboconfig
5059 libopenipmi . . . . . $with_libopenipmipthread
5060 liboping . . . . . . $with_liboping
5061 libpcap . . . . . . . $with_libpcap
5062 libperfstat . . . . . $with_perfstat
5063 libperl . . . . . . . $with_libperl
5064 libpq . . . . . . . . $with_libpq
5065 libpthread . . . . . $with_libpthread
5066 librabbitmq . . . . . $with_librabbitmq
5067 librouteros . . . . . $with_librouteros
5068 librrd . . . . . . . $with_librrd
5069 libsensors . . . . . $with_libsensors
5070 libstatgrab . . . . . $with_libstatgrab
5071 libtokyotyrant . . . $with_libtokyotyrant
5072 libupsclient . . . . $with_libupsclient
5073 libvarnish . . . . . $with_libvarnish
5074 libvirt . . . . . . . $with_libvirt
5075 libxml2 . . . . . . . $with_libxml2
5076 libxmms . . . . . . . $with_libxmms
5077 libyajl . . . . . . . $with_libyajl
5078 libevent . . . . . . $with_libevent
5079 protobuf-c . . . . . $have_protoc_c
5080 oracle . . . . . . . $with_oracle
5081 python . . . . . . . $with_python
5084 daemon mode . . . . . $enable_daemon
5085 debug . . . . . . . . $enable_debug
5088 perl . . . . . . . . $with_perl_bindings
5091 amqp . . . . . . . $enable_amqp
5092 apache . . . . . . . $enable_apache
5093 apcups . . . . . . . $enable_apcups
5094 apple_sensors . . . . $enable_apple_sensors
5095 ascent . . . . . . . $enable_ascent
5096 battery . . . . . . . $enable_battery
5097 bind . . . . . . . . $enable_bind
5098 conntrack . . . . . . $enable_conntrack
5099 contextswitch . . . . $enable_contextswitch
5100 cpu . . . . . . . . . $enable_cpu
5101 cpufreq . . . . . . . $enable_cpufreq
5102 csv . . . . . . . . . $enable_csv
5103 curl . . . . . . . . $enable_curl
5104 curl_json . . . . . . $enable_curl_json
5105 curl_xml . . . . . . $enable_curl_xml
5106 dbi . . . . . . . . . $enable_dbi
5107 df . . . . . . . . . $enable_df
5108 disk . . . . . . . . $enable_disk
5109 dns . . . . . . . . . $enable_dns
5110 email . . . . . . . . $enable_email
5111 entropy . . . . . . . $enable_entropy
5112 ethstat . . . . . . . $enable_ethstat
5113 exec . . . . . . . . $enable_exec
5114 filecount . . . . . . $enable_filecount
5115 fscache . . . . . . . $enable_fscache
5116 gmond . . . . . . . . $enable_gmond
5117 hddtemp . . . . . . . $enable_hddtemp
5118 interface . . . . . . $enable_interface
5119 ipmi . . . . . . . . $enable_ipmi
5120 iptables . . . . . . $enable_iptables
5121 ipvs . . . . . . . . $enable_ipvs
5122 irq . . . . . . . . . $enable_irq
5123 java . . . . . . . . $enable_java
5124 libvirt . . . . . . . $enable_libvirt
5125 load . . . . . . . . $enable_load
5126 logfile . . . . . . . $enable_logfile
5127 lpar... . . . . . . . $enable_lpar
5128 madwifi . . . . . . . $enable_madwifi
5129 match_empty_counter . $enable_match_empty_counter
5130 match_hashed . . . . $enable_match_hashed
5131 match_regex . . . . . $enable_match_regex
5132 match_timediff . . . $enable_match_timediff
5133 match_value . . . . . $enable_match_value
5134 mbmon . . . . . . . . $enable_mbmon
5135 md . . . . . . . . . $enable_md
5136 memcachec . . . . . . $enable_memcachec
5137 memcached . . . . . . $enable_memcached
5138 memory . . . . . . . $enable_memory
5139 modbus . . . . . . . $enable_modbus
5140 multimeter . . . . . $enable_multimeter
5141 mysql . . . . . . . . $enable_mysql
5142 netapp . . . . . . . $enable_netapp
5143 netlink . . . . . . . $enable_netlink
5144 network . . . . . . . $enable_network
5145 nfs . . . . . . . . . $enable_nfs
5146 nginx . . . . . . . . $enable_nginx
5147 notify_desktop . . . $enable_notify_desktop
5148 notify_email . . . . $enable_notify_email
5149 ntpd . . . . . . . . $enable_ntpd
5150 numa . . . . . . . . $enable_numa
5151 nut . . . . . . . . . $enable_nut
5152 olsrd . . . . . . . . $enable_olsrd
5153 onewire . . . . . . . $enable_onewire
5154 openvpn . . . . . . . $enable_openvpn
5155 oracle . . . . . . . $enable_oracle
5156 perl . . . . . . . . $enable_perl
5157 pinba . . . . . . . . $enable_pinba
5158 ping . . . . . . . . $enable_ping
5159 postgresql . . . . . $enable_postgresql
5160 powerdns . . . . . . $enable_powerdns
5161 processes . . . . . . $enable_processes
5162 protocols . . . . . . $enable_protocols
5163 python . . . . . . . $enable_python
5164 redis . . . . . . . . $enable_redis
5165 routeros . . . . . . $enable_routeros
5166 rrdcached . . . . . . $enable_rrdcached
5167 rrdtool . . . . . . . $enable_rrdtool
5168 sensors . . . . . . . $enable_sensors
5169 serial . . . . . . . $enable_serial
5170 snmp . . . . . . . . $enable_snmp
5171 swap . . . . . . . . $enable_swap
5172 syslog . . . . . . . $enable_syslog
5173 table . . . . . . . . $enable_table
5174 tail . . . . . . . . $enable_tail
5175 tape . . . . . . . . $enable_tape
5176 target_notification . $enable_target_notification
5177 target_replace . . . $enable_target_replace
5178 target_scale . . . . $enable_target_scale
5179 target_set . . . . . $enable_target_set
5180 target_v5upgrade . . $enable_target_v5upgrade
5181 tcpconns . . . . . . $enable_tcpconns
5182 teamspeak2 . . . . . $enable_teamspeak2
5183 ted . . . . . . . . . $enable_ted
5184 thermal . . . . . . . $enable_thermal
5185 threshold . . . . . . $enable_threshold
5186 tokyotyrant . . . . . $enable_tokyotyrant
5187 unixsock . . . . . . $enable_unixsock
5188 uptime . . . . . . . $enable_uptime
5189 users . . . . . . . . $enable_users
5190 uuid . . . . . . . . $enable_uuid
5191 varnish . . . . . . . $enable_varnish
5192 vmem . . . . . . . . $enable_vmem
5193 vserver . . . . . . . $enable_vserver
5194 wireless . . . . . . $enable_wireless
5195 write_graphite . . . $enable_write_graphite
5196 write_http . . . . . $enable_write_http
5197 write_redis . . . . . $enable_write_redis
5198 write_mongodb . . . . $enable_write_mongodb
5199 xmms . . . . . . . . $enable_xmms
5200 zfs_arc . . . . . . . $enable_zfs_arc
5204 if test "x$dependency_error" = "xyes"; then
5205 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5208 if test "x$dependency_warning" = "xyes"; then
5209 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5212 # vim: set fdm=marker :