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.])
94 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
96 if test "x$ac_system" = "xAIX"
98 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
101 # Where to install .pc files.
102 pkgconfigdir="${libdir}/pkgconfig"
103 AC_SUBST(pkgconfigdir)
105 # Check for standards compliance mode
106 AC_ARG_ENABLE(standards,
107 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
108 [enable_standards="$enableval"],
109 [enable_standards="no"])
110 if test "x$enable_standards" = "xyes"
112 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
113 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
114 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
115 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
116 if test "x$GCC" = "xyes"
118 CFLAGS="$CFLAGS -std=c99"
121 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
124 # Checks for header files.
131 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)
134 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
139 # include <sys/types.h>
142 AC_CHECK_HEADERS(netinet/in.h, [], [],
147 # include <sys/types.h>
149 #if HAVE_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
153 AC_CHECK_HEADERS(netinet/ip.h, [], [],
158 # include <sys/types.h>
160 #if HAVE_NETINET_IN_SYSTM_H
161 # include <netinet/in_systm.h>
163 #if HAVE_NETINET_IN_H
164 # include <netinet/in.h>
167 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
172 # include <sys/types.h>
174 #if HAVE_NETINET_IN_SYSTM_H
175 # include <netinet/in_systm.h>
177 #if HAVE_NETINET_IN_H
178 # include <netinet/in.h>
180 #if HAVE_NETINET_IP_H
181 # include <netinet/ip.h>
184 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
189 # include <sys/types.h>
191 #if HAVE_NETINET_IN_SYSTM_H
192 # include <netinet/in_systm.h>
194 #if HAVE_NETINET_IN_H
195 # include <netinet/in.h>
197 #if HAVE_NETINET_IP_H
198 # include <netinet/ip.h>
201 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
206 # include <sys/types.h>
208 #if HAVE_NETINET_IN_SYSTM_H
209 # include <netinet/in_systm.h>
211 #if HAVE_NETINET_IN_H
212 # include <netinet/in.h>
215 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
220 # include <sys/types.h>
222 #if HAVE_NETINET_IN_SYSTM_H
223 # include <netinet/in_systm.h>
225 #if HAVE_NETINET_IN_H
226 # include <netinet/in.h>
228 #if HAVE_NETINET_IP6_H
229 # include <netinet/ip6.h>
232 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
237 # include <sys/types.h>
239 #if HAVE_NETINET_IN_SYSTM_H
240 # include <netinet/in_systm.h>
242 #if HAVE_NETINET_IN_H
243 # include <netinet/in.h>
245 #if HAVE_NETINET_IP_H
246 # include <netinet/ip.h>
249 AC_CHECK_HEADERS(netinet/udp.h, [], [],
254 # include <sys/types.h>
256 #if HAVE_NETINET_IN_SYSTM_H
257 # include <netinet/in_systm.h>
259 #if HAVE_NETINET_IN_H
260 # include <netinet/in.h>
262 #if HAVE_NETINET_IP_H
263 # include <netinet/ip.h>
268 AC_CHECK_HEADERS(sys/dkstat.h)
269 if test "x$ac_system" = "xDarwin"
271 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)
272 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
274 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
277 # include <sys/types.h>
280 # include <sys/param.h>
284 AC_MSG_CHECKING([for sysctl kern.cp_times])
285 if test -x /sbin/sysctl
287 /sbin/sysctl kern.cp_times 2>/dev/null
291 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
292 [Define if sysctl supports kern.cp_times])
301 AC_CHECK_HEADERS(linux/major.h libgen.h)
303 # For the battery plugin
304 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
306 #if HAVE_IOKIT_IOKITLIB_H
307 # include <IOKit/IOKitLib.h>
309 #if HAVE_IOKIT_IOTYPES_H
310 # include <IOKit/IOTypes.h>
314 # For the swap module
315 have_linux_wireless_h="no"
316 if test "x$ac_system" = "xLinux"
318 AC_CHECK_HEADERS(linux/wireless.h,
319 [have_linux_wireless_h="yes"],
320 [have_linux_wireless_h="no"],
323 #include <sys/ioctl.h>
324 #include <sys/socket.h>
328 # For the swap module
329 have_sys_swap_h="yes"
330 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
332 #undef _FILE_OFFSET_BITS
333 #undef _LARGEFILE64_SOURCE
335 # include <sys/types.h>
338 # include <sys/param.h>
342 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
345 if test "x$GCC" = "xyes"
347 hint_64="CFLAGS='-m64'"
349 hint_64="CFLAGS='-xarch=v9'"
351 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
355 # For the processes plugin
357 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
359 # For interface plugin
360 AC_CHECK_HEADERS(ifaddrs.h)
361 AC_CHECK_HEADERS(net/if.h, [], [],
364 # include <sys/types.h>
366 #if HAVE_SYS_SOCKET_H
367 # include <sys/socket.h>
370 AC_CHECK_HEADERS(linux/if.h, [], [],
373 # include <sys/types.h>
375 #if HAVE_SYS_SOCKET_H
376 # include <sys/socket.h>
379 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
382 # include <sys/types.h>
384 #if HAVE_SYS_SOCKET_H
385 # include <sys/socket.h>
388 # include <linux/if.h>
393 have_linux_ip_vs_h="no"
394 have_net_ip_vs_h="no"
396 ip_vs_h_needs_kernel_cflags="no"
397 if test "x$ac_system" = "xLinux"
399 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
400 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
401 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
403 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
405 SAVE_CFLAGS="$CFLAGS"
406 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
408 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
410 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
411 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
412 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
414 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
416 ip_vs_h_needs_kernel_cflags="yes"
419 CFLAGS="$SAVE_CFLAGS"
422 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
425 AC_CHECK_HEADERS(sys/ucred.h, [], [],
428 # include <sys/types.h>
431 # include <sys/param.h>
435 # For mount interface
436 AC_CHECK_HEADERS(sys/mount.h, [], [],
439 # include <sys/types.h>
442 # include <sys/param.h>
446 # For the email plugin
447 AC_CHECK_HEADERS(linux/un.h, [], [],
449 #if HAVE_SYS_SOCKET_H
450 # include <sys/socket.h>
454 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)
457 AC_CHECK_HEADERS(arpa/nameser.h)
458 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
460 #if HAVE_ARPA_NAMESER_H
461 # include <arpa/nameser.h>
465 AC_CHECK_HEADERS(net/if_arp.h, [], [],
466 [#if HAVE_SYS_SOCKET_H
467 # include <sys/socket.h>
470 AC_CHECK_HEADERS(net/ppp_defs.h)
471 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
472 [#if HAVE_NET_PPP_DEFS_H
473 # include <net/ppp_defs.h>
476 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
481 # include <sys/types.h>
483 #if HAVE_SYS_SOCKET_H
484 # include <sys/socket.h>
489 #if HAVE_NETINET_IN_H
490 # include <netinet/in.h>
494 AC_CHECK_HEADERS(netinet/ip_compat.h)
496 # For the multimeter plugin
498 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
501 # Checks for typedefs, structures, and compiler characteristics.
510 # Checks for library functions.
512 AC_PROG_GCC_TRADITIONAL
513 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
517 SAVE_CFLAGS="$CFLAGS"
518 # Emulate behavior of src/Makefile.am
519 if test "x$GCC" = "xyes"
521 CFLAGS="$CFLAGS -Wall -Werror"
524 AC_CACHE_CHECK([for strtok_r],
525 [c_cv_have_strtok_r_default],
534 char buffer[] = "foo,bar,baz";
541 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
544 printf ("token = %s;\n", token);
547 [c_cv_have_strtok_r_default="yes"],
548 [c_cv_have_strtok_r_default="no"]
552 if test "x$c_cv_have_strtok_r_default" = "xno"
554 CFLAGS="$CFLAGS -D_REENTRANT=1"
556 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
557 [c_cv_have_strtok_r_reentrant],
566 char buffer[] = "foo,bar,baz";
573 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
576 printf ("token = %s;\n", token);
579 [c_cv_have_strtok_r_reentrant="yes"],
580 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
585 CFLAGS="$SAVE_CFLAGS"
586 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
588 CFLAGS="$CFLAGS -D_REENTRANT=1"
591 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
593 socket_needs_socket="no"
594 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
595 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
597 clock_gettime_needs_rt="no"
598 clock_gettime_needs_posix4="no"
599 have_clock_gettime="no"
600 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
601 if test "x$have_clock_gettime" = "xno"
603 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
604 have_clock_gettime="yes"])
606 if test "x$have_clock_gettime" = "xno"
608 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
609 have_clock_gettime="yes"])
611 if test "x$have_clock_gettime" = "xyes"
613 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
615 AC_MSG_WARN(cannot find clock_gettime)
618 nanosleep_needs_rt="no"
619 nanosleep_needs_posix4="no"
620 AC_CHECK_FUNCS(nanosleep,
622 AC_CHECK_LIB(rt, nanosleep,
623 [nanosleep_needs_rt="yes"],
624 AC_CHECK_LIB(posix4, nanosleep,
625 [nanosleep_needs_posix4="yes"],
626 AC_MSG_ERROR(cannot find nanosleep))))
628 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
629 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
631 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
632 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
633 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
634 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
635 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
636 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
637 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
638 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
639 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
640 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
641 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
642 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
644 # Check for strptime {{{
645 if test "x$GCC" = "xyes"
647 SAVE_CFLAGS="$CFLAGS"
648 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
651 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
652 if test "x$have_strptime" = "xyes"
654 AC_CACHE_CHECK([whether strptime is exported by default],
655 [c_cv_have_strptime_default],
664 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
666 [c_cv_have_strptime_default="yes"],
667 [c_cv_have_strptime_default="no"]))
669 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
671 AC_CACHE_CHECK([whether strptime needs standards mode],
672 [c_cv_have_strptime_standards],
676 #ifndef _ISOC99_SOURCE
677 # define _ISOC99_SOURCE 1
679 #ifndef _POSIX_C_SOURCE
680 # define _POSIX_C_SOURCE 200112L
682 #ifndef _XOPEN_SOURCE
683 # define _XOPEN_SOURCE 500
690 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
692 [c_cv_have_strptime_standards="yes"],
693 [c_cv_have_strptime_standards="no"]))
695 if test "x$c_cv_have_strptime_standards" = "xyes"
697 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
703 if test "x$GCC" = "xyes"
705 CFLAGS="$SAVE_CFLAGS"
708 # }}} Check for strptime
710 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
711 if test "x$have_swapctl" = "xyes"; then
712 AC_CACHE_CHECK([whether swapctl takes two arguments],
713 [c_cv_have_swapctl_two_args],
715 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
716 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
717 # undef _FILE_OFFSET_BITS
718 # undef _LARGEFILE64_SOURCE
720 #include <sys/stat.h>
721 #include <sys/swap.h>]],
723 int num = swapctl(0, NULL);
726 [c_cv_have_swapctl_two_args="yes"],
727 [c_cv_have_swapctl_two_args="no"]
730 AC_CACHE_CHECK([whether swapctl takes three arguments],
731 [c_cv_have_swapctl_three_args],
733 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
734 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
735 # undef _FILE_OFFSET_BITS
736 # undef _LARGEFILE64_SOURCE
738 #include <sys/stat.h>
739 #include <sys/swap.h>]],
741 int num = swapctl(0, NULL,0);
744 [c_cv_have_swapctl_three_args="yes"],
745 [c_cv_have_swapctl_three_args="no"]
749 # Check for different versions of `swapctl' here..
750 if test "x$have_swapctl" = "xyes"; then
751 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
752 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
753 [Define if the function swapctl exists and takes two arguments.])
755 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
756 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
757 [Define if the function swapctl exists and takes three arguments.])
762 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
764 if test "x$withval" = "xno"; then
766 else if test "x$withval" = "xyes"; then
773 if test "x$nan_type" = "xnone"; then
774 AC_CACHE_CHECK([whether NAN is defined by default],
775 [c_cv_have_nan_default],
781 static double foo = NAN;
789 [c_cv_have_nan_default="yes"],
790 [c_cv_have_nan_default="no"]
793 if test "x$c_cv_have_nan_default" = "xyes"
798 if test "x$nan_type" = "xnone"; then
799 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
800 [c_cv_have_nan_isoc],
805 #define __USE_ISOC99 1
807 static double foo = NAN;
815 [c_cv_have_nan_isoc="yes"],
816 [c_cv_have_nan_isoc="no"]
819 if test "x$c_cv_have_nan_isoc" = "xyes"
824 if test "x$nan_type" = "xnone"; then
825 SAVE_LDFLAGS=$LDFLAGS
826 LDFLAGS="$LDFLAGS -lm"
827 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
828 [c_cv_have_nan_zero],
837 #define NAN (0.0 / 0.0)
839 # define isnan(f) ((f) != (f))
841 static double foo = NAN;
849 [c_cv_have_nan_zero="yes"],
850 [c_cv_have_nan_zero="no"]
853 LDFLAGS=$SAVE_LDFLAGS
854 if test "x$c_cv_have_nan_zero" = "xyes"
860 if test "x$nan_type" = "xdefault"; then
861 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
862 [Define if NAN is defined by default and can initialize static variables.])
863 else if test "x$nan_type" = "xisoc99"; then
864 AC_DEFINE(NAN_STATIC_ISOC, 1,
865 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
866 else if test "x$nan_type" = "xzero"; then
867 AC_DEFINE(NAN_ZERO_ZERO, 1,
868 [Define if NAN can be defined as (0.0 / 0.0)])
870 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
873 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
875 if test "x$withval" = "xnothing"; then
876 fp_layout_type="nothing"
877 else if test "x$withval" = "xendianflip"; then
878 fp_layout_type="endianflip"
879 else if test "x$withval" = "xintswap"; then
880 fp_layout_type="intswap"
882 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
885 [fp_layout_type="unknown"])
887 if test "x$fp_layout_type" = "xunknown"; then
888 AC_CACHE_CHECK([if doubles are stored in x86 representation],
889 [c_cv_fp_layout_need_nothing],
900 # include <inttypes.h>
903 # include <stdbool.h>
913 memcpy ((void *) &i0, (void *) &d, 8);
916 memcpy ((void *) c, (void *) &i1, 8);
918 if ((c[0] == 0x2f) && (c[1] == 0x25)
919 && (c[2] == 0xc0) && (c[3] == 0xc7)
920 && (c[4] == 0x43) && (c[5] == 0x2b)
921 && (c[6] == 0x1f) && (c[7] == 0x5b))
926 [c_cv_fp_layout_need_nothing="yes"],
927 [c_cv_fp_layout_need_nothing="no"]
930 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
931 fp_layout_type="nothing"
934 if test "x$fp_layout_type" = "xunknown"; then
935 AC_CACHE_CHECK([if endianflip converts to x86 representation],
936 [c_cv_fp_layout_need_endianflip],
947 # include <inttypes.h>
950 # include <stdbool.h>
952 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
953 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
954 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
955 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
956 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
957 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
958 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
959 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
968 memcpy ((void *) &i0, (void *) &d, 8);
970 i1 = endianflip (i0);
971 memcpy ((void *) c, (void *) &i1, 8);
973 if ((c[0] == 0x2f) && (c[1] == 0x25)
974 && (c[2] == 0xc0) && (c[3] == 0xc7)
975 && (c[4] == 0x43) && (c[5] == 0x2b)
976 && (c[6] == 0x1f) && (c[7] == 0x5b))
981 [c_cv_fp_layout_need_endianflip="yes"],
982 [c_cv_fp_layout_need_endianflip="no"]
985 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
986 fp_layout_type="endianflip"
989 if test "x$fp_layout_type" = "xunknown"; then
990 AC_CACHE_CHECK([if intswap converts to x86 representation],
991 [c_cv_fp_layout_need_intswap],
1002 # include <inttypes.h>
1005 # include <stdbool.h>
1007 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1008 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1017 memcpy ((void *) &i0, (void *) &d, 8);
1020 memcpy ((void *) c, (void *) &i1, 8);
1022 if ((c[0] == 0x2f) && (c[1] == 0x25)
1023 && (c[2] == 0xc0) && (c[3] == 0xc7)
1024 && (c[4] == 0x43) && (c[5] == 0x2b)
1025 && (c[6] == 0x1f) && (c[7] == 0x5b))
1030 [c_cv_fp_layout_need_intswap="yes"],
1031 [c_cv_fp_layout_need_intswap="no"]
1034 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1035 fp_layout_type="intswap"
1039 if test "x$fp_layout_type" = "xnothing"; then
1040 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1041 [Define if doubles are stored in x86 representation.])
1042 else if test "x$fp_layout_type" = "xendianflip"; then
1043 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1044 [Define if endianflip is needed to convert to x86 representation.])
1045 else if test "x$fp_layout_type" = "xintswap"; then
1046 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1047 [Define if intswap is needed to convert to x86 representation.])
1049 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1053 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1054 have_getvfsstat="no"
1055 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1056 have_listmntent="no"
1057 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1060 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1061 if test "x$have_getmntent" = "xno"; then
1062 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1064 if test "x$have_getmntent" = "xno"; then
1065 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1067 if test "x$have_getmntent" = "xno"; then
1068 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1071 if test "x$have_getmntent" = "xc"; then
1072 AC_CACHE_CHECK([whether getmntent takes one argument],
1073 [c_cv_have_one_getmntent],
1075 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1076 #include "$srcdir/src/utils_mount.h"]],
1080 fh = setmntent ("/etc/mtab", "r");
1081 me = getmntent (fh);
1084 [c_cv_have_one_getmntent="yes"],
1085 [c_cv_have_one_getmntent="no"]
1088 AC_CACHE_CHECK([whether getmntent takes two arguments],
1089 [c_cv_have_two_getmntent],
1091 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1092 #include "$srcdir/src/utils_mount.h"]],
1097 fh = fopen ("/etc/mnttab", "r");
1098 status = getmntent (fh, &mt);
1101 [c_cv_have_two_getmntent="yes"],
1102 [c_cv_have_two_getmntent="no"]
1107 # Check for different versions of `getmntent' here..
1109 if test "x$have_getmntent" = "xc"; then
1110 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1111 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1112 [Define if the function getmntent exists and takes one argument.])
1114 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1115 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1116 [Define if the function getmntent exists and takes two arguments.])
1119 if test "x$have_getmntent" = "xsun"; then
1120 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1121 [Define if the function getmntent exists. It's the version from libsun.])
1123 if test "x$have_getmntent" = "xseq"; then
1124 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1125 [Define if the function getmntent exists. It's the version from libseq.])
1127 if test "x$have_getmntent" = "xgen"; then
1128 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1129 [Define if the function getmntent exists. It's the version from libgen.])
1133 AC_MSG_CHECKING([if have htonll defined])
1138 #include <sys/types.h>
1139 #include <netinet/in.h>
1141 # include <inttypes.h>
1148 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1151 AC_MSG_RESULT([$have_htonll])
1153 # Check for structures
1154 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1155 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1158 #include <sys/types.h>
1159 #include <sys/socket.h>
1162 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1163 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1166 #include <sys/types.h>
1167 #include <sys/socket.h>
1168 #include <linux/if.h>
1169 #include <linux/netdevice.h>
1172 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1175 #include <netinet/in.h>
1179 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1181 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1182 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1183 have_struct_kinfo_proc_freebsd="yes"
1186 have_struct_kinfo_proc_freebsd="no"
1191 #include <sys/param.h>
1192 #include <sys/sysctl.h>
1193 #include <sys/user.h>
1196 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1198 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1199 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1200 have_struct_kinfo_proc_openbsd="yes"
1203 have_struct_kinfo_proc_openbsd="no"
1207 #include <sys/param.h>
1208 #include <sys/sysctl.h>
1212 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1213 [#define _BSD_SOURCE
1215 # include <stdint.h>
1217 #if HAVE_SYS_TYPES_H
1218 # include <sys/types.h>
1220 #if HAVE_NETINET_IN_SYSTM_H
1221 # include <netinet/in_systm.h>
1223 #if HAVE_NETINET_IN_H
1224 # include <netinet/in.h>
1226 #if HAVE_NETINET_IP_H
1227 # include <netinet/ip.h>
1229 #if HAVE_NETINET_UDP_H
1230 # include <netinet/udp.h>
1233 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1234 [#define _BSD_SOURCE
1236 # include <stdint.h>
1238 #if HAVE_SYS_TYPES_H
1239 # include <sys/types.h>
1241 #if HAVE_NETINET_IN_SYSTM_H
1242 # include <netinet/in_systm.h>
1244 #if HAVE_NETINET_IN_H
1245 # include <netinet/in.h>
1247 #if HAVE_NETINET_IP_H
1248 # include <netinet/ip.h>
1250 #if HAVE_NETINET_UDP_H
1251 # include <netinet/udp.h>
1255 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1265 # Checks for libraries begin here
1267 with_libresolv="yes"
1268 AC_CHECK_LIB(resolv, res_search,
1270 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1272 [with_libresolv="no"])
1273 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1275 dnl Check for HAL (hardware abstraction library)
1277 AC_CHECK_LIB(hal,libhal_device_property_exists,
1278 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1280 if test "x$with_libhal" = "xyes"; then
1281 if test "x$PKG_CONFIG" != "x"; then
1282 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1283 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1284 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1285 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1289 m4_divert_once([HELP_WITH], [
1290 collectd additional packages:])
1292 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1294 if test "x$ac_system" = "xAIX"
1299 with_perfstat="no (AIX only)"
1300 with_procinfo="no (AIX only)"
1303 if test "x$with_perfstat" = "xyes"
1305 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1306 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1308 if test "x$with_perfstat" = "xyes"
1310 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1311 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1312 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1313 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1315 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1318 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1320 # Processes plugin under AIX.
1321 if test "x$with_procinfo" = "xyes"
1323 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1325 if test "x$with_procinfo" = "xyes"
1327 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1330 if test "x$ac_system" = "xSolaris"
1335 with_kstat="no (Solaris only)"
1336 with_devinfo="no (Solaris only)"
1339 if test "x$with_kstat" = "xyes"
1341 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1343 if test "x$with_kstat" = "xyes"
1345 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1346 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1348 if test "x$with_kstat" = "xyes"
1350 AC_DEFINE(HAVE_LIBKSTAT, 1,
1351 [Define to 1 if you have the 'kstat' library (-lkstat)])
1353 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1354 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1357 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1364 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1367 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1368 if test "x$with_kvm_getprocs" = "xyes"
1370 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1371 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1374 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1376 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1377 if test "x$with_kvm_getswapinfo" = "xyes"
1379 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1380 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1383 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1385 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1386 if test "x$with_kvm_nlist" = "xyes"
1388 AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
1389 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1390 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1393 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1395 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1396 if test "x$with_kvm_openfiles" = "xyes"
1398 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1399 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1402 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1404 # --with-libcredis {{{
1405 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1407 if test "x$withval" = "xyes"
1409 with_libcredis="yes"
1410 else if test "x$withval" = "xno"
1414 with_libcredis="yes"
1415 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1416 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1419 [with_libcredis="yes"])
1421 SAVE_CPPFLAGS="$CPPFLAGS"
1422 SAVE_LDFLAGS="$LDFLAGS"
1424 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1425 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1427 if test "x$with_libcredis" = "xyes"
1429 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1431 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1433 AC_CHECK_HEADERS(credis.h,
1434 [with_libcredis="yes"],
1435 [with_libcredis="no (credis.h not found)"])
1437 if test "x$with_libcredis" = "xyes"
1439 if test "x$LIBCREDIS_LDFLAGS" != "x"
1441 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1443 AC_CHECK_LIB(credis, credis_info,
1444 [with_libcredis="yes"],
1445 [with_libcredis="no (symbol 'credis_info' not found)"])
1449 CPPFLAGS="$SAVE_CPPFLAGS"
1450 LDFLAGS="$SAVE_LDFLAGS"
1452 if test "x$with_libcredis" = "xyes"
1454 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1455 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1456 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1457 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1459 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1462 # --with-libcurl {{{
1463 with_curl_config="curl-config"
1466 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1468 if test "x$withval" = "xno"
1471 else if test "x$withval" = "xyes"
1475 if test -f "$withval" && test -x "$withval"
1477 with_curl_config="$withval"
1479 else if test -x "$withval/bin/curl-config"
1481 with_curl_config="$withval/bin/curl-config"
1490 if test "x$with_libcurl" = "xyes"
1492 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1493 curl_config_status=$?
1495 if test $curl_config_status -ne 0
1497 with_libcurl="no ($with_curl_config failed)"
1499 SAVE_CPPFLAGS="$CPPFLAGS"
1500 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1502 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1504 CPPFLAGS="$SAVE_CPPFLAGS"
1507 if test "x$with_libcurl" = "xyes"
1509 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1510 curl_config_status=$?
1512 if test $curl_config_status -ne 0
1514 with_libcurl="no ($with_curl_config failed)"
1516 AC_CHECK_LIB(curl, curl_easy_init,
1517 [with_libcurl="yes"],
1518 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1522 if test "x$with_libcurl" = "xyes"
1524 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1525 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1526 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1527 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1529 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1533 with_libdbi_cppflags=""
1534 with_libdbi_ldflags=""
1535 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1537 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1539 with_libdbi_cppflags="-I$withval/include"
1540 with_libdbi_ldflags="-L$withval/lib"
1543 with_libdbi="$withval"
1549 if test "x$with_libdbi" = "xyes"
1551 SAVE_CPPFLAGS="$CPPFLAGS"
1552 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1554 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1556 CPPFLAGS="$SAVE_CPPFLAGS"
1558 if test "x$with_libdbi" = "xyes"
1560 SAVE_CPPFLAGS="$CPPFLAGS"
1561 SAVE_LDFLAGS="$LDFLAGS"
1562 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1563 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1565 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1567 CPPFLAGS="$SAVE_CPPFLAGS"
1568 LDFLAGS="$SAVE_LDFLAGS"
1570 if test "x$with_libdbi" = "xyes"
1572 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1573 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1574 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1575 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1576 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1577 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1579 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1582 # --with-libesmtp {{{
1583 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1585 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1587 LDFLAGS="$LDFLAGS -L$withval/lib"
1588 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1591 with_libesmtp="$withval"
1597 if test "x$with_libesmtp" = "xyes"
1599 AC_CHECK_LIB(esmtp, smtp_create_session,
1601 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1602 ], [with_libesmtp="no (libesmtp not found)"])
1604 if test "x$with_libesmtp" = "xyes"
1606 AC_CHECK_HEADERS(libesmtp.h,
1608 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1609 ], [with_libesmtp="no (libesmtp.h not found)"])
1611 if test "x$with_libesmtp" = "xyes"
1617 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1618 [Wether or not to use the esmtp library])
1619 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1622 # --with-libganglia {{{
1623 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1625 if test -f "$withval" && test -x "$withval"
1627 with_libganglia_config="$withval"
1628 with_libganglia="yes"
1629 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1631 with_libganglia_config="$withval/bin/ganglia-config"
1632 with_libganglia="yes"
1633 else if test -d "$withval"
1635 GANGLIA_CPPFLAGS="-I$withval/include"
1636 GANGLIA_LDFLAGS="-L$withval/lib"
1637 with_libganglia="yes"
1639 with_libganglia_config="ganglia-config"
1640 with_libganglia="$withval"
1644 with_libganglia_config="ganglia-config"
1645 with_libganglia="yes"
1648 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1650 if test "x$GANGLIA_CPPFLAGS" = "x"
1652 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1655 if test "x$GANGLIA_LDFLAGS" = "x"
1657 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1660 if test "x$GANGLIA_LIBS" = "x"
1662 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1666 SAVE_CPPFLAGS="$CPPFLAGS"
1667 SAVE_LDFLAGS="$LDFLAGS"
1668 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1669 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1671 if test "x$with_libganglia" = "xyes"
1673 AC_CHECK_HEADERS(gm_protocol.h,
1675 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1676 [Define to 1 if you have the <gm_protocol.h> header file.])
1677 ], [with_libganglia="no (gm_protocol.h not found)"])
1680 if test "x$with_libganglia" = "xyes"
1682 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1684 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1685 [Define to 1 if you have the ganglia library (-lganglia).])
1686 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1689 CPPFLAGS="$SAVE_CPPFLAGS"
1690 LDFLAGS="$SAVE_LDFLAGS"
1692 AC_SUBST(GANGLIA_CPPFLAGS)
1693 AC_SUBST(GANGLIA_LDFLAGS)
1694 AC_SUBST(GANGLIA_LIBS)
1695 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1698 # --with-libgcrypt {{{
1699 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1700 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1701 GCRYPT_LIBS="$GCRYPT_LIBS"
1702 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1704 if test -f "$withval" && test -x "$withval"
1706 with_libgcrypt_config="$withval"
1707 with_libgcrypt="yes"
1708 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1710 with_libgcrypt_config="$withval/bin/gcrypt-config"
1711 with_libgcrypt="yes"
1712 else if test -d "$withval"
1714 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1715 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1716 with_libgcrypt="yes"
1718 with_libgcrypt_config="gcrypt-config"
1719 with_libgcrypt="$withval"
1723 with_libgcrypt_config="libgcrypt-config"
1724 with_libgcrypt="yes"
1727 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1729 if test "x$GCRYPT_CPPFLAGS" = "x"
1731 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1734 if test "x$GCRYPT_LDFLAGS" = "x"
1736 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1737 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1740 if test "x$GCRYPT_LIBS" = "x"
1742 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1746 SAVE_CPPFLAGS="$CPPFLAGS"
1747 SAVE_LDFLAGS="$LDFLAGS"
1748 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1749 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1751 if test "x$with_libgcrypt" = "xyes"
1753 if test "x$GCRYPT_CPPFLAGS" != "x"
1755 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1757 AC_CHECK_HEADERS(gcrypt.h,
1758 [with_libgcrypt="yes"],
1759 [with_libgcrypt="no (gcrypt.h not found)"])
1762 if test "x$with_libgcrypt" = "xyes"
1764 if test "x$GCRYPT_LDFLAGS" != "x"
1766 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1768 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1769 [with_libgcrypt="yes"],
1770 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1772 if test "$with_libgcrypt" != "no"; then
1773 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1777 CPPFLAGS="$SAVE_CPPFLAGS"
1778 LDFLAGS="$SAVE_LDFLAGS"
1780 if test "x$with_libgcrypt" = "xyes"
1782 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1785 AC_SUBST(GCRYPT_CPPFLAGS)
1786 AC_SUBST(GCRYPT_LDFLAGS)
1787 AC_SUBST(GCRYPT_LIBS)
1788 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1791 # --with-libiptc {{{
1792 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1794 if test "x$withval" = "xshipped"
1797 else if test "x$withval" = "xyes"
1799 with_libiptc="pkgconfig"
1800 else if test "x$withval" = "xno"
1805 with_libiptc_cflags="-I$withval/include"
1806 with_libiptc_libs="-L$withval/lib"
1810 if test "x$ac_system" = "xLinux"
1812 with_libiptc="pkgconfig"
1814 with_libiptc="no (Linux only)"
1818 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1820 with_libiptc="no (Don't have pkg-config)"
1823 if test "x$with_libiptc" = "xpkgconfig"
1825 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
1828 with_libiptc="no (pkg-config doesn't know libiptc)"
1831 if test "x$with_libiptc" = "xpkgconfig"
1833 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
1836 with_libiptc="no ($PKG_CONFIG failed)"
1838 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
1841 with_libiptc="no ($PKG_CONFIG failed)"
1845 SAVE_CPPFLAGS="$CPPFLAGS"
1846 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
1848 # check whether the header file for libiptc is available.
1849 if test "x$with_libiptc" = "xpkgconfig"
1851 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
1852 [with_libiptc="no (header file missing)"])
1854 # If the header file is available, check for the required type declaractions.
1855 # They may be missing in old versions of libiptc. In that case, they will be
1856 # declared in the iptables plugin.
1857 if test "x$with_libiptc" = "xpkgconfig"
1859 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
1861 # Check for the iptc_init symbol in the library.
1862 # This could be in iptc or ip4tc
1863 if test "x$with_libiptc" = "xpkgconfig"
1866 AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
1867 [with_libiptc="pkgconfig"],
1868 [with_libiptc="no"],
1869 [$with_libiptc_libs])
1872 if test "x$with_libiptc" = "xpkgconfig"
1877 CPPFLAGS="$SAVE_CPPFLAGS"
1879 if test "x$with_libiptc" = "xown"
1881 with_libiptc_cflags=""
1882 with_libiptc_libs=""
1884 if test "x$with_libiptc" = "xown"
1886 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1888 with_libiptc="no (Linux iptables headers not found)"
1891 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1894 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
1895 if test "x$with_libiptc" = "xown"
1897 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1901 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1902 if test "x$with_libiptc" = "xyes"
1904 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
1905 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
1906 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1907 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1912 with_java_home="$JAVA_HOME"
1913 with_java_vmtype="client"
1918 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1920 if test "x$withval" = "xno"
1923 else if test "x$withval" = "xyes"
1927 with_java_home="$withval"
1932 if test "x$with_java" = "xyes"
1934 if test -d "$with_java_home"
1936 AC_MSG_CHECKING([for jni.h])
1937 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1938 if test "x$TMPDIR" != "x"
1940 AC_MSG_RESULT([found in $TMPDIR])
1941 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1943 AC_MSG_RESULT([not found])
1946 AC_MSG_CHECKING([for jni_md.h])
1947 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1948 if test "x$TMPDIR" != "x"
1950 AC_MSG_RESULT([found in $TMPDIR])
1951 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1953 AC_MSG_RESULT([not found])
1956 AC_MSG_CHECKING([for libjvm.so])
1957 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1958 if test "x$TMPDIR" != "x"
1960 AC_MSG_RESULT([found in $TMPDIR])
1961 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1963 AC_MSG_RESULT([not found])
1966 if test "x$JAVAC" = "x"
1968 AC_MSG_CHECKING([for javac])
1969 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1970 if test "x$TMPDIR" != "x"
1973 AC_MSG_RESULT([$JAVAC])
1975 AC_MSG_RESULT([not found])
1978 if test "x$JAR" = "x"
1980 AC_MSG_CHECKING([for jar])
1981 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1982 if test "x$TMPDIR" != "x"
1985 AC_MSG_RESULT([$JAR])
1987 AC_MSG_RESULT([not found])
1990 else if test "x$with_java_home" != "x"
1992 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1996 if test "x$JAVA_CPPFLAGS" != "x"
1998 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2000 if test "x$JAVA_CFLAGS" != "x"
2002 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2004 if test "x$JAVA_LDFLAGS" != "x"
2006 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2008 if test "x$JAVAC" = "x"
2010 with_javac_path="$PATH"
2011 if test "x$with_java_home" != "x"
2013 with_javac_path="$with_java_home:with_javac_path"
2014 if test -d "$with_java_home/bin"
2016 with_javac_path="$with_java_home/bin:with_javac_path"
2020 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2022 if test "x$JAVAC" = "x"
2024 with_java="no (javac not found)"
2026 if test "x$JAR" = "x"
2028 with_jar_path="$PATH"
2029 if test "x$with_java_home" != "x"
2031 with_jar_path="$with_java_home:$with_jar_path"
2032 if test -d "$with_java_home/bin"
2034 with_jar_path="$with_java_home/bin:$with_jar_path"
2038 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2040 if test "x$JAR" = "x"
2042 with_java="no (jar not found)"
2045 SAVE_CPPFLAGS="$CPPFLAGS"
2046 SAVE_CFLAGS="$CFLAGS"
2047 SAVE_LDFLAGS="$LDFLAGS"
2048 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2049 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2050 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2052 if test "x$with_java" = "xyes"
2054 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2056 if test "x$with_java" = "xyes"
2058 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2060 [with_java="no (libjvm not found)"],
2063 if test "x$with_java" = "xyes"
2065 JAVA_LIBS="$JAVA_LIBS -ljvm"
2066 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2069 CPPFLAGS="$SAVE_CPPFLAGS"
2070 CFLAGS="$SAVE_CFLAGS"
2071 LDFLAGS="$SAVE_LDFLAGS"
2073 AC_SUBST(JAVA_CPPFLAGS)
2074 AC_SUBST(JAVA_CFLAGS)
2075 AC_SUBST(JAVA_LDFLAGS)
2077 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2080 # --with-libmemcached {{{
2081 with_libmemcached_cppflags=""
2082 with_libmemcached_ldflags=""
2083 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2085 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2087 with_libmemcached_cppflags="-I$withval/include"
2088 with_libmemcached_ldflags="-L$withval/lib"
2089 with_libmemcached="yes"
2091 with_libmemcached="$withval"
2095 with_libmemcached="yes"
2097 if test "x$with_libmemcached" = "xyes"
2099 SAVE_CPPFLAGS="$CPPFLAGS"
2100 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2102 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2104 CPPFLAGS="$SAVE_CPPFLAGS"
2106 if test "x$with_libmemcached" = "xyes"
2108 SAVE_CPPFLAGS="$CPPFLAGS"
2109 SAVE_LDFLAGS="$LDFLAGS"
2110 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2111 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2113 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2115 CPPFLAGS="$SAVE_CPPFLAGS"
2116 LDFLAGS="$SAVE_LDFLAGS"
2118 if test "x$with_libmemcached" = "xyes"
2120 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2121 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2122 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2123 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2124 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2125 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2126 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2128 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2131 # --with-libmodbus {{{
2132 with_libmodbus_config=""
2133 with_libmodbus_cflags=""
2134 with_libmodbus_libs=""
2135 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2137 if test "x$withval" = "xno"
2140 else if test "x$withval" = "xyes"
2142 with_libmodbus="use_pkgconfig"
2143 else if test -d "$with_libmodbus/lib"
2145 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2146 with_libmodbus_cflags="-I$withval/include"
2147 with_libmodbus_libs="-L$withval/lib -lmodbus"
2148 with_libmodbus="yes"
2151 [with_libmodbus="use_pkgconfig"])
2153 # configure using pkg-config
2154 if test "x$with_libmodbus" = "xuse_pkgconfig"
2156 if test "x$PKG_CONFIG" = "x"
2158 with_libmodbus="no (Don't have pkg-config)"
2161 if test "x$with_libmodbus" = "xuse_pkgconfig"
2163 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
2164 $PKG_CONFIG --exists 'modbus' 2>/dev/null
2167 with_libmodbus="no (pkg-config doesn't know modbus)"
2170 if test "x$with_libmodbus" = "xuse_pkgconfig"
2172 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
2175 with_libmodbus="no ($PKG_CONFIG failed)"
2177 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
2180 with_libmodbus="no ($PKG_CONFIG failed)"
2183 if test "x$with_libmodbus" = "xuse_pkgconfig"
2185 with_libmodbus="yes"
2188 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2189 # the actual checks.
2190 if test "x$with_libmodbus" = "xyes"
2192 SAVE_CPPFLAGS="$CPPFLAGS"
2193 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2195 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2197 CPPFLAGS="$SAVE_CPPFLAGS"
2199 if test "x$with_libmodbus" = "xyes"
2201 SAVE_CPPFLAGS="$CPPFLAGS"
2202 SAVE_LDFLAGS="$LDFLAGS"
2204 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2205 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2207 AC_CHECK_LIB(modbus, modbus_connect,
2208 [with_libmodbus="yes"],
2209 [with_libmodbus="no (symbol modbus_connect not found)"])
2211 CPPFLAGS="$SAVE_CPPFLAGS"
2212 LDFLAGS="$SAVE_LDFLAGS"
2214 if test "x$with_libmodbus" = "xyes"
2216 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2217 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2218 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2219 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2223 # --with-libmysql {{{
2224 with_mysql_config="mysql_config"
2225 with_mysql_cflags=""
2227 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2229 if test "x$withval" = "xno"
2232 else if test "x$withval" = "xyes"
2236 if test -f "$withval" && test -x "$withval";
2238 with_mysql_config="$withval"
2239 else if test -x "$withval/bin/mysql_config"
2241 with_mysql_config="$withval/bin/mysql_config"
2249 if test "x$with_libmysql" = "xyes"
2251 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2252 mysql_config_status=$?
2254 if test $mysql_config_status -ne 0
2256 with_libmysql="no ($with_mysql_config failed)"
2258 SAVE_CPPFLAGS="$CPPFLAGS"
2259 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2262 have_mysql_mysql_h="no"
2263 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2265 if test "x$have_mysql_h" = "xno"
2267 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2270 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2272 with_libmysql="no (mysql.h not found)"
2275 CPPFLAGS="$SAVE_CPPFLAGS"
2278 if test "x$with_libmysql" = "xyes"
2280 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2281 mysql_config_status=$?
2283 if test $mysql_config_status -ne 0
2285 with_libmysql="no ($with_mysql_config failed)"
2287 AC_CHECK_LIB(mysqlclient, mysql_init,
2288 [with_libmysql="yes"],
2289 [with_libmysql="no (symbol 'mysql_init' not found)"],
2292 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2293 [with_libmysql="yes"],
2294 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2298 if test "x$with_libmysql" = "xyes"
2300 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2301 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2302 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2303 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2305 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2308 # --with-libnetlink {{{
2309 with_libnetlink_cflags=""
2310 with_libnetlink_libs="-lnetlink"
2311 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2313 echo "libnetlink: withval = $withval"
2314 if test "x$withval" = "xyes"
2316 with_libnetlink="yes"
2317 else if test "x$withval" = "xno"
2319 with_libnetlink="no"
2321 if test -d "$withval/include"
2323 with_libnetlink_cflags="-I$withval/include"
2324 with_libnetlink_libs="-L$withval/lib -lnetlink"
2325 with_libnetlink="yes"
2327 AC_MSG_ERROR("no such directory: $withval/include")
2332 if test "x$ac_system" = "xLinux"
2334 with_libnetlink="yes"
2336 with_libnetlink="no (Linux only library)"
2339 if test "x$with_libnetlink" = "xyes"
2341 SAVE_CFLAGS="$CFLAGS"
2342 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2344 with_libnetlink="no (libnetlink.h not found)"
2346 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2348 with_libnetlink="yes"
2352 #include <sys/types.h>
2353 #include <asm/types.h>
2354 #include <sys/socket.h>
2355 #include <linux/netlink.h>
2356 #include <linux/rtnetlink.h>])
2357 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2359 #include <sys/types.h>
2360 #include <asm/types.h>
2361 #include <sys/socket.h>])
2363 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2366 #include <sys/types.h>
2367 #include <asm/types.h>
2368 #include <sys/socket.h>
2369 #include <linux/netlink.h>
2370 #include <linux/rtnetlink.h>
2372 int retval = TCA_STATS2;
2376 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])])
2380 #include <sys/types.h>
2381 #include <asm/types.h>
2382 #include <sys/socket.h>
2383 #include <linux/netlink.h>
2384 #include <linux/rtnetlink.h>
2388 int retval = TCA_STATS;
2391 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2394 CFLAGS="$SAVE_CFLAGS"
2396 if test "x$with_libnetlink" = "xyes"
2398 AC_CHECK_LIB(netlink, rtnl_open,
2399 [with_libnetlink="yes"],
2400 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2401 [$with_libnetlink_libs])
2403 if test "x$with_libnetlink" = "xyes"
2405 SAVE_CFLAGS="$CFLAGS"
2406 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2409 [if function 'rtnl_dump_filter' expects five arguments],
2410 [c_cv_rtnl_dump_filter_five_args],
2411 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2414 #include <asm/types.h>
2415 #include <sys/socket.h>
2416 #if HAVE_LIBNETLINK_H
2417 # include <libnetlink.h>
2418 #elif HAVE_IPROUTE_LIBNETLINK_H
2419 # include <iproute/libnetlink.h>
2420 #elif HAVE_LINUX_LIBNETLINK_H
2421 # include <linux/libnetlink.h>
2425 if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL))
2430 [c_cv_rtnl_dump_filter_five_args="yes"],
2431 [c_cv_rtnl_dump_filter_five_args="no"]
2436 [if function 'rtnl_dump_filter' expects three arguments],
2437 [c_cv_rtnl_dump_filter_three_args],
2438 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2441 #include <asm/types.h>
2442 #include <sys/socket.h>
2443 #if HAVE_LIBNETLINK_H
2444 # include <libnetlink.h>
2445 #elif HAVE_IPROUTE_LIBNETLINK_H
2446 # include <iproute/libnetlink.h>
2447 #elif HAVE_LINUX_LIBNETLINK_H
2448 # include <linux/libnetlink.h>
2452 if (rtnl_dump_filter(NULL, NULL, NULL))
2457 [c_cv_rtnl_dump_filter_three_args="yes"],
2458 [c_cv_rtnl_dump_filter_three_args="no"]
2462 CFLAGS="$SAVE_CFLAGS"
2464 if test "x$c_cv_rtnl_dump_filter_five_args" = "xyes"
2466 AC_DEFINE(RTNL_DUMP_FILTER_FIVE_ARGS, 1,
2467 [Define to 1 if function 'rtnl_dump_filter' expects five arguments.])
2469 if test "x$c_cv_rtnl_dump_filter_three_args" = "xyes"
2471 AC_DEFINE(RTNL_DUMP_FILTER_THREE_ARGS, 1,
2472 [Define to 1 if function 'rtnl_dump_filter' expects three arguments.])
2475 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2476 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2477 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2478 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2480 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2483 # --with-libnetapp {{{
2484 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2485 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2486 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2487 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2488 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2489 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2490 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2492 if test -d "$withval"
2494 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2495 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2496 with_libnetapp="yes"
2498 with_libnetapp="$withval"
2502 with_libnetapp="yes"
2505 SAVE_CPPFLAGS="$CPPFLAGS"
2506 SAVE_LDFLAGS="$LDFLAGS"
2507 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2508 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2510 if test "x$with_libnetapp" = "xyes"
2512 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2514 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2516 AC_CHECK_HEADERS(netapp_api.h,
2517 [with_libnetapp="yes"],
2518 [with_libnetapp="no (netapp_api.h not found)"])
2521 if test "x$with_libnetapp" = "xyes"
2523 if test "x$LIBNETAPP_LDFLAGS" != "x"
2525 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2528 if test "x$LIBNETAPP_LIBS" = "x"
2530 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2532 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2534 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2535 [with_libnetapp="yes"],
2536 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2538 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2541 CPPFLAGS="$SAVE_CPPFLAGS"
2542 LDFLAGS="$SAVE_LDFLAGS"
2544 if test "x$with_libnetapp" = "xyes"
2546 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2549 AC_SUBST(LIBNETAPP_CPPFLAGS)
2550 AC_SUBST(LIBNETAPP_LDFLAGS)
2551 AC_SUBST(LIBNETAPP_LIBS)
2552 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2555 # --with-libnetsnmp {{{
2556 with_snmp_config="net-snmp-config"
2559 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2561 if test "x$withval" = "xno"
2563 with_libnetsnmp="no"
2564 else if test "x$withval" = "xyes"
2566 with_libnetsnmp="yes"
2568 if test -x "$withval"
2570 with_snmp_config="$withval"
2571 with_libnetsnmp="yes"
2573 with_snmp_config="$withval/bin/net-snmp-config"
2574 with_libnetsnmp="yes"
2578 [with_libnetsnmp="yes"])
2579 if test "x$with_libnetsnmp" = "xyes"
2581 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2582 snmp_config_status=$?
2584 if test $snmp_config_status -ne 0
2586 with_libnetsnmp="no ($with_snmp_config failed)"
2588 SAVE_CPPFLAGS="$CPPFLAGS"
2589 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2591 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2593 CPPFLAGS="$SAVE_CPPFLAGS"
2596 if test "x$with_libnetsnmp" = "xyes"
2598 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2599 snmp_config_status=$?
2601 if test $snmp_config_status -ne 0
2603 with_libnetsnmp="no ($with_snmp_config failed)"
2605 AC_CHECK_LIB(netsnmp, init_snmp,
2606 [with_libnetsnmp="yes"],
2607 [with_libnetsnmp="no (libnetsnmp not found)"],
2611 if test "x$with_libnetsnmp" = "xyes"
2613 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2614 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2615 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2616 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2618 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2621 # --with-liboconfig {{{
2622 with_own_liboconfig="no"
2623 liboconfig_LDFLAGS="$LDFLAGS"
2624 liboconfig_CPPFLAGS="$CPPFLAGS"
2625 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2627 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2629 if test -d "$withval/lib"
2631 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2633 if test -d "$withval/include"
2635 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2638 if test "x$withval" = "xno"
2640 AC_MSG_ERROR("liboconfig is required")
2644 with_liboconfig="yes"
2647 save_LDFLAGS="$LDFLAGS"
2648 save_CPPFLAGS="$CPPFLAGS"
2649 LDFLAGS="$liboconfig_LDFLAGS"
2650 CPPFLAGS="$liboconfig_CPPFLAGS"
2651 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2653 with_liboconfig="yes"
2654 with_own_liboconfig="no"
2657 with_liboconfig="yes"
2658 with_own_liboconfig="yes"
2659 LDFLAGS="$save_LDFLAGS"
2660 CPPFLAGS="$save_CPPFLAGS"
2663 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2664 if test "x$with_own_liboconfig" = "xyes"
2666 with_liboconfig="yes (shipped version)"
2670 # --with-liboping {{{
2671 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2673 if test "x$withval" = "xyes"
2676 else if test "x$withval" = "xno"
2681 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2682 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2685 [with_liboping="yes"])
2687 SAVE_CPPFLAGS="$CPPFLAGS"
2688 SAVE_LDFLAGS="$LDFLAGS"
2690 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2691 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2693 if test "x$with_liboping" = "xyes"
2695 if test "x$LIBOPING_CPPFLAGS" != "x"
2697 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2699 AC_CHECK_HEADERS(oping.h,
2700 [with_liboping="yes"],
2701 [with_liboping="no (oping.h not found)"])
2703 if test "x$with_liboping" = "xyes"
2705 if test "x$LIBOPING_LDFLAGS" != "x"
2707 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2709 AC_CHECK_LIB(oping, ping_construct,
2710 [with_liboping="yes"],
2711 [with_liboping="no (symbol 'ping_construct' not found)"])
2714 CPPFLAGS="$SAVE_CPPFLAGS"
2715 LDFLAGS="$SAVE_LDFLAGS"
2717 if test "x$with_liboping" = "xyes"
2719 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2720 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2721 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2722 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2724 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2728 with_oracle_cppflags=""
2730 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2732 if test "x$withval" = "xyes"
2734 if test "x$ORACLE_HOME" = "x"
2736 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2739 else if test "x$withval" = "xno"
2744 ORACLE_HOME="$withval"
2748 if test "x$ORACLE_HOME" = "x"
2750 with_oracle="no (ORACLE_HOME is not set)"
2755 if test "x$ORACLE_HOME" != "x"
2757 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2759 if test -e "$ORACLE_HOME/lib/ldflags"
2761 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2763 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2764 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2766 if test "x$with_oracle" = "xyes"
2768 SAVE_CPPFLAGS="$CPPFLAGS"
2769 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2771 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2773 CPPFLAGS="$SAVE_CPPFLAGS"
2775 if test "x$with_oracle" = "xyes"
2777 SAVE_CPPFLAGS="$CPPFLAGS"
2778 SAVE_LDFLAGS="$LDFLAGS"
2779 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2780 LDFLAGS="$LDFLAGS $with_oracle_libs"
2782 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2784 CPPFLAGS="$SAVE_CPPFLAGS"
2785 LDFLAGS="$SAVE_LDFLAGS"
2787 if test "x$with_oracle" = "xyes"
2789 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2790 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2791 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2792 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2796 # --with-libowcapi {{{
2797 with_libowcapi_cppflags=""
2798 with_libowcapi_libs="-lowcapi"
2799 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2801 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2803 with_libowcapi_cppflags="-I$withval/include"
2804 with_libowcapi_libs="-L$withval/lib -lowcapi"
2805 with_libowcapi="yes"
2807 with_libowcapi="$withval"
2811 with_libowcapi="yes"
2813 if test "x$with_libowcapi" = "xyes"
2815 SAVE_CPPFLAGS="$CPPFLAGS"
2816 CPPFLAGS="$with_libowcapi_cppflags"
2818 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2820 CPPFLAGS="$SAVE_CPPFLAGS"
2822 if test "x$with_libowcapi" = "xyes"
2824 SAVE_LDFLAGS="$LDFLAGS"
2825 SAVE_CPPFLAGS="$CPPFLAGS"
2826 LDFLAGS="$with_libowcapi_libs"
2827 CPPFLAGS="$with_libowcapi_cppflags"
2829 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2831 LDFLAGS="$SAVE_LDFLAGS"
2832 CPPFLAGS="$SAVE_CPPFLAGS"
2834 if test "x$with_libowcapi" = "xyes"
2836 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2837 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2838 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2839 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2843 # --with-libpcap {{{
2844 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2846 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2848 LDFLAGS="$LDFLAGS -L$withval/lib"
2849 CPPFLAGS="$CPPFLAGS -I$withval/include"
2852 with_libpcap="$withval"
2858 if test "x$with_libpcap" = "xyes"
2860 AC_CHECK_LIB(pcap, pcap_open_live,
2862 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2863 ], [with_libpcap="no (libpcap not found)"])
2865 if test "x$with_libpcap" = "xyes"
2867 AC_CHECK_HEADERS(pcap.h,,
2868 [with_libpcap="no (pcap.h not found)"])
2870 if test "x$with_libpcap" = "xyes"
2872 AC_CHECK_HEADERS(pcap-bpf.h,,
2873 [with_libpcap="no (pcap-bpf.h not found)"])
2875 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2878 # --with-libperl {{{
2879 perl_interpreter="perl"
2880 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2882 if test -f "$withval" && test -x "$withval"
2884 perl_interpreter="$withval"
2886 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2888 LDFLAGS="$LDFLAGS -L$withval/lib"
2889 CPPFLAGS="$CPPFLAGS -I$withval/include"
2890 perl_interpreter="$withval/bin/perl"
2893 with_libperl="$withval"
2900 AC_MSG_CHECKING([for perl])
2901 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2902 if test -x "$perl_interpreter"
2904 AC_MSG_RESULT([yes ($perl_interpreter)])
2910 AC_SUBST(PERL, "$perl_interpreter")
2912 if test "x$with_libperl" = "xyes" \
2913 && test -n "$perl_interpreter"
2915 SAVE_CFLAGS="$CFLAGS"
2916 SAVE_LDFLAGS="$LDFLAGS"
2917 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2918 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2919 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2920 CFLAGS="$CFLAGS $PERL_CFLAGS"
2921 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2923 AC_CACHE_CHECK([for libperl],
2924 [c_cv_have_libperl],
2928 #define PERL_NO_GET_CONTEXT
2935 load_module (PERL_LOADMOD_NOIMPORT,
2936 newSVpv ("Collectd::Plugin::FooBar", 24),
2939 [c_cv_have_libperl="yes"],
2940 [c_cv_have_libperl="no"]
2944 if test "x$c_cv_have_libperl" = "xyes"
2946 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2947 AC_SUBST(PERL_CFLAGS)
2948 AC_SUBST(PERL_LDFLAGS)
2953 CFLAGS="$SAVE_CFLAGS"
2954 LDFLAGS="$SAVE_LDFLAGS"
2955 else if test -z "$perl_interpreter"; then
2956 with_libperl="no (no perl interpreter found)"
2957 c_cv_have_libperl="no"
2959 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2961 if test "x$with_libperl" = "xyes"
2963 SAVE_CFLAGS="$CFLAGS"
2964 SAVE_LDFLAGS="$LDFLAGS"
2965 CFLAGS="$CFLAGS $PERL_CFLAGS"
2966 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2968 AC_CACHE_CHECK([if perl supports ithreads],
2969 [c_cv_have_perl_ithreads],
2977 #if !defined(USE_ITHREADS)
2978 # error "Perl does not support ithreads!"
2979 #endif /* !defined(USE_ITHREADS) */
2982 [c_cv_have_perl_ithreads="yes"],
2983 [c_cv_have_perl_ithreads="no"]
2987 if test "x$c_cv_have_perl_ithreads" = "xyes"
2989 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2992 CFLAGS="$SAVE_CFLAGS"
2993 LDFLAGS="$SAVE_LDFLAGS"
2996 if test "x$with_libperl" = "xyes"
2998 SAVE_CFLAGS="$CFLAGS"
2999 SAVE_LDFLAGS="$LDFLAGS"
3000 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3001 # (see issues #41 and #42)
3002 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3003 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3005 AC_CACHE_CHECK([for broken Perl_load_module()],
3006 [c_cv_have_broken_perl_load_module],
3010 #define PERL_NO_GET_CONTEXT
3017 load_module (PERL_LOADMOD_NOIMPORT,
3018 newSVpv ("Collectd::Plugin::FooBar", 24),
3021 [c_cv_have_broken_perl_load_module="no"],
3022 [c_cv_have_broken_perl_load_module="yes"]
3026 CFLAGS="$SAVE_CFLAGS"
3027 LDFLAGS="$SAVE_LDFLAGS"
3029 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3030 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3032 if test "x$with_libperl" = "xyes"
3034 SAVE_CFLAGS="$CFLAGS"
3035 SAVE_LDFLAGS="$LDFLAGS"
3036 CFLAGS="$CFLAGS $PERL_CFLAGS"
3037 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3040 [struct mgvtbl.svt_local],
3041 [have_struct_mgvtbl_svt_local="yes"],
3042 [have_struct_mgvtbl_svt_local="no"],
3049 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3051 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3052 [Define if Perl's struct mgvtbl has member svt_local.])
3055 CFLAGS="$SAVE_CFLAGS"
3056 LDFLAGS="$SAVE_LDFLAGS"
3061 with_pg_config="pg_config"
3062 with_libpq_includedir=""
3063 with_libpq_libdir=""
3064 with_libpq_cppflags=""
3065 with_libpq_ldflags=""
3066 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3069 if test "x$withval" = "xno"
3072 else if test "x$withval" = "xyes"
3076 if test -f "$withval" && test -x "$withval";
3078 with_pg_config="$withval"
3079 else if test -x "$withval/bin/pg_config"
3081 with_pg_config="$withval/bin/pg_config"
3089 if test "x$with_libpq" = "xyes"
3091 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3094 if test $pg_config_status -eq 0
3096 if test -n "$with_libpq_includedir"; then
3097 for dir in $with_libpq_includedir; do
3098 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3102 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3105 SAVE_CPPFLAGS="$CPPFLAGS"
3106 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3108 AC_CHECK_HEADERS(libpq-fe.h, [],
3109 [with_libpq="no (libpq-fe.h not found)"], [])
3111 CPPFLAGS="$SAVE_CPPFLAGS"
3113 if test "x$with_libpq" = "xyes"
3115 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3118 if test $pg_config_status -eq 0
3120 if test -n "$with_libpq_libdir"; then
3121 for dir in $with_libpq_libdir; do
3122 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3126 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3129 SAVE_LDFLAGS="$LDFLAGS"
3130 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3132 AC_CHECK_LIB(pq, PQconnectdb,
3134 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3136 AC_CHECK_LIB(pq, PQserverVersion,
3138 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3140 LDFLAGS="$SAVE_LDFLAGS"
3142 if test "x$with_libpq" = "xyes"
3144 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3145 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3146 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3147 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3149 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3152 # --with-libpthread {{{
3153 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3154 [ if test "x$withval" != "xno" \
3155 && test "x$withval" != "xyes"
3157 LDFLAGS="$LDFLAGS -L$withval/lib"
3158 CPPFLAGS="$CPPFLAGS -I$withval/include"
3159 with_libpthread="yes"
3161 if test "x$withval" = "xno"
3163 with_libpthread="no (disabled)"
3166 ], [with_libpthread="yes"])
3167 if test "x$with_libpthread" = "xyes"
3169 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3172 if test "x$with_libpthread" = "xyes"
3174 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3176 if test "x$with_libpthread" = "xyes"
3182 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3183 [Wether or not to use pthread (POSIX threads) library])
3184 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3189 with_python_path="$PATH"
3190 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3192 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3194 with_python="$withval"
3195 else if test -x "$withval"
3197 with_python_prog="$withval"
3198 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3200 else if test -d "$withval"
3202 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3205 AC_MSG_WARN([Argument not recognized: $withval])
3207 ], [with_python="yes"])
3210 SAVE_CPPFLAGS="$CPPFLAGS"
3211 SAVE_LDFLAGS="$LDFLAGS"
3214 PATH="$with_python_path"
3216 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3218 AC_MSG_CHECKING([for python])
3219 with_python_prog="`which python 2>/dev/null`"
3220 if test "x$with_python_prog" = "x"
3222 AC_MSG_RESULT([not found])
3223 with_python="no (interpreter not found)"
3225 AC_MSG_RESULT([$with_python_prog])
3229 if test "x$with_python" = "xyes"
3231 AC_MSG_CHECKING([for Python CPPFLAGS])
3232 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3233 python_config_status=$?
3235 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3237 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3240 AC_MSG_RESULT([$python_include_path])
3244 if test "x$with_python" = "xyes"
3246 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3247 AC_CHECK_HEADERS(Python.h,
3248 [with_python="yes"],
3249 [with_python="no ('Python.h' not found)"])
3252 if test "x$with_python" = "xyes"
3254 AC_MSG_CHECKING([for Python LDFLAGS])
3255 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`
3256 python_config_status=$?
3258 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3260 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3263 AC_MSG_RESULT([$python_library_path])
3267 if test "x$with_python" = "xyes"
3269 AC_MSG_CHECKING([for Python LIBS])
3270 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`
3271 python_config_status=$?
3273 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3275 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3278 AC_MSG_RESULT([$python_library_flags])
3282 if test "x$with_python" = "xyes"
3284 LDFLAGS="-L$python_library_path $LDFLAGS"
3285 LIBS="$python_library_flags $LIBS"
3287 AC_CHECK_FUNC(PyObject_CallFunction,
3288 [with_python="yes"],
3289 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3293 CPPFLAGS="$SAVE_CPPFLAGS"
3294 LDFLAGS="$SAVE_LDFLAGS"
3297 if test "x$with_python" = "xyes"
3299 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3300 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3301 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3302 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3303 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3304 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3308 # --with-librabbitmq {{{
3309 with_librabbitmq_cppflags=""
3310 with_librabbitmq_ldflags=""
3311 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3313 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3315 with_librabbitmq_cppflags="-I$withval/include"
3316 with_librabbitmq_ldflags="-L$withval/lib"
3317 with_librabbitmq="yes"
3319 with_librabbitmq="$withval"
3323 with_librabbitmq="yes"
3325 SAVE_CPPFLAGS="$CPPFLAGS"
3326 SAVE_LDFLAGS="$LDFLAGS"
3327 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3328 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3329 if test "x$with_librabbitmq" = "xyes"
3331 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3333 if test "x$with_librabbitmq" = "xyes"
3335 # librabbitmq up to version 0.9.1 provides "library_errno", later
3336 # versions use "library_error". The library does not provide a version
3337 # macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
3338 AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
3341 # include <stdlib.h>
3347 # include <stdint.h>
3350 # include <inttypes.h>
3355 if test "x$with_librabbitmq" = "xyes"
3357 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3359 if test "x$with_librabbitmq" = "xyes"
3361 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3362 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3363 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3364 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3365 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3366 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3367 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3369 CPPFLAGS="$SAVE_CPPFLAGS"
3370 LDFLAGS="$SAVE_LDFLAGS"
3371 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3374 # --with-librouteros {{{
3375 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3377 if test "x$withval" = "xyes"
3379 with_librouteros="yes"
3380 else if test "x$withval" = "xno"
3382 with_librouteros="no"
3384 with_librouteros="yes"
3385 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3386 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3389 [with_librouteros="yes"])
3391 SAVE_CPPFLAGS="$CPPFLAGS"
3392 SAVE_LDFLAGS="$LDFLAGS"
3394 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3395 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3397 if test "x$with_librouteros" = "xyes"
3399 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3401 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3403 AC_CHECK_HEADERS(routeros_api.h,
3404 [with_librouteros="yes"],
3405 [with_librouteros="no (routeros_api.h not found)"])
3407 if test "x$with_librouteros" = "xyes"
3409 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3411 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3413 AC_CHECK_LIB(routeros, ros_interface,
3414 [with_librouteros="yes"],
3415 [with_librouteros="no (symbol 'ros_interface' not found)"])
3418 CPPFLAGS="$SAVE_CPPFLAGS"
3419 LDFLAGS="$SAVE_LDFLAGS"
3421 if test "x$with_librouteros" = "xyes"
3423 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3424 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3425 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3426 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3428 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3432 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3435 librrd_threadsafe="yes"
3436 librrd_rrdc_update="no"
3437 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3438 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3440 librrd_cflags="-I$withval/include"
3441 librrd_ldflags="-L$withval/lib"
3444 with_librrd="$withval"
3446 ], [with_librrd="yes"])
3447 if test "x$with_librrd" = "xyes"
3449 SAVE_CPPFLAGS="$CPPFLAGS"
3450 SAVE_LDFLAGS="$LDFLAGS"
3452 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3453 LDFLAGS="$LDFLAGS $librrd_ldflags"
3455 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3457 CPPFLAGS="$SAVE_CPPFLAGS"
3458 LDFLAGS="$SAVE_LDFLAGS"
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_LIB(rrd_th, rrd_update_r,
3470 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3472 [librrd_threadsafe="no"
3473 AC_CHECK_LIB(rrd, rrd_update,
3475 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3477 [with_librrd="no (symbol 'rrd_update' not found)"],
3482 if test "x$librrd_threadsafe" = "xyes"
3484 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3486 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3489 CPPFLAGS="$SAVE_CPPFLAGS"
3490 LDFLAGS="$SAVE_LDFLAGS"
3492 if test "x$with_librrd" = "xyes"
3494 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3495 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3496 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3497 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3499 if test "x$librrd_threadsafe" = "xyes"
3501 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3505 # --with-libsensors {{{
3506 with_sensors_cflags=""
3507 with_sensors_ldflags=""
3508 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3510 if test "x$withval" = "xno"
3512 with_libsensors="no"
3514 with_libsensors="yes"
3515 if test "x$withval" != "xyes"
3517 with_sensors_cflags="-I$withval/include"
3518 with_sensors_ldflags="-L$withval/lib"
3519 with_libsensors="yes"
3524 if test "x$ac_system" = "xLinux"
3526 with_libsensors="yes"
3528 with_libsensors="no (Linux only library)"
3531 if test "x$with_libsensors" = "xyes"
3533 SAVE_CPPFLAGS="$CPPFLAGS"
3534 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3536 # AC_CHECK_HEADERS(sensors/sensors.h,
3538 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3540 # [with_libsensors="no (sensors/sensors.h not found)"])
3541 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3543 CPPFLAGS="$SAVE_CPPFLAGS"
3545 if test "x$with_libsensors" = "xyes"
3547 SAVE_CPPFLAGS="$CPPFLAGS"
3548 SAVE_LDFLAGS="$LDFLAGS"
3549 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3550 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3552 AC_CHECK_LIB(sensors, sensors_init,
3554 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3556 [with_libsensors="no (libsensors not found)"])
3558 CPPFLAGS="$SAVE_CPPFLAGS"
3559 LDFLAGS="$SAVE_LDFLAGS"
3561 if test "x$with_libsensors" = "xyes"
3563 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3564 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3565 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3566 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3568 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3571 # --with-libstatgrab {{{
3572 with_libstatgrab_cflags=""
3573 with_libstatgrab_ldflags=""
3574 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3576 if test "x$withval" != "xno" \
3577 && test "x$withval" != "xyes"
3579 with_libstatgrab_cflags="-I$withval/include"
3580 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3581 with_libstatgrab="yes"
3582 with_libstatgrab_pkg_config="no"
3584 with_libstatgrab="$withval"
3585 with_libstatgrab_pkg_config="yes"
3589 with_libstatgrab="yes"
3590 with_libstatgrab_pkg_config="yes"
3593 if test "x$with_libstatgrab" = "xyes" \
3594 && test "x$with_libstatgrab_pkg_config" = "xyes"
3596 if test "x$PKG_CONFIG" != "x"
3598 AC_MSG_CHECKING([pkg-config for libstatgrab])
3600 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3603 with_libstatgrab_pkg_config="no"
3604 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3605 temp_result="not found"
3607 AC_MSG_RESULT([$temp_result])
3609 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3610 with_libstatgrab_pkg_config="no"
3611 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3615 if test "x$with_libstatgrab" = "xyes" \
3616 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3617 && test "x$with_libstatgrab_cflags" = "x"
3619 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3620 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3623 with_libstatgrab_cflags="$temp_result"
3625 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3626 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3628 AC_MSG_RESULT([$temp_result])
3631 if test "x$with_libstatgrab" = "xyes" \
3632 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3633 && test "x$with_libstatgrab_ldflags" = "x"
3635 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3636 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3639 with_libstatgrab_ldflags="$temp_result"
3641 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3642 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3644 AC_MSG_RESULT([$temp_result])
3647 if test "x$with_libstatgrab" = "xyes"
3649 SAVE_CPPFLAGS="$CPPFLAGS"
3650 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3652 AC_CHECK_HEADERS(statgrab.h,
3653 [with_libstatgrab="yes"],
3654 [with_libstatgrab="no (statgrab.h not found)"])
3656 CPPFLAGS="$SAVE_CPPFLAGS"
3659 if test "x$with_libstatgrab" = "xyes"
3661 SAVE_CFLAGS="$CFLAGS"
3662 SAVE_LDFLAGS="$LDFLAGS"
3664 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3665 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3667 AC_CHECK_LIB(statgrab, sg_init,
3668 [with_libstatgrab="yes"],
3669 [with_libstatgrab="no (symbol sg_init not found)"])
3671 CFLAGS="$SAVE_CFLAGS"
3672 LDFLAGS="$SAVE_LDFLAGS"
3675 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3676 if test "x$with_libstatgrab" = "xyes"
3678 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3679 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3680 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3681 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3682 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3686 # --with-libtokyotyrant {{{
3687 with_libtokyotyrant_cppflags=""
3688 with_libtokyotyrant_ldflags=""
3689 with_libtokyotyrant_libs=""
3690 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3692 if test "x$withval" = "xno"
3694 with_libtokyotyrant="no"
3695 else if test "x$withval" = "xyes"
3697 with_libtokyotyrant="yes"
3699 with_libtokyotyrant_cppflags="-I$withval/include"
3700 with_libtokyotyrant_ldflags="-L$withval/include"
3701 with_libtokyotyrant_libs="-ltokyotyrant"
3702 with_libtokyotyrant="yes"
3706 with_libtokyotyrant="yes"
3709 if test "x$with_libtokyotyrant" = "xyes"
3711 if $PKG_CONFIG --exists tokyotyrant
3713 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3714 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3715 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3719 SAVE_CPPFLAGS="$CPPFLAGS"
3720 SAVE_LDFLAGS="$LDFLAGS"
3721 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3722 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3724 if test "x$with_libtokyotyrant" = "xyes"
3726 AC_CHECK_HEADERS(tcrdb.h,
3728 AC_DEFINE(HAVE_TCRDB_H, 1,
3729 [Define to 1 if you have the <tcrdb.h> header file.])
3730 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3733 if test "x$with_libtokyotyrant" = "xyes"
3735 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3737 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3738 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3740 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3741 [$with_libtokyotyrant_libs])
3744 CPPFLAGS="$SAVE_CPPFLAGS"
3745 LDFLAGS="$SAVE_LDFLAGS"
3747 if test "x$with_libtokyotyrant" = "xyes"
3749 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3750 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3751 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3752 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3753 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3754 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3756 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3759 # --with-libupsclient {{{
3760 with_libupsclient_config=""
3761 with_libupsclient_cflags=""
3762 with_libupsclient_libs=""
3763 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3765 if test "x$withval" = "xno"
3767 with_libupsclient="no"
3768 else if test "x$withval" = "xyes"
3770 with_libupsclient="use_pkgconfig"
3772 if test -x "$withval"
3774 with_libupsclient_config="$withval"
3775 with_libupsclient="use_libupsclient_config"
3776 else if test -x "$withval/bin/libupsclient-config"
3778 with_libupsclient_config="$withval/bin/libupsclient-config"
3779 with_libupsclient="use_libupsclient_config"
3781 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3782 with_libupsclient_cflags="-I$withval/include"
3783 with_libupsclient_libs="-L$withval/lib -lupsclient"
3784 with_libupsclient="yes"
3788 [with_libupsclient="use_pkgconfig"])
3790 # configure using libupsclient-config
3791 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3793 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3794 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3797 with_libupsclient="no ($with_libupsclient_config failed)"
3799 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3802 with_libupsclient="no ($with_libupsclient_config failed)"
3805 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3807 with_libupsclient="yes"
3810 # configure using pkg-config
3811 if test "x$with_libupsclient" = "xuse_pkgconfig"
3813 if test "x$PKG_CONFIG" = "x"
3815 with_libupsclient="no (Don't have pkg-config)"
3818 if test "x$with_libupsclient" = "xuse_pkgconfig"
3820 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3821 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3824 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3827 if test "x$with_libupsclient" = "xuse_pkgconfig"
3829 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3832 with_libupsclient="no ($PKG_CONFIG failed)"
3834 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3837 with_libupsclient="no ($PKG_CONFIG failed)"
3840 if test "x$with_libupsclient" = "xuse_pkgconfig"
3842 with_libupsclient="yes"
3845 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3846 # the actual checks.
3847 if test "x$with_libupsclient" = "xyes"
3849 SAVE_CPPFLAGS="$CPPFLAGS"
3850 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3852 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3854 CPPFLAGS="$SAVE_CPPFLAGS"
3856 if test "x$with_libupsclient" = "xyes"
3858 SAVE_CPPFLAGS="$CPPFLAGS"
3859 SAVE_LDFLAGS="$LDFLAGS"
3861 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3862 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3864 AC_CHECK_LIB(upsclient, upscli_connect,
3865 [with_libupsclient="yes"],
3866 [with_libupsclient="no (symbol upscli_connect not found)"])
3868 CPPFLAGS="$SAVE_CPPFLAGS"
3869 LDFLAGS="$SAVE_LDFLAGS"
3871 if test "x$with_libupsclient" = "xyes"
3873 SAVE_CPPFLAGS="$CPPFLAGS"
3874 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3876 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3877 [#include <stdlib.h>
3879 #include <upsclient.h>])
3881 CPPFLAGS="$SAVE_CPPFLAGS"
3883 if test "x$with_libupsclient" = "xyes"
3885 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3886 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3887 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3888 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3892 # --with-libxmms {{{
3893 with_xmms_config="xmms-config"
3896 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3898 if test "x$withval" != "xno" \
3899 && test "x$withval" != "xyes"
3901 if test -f "$withval" && test -x "$withval";
3903 with_xmms_config="$withval"
3904 else if test -x "$withval/bin/xmms-config"
3906 with_xmms_config="$withval/bin/xmms-config"
3909 else if test "x$withval" = "xno"
3919 if test "x$with_libxmms" = "xyes"
3921 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3922 xmms_config_status=$?
3924 if test $xmms_config_status -ne 0
3929 if test "x$with_libxmms" = "xyes"
3931 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3932 xmms_config_status=$?
3934 if test $xmms_config_status -ne 0
3939 if test "x$with_libxmms" = "xyes"
3941 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3943 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3944 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3945 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3946 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3953 with_libxmms_numeric=0
3954 if test "x$with_libxmms" = "xyes"
3956 with_libxmms_numeric=1
3958 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3959 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3962 # --with-libyajl {{{
3963 with_libyajl_cppflags=""
3964 with_libyajl_ldflags=""
3965 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3967 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3969 with_libyajl_cppflags="-I$withval/include"
3970 with_libyajl_ldflags="-L$withval/lib"
3973 with_libyajl="$withval"
3979 if test "x$with_libyajl" = "xyes"
3981 SAVE_CPPFLAGS="$CPPFLAGS"
3982 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3984 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3985 AC_CHECK_HEADERS(yajl/yajl_version.h)
3987 CPPFLAGS="$SAVE_CPPFLAGS"
3989 if test "x$with_libyajl" = "xyes"
3991 SAVE_CPPFLAGS="$CPPFLAGS"
3992 SAVE_LDFLAGS="$LDFLAGS"
3993 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3994 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3996 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3998 CPPFLAGS="$SAVE_CPPFLAGS"
3999 LDFLAGS="$SAVE_LDFLAGS"
4001 if test "x$with_libyajl" = "xyes"
4003 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
4004 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
4005 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
4006 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
4007 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
4008 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
4009 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
4011 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4014 # --with-libvarnish {{{
4015 with_libvarnish_cppflags=""
4016 with_libvarnish_cflags=""
4017 with_libvarnish_libs=""
4018 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4020 if test "x$withval" = "xno"
4022 with_libvarnish="no"
4023 else if test "x$withval" = "xyes"
4025 with_libvarnish="use_pkgconfig"
4026 else if test -d "$with_libvarnish/lib"
4028 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4029 with_libvarnish_cflags="-I$withval/include"
4030 with_libvarnish_libs="-L$withval/lib -lvarnishapi"
4031 with_libvarnish="yes"
4034 [with_libvarnish="use_pkgconfig"])
4036 # configure using pkg-config
4037 if test "x$with_libvarnish" = "xuse_pkgconfig"
4039 if test "x$PKG_CONFIG" = "x"
4041 with_libvarnish="no (Don't have pkg-config)"
4044 if test "x$with_libvarnish" = "xuse_pkgconfig"
4046 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4047 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4050 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4053 if test "x$with_libvarnish" = "xuse_pkgconfig"
4055 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4058 with_libvarnish="no ($PKG_CONFIG failed)"
4060 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4063 with_libvarnish="no ($PKG_CONFIG failed)"
4066 if test "x$with_libvarnish" = "xuse_pkgconfig"
4068 with_libvarnish="yes"
4071 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4072 # the actual checks.
4073 if test "x$with_libvarnish" = "xyes"
4075 SAVE_CPPFLAGS="$CPPFLAGS"
4076 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4077 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4079 CPPFLAGS="$SAVE_CPPFLAGS"
4081 if test "x$with_libvarnish" = "xyes"
4083 SAVE_CPPFLAGS="$CPPFLAGS"
4084 #SAVE_LDFLAGS="$LDFLAGS"
4086 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4087 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4089 AC_CHECK_LIB(varnishapi, VSL_OpenStats,
4090 [with_libvarnish="yes"],
4091 [with_libvarnish="no (symbol VSL_OpenStats not found)"],
4092 [$with_libvarnish_libs])
4094 CPPFLAGS="$SAVE_CPPFLAGS"
4095 #LDFLAGS="$SAVE_LDFLAGS"
4097 if test "x$with_libvarnish" = "xyes"
4099 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4100 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4101 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4102 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4106 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4107 with_libxml2="no (pkg-config isn't available)"
4108 with_libxml2_cflags=""
4109 with_libxml2_ldflags=""
4110 with_libvirt="no (pkg-config isn't available)"
4111 with_libvirt_cflags=""
4112 with_libvirt_ldflags=""
4113 if test "x$PKG_CONFIG" != "x"
4115 pkg-config --exists 'libxml-2.0' 2>/dev/null
4120 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4123 pkg-config --exists libvirt 2>/dev/null
4128 with_libvirt="no (pkg-config doesn't know libvirt)"
4131 if test "x$with_libxml2" = "xyes"
4133 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4138 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4144 if test "x$with_libxml2" = "xyes"
4146 SAVE_CPPFLAGS="$CPPFLAGS"
4147 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4149 AC_CHECK_HEADERS(libxml/parser.h, [],
4150 [with_libxml2="no (libxml/parser.h not found)"])
4152 CPPFLAGS="$SAVE_CPPFLAGS"
4154 if test "x$with_libxml2" = "xyes"
4156 SAVE_CFLAGS="$CFLAGS"
4157 SAVE_LDFLAGS="$LDFLAGS"
4159 CFLAGS="$CFLAGS $with_libxml2_cflags"
4160 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4162 AC_CHECK_LIB(xml2, xmlXPathEval,
4163 [with_libxml2="yes"],
4164 [with_libxml2="no (symbol xmlXPathEval not found)"])
4166 CFLAGS="$SAVE_CFLAGS"
4167 LDFLAGS="$SAVE_LDFLAGS"
4169 dnl Add the right compiler flags and libraries.
4170 if test "x$with_libxml2" = "xyes"; then
4171 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4172 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4173 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4174 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4176 if test "x$with_libvirt" = "xyes"
4178 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4183 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4189 if test "x$with_libvirt" = "xyes"
4191 SAVE_CPPFLAGS="$CPPFLAGS"
4192 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4194 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4195 [with_libvirt="no (libvirt/libvirt.h not found)"])
4197 CPPFLAGS="$SAVE_CPPFLAGS"
4199 if test "x$with_libvirt" = "xyes"
4201 SAVE_CFLAGS="$CFLAGS"
4202 SAVE_LDFLAGS="$LDFLAGS"
4204 CFLAGS="$CFLAGS $with_libvirt_cflags"
4205 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4207 AC_CHECK_LIB(virt, virDomainBlockStats,
4208 [with_libvirt="yes"],
4209 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4211 CFLAGS="$SAVE_CFLAGS"
4212 LDFLAGS="$SAVE_LDFLAGS"
4214 dnl Add the right compiler flags and libraries.
4215 if test "x$with_libvirt" = "xyes"; then
4216 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4217 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4218 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4219 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4223 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4224 with_libopenipmipthread="yes"
4225 with_libopenipmipthread_cflags=""
4226 with_libopenipmipthread_libs=""
4228 AC_MSG_CHECKING([for pkg-config])
4230 if test "x$PKG_CONFIG" = "x"
4232 with_libopenipmipthread="no"
4235 temp_result="$PKG_CONFIG"
4237 AC_MSG_RESULT([$temp_result])
4239 if test "x$with_libopenipmipthread" = "xyes"
4241 AC_MSG_CHECKING([for libOpenIPMIpthread])
4242 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4245 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4247 AC_MSG_RESULT([$with_libopenipmipthread])
4250 if test "x$with_libopenipmipthread" = "xyes"
4252 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4253 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4256 with_libopenipmipthread_cflags="$temp_result"
4258 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4259 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4261 AC_MSG_RESULT([$temp_result])
4264 if test "x$with_libopenipmipthread" = "xyes"
4266 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4267 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4270 with_libopenipmipthread_ldflags="$temp_result"
4272 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4273 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4275 AC_MSG_RESULT([$temp_result])
4278 if test "x$with_libopenipmipthread" = "xyes"
4280 SAVE_CPPFLAGS="$CPPFLAGS"
4281 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4283 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4284 [with_libopenipmipthread="yes"],
4285 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4286 [#include <OpenIPMI/ipmiif.h>
4287 #include <OpenIPMI/ipmi_err.h>
4288 #include <OpenIPMI/ipmi_posix.h>
4289 #include <OpenIPMI/ipmi_conn.h>
4292 CPPFLAGS="$SAVE_CPPFLAGS"
4295 if test "x$with_libopenipmipthread" = "xyes"
4297 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4298 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4299 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4300 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4304 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4305 [with_libnotify="yes"],
4306 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4309 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4312 # Check for enabled/disabled features
4315 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4316 # ------------------------------------------------------------
4318 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4323 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4328 m4_define([EnDis],[disabled])dnl
4329 m4_define([YesNo],[no])dnl
4335 m4_define([EnDis],[enabled])dnl
4336 m4_define([YesNo],[yes])dnl
4339 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4343 m4_if([$3], [feature], [],
4347 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4353 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4355 enable_$1='[YesNo]'dnl
4357 if test "x$enable_$1" = "xno"
4361 if test "x$enable_$1" = "xyes"
4365 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4370 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4371 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4373 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4375 # AC_PLUGIN(name, default, info)
4376 # ------------------------------------------------------------
4383 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4385 if test "x$enableval" = "xyes"
4388 else if test "x$enableval" = "xforce"
4393 enable_plugin="no (disabled on command line)"
4397 if test "x$enable_all_plugins" = "xauto"
4399 if test "x$2" = "xyes"
4406 enable_plugin="$enable_all_plugins"
4409 if test "x$enable_plugin" = "xyes"
4411 if test "x$2" = "xyes" || test "x$force" = "xyes"
4413 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4414 if test "x$2" != "xyes"
4416 dependency_warning="yes"
4418 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4419 dependency_error="yes"
4420 enable_plugin="no (dependency error)"
4423 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4424 enable_$1="$enable_plugin"
4426 )# AC_PLUGIN(name, default, info)
4428 m4_divert_once([HELP_ENABLE], [
4429 collectd features:])
4430 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4431 AC_COLLECTD([debug], [enable], [feature], [debugging])
4432 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4433 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4435 dependency_warning="no"
4436 dependency_error="no"
4441 plugin_conntrack="no"
4442 plugin_contextswitch="no"
4445 plugin_curl_json="no"
4446 plugin_curl_xml="no"
4450 plugin_interface="no"
4457 plugin_multimeter="no"
4461 plugin_processes="no"
4462 plugin_protocols="no"
4466 plugin_tcpconns="no"
4473 plugin_wireless="no"
4477 if test "x$ac_system" = "xLinux"
4479 plugin_battery="yes"
4480 plugin_conntrack="yes"
4481 plugin_contextswitch="yes"
4483 plugin_cpufreq="yes"
4485 plugin_entropy="yes"
4486 plugin_interface="yes"
4491 plugin_fscache="yes"
4492 plugin_processes="yes"
4493 plugin_protocols="yes"
4496 plugin_tcpconns="yes"
4497 plugin_thermal="yes"
4500 plugin_vserver="yes"
4501 plugin_wireless="yes"
4503 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4509 if test "x$ac_system" = "xOpenBSD"
4511 plugin_tcpconns="yes"
4515 if test "x$with_libiokit" = "xyes"
4517 plugin_battery="yes"
4522 if test "x$with_perfstat" = "xyes"
4528 plugin_interface="yes"
4532 if test "x$with_procinfo" = "xyes"
4534 plugin_processes="yes"
4538 if test "x$with_kstat" = "xyes"
4541 plugin_zfs_arc="yes"
4544 if test "x$with_devinfo$with_kstat" = "xyesyes"
4548 plugin_interface="yes"
4554 if test "x$with_libstatgrab" = "xyes"
4558 plugin_interface="yes"
4565 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4568 if test "x$have_strptime" = "xyes"
4574 if test "x$with_libopenipmipthread" = "xyes"
4579 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4581 plugin_curl_json="yes"
4584 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4586 plugin_curl_xml="yes"
4589 if test "x$have_processor_info" = "xyes"
4593 if test "x$have_sysctl" = "xyes"
4598 if test "x$ac_system" = "xDarwin"
4603 if test "x$have_sysctlbyname" = "xyes"
4605 plugin_contextswitch="yes"
4608 plugin_tcpconns="yes"
4611 # Df plugin: Check if we know how to determine mount points first.
4612 #if test "x$have_listmntent" = "xyes"; then
4615 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4619 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4623 #if test "x$have_getmntent" = "xseq"
4627 if test "x$c_cv_have_one_getmntent" = "xyes"
4632 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4633 if test "x$plugin_df" = "xyes"
4636 if test "x$have_statfs" = "xyes"
4640 if test "x$have_statvfs" = "xyes"
4646 if test "x$have_getifaddrs" = "xyes"
4648 plugin_interface="yes"
4651 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4653 plugin_libvirt="yes"
4656 if test "x$have_getloadavg" = "xyes"
4661 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4666 # Mac OS X memory interface
4667 if test "x$have_host_statistics" = "xyes"
4672 if test "x$have_termios_h" = "xyes"
4674 plugin_multimeter="yes"
4678 if test "x$have_thread_info" = "xyes"
4680 plugin_processes="yes"
4683 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4685 plugin_processes="yes"
4688 if test "x$with_kvm_getswapinfo" = "xyes"
4693 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4698 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4700 plugin_tcpconns="yes"
4703 if test "x$have_getutent" = "xyes"
4707 if test "x$have_getutxent" = "xyes"
4712 m4_divert_once([HELP_ENABLE], [
4715 AC_ARG_ENABLE([all-plugins],
4716 AC_HELP_STRING([--enable-all-plugins],
4717 [enable all plugins (auto by def)]),
4719 if test "x$enableval" = "xyes"
4721 enable_all_plugins="yes"
4722 else if test "x$enableval" = "xauto"
4724 enable_all_plugins="auto"
4726 enable_all_plugins="no"
4729 [enable_all_plugins="auto"])
4731 m4_divert_once([HELP_ENABLE], [])
4733 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4734 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4735 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4736 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4737 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4738 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4739 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4740 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4741 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4742 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4743 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4744 AC_PLUGIN([csv], [yes], [CSV output plugin])
4745 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4746 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4747 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4748 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4749 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4750 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4751 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4752 AC_PLUGIN([email], [yes], [EMail statistics])
4753 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4754 AC_PLUGIN([exec], [yes], [Execution of external programs])
4755 AC_PLUGIN([filecount], [yes], [Count files in directories])
4756 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4757 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4758 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4759 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4760 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4761 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4762 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4763 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4764 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4765 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4766 AC_PLUGIN([load], [$plugin_load], [System load])
4767 AC_PLUGIN([logfile], [yes], [File logging plugin])
4768 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4769 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4770 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4771 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4772 AC_PLUGIN([match_regex], [yes], [The regex match])
4773 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4774 AC_PLUGIN([match_value], [yes], [The value match])
4775 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4776 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4777 AC_PLUGIN([memcached], [yes], [memcached statistics])
4778 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4779 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4780 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4781 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4782 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4783 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4784 AC_PLUGIN([network], [yes], [Network communication plugin])
4785 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4786 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4787 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4788 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4789 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4790 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4791 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4792 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4793 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4794 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4795 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4796 # FIXME: Check for libevent, too.
4797 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4798 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4799 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4800 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4801 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4802 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4803 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4804 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4805 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4806 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4807 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4808 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4809 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4810 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4811 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4812 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4813 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4814 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4815 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4816 AC_PLUGIN([target_notification], [yes], [The notification target])
4817 AC_PLUGIN([target_replace], [yes], [The replace target])
4818 AC_PLUGIN([target_scale],[yes], [The scale target])
4819 AC_PLUGIN([target_set], [yes], [The set target])
4820 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4821 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4822 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4823 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4824 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4825 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4826 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4827 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4828 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4829 AC_PLUGIN([users], [$plugin_users], [User statistics])
4830 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4831 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4832 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4833 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4834 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4835 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4836 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4837 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4838 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4840 dnl Default configuration file
4841 # Load either syslog or logfile
4842 LOAD_PLUGIN_SYSLOG=""
4843 LOAD_PLUGIN_LOGFILE=""
4845 AC_MSG_CHECKING([which default log plugin to load])
4846 default_log_plugin="none"
4847 if test "x$enable_syslog" = "xyes"
4849 default_log_plugin="syslog"
4851 LOAD_PLUGIN_SYSLOG="##"
4854 if test "x$enable_logfile" = "xyes"
4856 if test "x$default_log_plugin" = "xnone"
4858 default_log_plugin="logfile"
4860 LOAD_PLUGIN_LOGFILE="#"
4863 LOAD_PLUGIN_LOGFILE="##"
4865 AC_MSG_RESULT([$default_log_plugin])
4867 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4868 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4870 DEFAULT_LOG_LEVEL="info"
4871 if test "x$enable_debug" = "xyes"
4873 DEFAULT_LOG_LEVEL="debug"
4875 AC_SUBST(DEFAULT_LOG_LEVEL)
4877 # Load only one of rrdtool, network, csv in the default config.
4878 LOAD_PLUGIN_RRDTOOL=""
4879 LOAD_PLUGIN_NETWORK=""
4882 AC_MSG_CHECKING([which default write plugin to load])
4883 default_write_plugin="none"
4884 if test "x$enable_rrdtool" = "xyes"
4886 default_write_plugin="rrdtool"
4888 LOAD_PLUGIN_RRDTOOL="##"
4891 if test "x$enable_network" = "xyes"
4893 if test "x$default_write_plugin" = "xnone"
4895 default_write_plugin="network"
4897 LOAD_PLUGIN_NETWORK="#"
4900 LOAD_PLUGIN_NETWORK="##"
4903 if test "x$enable_csv" = "xyes"
4905 if test "x$default_write_plugin" = "xnone"
4907 default_write_plugin="csv"
4912 LOAD_PLUGIN_CSV="##"
4914 AC_MSG_RESULT([$default_write_plugin])
4916 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4917 AC_SUBST(LOAD_PLUGIN_NETWORK)
4918 AC_SUBST(LOAD_PLUGIN_CSV)
4921 if test "x$ac_system" = "xLinux" \
4922 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
4924 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4927 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
4929 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
4933 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4935 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4937 PERL_BINDINGS_OPTIONS="$withval"
4938 with_perl_bindings="yes"
4940 PERL_BINDINGS_OPTIONS=""
4941 with_perl_bindings="$withval"
4945 PERL_BINDINGS_OPTIONS=""
4946 if test -n "$perl_interpreter"
4948 with_perl_bindings="yes"
4950 with_perl_bindings="no (no perl interpreter found)"
4953 if test "x$with_perl_bindings" = "xyes"
4955 PERL_BINDINGS="perl"
4959 AC_SUBST(PERL_BINDINGS)
4960 AC_SUBST(PERL_BINDINGS_OPTIONS)
4962 dnl libcollectdclient
4963 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4964 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4965 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4967 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4969 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4971 AC_SUBST(LCC_VERSION_MAJOR)
4972 AC_SUBST(LCC_VERSION_MINOR)
4973 AC_SUBST(LCC_VERSION_PATCH)
4974 AC_SUBST(LCC_VERSION_EXTRA)
4975 AC_SUBST(LCC_VERSION_STRING)
4977 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4979 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
4981 if test "x$with_librrd" = "xyes" \
4982 && test "x$librrd_threadsafe" != "xyes"
4984 with_librrd="yes (warning: librrd is not thread-safe)"
4987 if test "x$with_libperl" = "xyes"
4989 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4991 enable_perl="no (needs libperl)"
4994 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4996 enable_perl="no (libperl doesn't support ithreads)"
4999 if test "x$with_perl_bindings" = "xyes" \
5000 && test "x$PERL_BINDINGS_OPTIONS" != "x"
5002 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5009 libcurl . . . . . . . $with_libcurl
5010 libdbi . . . . . . . $with_libdbi
5011 libcredis . . . . . . $with_libcredis
5012 libesmtp . . . . . . $with_libesmtp
5013 libganglia . . . . . $with_libganglia
5014 libgcrypt . . . . . . $with_libgcrypt
5015 libiokit . . . . . . $with_libiokit
5016 libiptc . . . . . . . $with_libiptc
5017 libjvm . . . . . . . $with_java
5018 libkstat . . . . . . $with_kstat
5019 libkvm . . . . . . . $with_libkvm
5020 libmemcached . . . . $with_libmemcached
5021 libmodbus . . . . . . $with_libmodbus
5022 libmysql . . . . . . $with_libmysql
5023 libnetapp . . . . . . $with_libnetapp
5024 libnetlink . . . . . $with_libnetlink
5025 libnetsnmp . . . . . $with_libnetsnmp
5026 libnotify . . . . . . $with_libnotify
5027 liboconfig . . . . . $with_liboconfig
5028 libopenipmi . . . . . $with_libopenipmipthread
5029 liboping . . . . . . $with_liboping
5030 libpcap . . . . . . . $with_libpcap
5031 libperfstat . . . . . $with_perfstat
5032 libperl . . . . . . . $with_libperl
5033 libpq . . . . . . . . $with_libpq
5034 libpthread . . . . . $with_libpthread
5035 librabbitmq . . . . . $with_librabbitmq
5036 librouteros . . . . . $with_librouteros
5037 librrd . . . . . . . $with_librrd
5038 libsensors . . . . . $with_libsensors
5039 libstatgrab . . . . . $with_libstatgrab
5040 libtokyotyrant . . . $with_libtokyotyrant
5041 libupsclient . . . . $with_libupsclient
5042 libvarnish . . . . . $with_libvarnish
5043 libvirt . . . . . . . $with_libvirt
5044 libxml2 . . . . . . . $with_libxml2
5045 libxmms . . . . . . . $with_libxmms
5046 libyajl . . . . . . . $with_libyajl
5047 libevent . . . . . . $with_libevent
5048 protobuf-c . . . . . $have_protoc_c
5049 oracle . . . . . . . $with_oracle
5050 python . . . . . . . $with_python
5053 daemon mode . . . . . $enable_daemon
5054 debug . . . . . . . . $enable_debug
5057 perl . . . . . . . . $with_perl_bindings
5060 amqp . . . . . . . $enable_amqp
5061 apache . . . . . . . $enable_apache
5062 apcups . . . . . . . $enable_apcups
5063 apple_sensors . . . . $enable_apple_sensors
5064 ascent . . . . . . . $enable_ascent
5065 battery . . . . . . . $enable_battery
5066 bind . . . . . . . . $enable_bind
5067 conntrack . . . . . . $enable_conntrack
5068 contextswitch . . . . $enable_contextswitch
5069 cpu . . . . . . . . . $enable_cpu
5070 cpufreq . . . . . . . $enable_cpufreq
5071 csv . . . . . . . . . $enable_csv
5072 curl . . . . . . . . $enable_curl
5073 curl_json . . . . . . $enable_curl_json
5074 curl_xml . . . . . . $enable_curl_xml
5075 dbi . . . . . . . . . $enable_dbi
5076 df . . . . . . . . . $enable_df
5077 disk . . . . . . . . $enable_disk
5078 dns . . . . . . . . . $enable_dns
5079 email . . . . . . . . $enable_email
5080 entropy . . . . . . . $enable_entropy
5081 exec . . . . . . . . $enable_exec
5082 filecount . . . . . . $enable_filecount
5083 fscache . . . . . . . $enable_fscache
5084 gmond . . . . . . . . $enable_gmond
5085 hddtemp . . . . . . . $enable_hddtemp
5086 interface . . . . . . $enable_interface
5087 ipmi . . . . . . . . $enable_ipmi
5088 iptables . . . . . . $enable_iptables
5089 ipvs . . . . . . . . $enable_ipvs
5090 irq . . . . . . . . . $enable_irq
5091 java . . . . . . . . $enable_java
5092 libvirt . . . . . . . $enable_libvirt
5093 load . . . . . . . . $enable_load
5094 logfile . . . . . . . $enable_logfile
5095 lpar... . . . . . . . $enable_lpar
5096 madwifi . . . . . . . $enable_madwifi
5097 match_empty_counter . $enable_match_empty_counter
5098 match_hashed . . . . $enable_match_hashed
5099 match_regex . . . . . $enable_match_regex
5100 match_timediff . . . $enable_match_timediff
5101 match_value . . . . . $enable_match_value
5102 mbmon . . . . . . . . $enable_mbmon
5103 memcachec . . . . . . $enable_memcachec
5104 memcached . . . . . . $enable_memcached
5105 memory . . . . . . . $enable_memory
5106 modbus . . . . . . . $enable_modbus
5107 multimeter . . . . . $enable_multimeter
5108 mysql . . . . . . . . $enable_mysql
5109 netapp . . . . . . . $enable_netapp
5110 netlink . . . . . . . $enable_netlink
5111 network . . . . . . . $enable_network
5112 nfs . . . . . . . . . $enable_nfs
5113 nginx . . . . . . . . $enable_nginx
5114 notify_desktop . . . $enable_notify_desktop
5115 notify_email . . . . $enable_notify_email
5116 ntpd . . . . . . . . $enable_ntpd
5117 nut . . . . . . . . . $enable_nut
5118 olsrd . . . . . . . . $enable_olsrd
5119 onewire . . . . . . . $enable_onewire
5120 openvpn . . . . . . . $enable_openvpn
5121 oracle . . . . . . . $enable_oracle
5122 perl . . . . . . . . $enable_perl
5123 pinba . . . . . . . . $enable_pinba
5124 ping . . . . . . . . $enable_ping
5125 postgresql . . . . . $enable_postgresql
5126 powerdns . . . . . . $enable_powerdns
5127 processes . . . . . . $enable_processes
5128 protocols . . . . . . $enable_protocols
5129 python . . . . . . . $enable_python
5130 redis . . . . . . . . $enable_redis
5131 routeros . . . . . . $enable_routeros
5132 rrdcached . . . . . . $enable_rrdcached
5133 rrdtool . . . . . . . $enable_rrdtool
5134 sensors . . . . . . . $enable_sensors
5135 serial . . . . . . . $enable_serial
5136 snmp . . . . . . . . $enable_snmp
5137 swap . . . . . . . . $enable_swap
5138 syslog . . . . . . . $enable_syslog
5139 table . . . . . . . . $enable_table
5140 tail . . . . . . . . $enable_tail
5141 tape . . . . . . . . $enable_tape
5142 target_notification . $enable_target_notification
5143 target_replace . . . $enable_target_replace
5144 target_scale . . . . $enable_target_scale
5145 target_set . . . . . $enable_target_set
5146 target_v5upgrade . . $enable_target_v5upgrade
5147 tcpconns . . . . . . $enable_tcpconns
5148 teamspeak2 . . . . . $enable_teamspeak2
5149 ted . . . . . . . . . $enable_ted
5150 thermal . . . . . . . $enable_thermal
5151 threshold . . . . . . $enable_threshold
5152 tokyotyrant . . . . . $enable_tokyotyrant
5153 unixsock . . . . . . $enable_unixsock
5154 uptime . . . . . . . $enable_uptime
5155 users . . . . . . . . $enable_users
5156 uuid . . . . . . . . $enable_uuid
5157 varnish . . . . . . . $enable_varnish
5158 vmem . . . . . . . . $enable_vmem
5159 vserver . . . . . . . $enable_vserver
5160 wireless . . . . . . $enable_wireless
5161 write_http . . . . . $enable_write_http
5162 write_redis . . . . . $enable_write_redis
5163 xmms . . . . . . . . $enable_xmms
5164 zfs_arc . . . . . . . $enable_zfs_arc
5168 if test "x$dependency_error" = "xyes"; then
5169 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5172 if test "x$dependency_warning" = "xyes"; then
5173 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5176 # vim: set fdm=marker :