1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 m4_ifdef([LT_PACKAGE_VERSION],
10 LT_CONFIG_LTDL_DIR([libltdl])
12 LTDL_INIT([convenience])
13 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
18 AC_LIBLTDL_CONVENIENCE
22 AC_CONFIG_SUBDIRS(libltdl)
23 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
27 AM_INIT_AUTOMAKE(dist-bzip2)
30 AC_PREFIX_DEFAULT("/opt/collectd")
35 # Checks for programs.
43 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
51 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
52 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
54 AC_MSG_CHECKING([for kernel type ($host_os)])
57 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
61 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
71 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
77 AC_MSG_RESULT([$ac_system])
79 if test "x$ac_system" = "xLinux"
81 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
82 if test -z "$KERNEL_DIR"
84 KERNEL_DIR="/lib/modules/`uname -r`/source"
87 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
88 AC_SUBST(KERNEL_CFLAGS)
91 if test "x$ac_system" = "xSolaris"
93 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
95 if test "x$ac_system" = "xAIX"
97 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
100 # Where to install .pc files.
101 pkgconfigdir="${libdir}/pkgconfig"
102 AC_SUBST(pkgconfigdir)
104 # Check for standards compliance mode
105 AC_ARG_ENABLE(standards,
106 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
107 [enable_standards="$enableval"],
108 [enable_standards="no"])
109 if test "x$enable_standards" = "xyes"
111 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
112 AC_DEFINE(_POSIX_C_SOURCE, 200809L, [Define to enforce POSIX.1-2008 compliance.])
113 AC_DEFINE(_XOPEN_SOURCE, 700, [Define to enforce X/Open 7 (XSI) compliance.])
114 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
115 if test "x$GCC" = "xyes"
117 CFLAGS="$CFLAGS -std=c99"
120 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
123 # Checks for header files.
130 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
133 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
138 # include <sys/types.h>
141 AC_CHECK_HEADERS(netinet/in.h, [], [],
146 # include <sys/types.h>
148 #if HAVE_NETINET_IN_SYSTM_H
149 # include <netinet/in_systm.h>
152 AC_CHECK_HEADERS(netinet/ip.h, [], [],
157 # include <sys/types.h>
159 #if HAVE_NETINET_IN_SYSTM_H
160 # include <netinet/in_systm.h>
162 #if HAVE_NETINET_IN_H
163 # include <netinet/in.h>
166 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
171 # include <sys/types.h>
173 #if HAVE_NETINET_IN_SYSTM_H
174 # include <netinet/in_systm.h>
176 #if HAVE_NETINET_IN_H
177 # include <netinet/in.h>
179 #if HAVE_NETINET_IP_H
180 # include <netinet/ip.h>
183 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
188 # include <sys/types.h>
190 #if HAVE_NETINET_IN_SYSTM_H
191 # include <netinet/in_systm.h>
193 #if HAVE_NETINET_IN_H
194 # include <netinet/in.h>
196 #if HAVE_NETINET_IP_H
197 # include <netinet/ip.h>
200 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
205 # include <sys/types.h>
207 #if HAVE_NETINET_IN_SYSTM_H
208 # include <netinet/in_systm.h>
210 #if HAVE_NETINET_IN_H
211 # include <netinet/in.h>
214 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
219 # include <sys/types.h>
221 #if HAVE_NETINET_IN_SYSTM_H
222 # include <netinet/in_systm.h>
224 #if HAVE_NETINET_IN_H
225 # include <netinet/in.h>
227 #if HAVE_NETINET_IP6_H
228 # include <netinet/ip6.h>
231 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
236 # include <sys/types.h>
238 #if HAVE_NETINET_IN_SYSTM_H
239 # include <netinet/in_systm.h>
241 #if HAVE_NETINET_IN_H
242 # include <netinet/in.h>
244 #if HAVE_NETINET_IP_H
245 # include <netinet/ip.h>
248 AC_CHECK_HEADERS(netinet/udp.h, [], [],
253 # include <sys/types.h>
255 #if HAVE_NETINET_IN_SYSTM_H
256 # include <netinet/in_systm.h>
258 #if HAVE_NETINET_IN_H
259 # include <netinet/in.h>
261 #if HAVE_NETINET_IP_H
262 # include <netinet/ip.h>
267 AC_CHECK_HEADERS(sys/dkstat.h)
268 if test "x$ac_system" = "xDarwin"
270 AC_CHECK_HEADERS(mach/mach_init.h mach/host_priv.h mach/mach_error.h mach/mach_host.h mach/mach_port.h mach/mach_types.h mach/message.h mach/processor_set.h mach/processor.h mach/processor_info.h mach/task.h mach/thread_act.h mach/vm_region.h mach/vm_map.h mach/vm_prot.h mach/vm_statistics.h mach/kern_return.h)
271 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
273 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
276 # include <sys/types.h>
279 # include <sys/param.h>
283 AC_MSG_CHECKING([for sysctl kern.cp_times])
284 if test -x /sbin/sysctl
286 /sbin/sysctl kern.cp_times 2>/dev/null
290 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
291 [Define if sysctl supports kern.cp_times])
300 AC_CHECK_HEADERS(linux/major.h libgen.h)
302 # For md module (Linux only)
303 if test "x$ac_system" = "xLinux"
305 AC_CHECK_HEADERS(linux/raid/md_u.h,
306 [have_linux_raid_md_u_h="yes"],
307 [have_linux_raid_md_u_h="no"],
309 #include <sys/ioctl.h>
310 #include <linux/major.h>
311 #include <linux/types.h>
314 have_linux_raid_md_u_h="no"
317 # For the battery plugin
318 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
320 #if HAVE_IOKIT_IOKITLIB_H
321 # include <IOKit/IOKitLib.h>
323 #if HAVE_IOKIT_IOTYPES_H
324 # include <IOKit/IOTypes.h>
328 # For the swap module
329 have_linux_wireless_h="no"
330 if test "x$ac_system" = "xLinux"
332 AC_CHECK_HEADERS(linux/wireless.h,
333 [have_linux_wireless_h="yes"],
334 [have_linux_wireless_h="no"],
337 #include <sys/ioctl.h>
338 #include <sys/socket.h>
342 # For the swap module
343 have_sys_swap_h="yes"
344 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
346 #undef _FILE_OFFSET_BITS
347 #undef _LARGEFILE64_SOURCE
349 # include <sys/types.h>
352 # include <sys/param.h>
356 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
359 if test "x$GCC" = "xyes"
361 hint_64="CFLAGS='-m64'"
363 hint_64="CFLAGS='-xarch=v9'"
365 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
369 # For the processes plugin
371 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
373 # For interface plugin
374 AC_CHECK_HEADERS(ifaddrs.h)
375 AC_CHECK_HEADERS(net/if.h, [], [],
378 # include <sys/types.h>
380 #if HAVE_SYS_SOCKET_H
381 # include <sys/socket.h>
384 AC_CHECK_HEADERS(linux/if.h, [], [],
387 # include <sys/types.h>
389 #if HAVE_SYS_SOCKET_H
390 # include <sys/socket.h>
393 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
396 # include <sys/types.h>
398 #if HAVE_SYS_SOCKET_H
399 # include <sys/socket.h>
402 # include <linux/if.h>
407 have_linux_ip_vs_h="no"
408 have_net_ip_vs_h="no"
410 ip_vs_h_needs_kernel_cflags="no"
411 if test "x$ac_system" = "xLinux"
413 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
414 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
415 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
417 if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
419 SAVE_CFLAGS="$CFLAGS"
420 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
422 AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
424 AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
425 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
426 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
428 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
430 ip_vs_h_needs_kernel_cflags="yes"
433 CFLAGS="$SAVE_CFLAGS"
436 AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
439 AC_CHECK_HEADERS(sys/ucred.h, [], [],
442 # include <sys/types.h>
445 # include <sys/param.h>
449 # For mount interface
450 AC_CHECK_HEADERS(sys/mount.h, [], [],
453 # include <sys/types.h>
456 # include <sys/param.h>
460 # For the email plugin
461 AC_CHECK_HEADERS(linux/un.h, [], [],
463 #if HAVE_SYS_SOCKET_H
464 # include <sys/socket.h>
468 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)
471 AC_CHECK_HEADERS(arpa/nameser.h)
472 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
474 #if HAVE_ARPA_NAMESER_H
475 # include <arpa/nameser.h>
479 AC_CHECK_HEADERS(net/if_arp.h, [], [],
480 [#if HAVE_SYS_SOCKET_H
481 # include <sys/socket.h>
484 AC_CHECK_HEADERS(net/ppp_defs.h)
485 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
486 [#if HAVE_NET_PPP_DEFS_H
487 # include <net/ppp_defs.h>
490 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
495 # include <sys/types.h>
497 #if HAVE_SYS_SOCKET_H
498 # include <sys/socket.h>
503 #if HAVE_NETINET_IN_H
504 # include <netinet/in.h>
508 # For the multimeter plugin
510 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
513 # Checks for typedefs, structures, and compiler characteristics.
522 # Checks for library functions.
524 AC_PROG_GCC_TRADITIONAL
525 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
529 SAVE_CFLAGS="$CFLAGS"
530 # Emulate behavior of src/Makefile.am
531 if test "x$GCC" = "xyes"
533 CFLAGS="$CFLAGS -Wall -Werror"
536 AC_CACHE_CHECK([for strtok_r],
537 [c_cv_have_strtok_r_default],
546 char buffer[] = "foo,bar,baz";
553 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
556 printf ("token = %s;\n", token);
559 [c_cv_have_strtok_r_default="yes"],
560 [c_cv_have_strtok_r_default="no"]
564 if test "x$c_cv_have_strtok_r_default" = "xno"
566 CFLAGS="$CFLAGS -D_REENTRANT=1"
568 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
569 [c_cv_have_strtok_r_reentrant],
578 char buffer[] = "foo,bar,baz";
585 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
588 printf ("token = %s;\n", token);
591 [c_cv_have_strtok_r_reentrant="yes"],
592 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
597 CFLAGS="$SAVE_CFLAGS"
598 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
600 CFLAGS="$CFLAGS -D_REENTRANT=1"
603 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
605 socket_needs_socket="no"
606 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
607 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
609 clock_gettime_needs_rt="no"
610 clock_gettime_needs_posix4="no"
611 have_clock_gettime="no"
612 AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"])
613 if test "x$have_clock_gettime" = "xno"
615 AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes"
616 have_clock_gettime="yes"])
618 if test "x$have_clock_gettime" = "xno"
620 AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes"
621 have_clock_gettime="yes"])
623 if test "x$have_clock_gettime" = "xyes"
625 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
627 AC_MSG_WARN(cannot find clock_gettime)
630 nanosleep_needs_rt="no"
631 nanosleep_needs_posix4="no"
632 AC_CHECK_FUNCS(nanosleep,
634 AC_CHECK_LIB(rt, nanosleep,
635 [nanosleep_needs_rt="yes"],
636 AC_CHECK_LIB(posix4, nanosleep,
637 [nanosleep_needs_posix4="yes"],
638 AC_MSG_ERROR(cannot find nanosleep))))
640 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes")
641 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes")
643 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
644 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
645 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
646 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
647 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
648 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
649 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
650 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
651 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
652 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
653 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
654 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
656 # Check for strptime {{{
657 if test "x$GCC" = "xyes"
659 SAVE_CFLAGS="$CFLAGS"
660 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
663 AC_CHECK_FUNCS(strptime, [have_strptime="yes"], [have_strptime="no"])
664 if test "x$have_strptime" = "xyes"
666 AC_CACHE_CHECK([whether strptime is exported by default],
667 [c_cv_have_strptime_default],
676 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
678 [c_cv_have_strptime_default="yes"],
679 [c_cv_have_strptime_default="no"]))
681 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
683 AC_CACHE_CHECK([whether strptime needs standards mode],
684 [c_cv_have_strptime_standards],
688 #ifndef _ISOC99_SOURCE
689 # define _ISOC99_SOURCE 1
691 #ifndef _POSIX_C_SOURCE
692 # define _POSIX_C_SOURCE 200112L
694 #ifndef _XOPEN_SOURCE
695 # define _XOPEN_SOURCE 500
702 (void) strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
704 [c_cv_have_strptime_standards="yes"],
705 [c_cv_have_strptime_standards="no"]))
707 if test "x$c_cv_have_strptime_standards" = "xyes"
709 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], 1, [Set to true if strptime is only exported in X/Open mode (GNU libc).])
715 if test "x$GCC" = "xyes"
717 CFLAGS="$SAVE_CFLAGS"
720 # }}} Check for strptime
722 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
723 if test "x$have_swapctl" = "xyes"; then
724 AC_CACHE_CHECK([whether swapctl takes two arguments],
725 [c_cv_have_swapctl_two_args],
727 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
728 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
729 # undef _FILE_OFFSET_BITS
730 # undef _LARGEFILE64_SOURCE
732 #include <sys/stat.h>
733 #include <sys/swap.h>]],
735 int num = swapctl(0, NULL);
738 [c_cv_have_swapctl_two_args="yes"],
739 [c_cv_have_swapctl_two_args="no"]
742 AC_CACHE_CHECK([whether swapctl takes three arguments],
743 [c_cv_have_swapctl_three_args],
745 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
746 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
747 # undef _FILE_OFFSET_BITS
748 # undef _LARGEFILE64_SOURCE
750 #include <sys/stat.h>
751 #include <sys/swap.h>]],
753 int num = swapctl(0, NULL,0);
756 [c_cv_have_swapctl_three_args="yes"],
757 [c_cv_have_swapctl_three_args="no"]
761 # Check for different versions of `swapctl' here..
762 if test "x$have_swapctl" = "xyes"; then
763 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
764 AC_DEFINE(HAVE_SWAPCTL_TWO_ARGS, 1,
765 [Define if the function swapctl exists and takes two arguments.])
767 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
768 AC_DEFINE(HAVE_SWAPCTL_THREE_ARGS, 1,
769 [Define if the function swapctl exists and takes three arguments.])
774 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
776 if test "x$withval" = "xno"; then
778 else if test "x$withval" = "xyes"; then
785 if test "x$nan_type" = "xnone"; then
786 AC_CACHE_CHECK([whether NAN is defined by default],
787 [c_cv_have_nan_default],
793 static double foo = NAN;
801 [c_cv_have_nan_default="yes"],
802 [c_cv_have_nan_default="no"]
805 if test "x$c_cv_have_nan_default" = "xyes"
810 if test "x$nan_type" = "xnone"; then
811 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
812 [c_cv_have_nan_isoc],
817 #define __USE_ISOC99 1
819 static double foo = NAN;
827 [c_cv_have_nan_isoc="yes"],
828 [c_cv_have_nan_isoc="no"]
831 if test "x$c_cv_have_nan_isoc" = "xyes"
836 if test "x$nan_type" = "xnone"; then
837 SAVE_LDFLAGS=$LDFLAGS
838 LDFLAGS="$LDFLAGS -lm"
839 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
840 [c_cv_have_nan_zero],
849 #define NAN (0.0 / 0.0)
851 # define isnan(f) ((f) != (f))
853 static double foo = NAN;
861 [c_cv_have_nan_zero="yes"],
862 [c_cv_have_nan_zero="no"]
865 LDFLAGS=$SAVE_LDFLAGS
866 if test "x$c_cv_have_nan_zero" = "xyes"
872 if test "x$nan_type" = "xdefault"; then
873 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
874 [Define if NAN is defined by default and can initialize static variables.])
875 else if test "x$nan_type" = "xisoc99"; then
876 AC_DEFINE(NAN_STATIC_ISOC, 1,
877 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
878 else if test "x$nan_type" = "xzero"; then
879 AC_DEFINE(NAN_ZERO_ZERO, 1,
880 [Define if NAN can be defined as (0.0 / 0.0)])
882 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
885 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
887 if test "x$withval" = "xnothing"; then
888 fp_layout_type="nothing"
889 else if test "x$withval" = "xendianflip"; then
890 fp_layout_type="endianflip"
891 else if test "x$withval" = "xintswap"; then
892 fp_layout_type="intswap"
894 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
897 [fp_layout_type="unknown"])
899 if test "x$fp_layout_type" = "xunknown"; then
900 AC_CACHE_CHECK([if doubles are stored in x86 representation],
901 [c_cv_fp_layout_need_nothing],
912 # include <inttypes.h>
915 # include <stdbool.h>
925 memcpy ((void *) &i0, (void *) &d, 8);
928 memcpy ((void *) c, (void *) &i1, 8);
930 if ((c[0] == 0x2f) && (c[1] == 0x25)
931 && (c[2] == 0xc0) && (c[3] == 0xc7)
932 && (c[4] == 0x43) && (c[5] == 0x2b)
933 && (c[6] == 0x1f) && (c[7] == 0x5b))
938 [c_cv_fp_layout_need_nothing="yes"],
939 [c_cv_fp_layout_need_nothing="no"]
942 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
943 fp_layout_type="nothing"
946 if test "x$fp_layout_type" = "xunknown"; then
947 AC_CACHE_CHECK([if endianflip converts to x86 representation],
948 [c_cv_fp_layout_need_endianflip],
959 # include <inttypes.h>
962 # include <stdbool.h>
964 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
965 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
966 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
967 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
968 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
969 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
970 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
971 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
980 memcpy ((void *) &i0, (void *) &d, 8);
982 i1 = endianflip (i0);
983 memcpy ((void *) c, (void *) &i1, 8);
985 if ((c[0] == 0x2f) && (c[1] == 0x25)
986 && (c[2] == 0xc0) && (c[3] == 0xc7)
987 && (c[4] == 0x43) && (c[5] == 0x2b)
988 && (c[6] == 0x1f) && (c[7] == 0x5b))
993 [c_cv_fp_layout_need_endianflip="yes"],
994 [c_cv_fp_layout_need_endianflip="no"]
997 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
998 fp_layout_type="endianflip"
1001 if test "x$fp_layout_type" = "xunknown"; then
1002 AC_CACHE_CHECK([if intswap converts to x86 representation],
1003 [c_cv_fp_layout_need_intswap],
1011 # include <stdint.h>
1014 # include <inttypes.h>
1017 # include <stdbool.h>
1019 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1020 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1029 memcpy ((void *) &i0, (void *) &d, 8);
1032 memcpy ((void *) c, (void *) &i1, 8);
1034 if ((c[0] == 0x2f) && (c[1] == 0x25)
1035 && (c[2] == 0xc0) && (c[3] == 0xc7)
1036 && (c[4] == 0x43) && (c[5] == 0x2b)
1037 && (c[6] == 0x1f) && (c[7] == 0x5b))
1042 [c_cv_fp_layout_need_intswap="yes"],
1043 [c_cv_fp_layout_need_intswap="no"]
1046 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1047 fp_layout_type="intswap"
1051 if test "x$fp_layout_type" = "xnothing"; then
1052 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
1053 [Define if doubles are stored in x86 representation.])
1054 else if test "x$fp_layout_type" = "xendianflip"; then
1055 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
1056 [Define if endianflip is needed to convert to x86 representation.])
1057 else if test "x$fp_layout_type" = "xintswap"; then
1058 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
1059 [Define if intswap is needed to convert to x86 representation.])
1061 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1065 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
1066 have_getvfsstat="no"
1067 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
1068 have_listmntent="no"
1069 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
1072 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
1073 if test "x$have_getmntent" = "xno"; then
1074 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
1076 if test "x$have_getmntent" = "xno"; then
1077 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
1079 if test "x$have_getmntent" = "xno"; then
1080 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
1083 if test "x$have_getmntent" = "xc"; then
1084 AC_CACHE_CHECK([whether getmntent takes one argument],
1085 [c_cv_have_one_getmntent],
1087 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1088 #include "$srcdir/src/utils_mount.h"]],
1092 fh = setmntent ("/etc/mtab", "r");
1093 me = getmntent (fh);
1096 [c_cv_have_one_getmntent="yes"],
1097 [c_cv_have_one_getmntent="no"]
1100 AC_CACHE_CHECK([whether getmntent takes two arguments],
1101 [c_cv_have_two_getmntent],
1103 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
1104 #include "$srcdir/src/utils_mount.h"]],
1109 fh = fopen ("/etc/mnttab", "r");
1110 status = getmntent (fh, &mt);
1113 [c_cv_have_two_getmntent="yes"],
1114 [c_cv_have_two_getmntent="no"]
1119 # Check for different versions of `getmntent' here..
1121 if test "x$have_getmntent" = "xc"; then
1122 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1123 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
1124 [Define if the function getmntent exists and takes one argument.])
1126 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1127 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
1128 [Define if the function getmntent exists and takes two arguments.])
1131 if test "x$have_getmntent" = "xsun"; then
1132 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
1133 [Define if the function getmntent exists. It's the version from libsun.])
1135 if test "x$have_getmntent" = "xseq"; then
1136 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
1137 [Define if the function getmntent exists. It's the version from libseq.])
1139 if test "x$have_getmntent" = "xgen"; then
1140 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
1141 [Define if the function getmntent exists. It's the version from libgen.])
1145 AC_MSG_CHECKING([if have htonll defined])
1150 #include <sys/types.h>
1151 #include <netinet/in.h>
1153 # include <inttypes.h>
1160 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
1163 AC_MSG_RESULT([$have_htonll])
1165 # Check for structures
1166 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1167 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
1170 #include <sys/types.h>
1171 #include <sys/socket.h>
1174 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1175 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1178 #include <sys/types.h>
1179 #include <sys/socket.h>
1180 #include <linux/if.h>
1181 #include <linux/netdevice.h>
1184 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1187 #include <netinet/in.h>
1191 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1193 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1194 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1195 have_struct_kinfo_proc_freebsd="yes"
1198 have_struct_kinfo_proc_freebsd="no"
1202 #include <sys/param.h>
1203 #include <sys/sysctl.h>
1204 #include <sys/user.h>
1207 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1209 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1210 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1211 have_struct_kinfo_proc_openbsd="yes"
1214 have_struct_kinfo_proc_openbsd="no"
1217 #include <sys/param.h>
1218 #include <sys/sysctl.h>
1222 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1223 [#define _BSD_SOURCE
1225 # include <stdint.h>
1227 #if HAVE_SYS_TYPES_H
1228 # include <sys/types.h>
1230 #if HAVE_NETINET_IN_SYSTM_H
1231 # include <netinet/in_systm.h>
1233 #if HAVE_NETINET_IN_H
1234 # include <netinet/in.h>
1236 #if HAVE_NETINET_IP_H
1237 # include <netinet/ip.h>
1239 #if HAVE_NETINET_UDP_H
1240 # include <netinet/udp.h>
1243 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1244 [#define _BSD_SOURCE
1246 # include <stdint.h>
1248 #if HAVE_SYS_TYPES_H
1249 # include <sys/types.h>
1251 #if HAVE_NETINET_IN_SYSTM_H
1252 # include <netinet/in_systm.h>
1254 #if HAVE_NETINET_IN_H
1255 # include <netinet/in.h>
1257 #if HAVE_NETINET_IP_H
1258 # include <netinet/ip.h>
1260 #if HAVE_NETINET_UDP_H
1261 # include <netinet/udp.h>
1265 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1275 # Checks for libraries begin here
1278 with_libresolv="yes"
1279 AC_CHECK_LIB(resolv, res_search,
1281 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1283 [with_libresolv="no"])
1284 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1286 dnl Check for HAL (hardware abstraction library)
1288 AC_CHECK_LIB(hal,libhal_device_property_exists,
1289 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1291 if test "x$with_libhal" = "xyes"; then
1292 if test "x$PKG_CONFIG" != "x"; then
1293 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1294 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1295 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1296 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1300 m4_divert_once([HELP_WITH], [
1301 collectd additional packages:])
1303 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1305 if test "x$ac_system" = "xAIX"
1310 with_perfstat="no (AIX only)"
1311 with_procinfo="no (AIX only)"
1314 if test "x$with_perfstat" = "xyes"
1316 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1317 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1319 if test "x$with_perfstat" = "xyes"
1321 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1322 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1323 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
1324 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
1326 AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
1329 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1331 # Processes plugin under AIX.
1332 if test "x$with_procinfo" = "xyes"
1334 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1336 if test "x$with_procinfo" = "xyes"
1338 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1341 if test "x$ac_system" = "xSolaris"
1346 with_kstat="no (Solaris only)"
1347 with_devinfo="no (Solaris only)"
1350 if test "x$with_kstat" = "xyes"
1352 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1354 if test "x$with_kstat" = "xyes"
1356 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1357 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1359 if test "x$with_kstat" = "xyes"
1361 AC_DEFINE(HAVE_LIBKSTAT, 1,
1362 [Define to 1 if you have the 'kstat' library (-lkstat)])
1364 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1365 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1368 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1375 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1378 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1379 if test "x$with_kvm_getprocs" = "xyes"
1381 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1382 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1385 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1387 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1388 if test "x$with_kvm_getswapinfo" = "xyes"
1390 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1391 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1394 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1396 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1397 if test "x$with_kvm_nlist" = "xyes"
1399 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1400 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1403 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1405 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1406 if test "x$with_kvm_openfiles" = "xyes"
1408 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1409 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1412 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1414 # --with-libcredis {{{
1415 AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
1417 if test "x$withval" = "xyes"
1419 with_libcredis="yes"
1420 else if test "x$withval" = "xno"
1424 with_libcredis="yes"
1425 LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
1426 LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
1429 [with_libcredis="yes"])
1431 SAVE_CPPFLAGS="$CPPFLAGS"
1432 SAVE_LDFLAGS="$LDFLAGS"
1434 CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
1435 LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
1437 if test "x$with_libcredis" = "xyes"
1439 if test "x$LIBCREDIS_CPPFLAGS" != "x"
1441 AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
1443 AC_CHECK_HEADERS(credis.h,
1444 [with_libcredis="yes"],
1445 [with_libcredis="no (credis.h not found)"])
1447 if test "x$with_libcredis" = "xyes"
1449 if test "x$LIBCREDIS_LDFLAGS" != "x"
1451 AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
1453 AC_CHECK_LIB(credis, credis_info,
1454 [with_libcredis="yes"],
1455 [with_libcredis="no (symbol 'credis_info' not found)"])
1459 CPPFLAGS="$SAVE_CPPFLAGS"
1460 LDFLAGS="$SAVE_LDFLAGS"
1462 if test "x$with_libcredis" = "xyes"
1464 BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
1465 BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
1466 AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
1467 AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
1469 AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
1472 # --with-libcurl {{{
1473 with_curl_config="curl-config"
1476 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1478 if test "x$withval" = "xno"
1481 else if test "x$withval" = "xyes"
1485 if test -f "$withval" && test -x "$withval"
1487 with_curl_config="$withval"
1489 else if test -x "$withval/bin/curl-config"
1491 with_curl_config="$withval/bin/curl-config"
1500 if test "x$with_libcurl" = "xyes"
1502 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1503 curl_config_status=$?
1505 if test $curl_config_status -ne 0
1507 with_libcurl="no ($with_curl_config failed)"
1509 SAVE_CPPFLAGS="$CPPFLAGS"
1510 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1512 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1514 CPPFLAGS="$SAVE_CPPFLAGS"
1517 if test "x$with_libcurl" = "xyes"
1519 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1520 curl_config_status=$?
1522 if test $curl_config_status -ne 0
1524 with_libcurl="no ($with_curl_config failed)"
1526 AC_CHECK_LIB(curl, curl_easy_init,
1527 [with_libcurl="yes"],
1528 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1532 if test "x$with_libcurl" = "xyes"
1534 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1535 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1536 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1537 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1539 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1543 with_libdbi_cppflags=""
1544 with_libdbi_ldflags=""
1545 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1547 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1549 with_libdbi_cppflags="-I$withval/include"
1550 with_libdbi_ldflags="-L$withval/lib"
1553 with_libdbi="$withval"
1559 if test "x$with_libdbi" = "xyes"
1561 SAVE_CPPFLAGS="$CPPFLAGS"
1562 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1564 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1566 CPPFLAGS="$SAVE_CPPFLAGS"
1568 if test "x$with_libdbi" = "xyes"
1570 SAVE_CPPFLAGS="$CPPFLAGS"
1571 SAVE_LDFLAGS="$LDFLAGS"
1572 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1573 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1575 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1577 CPPFLAGS="$SAVE_CPPFLAGS"
1578 LDFLAGS="$SAVE_LDFLAGS"
1580 if test "x$with_libdbi" = "xyes"
1582 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1583 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1584 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1585 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1586 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1587 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1589 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1592 # --with-libesmtp {{{
1593 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1595 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1597 LDFLAGS="$LDFLAGS -L$withval/lib"
1598 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1601 with_libesmtp="$withval"
1607 if test "x$with_libesmtp" = "xyes"
1609 AC_CHECK_LIB(esmtp, smtp_create_session,
1611 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1612 ], [with_libesmtp="no (libesmtp not found)"])
1614 if test "x$with_libesmtp" = "xyes"
1616 AC_CHECK_HEADERS(libesmtp.h,
1618 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1619 ], [with_libesmtp="no (libesmtp.h not found)"])
1621 if test "x$with_libesmtp" = "xyes"
1627 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1628 [Wether or not to use the esmtp library])
1629 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1632 # --with-libganglia {{{
1633 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1635 if test -f "$withval" && test -x "$withval"
1637 with_libganglia_config="$withval"
1638 with_libganglia="yes"
1639 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1641 with_libganglia_config="$withval/bin/ganglia-config"
1642 with_libganglia="yes"
1643 else if test -d "$withval"
1645 GANGLIA_CPPFLAGS="-I$withval/include"
1646 GANGLIA_LDFLAGS="-L$withval/lib"
1647 with_libganglia="yes"
1649 with_libganglia_config="ganglia-config"
1650 with_libganglia="$withval"
1654 with_libganglia_config="ganglia-config"
1655 with_libganglia="yes"
1658 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1660 if test "x$GANGLIA_CPPFLAGS" = "x"
1662 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1665 if test "x$GANGLIA_LDFLAGS" = "x"
1667 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1670 if test "x$GANGLIA_LIBS" = "x"
1672 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1676 SAVE_CPPFLAGS="$CPPFLAGS"
1677 SAVE_LDFLAGS="$LDFLAGS"
1678 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1679 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1681 if test "x$with_libganglia" = "xyes"
1683 AC_CHECK_HEADERS(gm_protocol.h,
1685 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1686 [Define to 1 if you have the <gm_protocol.h> header file.])
1687 ], [with_libganglia="no (gm_protocol.h not found)"])
1690 if test "x$with_libganglia" = "xyes"
1692 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1694 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1695 [Define to 1 if you have the ganglia library (-lganglia).])
1696 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1699 CPPFLAGS="$SAVE_CPPFLAGS"
1700 LDFLAGS="$SAVE_LDFLAGS"
1702 AC_SUBST(GANGLIA_CPPFLAGS)
1703 AC_SUBST(GANGLIA_LDFLAGS)
1704 AC_SUBST(GANGLIA_LIBS)
1705 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1708 # --with-libgcrypt {{{
1709 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1710 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1711 GCRYPT_LIBS="$GCRYPT_LIBS"
1712 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1714 if test -f "$withval" && test -x "$withval"
1716 with_libgcrypt_config="$withval"
1717 with_libgcrypt="yes"
1718 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1720 with_libgcrypt_config="$withval/bin/gcrypt-config"
1721 with_libgcrypt="yes"
1722 else if test -d "$withval"
1724 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1725 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1726 with_libgcrypt="yes"
1728 with_libgcrypt_config="gcrypt-config"
1729 with_libgcrypt="$withval"
1733 with_libgcrypt_config="libgcrypt-config"
1734 with_libgcrypt="yes"
1737 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1739 if test "x$GCRYPT_CPPFLAGS" = "x"
1741 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1744 if test "x$GCRYPT_LDFLAGS" = "x"
1746 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1747 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1750 if test "x$GCRYPT_LIBS" = "x"
1752 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1756 SAVE_CPPFLAGS="$CPPFLAGS"
1757 SAVE_LDFLAGS="$LDFLAGS"
1758 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1759 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1761 if test "x$with_libgcrypt" = "xyes"
1763 if test "x$GCRYPT_CPPFLAGS" != "x"
1765 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1767 AC_CHECK_HEADERS(gcrypt.h,
1768 [with_libgcrypt="yes"],
1769 [with_libgcrypt="no (gcrypt.h not found)"])
1772 if test "x$with_libgcrypt" = "xyes"
1774 if test "x$GCRYPT_LDFLAGS" != "x"
1776 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1778 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1779 [with_libgcrypt="yes"],
1780 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1782 if test "$with_libgcrypt" != "no"; then
1783 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1787 CPPFLAGS="$SAVE_CPPFLAGS"
1788 LDFLAGS="$SAVE_LDFLAGS"
1790 if test "x$with_libgcrypt" = "xyes"
1792 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1795 AC_SUBST(GCRYPT_CPPFLAGS)
1796 AC_SUBST(GCRYPT_LDFLAGS)
1797 AC_SUBST(GCRYPT_LIBS)
1798 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1801 # --with-libiptc {{{
1802 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1804 if test "x$withval" = "xshipped"
1807 else if test "x$withval" = "xyes"
1809 with_libiptc="pkgconfig"
1810 else if test "x$withval" = "xno"
1815 with_libiptc_cflags="-I$withval/include"
1816 with_libiptc_libs="-L$withval/lib"
1820 if test "x$ac_system" = "xLinux"
1822 with_libiptc="pkgconfig"
1824 with_libiptc="no (Linux only)"
1828 if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
1830 with_libiptc="no (Don't have pkg-config)"
1833 if test "x$with_libiptc" = "xpkgconfig"
1835 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
1838 with_libiptc="no (pkg-config doesn't know libiptc)"
1841 if test "x$with_libiptc" = "xpkgconfig"
1843 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
1846 with_libiptc="no ($PKG_CONFIG failed)"
1848 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
1851 with_libiptc="no ($PKG_CONFIG failed)"
1855 SAVE_CPPFLAGS="$CPPFLAGS"
1856 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
1858 # check whether the header file for libiptc is available.
1859 if test "x$with_libiptc" = "xpkgconfig"
1861 AC_CHECK_HEADERS(libiptc/libiptc.h libiptc/libip6tc.h, ,
1862 [with_libiptc="no (header file missing)"])
1864 # If the header file is available, check for the required type declaractions.
1865 # They may be missing in old versions of libiptc. In that case, they will be
1866 # declared in the iptables plugin.
1867 if test "x$with_libiptc" = "xpkgconfig"
1869 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
1871 # Check for the iptc_init symbol in the library.
1872 if test "x$with_libiptc" = "xpkgconfig"
1874 AC_CHECK_LIB(iptc, iptc_init,
1875 [with_libiptc="pkgconfig"],
1876 [with_libiptc="no"],
1877 [$with_libiptc_libs])
1879 if test "x$with_libiptc" = "xpkgconfig"
1884 CPPFLAGS="$SAVE_CPPFLAGS"
1886 if test "x$with_libiptc" = "xown"
1888 with_libiptc_cflags=""
1889 with_libiptc_libs=""
1891 if test "x$with_libiptc" = "xown"
1893 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1895 with_libiptc="no (Linux iptables headers not found)"
1898 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1901 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
1902 if test "x$with_libiptc" = "xown"
1904 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1908 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1909 if test "x$with_libiptc" = "xyes"
1911 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
1912 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
1913 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1914 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1919 with_java_home="$JAVA_HOME"
1920 with_java_vmtype="client"
1925 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1927 if test "x$withval" = "xno"
1930 else if test "x$withval" = "xyes"
1934 with_java_home="$withval"
1939 if test "x$with_java" = "xyes"
1941 if test -d "$with_java_home"
1943 AC_MSG_CHECKING([for jni.h])
1944 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1945 if test "x$TMPDIR" != "x"
1947 AC_MSG_RESULT([found in $TMPDIR])
1948 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1950 AC_MSG_RESULT([not found])
1953 AC_MSG_CHECKING([for jni_md.h])
1954 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1955 if test "x$TMPDIR" != "x"
1957 AC_MSG_RESULT([found in $TMPDIR])
1958 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1960 AC_MSG_RESULT([not found])
1963 AC_MSG_CHECKING([for libjvm.so])
1964 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1965 if test "x$TMPDIR" != "x"
1967 AC_MSG_RESULT([found in $TMPDIR])
1968 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1970 AC_MSG_RESULT([not found])
1973 if test "x$JAVAC" = "x"
1975 AC_MSG_CHECKING([for javac])
1976 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1977 if test "x$TMPDIR" != "x"
1980 AC_MSG_RESULT([$JAVAC])
1982 AC_MSG_RESULT([not found])
1985 if test "x$JAR" = "x"
1987 AC_MSG_CHECKING([for jar])
1988 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1989 if test "x$TMPDIR" != "x"
1992 AC_MSG_RESULT([$JAR])
1994 AC_MSG_RESULT([not found])
1997 else if test "x$with_java_home" != "x"
1999 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2003 if test "x$JAVA_CPPFLAGS" != "x"
2005 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
2007 if test "x$JAVA_CFLAGS" != "x"
2009 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
2011 if test "x$JAVA_LDFLAGS" != "x"
2013 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
2015 if test "x$JAVAC" = "x"
2017 with_javac_path="$PATH"
2018 if test "x$with_java_home" != "x"
2020 with_javac_path="$with_java_home:with_javac_path"
2021 if test -d "$with_java_home/bin"
2023 with_javac_path="$with_java_home/bin:with_javac_path"
2027 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
2029 if test "x$JAVAC" = "x"
2031 with_java="no (javac not found)"
2033 if test "x$JAR" = "x"
2035 with_jar_path="$PATH"
2036 if test "x$with_java_home" != "x"
2038 with_jar_path="$with_java_home:$with_jar_path"
2039 if test -d "$with_java_home/bin"
2041 with_jar_path="$with_java_home/bin:$with_jar_path"
2045 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
2047 if test "x$JAR" = "x"
2049 with_java="no (jar not found)"
2052 SAVE_CPPFLAGS="$CPPFLAGS"
2053 SAVE_CFLAGS="$CFLAGS"
2054 SAVE_LDFLAGS="$LDFLAGS"
2055 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2056 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2057 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2059 if test "x$with_java" = "xyes"
2061 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
2063 if test "x$with_java" = "xyes"
2065 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
2067 [with_java="no (libjvm not found)"],
2070 if test "x$with_java" = "xyes"
2072 JAVA_LIBS="$JAVA_LIBS -ljvm"
2073 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
2076 CPPFLAGS="$SAVE_CPPFLAGS"
2077 CFLAGS="$SAVE_CFLAGS"
2078 LDFLAGS="$SAVE_LDFLAGS"
2080 AC_SUBST(JAVA_CPPFLAGS)
2081 AC_SUBST(JAVA_CFLAGS)
2082 AC_SUBST(JAVA_LDFLAGS)
2084 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
2087 # --with-libmemcached {{{
2088 with_libmemcached_cppflags=""
2089 with_libmemcached_ldflags=""
2090 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
2092 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2094 with_libmemcached_cppflags="-I$withval/include"
2095 with_libmemcached_ldflags="-L$withval/lib"
2096 with_libmemcached="yes"
2098 with_libmemcached="$withval"
2102 with_libmemcached="yes"
2104 if test "x$with_libmemcached" = "xyes"
2106 SAVE_CPPFLAGS="$CPPFLAGS"
2107 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2109 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
2111 CPPFLAGS="$SAVE_CPPFLAGS"
2113 if test "x$with_libmemcached" = "xyes"
2115 SAVE_CPPFLAGS="$CPPFLAGS"
2116 SAVE_LDFLAGS="$LDFLAGS"
2117 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
2118 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
2120 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
2122 CPPFLAGS="$SAVE_CPPFLAGS"
2123 LDFLAGS="$SAVE_LDFLAGS"
2125 if test "x$with_libmemcached" = "xyes"
2127 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
2128 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
2129 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
2130 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
2131 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
2132 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
2133 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
2135 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
2138 # --with-libmodbus {{{
2139 with_libmodbus_config=""
2140 with_libmodbus_cflags=""
2141 with_libmodbus_libs=""
2142 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
2144 if test "x$withval" = "xno"
2147 else if test "x$withval" = "xyes"
2149 with_libmodbus="use_pkgconfig"
2150 else if test -d "$with_libmodbus/lib"
2152 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
2153 with_libmodbus_cflags="-I$withval/include"
2154 with_libmodbus_libs="-L$withval/lib -lmodbus"
2155 with_libmodbus="yes"
2158 [with_libmodbus="use_pkgconfig"])
2160 # configure using pkg-config
2161 if test "x$with_libmodbus" = "xuse_pkgconfig"
2163 if test "x$PKG_CONFIG" = "x"
2165 with_libmodbus="no (Don't have pkg-config)"
2168 if test "x$with_libmodbus" = "xuse_pkgconfig"
2170 AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
2171 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
2174 with_libmodbus="no (pkg-config doesn't know libmodbus)"
2177 if test "x$with_libmodbus" = "xuse_pkgconfig"
2179 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
2182 with_libmodbus="no ($PKG_CONFIG failed)"
2184 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
2187 with_libmodbus="no ($PKG_CONFIG failed)"
2190 if test "x$with_libmodbus" = "xuse_pkgconfig"
2192 with_libmodbus="yes"
2195 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
2196 # the actual checks.
2197 if test "x$with_libmodbus" = "xyes"
2199 SAVE_CPPFLAGS="$CPPFLAGS"
2200 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2202 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
2204 CPPFLAGS="$SAVE_CPPFLAGS"
2206 if test "x$with_libmodbus" = "xyes"
2208 SAVE_CPPFLAGS="$CPPFLAGS"
2209 SAVE_LDFLAGS="$LDFLAGS"
2211 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
2212 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
2214 AC_CHECK_LIB(modbus, modbus_connect,
2215 [with_libmodbus="yes"],
2216 [with_libmodbus="no (symbol modbus_connect not found)"])
2218 CPPFLAGS="$SAVE_CPPFLAGS"
2219 LDFLAGS="$SAVE_LDFLAGS"
2221 if test "x$with_libmodbus" = "xyes"
2223 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
2224 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
2225 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
2226 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
2230 # --with-libmongoc {{{
2231 AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
2233 if test "x$withval" = "xyes"
2235 with_libmongoc="yes"
2236 else if test "x$withval" = "xno"
2240 with_libmongoc="yes"
2241 LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
2242 LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
2245 [with_libmongoc="yes"])
2247 SAVE_CPPFLAGS="$CPPFLAGS"
2248 SAVE_LDFLAGS="$LDFLAGS"
2250 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
2251 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
2253 if test "x$with_libmongoc" = "xyes"
2255 if test "x$LIBMONGOC_CPPFLAGS" != "x"
2257 AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
2259 AC_CHECK_HEADERS(mongo.h,
2260 [with_libmongoc="yes"],
2261 [with_libmongoc="no ('mongo.h' not found)"],
2263 # define MONGO_HAVE_STDINT 1
2265 # define MONGO_USE_LONG_LONG_INT 1
2269 if test "x$with_libmongoc" = "xyes"
2271 if test "x$LIBMONGOC_LDFLAGS" != "x"
2273 AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
2275 AC_CHECK_LIB(mongoc, mongo_run_command,
2276 [with_libmongoc="yes"],
2277 [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
2280 CPPFLAGS="$SAVE_CPPFLAGS"
2281 LDFLAGS="$SAVE_LDFLAGS"
2283 if test "x$with_libmongoc" = "xyes"
2285 BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
2286 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
2287 AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
2288 AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
2290 AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
2293 # --with-libmysql {{{
2294 with_mysql_config="mysql_config"
2295 with_mysql_cflags=""
2297 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
2299 if test "x$withval" = "xno"
2302 else if test "x$withval" = "xyes"
2306 if test -f "$withval" && test -x "$withval";
2308 with_mysql_config="$withval"
2309 else if test -x "$withval/bin/mysql_config"
2311 with_mysql_config="$withval/bin/mysql_config"
2319 if test "x$with_libmysql" = "xyes"
2321 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2322 mysql_config_status=$?
2324 if test $mysql_config_status -ne 0
2326 with_libmysql="no ($with_mysql_config failed)"
2328 SAVE_CPPFLAGS="$CPPFLAGS"
2329 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2332 have_mysql_mysql_h="no"
2333 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2335 if test "x$have_mysql_h" = "xno"
2337 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2340 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2342 with_libmysql="no (mysql.h not found)"
2345 CPPFLAGS="$SAVE_CPPFLAGS"
2348 if test "x$with_libmysql" = "xyes"
2350 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
2351 mysql_config_status=$?
2353 if test $mysql_config_status -ne 0
2355 with_libmysql="no ($with_mysql_config failed)"
2357 AC_CHECK_LIB(mysqlclient, mysql_init,
2358 [with_libmysql="yes"],
2359 [with_libmysql="no (symbol 'mysql_init' not found)"],
2362 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2363 [with_libmysql="yes"],
2364 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2368 if test "x$with_libmysql" = "xyes"
2370 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2371 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2372 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2373 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2375 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2378 # --with-libnetlink {{{
2379 with_libnetlink_cflags=""
2380 with_libnetlink_libs="-lnetlink"
2381 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2383 echo "libnetlink: withval = $withval"
2384 if test "x$withval" = "xyes"
2386 with_libnetlink="yes"
2387 else if test "x$withval" = "xno"
2389 with_libnetlink="no"
2391 if test -d "$withval/include"
2393 with_libnetlink_cflags="-I$withval/include"
2394 with_libnetlink_libs="-L$withval/lib -lnetlink"
2395 with_libnetlink="yes"
2397 AC_MSG_ERROR("no such directory: $withval/include")
2402 if test "x$ac_system" = "xLinux"
2404 with_libnetlink="yes"
2406 with_libnetlink="no (Linux only library)"
2409 if test "x$with_libnetlink" = "xyes"
2411 SAVE_CFLAGS="$CFLAGS"
2412 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2414 with_libnetlink="no (libnetlink.h not found)"
2416 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2418 with_libnetlink="yes"
2422 #include <sys/types.h>
2423 #include <asm/types.h>
2424 #include <sys/socket.h>
2425 #include <linux/netlink.h>
2426 #include <linux/rtnetlink.h>])
2427 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2429 #include <sys/types.h>
2430 #include <asm/types.h>
2431 #include <sys/socket.h>])
2435 #include <sys/types.h>
2436 #include <asm/types.h>
2437 #include <sys/socket.h>
2438 #include <linux/netlink.h>
2439 #include <linux/rtnetlink.h>
2443 int retval = TCA_STATS2;
2446 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2451 #include <sys/types.h>
2452 #include <asm/types.h>
2453 #include <sys/socket.h>
2454 #include <linux/netlink.h>
2455 #include <linux/rtnetlink.h>
2459 int retval = TCA_STATS;
2462 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2465 CFLAGS="$SAVE_CFLAGS"
2467 if test "x$with_libnetlink" = "xyes"
2469 AC_CHECK_LIB(netlink, rtnl_open,
2470 [with_libnetlink="yes"],
2471 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2472 [$with_libnetlink_libs])
2474 if test "x$with_libnetlink" = "xyes"
2476 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2477 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2478 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2479 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2481 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2484 # --with-libnetapp {{{
2485 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2486 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2487 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2488 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2489 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2490 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2491 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2493 if test -d "$withval"
2495 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2496 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2497 with_libnetapp="yes"
2499 with_libnetapp="$withval"
2503 with_libnetapp="yes"
2506 SAVE_CPPFLAGS="$CPPFLAGS"
2507 SAVE_LDFLAGS="$LDFLAGS"
2508 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2509 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2511 if test "x$with_libnetapp" = "xyes"
2513 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2515 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2517 AC_CHECK_HEADERS(netapp_api.h,
2518 [with_libnetapp="yes"],
2519 [with_libnetapp="no (netapp_api.h not found)"])
2522 if test "x$with_libnetapp" = "xyes"
2524 if test "x$LIBNETAPP_LDFLAGS" != "x"
2526 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2529 if test "x$LIBNETAPP_LIBS" = "x"
2531 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2533 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2535 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2536 [with_libnetapp="yes"],
2537 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2539 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2542 CPPFLAGS="$SAVE_CPPFLAGS"
2543 LDFLAGS="$SAVE_LDFLAGS"
2545 if test "x$with_libnetapp" = "xyes"
2547 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2550 AC_SUBST(LIBNETAPP_CPPFLAGS)
2551 AC_SUBST(LIBNETAPP_LDFLAGS)
2552 AC_SUBST(LIBNETAPP_LIBS)
2553 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2556 # --with-libnetsnmp {{{
2557 with_snmp_config="net-snmp-config"
2560 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2562 if test "x$withval" = "xno"
2564 with_libnetsnmp="no"
2565 else if test "x$withval" = "xyes"
2567 with_libnetsnmp="yes"
2569 if test -x "$withval"
2571 with_snmp_config="$withval"
2572 with_libnetsnmp="yes"
2574 with_snmp_config="$withval/bin/net-snmp-config"
2575 with_libnetsnmp="yes"
2579 [with_libnetsnmp="yes"])
2580 if test "x$with_libnetsnmp" = "xyes"
2582 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2583 snmp_config_status=$?
2585 if test $snmp_config_status -ne 0
2587 with_libnetsnmp="no ($with_snmp_config failed)"
2589 SAVE_CPPFLAGS="$CPPFLAGS"
2590 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2592 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2594 CPPFLAGS="$SAVE_CPPFLAGS"
2597 if test "x$with_libnetsnmp" = "xyes"
2599 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2600 snmp_config_status=$?
2602 if test $snmp_config_status -ne 0
2604 with_libnetsnmp="no ($with_snmp_config failed)"
2606 AC_CHECK_LIB(netsnmp, init_snmp,
2607 [with_libnetsnmp="yes"],
2608 [with_libnetsnmp="no (libnetsnmp not found)"],
2612 if test "x$with_libnetsnmp" = "xyes"
2614 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2615 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2616 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2617 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2619 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2622 # --with-liboconfig {{{
2623 with_own_liboconfig="no"
2624 liboconfig_LDFLAGS="$LDFLAGS"
2625 liboconfig_CPPFLAGS="$CPPFLAGS"
2626 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2628 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2630 if test -d "$withval/lib"
2632 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2634 if test -d "$withval/include"
2636 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2639 if test "x$withval" = "xno"
2641 AC_MSG_ERROR("liboconfig is required")
2645 with_liboconfig="yes"
2648 save_LDFLAGS="$LDFLAGS"
2649 save_CPPFLAGS="$CPPFLAGS"
2650 LDFLAGS="$liboconfig_LDFLAGS"
2651 CPPFLAGS="$liboconfig_CPPFLAGS"
2652 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2654 with_liboconfig="yes"
2655 with_own_liboconfig="no"
2658 with_liboconfig="yes"
2659 with_own_liboconfig="yes"
2660 LDFLAGS="$save_LDFLAGS"
2661 CPPFLAGS="$save_CPPFLAGS"
2664 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2665 if test "x$with_own_liboconfig" = "xyes"
2667 with_liboconfig="yes (shipped version)"
2671 # --with-liboping {{{
2672 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2674 if test "x$withval" = "xyes"
2677 else if test "x$withval" = "xno"
2682 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2683 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2686 [with_liboping="yes"])
2688 SAVE_CPPFLAGS="$CPPFLAGS"
2689 SAVE_LDFLAGS="$LDFLAGS"
2691 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2692 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2694 if test "x$with_liboping" = "xyes"
2696 if test "x$LIBOPING_CPPFLAGS" != "x"
2698 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2700 AC_CHECK_HEADERS(oping.h,
2701 [with_liboping="yes"],
2702 [with_liboping="no (oping.h not found)"])
2704 if test "x$with_liboping" = "xyes"
2706 if test "x$LIBOPING_LDFLAGS" != "x"
2708 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2710 AC_CHECK_LIB(oping, ping_construct,
2711 [with_liboping="yes"],
2712 [with_liboping="no (symbol 'ping_construct' not found)"])
2715 CPPFLAGS="$SAVE_CPPFLAGS"
2716 LDFLAGS="$SAVE_LDFLAGS"
2718 if test "x$with_liboping" = "xyes"
2720 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2721 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2722 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2723 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2725 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2729 with_oracle_cppflags=""
2731 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2733 if test "x$withval" = "xyes"
2735 if test "x$ORACLE_HOME" = "x"
2737 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2740 else if test "x$withval" = "xno"
2745 ORACLE_HOME="$withval"
2749 if test "x$ORACLE_HOME" = "x"
2751 with_oracle="no (ORACLE_HOME is not set)"
2756 if test "x$ORACLE_HOME" != "x"
2758 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2760 if test -e "$ORACLE_HOME/lib/ldflags"
2762 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2764 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2765 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2767 if test "x$with_oracle" = "xyes"
2769 SAVE_CPPFLAGS="$CPPFLAGS"
2770 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2772 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2774 CPPFLAGS="$SAVE_CPPFLAGS"
2776 if test "x$with_oracle" = "xyes"
2778 SAVE_CPPFLAGS="$CPPFLAGS"
2779 SAVE_LDFLAGS="$LDFLAGS"
2780 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2781 LDFLAGS="$LDFLAGS $with_oracle_libs"
2783 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2785 CPPFLAGS="$SAVE_CPPFLAGS"
2786 LDFLAGS="$SAVE_LDFLAGS"
2788 if test "x$with_oracle" = "xyes"
2790 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2791 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2792 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2793 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2797 # --with-libowcapi {{{
2798 with_libowcapi_cppflags=""
2799 with_libowcapi_libs="-lowcapi"
2800 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2802 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2804 with_libowcapi_cppflags="-I$withval/include"
2805 with_libowcapi_libs="-L$withval/lib -lowcapi"
2806 with_libowcapi="yes"
2808 with_libowcapi="$withval"
2812 with_libowcapi="yes"
2814 if test "x$with_libowcapi" = "xyes"
2816 SAVE_CPPFLAGS="$CPPFLAGS"
2817 CPPFLAGS="$with_libowcapi_cppflags"
2819 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2821 CPPFLAGS="$SAVE_CPPFLAGS"
2823 if test "x$with_libowcapi" = "xyes"
2825 SAVE_LDFLAGS="$LDFLAGS"
2826 SAVE_CPPFLAGS="$CPPFLAGS"
2827 LDFLAGS="$with_libowcapi_libs"
2828 CPPFLAGS="$with_libowcapi_cppflags"
2830 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2832 LDFLAGS="$SAVE_LDFLAGS"
2833 CPPFLAGS="$SAVE_CPPFLAGS"
2835 if test "x$with_libowcapi" = "xyes"
2837 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2838 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2839 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2840 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2844 # --with-libpcap {{{
2845 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2847 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2849 LDFLAGS="$LDFLAGS -L$withval/lib"
2850 CPPFLAGS="$CPPFLAGS -I$withval/include"
2853 with_libpcap="$withval"
2859 if test "x$with_libpcap" = "xyes"
2861 AC_CHECK_LIB(pcap, pcap_open_live,
2863 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2864 ], [with_libpcap="no (libpcap not found)"])
2866 if test "x$with_libpcap" = "xyes"
2868 AC_CHECK_HEADERS(pcap.h,,
2869 [with_libpcap="no (pcap.h not found)"])
2871 if test "x$with_libpcap" = "xyes"
2873 AC_CHECK_HEADERS(pcap-bpf.h,,
2874 [with_libpcap="no (pcap-bpf.h not found)"])
2876 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2879 # --with-libperl {{{
2880 perl_interpreter="perl"
2881 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2883 if test -x "$withval"
2885 perl_interpreter="$withval"
2887 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2889 LDFLAGS="$LDFLAGS -L$withval/lib"
2890 CPPFLAGS="$CPPFLAGS -I$withval/include"
2891 perl_interpreter="$withval/bin/perl"
2894 with_libperl="$withval"
2901 AC_MSG_CHECKING([for perl])
2902 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2903 if test -x "$perl_interpreter"
2905 AC_MSG_RESULT([yes ($perl_interpreter)])
2911 AC_SUBST(PERL, "$perl_interpreter")
2913 if test "x$with_libperl" = "xyes" \
2914 && test -n "$perl_interpreter"
2916 SAVE_CFLAGS="$CFLAGS"
2917 SAVE_LDFLAGS="$LDFLAGS"
2918 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2919 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2920 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2921 CFLAGS="$CFLAGS $PERL_CFLAGS"
2922 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2924 AC_CACHE_CHECK([for libperl],
2925 [c_cv_have_libperl],
2929 #define PERL_NO_GET_CONTEXT
2936 load_module (PERL_LOADMOD_NOIMPORT,
2937 newSVpv ("Collectd::Plugin::FooBar", 24),
2940 [c_cv_have_libperl="yes"],
2941 [c_cv_have_libperl="no"]
2945 if test "x$c_cv_have_libperl" = "xyes"
2947 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2948 AC_SUBST(PERL_CFLAGS)
2949 AC_SUBST(PERL_LDFLAGS)
2954 CFLAGS="$SAVE_CFLAGS"
2955 LDFLAGS="$SAVE_LDFLAGS"
2956 else if test -z "$perl_interpreter"; then
2957 with_libperl="no (no perl interpreter found)"
2958 c_cv_have_libperl="no"
2960 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2962 if test "x$with_libperl" = "xyes"
2964 SAVE_CFLAGS="$CFLAGS"
2965 SAVE_LDFLAGS="$LDFLAGS"
2966 CFLAGS="$CFLAGS $PERL_CFLAGS"
2967 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2969 AC_CACHE_CHECK([if perl supports ithreads],
2970 [c_cv_have_perl_ithreads],
2978 #if !defined(USE_ITHREADS)
2979 # error "Perl does not support ithreads!"
2980 #endif /* !defined(USE_ITHREADS) */
2983 [c_cv_have_perl_ithreads="yes"],
2984 [c_cv_have_perl_ithreads="no"]
2988 if test "x$c_cv_have_perl_ithreads" = "xyes"
2990 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2993 CFLAGS="$SAVE_CFLAGS"
2994 LDFLAGS="$SAVE_LDFLAGS"
2997 if test "x$with_libperl" = "xyes"
2999 SAVE_CFLAGS="$CFLAGS"
3000 SAVE_LDFLAGS="$LDFLAGS"
3001 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
3002 # (see issues #41 and #42)
3003 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
3004 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3006 AC_CACHE_CHECK([for broken Perl_load_module()],
3007 [c_cv_have_broken_perl_load_module],
3011 #define PERL_NO_GET_CONTEXT
3018 load_module (PERL_LOADMOD_NOIMPORT,
3019 newSVpv ("Collectd::Plugin::FooBar", 24),
3022 [c_cv_have_broken_perl_load_module="no"],
3023 [c_cv_have_broken_perl_load_module="yes"]
3027 CFLAGS="$SAVE_CFLAGS"
3028 LDFLAGS="$SAVE_LDFLAGS"
3030 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
3031 test "x$c_cv_have_broken_perl_load_module" = "xyes")
3033 if test "x$with_libperl" = "xyes"
3035 SAVE_CFLAGS="$CFLAGS"
3036 SAVE_LDFLAGS="$LDFLAGS"
3037 CFLAGS="$CFLAGS $PERL_CFLAGS"
3038 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
3041 [struct mgvtbl.svt_local],
3042 [have_struct_mgvtbl_svt_local="yes"],
3043 [have_struct_mgvtbl_svt_local="no"],
3050 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
3052 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
3053 [Define if Perl's struct mgvtbl has member svt_local.])
3056 CFLAGS="$SAVE_CFLAGS"
3057 LDFLAGS="$SAVE_LDFLAGS"
3062 with_pg_config="pg_config"
3063 with_libpq_includedir=""
3064 with_libpq_libdir=""
3065 with_libpq_cppflags=""
3066 with_libpq_ldflags=""
3067 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
3070 if test "x$withval" = "xno"
3073 else if test "x$withval" = "xyes"
3077 if test -f "$withval" && test -x "$withval";
3079 with_pg_config="$withval"
3080 else if test -x "$withval/bin/pg_config"
3082 with_pg_config="$withval/bin/pg_config"
3090 if test "x$with_libpq" = "xyes"
3092 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
3095 if test $pg_config_status -eq 0
3097 if test -n "$with_libpq_includedir"; then
3098 for dir in $with_libpq_includedir; do
3099 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
3103 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3106 SAVE_CPPFLAGS="$CPPFLAGS"
3107 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
3109 AC_CHECK_HEADERS(libpq-fe.h, [],
3110 [with_libpq="no (libpq-fe.h not found)"], [])
3112 CPPFLAGS="$SAVE_CPPFLAGS"
3114 if test "x$with_libpq" = "xyes"
3116 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
3119 if test $pg_config_status -eq 0
3121 if test -n "$with_libpq_libdir"; then
3122 for dir in $with_libpq_libdir; do
3123 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
3127 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
3130 SAVE_LDFLAGS="$LDFLAGS"
3131 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
3133 AC_CHECK_LIB(pq, PQconnectdb,
3135 [with_libpq="no (symbol 'PQconnectdb' not found)"])
3137 AC_CHECK_LIB(pq, PQserverVersion,
3139 [with_libpq="no (symbol 'PQserverVersion' not found)"])
3141 LDFLAGS="$SAVE_LDFLAGS"
3143 if test "x$with_libpq" = "xyes"
3145 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
3146 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
3147 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
3148 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
3150 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
3153 # --with-libpthread {{{
3154 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
3155 [ if test "x$withval" != "xno" \
3156 && test "x$withval" != "xyes"
3158 LDFLAGS="$LDFLAGS -L$withval/lib"
3159 CPPFLAGS="$CPPFLAGS -I$withval/include"
3160 with_libpthread="yes"
3162 if test "x$withval" = "xno"
3164 with_libpthread="no (disabled)"
3167 ], [with_libpthread="yes"])
3168 if test "x$with_libpthread" = "xyes"
3170 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
3173 if test "x$with_libpthread" = "xyes"
3175 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
3177 if test "x$with_libpthread" = "xyes"
3183 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
3184 [Wether or not to use pthread (POSIX threads) library])
3185 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
3190 with_python_path="$PATH"
3191 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
3193 if test "x$withval" = "xyes" || test "x$withval" = "xno"
3195 with_python="$withval"
3196 else if test -x "$withval"
3198 with_python_prog="$withval"
3199 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
3201 else if test -d "$withval"
3203 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
3206 AC_MSG_WARN([Argument not recognized: $withval])
3208 ], [with_python="yes"])
3211 SAVE_CPPFLAGS="$CPPFLAGS"
3212 SAVE_LDFLAGS="$LDFLAGS"
3215 PATH="$with_python_path"
3217 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
3219 AC_MSG_CHECKING([for python])
3220 with_python_prog="`which python 2>/dev/null`"
3221 if test "x$with_python_prog" = "x"
3223 AC_MSG_RESULT([not found])
3224 with_python="no (interpreter not found)"
3226 AC_MSG_RESULT([$with_python_prog])
3230 if test "x$with_python" = "xyes"
3232 AC_MSG_CHECKING([for Python CPPFLAGS])
3233 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
3234 python_config_status=$?
3236 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
3238 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
3241 AC_MSG_RESULT([$python_include_path])
3245 if test "x$with_python" = "xyes"
3247 CPPFLAGS="-I$python_include_path $CPPFLAGS"
3248 AC_CHECK_HEADERS(Python.h,
3249 [with_python="yes"],
3250 [with_python="no ('Python.h' not found)"])
3253 if test "x$with_python" = "xyes"
3255 AC_MSG_CHECKING([for Python LDFLAGS])
3256 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`
3257 python_config_status=$?
3259 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
3261 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
3264 AC_MSG_RESULT([$python_library_path])
3268 if test "x$with_python" = "xyes"
3270 AC_MSG_CHECKING([for Python LIBS])
3271 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`
3272 python_config_status=$?
3274 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
3276 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
3279 AC_MSG_RESULT([$python_library_flags])
3283 if test "x$with_python" = "xyes"
3285 LDFLAGS="-L$python_library_path $LDFLAGS"
3286 LIBS="$python_library_flags $LIBS"
3288 AC_CHECK_FUNC(PyObject_CallFunction,
3289 [with_python="yes"],
3290 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
3294 CPPFLAGS="$SAVE_CPPFLAGS"
3295 LDFLAGS="$SAVE_LDFLAGS"
3298 if test "x$with_python" = "xyes"
3300 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
3301 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
3302 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
3303 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
3304 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
3305 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3309 # --with-librabbitmq {{{
3310 with_librabbitmq_cppflags=""
3311 with_librabbitmq_ldflags=""
3312 AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
3314 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3316 with_librabbitmq_cppflags="-I$withval/include"
3317 with_librabbitmq_ldflags="-L$withval/lib"
3318 with_librabbitmq="yes"
3320 with_librabbitmq="$withval"
3324 with_librabbitmq="yes"
3326 if test "x$with_librabbitmq" = "xyes"
3328 SAVE_CPPFLAGS="$CPPFLAGS"
3329 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3331 AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
3333 CPPFLAGS="$SAVE_CPPFLAGS"
3335 if test "x$with_librabbitmq" = "xyes"
3337 SAVE_CPPFLAGS="$CPPFLAGS"
3338 SAVE_LDFLAGS="$LDFLAGS"
3339 CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
3340 LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
3342 AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
3344 CPPFLAGS="$SAVE_CPPFLAGS"
3345 LDFLAGS="$SAVE_LDFLAGS"
3347 if test "x$with_librabbitmq" = "xyes"
3349 BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
3350 BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
3351 BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
3352 AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
3353 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
3354 AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
3355 AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
3357 AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
3360 # --with-librouteros {{{
3361 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3363 if test "x$withval" = "xyes"
3365 with_librouteros="yes"
3366 else if test "x$withval" = "xno"
3368 with_librouteros="no"
3370 with_librouteros="yes"
3371 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3372 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3375 [with_librouteros="yes"])
3377 SAVE_CPPFLAGS="$CPPFLAGS"
3378 SAVE_LDFLAGS="$LDFLAGS"
3380 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3381 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3383 if test "x$with_librouteros" = "xyes"
3385 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3387 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3389 AC_CHECK_HEADERS(routeros_api.h,
3390 [with_librouteros="yes"],
3391 [with_librouteros="no (routeros_api.h not found)"])
3393 if test "x$with_librouteros" = "xyes"
3395 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3397 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3399 AC_CHECK_LIB(routeros, ros_interface,
3400 [with_librouteros="yes"],
3401 [with_librouteros="no (symbol 'ros_interface' not found)"])
3404 CPPFLAGS="$SAVE_CPPFLAGS"
3405 LDFLAGS="$SAVE_LDFLAGS"
3407 if test "x$with_librouteros" = "xyes"
3409 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3410 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3411 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3412 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3414 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3418 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3421 librrd_threadsafe="yes"
3422 librrd_rrdc_update="no"
3423 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3424 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3426 librrd_cflags="-I$withval/include"
3427 librrd_ldflags="-L$withval/lib"
3430 with_librrd="$withval"
3432 ], [with_librrd="yes"])
3433 if test "x$with_librrd" = "xyes"
3435 SAVE_CPPFLAGS="$CPPFLAGS"
3436 SAVE_LDFLAGS="$LDFLAGS"
3438 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3439 LDFLAGS="$LDFLAGS $librrd_ldflags"
3441 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3443 CPPFLAGS="$SAVE_CPPFLAGS"
3444 LDFLAGS="$SAVE_LDFLAGS"
3446 if test "x$with_librrd" = "xyes"
3448 SAVE_CPPFLAGS="$CPPFLAGS"
3449 SAVE_LDFLAGS="$LDFLAGS"
3451 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3452 LDFLAGS="$LDFLAGS $librrd_ldflags"
3454 AC_CHECK_LIB(rrd_th, rrd_update_r,
3456 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3458 [librrd_threadsafe="no"
3459 AC_CHECK_LIB(rrd, rrd_update,
3461 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3463 [with_librrd="no (symbol 'rrd_update' not found)"],
3468 if test "x$librrd_threadsafe" = "xyes"
3470 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3472 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3475 CPPFLAGS="$SAVE_CPPFLAGS"
3476 LDFLAGS="$SAVE_LDFLAGS"
3478 if test "x$with_librrd" = "xyes"
3480 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3481 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3482 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3483 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3485 if test "x$librrd_threadsafe" = "xyes"
3487 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3491 # --with-libsensors {{{
3492 with_sensors_cflags=""
3493 with_sensors_ldflags=""
3494 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3496 if test "x$withval" = "xno"
3498 with_libsensors="no"
3500 with_libsensors="yes"
3501 if test "x$withval" != "xyes"
3503 with_sensors_cflags="-I$withval/include"
3504 with_sensors_ldflags="-L$withval/lib"
3505 with_libsensors="yes"
3510 if test "x$ac_system" = "xLinux"
3512 with_libsensors="yes"
3514 with_libsensors="no (Linux only library)"
3517 if test "x$with_libsensors" = "xyes"
3519 SAVE_CPPFLAGS="$CPPFLAGS"
3520 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3522 # AC_CHECK_HEADERS(sensors/sensors.h,
3524 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3526 # [with_libsensors="no (sensors/sensors.h not found)"])
3527 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3529 CPPFLAGS="$SAVE_CPPFLAGS"
3531 if test "x$with_libsensors" = "xyes"
3533 SAVE_CPPFLAGS="$CPPFLAGS"
3534 SAVE_LDFLAGS="$LDFLAGS"
3535 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3536 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3538 AC_CHECK_LIB(sensors, sensors_init,
3540 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3542 [with_libsensors="no (libsensors not found)"])
3544 CPPFLAGS="$SAVE_CPPFLAGS"
3545 LDFLAGS="$SAVE_LDFLAGS"
3547 if test "x$with_libsensors" = "xyes"
3549 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3550 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3551 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3552 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3554 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3557 # --with-libstatgrab {{{
3558 with_libstatgrab_cflags=""
3559 with_libstatgrab_ldflags=""
3560 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3562 if test "x$withval" != "xno" \
3563 && test "x$withval" != "xyes"
3565 with_libstatgrab_cflags="-I$withval/include"
3566 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3567 with_libstatgrab="yes"
3568 with_libstatgrab_pkg_config="no"
3570 with_libstatgrab="$withval"
3571 with_libstatgrab_pkg_config="yes"
3575 with_libstatgrab="yes"
3576 with_libstatgrab_pkg_config="yes"
3579 if test "x$with_libstatgrab" = "xyes" \
3580 && test "x$with_libstatgrab_pkg_config" = "xyes"
3582 if test "x$PKG_CONFIG" != "x"
3584 AC_MSG_CHECKING([pkg-config for libstatgrab])
3586 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3589 with_libstatgrab_pkg_config="no"
3590 with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
3591 temp_result="not found"
3593 AC_MSG_RESULT([$temp_result])
3595 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3596 with_libstatgrab_pkg_config="no"
3597 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3601 if test "x$with_libstatgrab" = "xyes" \
3602 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3603 && test "x$with_libstatgrab_cflags" = "x"
3605 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3606 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3609 with_libstatgrab_cflags="$temp_result"
3611 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3612 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3614 AC_MSG_RESULT([$temp_result])
3617 if test "x$with_libstatgrab" = "xyes" \
3618 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3619 && test "x$with_libstatgrab_ldflags" = "x"
3621 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3622 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3625 with_libstatgrab_ldflags="$temp_result"
3627 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3628 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3630 AC_MSG_RESULT([$temp_result])
3633 if test "x$with_libstatgrab" = "xyes"
3635 SAVE_CPPFLAGS="$CPPFLAGS"
3636 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3638 AC_CHECK_HEADERS(statgrab.h,
3639 [with_libstatgrab="yes"],
3640 [with_libstatgrab="no (statgrab.h not found)"])
3642 CPPFLAGS="$SAVE_CPPFLAGS"
3645 if test "x$with_libstatgrab" = "xyes"
3647 SAVE_CFLAGS="$CFLAGS"
3648 SAVE_LDFLAGS="$LDFLAGS"
3650 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3651 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3653 AC_CHECK_LIB(statgrab, sg_init,
3654 [with_libstatgrab="yes"],
3655 [with_libstatgrab="no (symbol sg_init not found)"])
3657 CFLAGS="$SAVE_CFLAGS"
3658 LDFLAGS="$SAVE_LDFLAGS"
3661 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3662 if test "x$with_libstatgrab" = "xyes"
3664 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3665 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3666 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3667 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3668 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3672 # --with-libtokyotyrant {{{
3673 with_libtokyotyrant_cppflags=""
3674 with_libtokyotyrant_ldflags=""
3675 with_libtokyotyrant_libs=""
3676 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3678 if test "x$withval" = "xno"
3680 with_libtokyotyrant="no"
3681 else if test "x$withval" = "xyes"
3683 with_libtokyotyrant="yes"
3685 with_libtokyotyrant_cppflags="-I$withval/include"
3686 with_libtokyotyrant_ldflags="-L$withval/include"
3687 with_libtokyotyrant_libs="-ltokyotyrant"
3688 with_libtokyotyrant="yes"
3692 with_libtokyotyrant="yes"
3695 if test "x$with_libtokyotyrant" = "xyes"
3697 if $PKG_CONFIG --exists tokyotyrant
3699 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3700 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3701 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3705 SAVE_CPPFLAGS="$CPPFLAGS"
3706 SAVE_LDFLAGS="$LDFLAGS"
3707 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3708 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3710 if test "x$with_libtokyotyrant" = "xyes"
3712 AC_CHECK_HEADERS(tcrdb.h,
3714 AC_DEFINE(HAVE_TCRDB_H, 1,
3715 [Define to 1 if you have the <tcrdb.h> header file.])
3716 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3719 if test "x$with_libtokyotyrant" = "xyes"
3721 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3723 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3724 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3726 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3727 [$with_libtokyotyrant_libs])
3730 CPPFLAGS="$SAVE_CPPFLAGS"
3731 LDFLAGS="$SAVE_LDFLAGS"
3733 if test "x$with_libtokyotyrant" = "xyes"
3735 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3736 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3737 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3738 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3739 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3740 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3742 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3745 # --with-libupsclient {{{
3746 with_libupsclient_config=""
3747 with_libupsclient_cflags=""
3748 with_libupsclient_libs=""
3749 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3751 if test "x$withval" = "xno"
3753 with_libupsclient="no"
3754 else if test "x$withval" = "xyes"
3756 with_libupsclient="use_pkgconfig"
3758 if test -x "$withval"
3760 with_libupsclient_config="$withval"
3761 with_libupsclient="use_libupsclient_config"
3762 else if test -x "$withval/bin/libupsclient-config"
3764 with_libupsclient_config="$withval/bin/libupsclient-config"
3765 with_libupsclient="use_libupsclient_config"
3767 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3768 with_libupsclient_cflags="-I$withval/include"
3769 with_libupsclient_libs="-L$withval/lib -lupsclient"
3770 with_libupsclient="yes"
3774 [with_libupsclient="use_pkgconfig"])
3776 # configure using libupsclient-config
3777 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3779 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3780 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3783 with_libupsclient="no ($with_libupsclient_config failed)"
3785 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3788 with_libupsclient="no ($with_libupsclient_config failed)"
3791 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3793 with_libupsclient="yes"
3796 # configure using pkg-config
3797 if test "x$with_libupsclient" = "xuse_pkgconfig"
3799 if test "x$PKG_CONFIG" = "x"
3801 with_libupsclient="no (Don't have pkg-config)"
3804 if test "x$with_libupsclient" = "xuse_pkgconfig"
3806 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3807 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3810 with_libupsclient="no (pkg-config doesn't know libupsclient)"
3813 if test "x$with_libupsclient" = "xuse_pkgconfig"
3815 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3818 with_libupsclient="no ($PKG_CONFIG failed)"
3820 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3823 with_libupsclient="no ($PKG_CONFIG failed)"
3826 if test "x$with_libupsclient" = "xuse_pkgconfig"
3828 with_libupsclient="yes"
3831 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3832 # the actual checks.
3833 if test "x$with_libupsclient" = "xyes"
3835 SAVE_CPPFLAGS="$CPPFLAGS"
3836 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3838 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3840 CPPFLAGS="$SAVE_CPPFLAGS"
3842 if test "x$with_libupsclient" = "xyes"
3844 SAVE_CPPFLAGS="$CPPFLAGS"
3845 SAVE_LDFLAGS="$LDFLAGS"
3847 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3848 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3850 AC_CHECK_LIB(upsclient, upscli_connect,
3851 [with_libupsclient="yes"],
3852 [with_libupsclient="no (symbol upscli_connect not found)"])
3854 CPPFLAGS="$SAVE_CPPFLAGS"
3855 LDFLAGS="$SAVE_LDFLAGS"
3857 if test "x$with_libupsclient" = "xyes"
3859 SAVE_CPPFLAGS="$CPPFLAGS"
3860 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3862 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3863 [#include <stdlib.h>
3865 #include <upsclient.h>])
3867 CPPFLAGS="$SAVE_CPPFLAGS"
3869 if test "x$with_libupsclient" = "xyes"
3871 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3872 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3873 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3874 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3878 # --with-libxmms {{{
3879 with_xmms_config="xmms-config"
3882 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3884 if test "x$withval" != "xno" \
3885 && test "x$withval" != "xyes"
3887 if test -f "$withval" && test -x "$withval";
3889 with_xmms_config="$withval"
3890 else if test -x "$withval/bin/xmms-config"
3892 with_xmms_config="$withval/bin/xmms-config"
3895 else if test "x$withval" = "xno"
3905 if test "x$with_libxmms" = "xyes"
3907 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3908 xmms_config_status=$?
3910 if test $xmms_config_status -ne 0
3915 if test "x$with_libxmms" = "xyes"
3917 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3918 xmms_config_status=$?
3920 if test $xmms_config_status -ne 0
3925 if test "x$with_libxmms" = "xyes"
3927 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3929 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3930 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3931 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3932 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3939 with_libxmms_numeric=0
3940 if test "x$with_libxmms" = "xyes"
3942 with_libxmms_numeric=1
3944 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3945 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3948 # --with-libyajl {{{
3949 with_libyajl_cppflags=""
3950 with_libyajl_ldflags=""
3951 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3953 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3955 with_libyajl_cppflags="-I$withval/include"
3956 with_libyajl_ldflags="-L$withval/lib"
3959 with_libyajl="$withval"
3965 if test "x$with_libyajl" = "xyes"
3967 SAVE_CPPFLAGS="$CPPFLAGS"
3968 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3970 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3971 AC_CHECK_HEADERS(yajl/yajl_version.h)
3973 CPPFLAGS="$SAVE_CPPFLAGS"
3975 if test "x$with_libyajl" = "xyes"
3977 SAVE_CPPFLAGS="$CPPFLAGS"
3978 SAVE_LDFLAGS="$LDFLAGS"
3979 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3980 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3982 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3984 CPPFLAGS="$SAVE_CPPFLAGS"
3985 LDFLAGS="$SAVE_LDFLAGS"
3987 if test "x$with_libyajl" = "xyes"
3989 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3990 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3991 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3992 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3993 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3994 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3995 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3997 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
4000 # --with-libvarnish {{{
4001 with_libvarnish_cppflags=""
4002 with_libvarnish_cflags=""
4003 with_libvarnish_libs=""
4004 AC_ARG_WITH(libvarnish, [AS_HELP_STRING([--with-libvarnish@<:@=PREFIX@:>@], [Path to libvarnish.])],
4006 if test "x$withval" = "xno"
4008 with_libvarnish="no"
4009 else if test "x$withval" = "xyes"
4011 with_libvarnish="use_pkgconfig"
4012 else if test -d "$with_libvarnish/lib"
4014 AC_MSG_NOTICE([Not checking for libvarnish: Manually configured])
4015 with_libvarnish_cflags="-I$withval/include"
4016 with_libvarnish_libs="-L$withval/lib -lvarnish -lvarnishcompat -lvarnishapi"
4017 with_libvarnish="yes"
4020 [with_libvarnish="use_pkgconfig"])
4022 # configure using pkg-config
4023 if test "x$with_libvarnish" = "xuse_pkgconfig"
4025 if test "x$PKG_CONFIG" = "x"
4027 with_libvarnish="no (Don't have pkg-config)"
4030 if test "x$with_libvarnish" = "xuse_pkgconfig"
4032 AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
4033 $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
4036 with_libvarnish="no (pkg-config doesn't know varnishapi)"
4039 if test "x$with_libvarnish" = "xuse_pkgconfig"
4041 with_libvarnish_cflags="`$PKG_CONFIG --cflags 'varnishapi'`"
4044 with_libvarnish="no ($PKG_CONFIG failed)"
4046 with_libvarnish_libs="`$PKG_CONFIG --libs 'varnishapi'`"
4049 with_libvarnish="no ($PKG_CONFIG failed)"
4052 if test "x$with_libvarnish" = "xuse_pkgconfig"
4054 with_libvarnish="yes"
4057 # with_libvarnish_cflags and with_libvarnish_libs are set up now, let's do
4058 # the actual checks.
4059 if test "x$with_libvarnish" = "xyes"
4061 SAVE_CPPFLAGS="$CPPFLAGS"
4062 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4063 AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
4065 CPPFLAGS="$SAVE_CPPFLAGS"
4067 if test "x$with_libvarnish" = "xyes"
4069 SAVE_CPPFLAGS="$CPPFLAGS"
4070 #SAVE_LDFLAGS="$LDFLAGS"
4072 CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
4073 #LDFLAGS="$LDFLAGS $with_libvarnish_libs"
4075 AC_CHECK_FUNC([VSL_OpenStats],
4076 [AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
4077 [AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])])
4079 CPPFLAGS="$SAVE_CPPFLAGS"
4080 #LDFLAGS="$SAVE_LDFLAGS"
4082 if test "x$with_libvarnish" = "xyes"
4084 BUILD_WITH_LIBVARNISH_CFLAGS="$with_libvarnish_cflags"
4085 BUILD_WITH_LIBVARNISH_LIBS="$with_libvarnish_libs"
4086 AC_SUBST(BUILD_WITH_LIBVARNISH_CFLAGS)
4087 AC_SUBST(BUILD_WITH_LIBVARNISH_LIBS)
4091 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
4092 with_libxml2="no (pkg-config isn't available)"
4093 with_libxml2_cflags=""
4094 with_libxml2_ldflags=""
4095 with_libvirt="no (pkg-config isn't available)"
4096 with_libvirt_cflags=""
4097 with_libvirt_ldflags=""
4098 if test "x$PKG_CONFIG" != "x"
4100 pkg-config --exists 'libxml-2.0' 2>/dev/null
4105 with_libxml2="no (pkg-config doesn't know libxml-2.0)"
4108 pkg-config --exists libvirt 2>/dev/null
4113 with_libvirt="no (pkg-config doesn't know libvirt)"
4116 if test "x$with_libxml2" = "xyes"
4118 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
4123 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
4129 if test "x$with_libxml2" = "xyes"
4131 SAVE_CPPFLAGS="$CPPFLAGS"
4132 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
4134 AC_CHECK_HEADERS(libxml/parser.h, [],
4135 [with_libxml2="no (libxml/parser.h not found)"])
4137 CPPFLAGS="$SAVE_CPPFLAGS"
4139 if test "x$with_libxml2" = "xyes"
4141 SAVE_CFLAGS="$CFLAGS"
4142 SAVE_LDFLAGS="$LDFLAGS"
4144 CFLAGS="$CFLAGS $with_libxml2_cflags"
4145 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
4147 AC_CHECK_LIB(xml2, xmlXPathEval,
4148 [with_libxml2="yes"],
4149 [with_libxml2="no (symbol xmlXPathEval not found)"])
4151 CFLAGS="$SAVE_CFLAGS"
4152 LDFLAGS="$SAVE_LDFLAGS"
4154 dnl Add the right compiler flags and libraries.
4155 if test "x$with_libxml2" = "xyes"; then
4156 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
4157 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
4158 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
4159 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
4161 if test "x$with_libvirt" = "xyes"
4163 with_libvirt_cflags="`pkg-config --cflags libvirt`"
4168 with_libvirt_ldflags="`pkg-config --libs libvirt`"
4174 if test "x$with_libvirt" = "xyes"
4176 SAVE_CPPFLAGS="$CPPFLAGS"
4177 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
4179 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
4180 [with_libvirt="no (libvirt/libvirt.h not found)"])
4182 CPPFLAGS="$SAVE_CPPFLAGS"
4184 if test "x$with_libvirt" = "xyes"
4186 SAVE_CFLAGS="$CFLAGS"
4187 SAVE_LDFLAGS="$LDFLAGS"
4189 CFLAGS="$CFLAGS $with_libvirt_cflags"
4190 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
4192 AC_CHECK_LIB(virt, virDomainBlockStats,
4193 [with_libvirt="yes"],
4194 [with_libvirt="no (symbol virDomainBlockStats not found)"])
4196 CFLAGS="$SAVE_CFLAGS"
4197 LDFLAGS="$SAVE_LDFLAGS"
4199 dnl Add the right compiler flags and libraries.
4200 if test "x$with_libvirt" = "xyes"; then
4201 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
4202 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
4203 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
4204 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
4208 # $PKG_CONFIG --exists OpenIPMIpthread {{{
4209 with_libopenipmipthread="yes"
4210 with_libopenipmipthread_cflags=""
4211 with_libopenipmipthread_libs=""
4213 AC_MSG_CHECKING([for pkg-config])
4215 if test "x$PKG_CONFIG" = "x"
4217 with_libopenipmipthread="no"
4220 temp_result="$PKG_CONFIG"
4222 AC_MSG_RESULT([$temp_result])
4224 if test "x$with_libopenipmipthread" = "xyes"
4226 AC_MSG_CHECKING([for libOpenIPMIpthread])
4227 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
4230 with_libopenipmipthread="no (pkg-config doesn't know OpenIPMIpthread)"
4232 AC_MSG_RESULT([$with_libopenipmipthread])
4235 if test "x$with_libopenipmipthread" = "xyes"
4237 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
4238 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
4241 with_libopenipmipthread_cflags="$temp_result"
4243 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
4244 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
4246 AC_MSG_RESULT([$temp_result])
4249 if test "x$with_libopenipmipthread" = "xyes"
4251 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
4252 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
4255 with_libopenipmipthread_ldflags="$temp_result"
4257 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
4258 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
4260 AC_MSG_RESULT([$temp_result])
4263 if test "x$with_libopenipmipthread" = "xyes"
4265 SAVE_CPPFLAGS="$CPPFLAGS"
4266 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
4268 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
4269 [with_libopenipmipthread="yes"],
4270 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
4271 [#include <OpenIPMI/ipmiif.h>
4272 #include <OpenIPMI/ipmi_err.h>
4273 #include <OpenIPMI/ipmi_posix.h>
4274 #include <OpenIPMI/ipmi_conn.h>
4277 CPPFLAGS="$SAVE_CPPFLAGS"
4280 if test "x$with_libopenipmipthread" = "xyes"
4282 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
4283 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
4284 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
4285 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
4289 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
4290 [with_libnotify="yes"],
4291 [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
4294 with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
4297 # Check for enabled/disabled features
4300 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
4301 # ------------------------------------------------------------
4303 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
4308 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
4313 m4_define([EnDis],[disabled])dnl
4314 m4_define([YesNo],[no])dnl
4320 m4_define([EnDis],[enabled])dnl
4321 m4_define([YesNo],[yes])dnl
4324 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
4328 m4_if([$3], [feature], [],
4332 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
4338 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
4340 enable_$1='[YesNo]'dnl
4342 if test "x$enable_$1" = "xno"
4346 if test "x$enable_$1" = "xyes"
4350 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
4355 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
4356 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
4358 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
4360 # AC_PLUGIN(name, default, info)
4361 # ------------------------------------------------------------
4368 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
4370 if test "x$enableval" = "xyes"
4373 else if test "x$enableval" = "xforce"
4378 enable_plugin="no (disabled on command line)"
4382 if test "x$enable_all_plugins" = "xauto"
4384 if test "x$2" = "xyes"
4391 enable_plugin="$enable_all_plugins"
4394 if test "x$enable_plugin" = "xyes"
4396 if test "x$2" = "xyes" || test "x$force" = "xyes"
4398 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
4399 if test "x$2" != "xyes"
4401 dependency_warning="yes"
4403 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
4404 dependency_error="yes"
4405 enable_plugin="no (dependency error)"
4408 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
4409 enable_$1="$enable_plugin"
4411 )# AC_PLUGIN(name, default, info)
4413 m4_divert_once([HELP_ENABLE], [
4414 collectd features:])
4415 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
4416 AC_COLLECTD([debug], [enable], [feature], [debugging])
4417 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
4418 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
4420 dependency_warning="no"
4421 dependency_error="no"
4426 plugin_conntrack="no"
4427 plugin_contextswitch="no"
4430 plugin_curl_json="no"
4431 plugin_curl_xml="no"
4436 plugin_interface="no"
4443 plugin_multimeter="no"
4447 plugin_processes="no"
4448 plugin_protocols="no"
4452 plugin_tcpconns="no"
4459 plugin_wireless="no"
4463 if test "x$ac_system" = "xLinux"
4465 plugin_battery="yes"
4466 plugin_conntrack="yes"
4467 plugin_contextswitch="yes"
4469 plugin_cpufreq="yes"
4471 plugin_entropy="yes"
4472 plugin_fscache="yes"
4473 plugin_interface="yes"
4479 plugin_processes="yes"
4480 plugin_protocols="yes"
4483 plugin_tcpconns="yes"
4484 plugin_thermal="yes"
4487 plugin_vserver="yes"
4488 plugin_wireless="yes"
4490 if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4496 if test "x$ac_system" = "xOpenBSD"
4498 plugin_tcpconns="yes"
4502 if test "x$with_libiokit" = "xyes"
4504 plugin_battery="yes"
4510 if test "x$ac_system" = "xAIX"
4512 plugin_tcpconns="yes"
4515 if test "x$with_perfstat" = "xyes"
4521 plugin_interface="yes"
4525 if test "x$with_procinfo" = "xyes"
4527 plugin_processes="yes"
4531 if test "x$with_kstat" = "xyes"
4534 plugin_zfs_arc="yes"
4537 if test "x$with_devinfo$with_kstat" = "xyesyes"
4541 plugin_interface="yes"
4547 if test "x$with_libstatgrab" = "xyes"
4551 plugin_interface="yes"
4558 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4561 if test "x$have_strptime" = "xyes"
4567 if test "x$with_libopenipmipthread" = "xyes"
4572 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4574 plugin_curl_json="yes"
4577 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4579 plugin_curl_xml="yes"
4582 if test "x$have_processor_info" = "xyes"
4586 if test "x$have_sysctl" = "xyes"
4591 if test "x$ac_system" = "xDarwin"
4596 if test "x$have_sysctlbyname" = "xyes"
4598 plugin_contextswitch="yes"
4601 plugin_tcpconns="yes"
4604 # Df plugin: Check if we know how to determine mount points first.
4605 #if test "x$have_listmntent" = "xyes"; then
4608 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4612 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4616 #if test "x$have_getmntent" = "xseq"
4620 if test "x$c_cv_have_one_getmntent" = "xyes"
4625 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4626 if test "x$plugin_df" = "xyes"
4629 if test "x$have_statfs" = "xyes"
4633 if test "x$have_statvfs" = "xyes"
4639 if test "x$have_getifaddrs" = "xyes"
4641 plugin_interface="yes"
4644 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4646 plugin_libvirt="yes"
4649 if test "x$have_getloadavg" = "xyes"
4654 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4659 # Mac OS X memory interface
4660 if test "x$have_host_statistics" = "xyes"
4665 if test "x$have_termios_h" = "xyes"
4667 plugin_multimeter="yes"
4671 if test "x$have_thread_info" = "xyes"
4673 plugin_processes="yes"
4676 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4678 plugin_processes="yes"
4681 if test "x$with_kvm_getswapinfo" = "xyes"
4686 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"
4691 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4693 plugin_tcpconns="yes"
4696 if test "x$have_getutent" = "xyes"
4700 if test "x$have_getutxent" = "xyes"
4705 m4_divert_once([HELP_ENABLE], [
4708 AC_ARG_ENABLE([all-plugins],
4709 AC_HELP_STRING([--enable-all-plugins],
4710 [enable all plugins (auto by def)]),
4712 if test "x$enableval" = "xyes"
4714 enable_all_plugins="yes"
4715 else if test "x$enableval" = "xauto"
4717 enable_all_plugins="auto"
4719 enable_all_plugins="no"
4722 [enable_all_plugins="auto"])
4724 m4_divert_once([HELP_ENABLE], [])
4726 AC_PLUGIN([amqp], [$with_librabbitmq], [AMQP output plugin])
4727 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4728 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4729 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4730 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4731 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4732 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4733 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4734 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4735 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4736 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4737 AC_PLUGIN([csv], [yes], [CSV output plugin])
4738 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4739 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4740 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4741 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4742 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4743 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4744 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4745 AC_PLUGIN([email], [yes], [EMail statistics])
4746 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4747 AC_PLUGIN([exec], [yes], [Execution of external programs])
4748 AC_PLUGIN([filecount], [yes], [Count files in directories])
4749 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4750 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4751 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4752 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4753 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4754 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4755 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4756 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4757 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4758 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4759 AC_PLUGIN([load], [$plugin_load], [System load])
4760 AC_PLUGIN([logfile], [yes], [File logging plugin])
4761 AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
4762 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4763 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4764 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4765 AC_PLUGIN([match_regex], [yes], [The regex match])
4766 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4767 AC_PLUGIN([match_value], [yes], [The value match])
4768 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4769 AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
4770 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4771 AC_PLUGIN([memcached], [yes], [memcached statistics])
4772 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4773 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4774 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4775 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4776 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4777 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4778 AC_PLUGIN([network], [yes], [Network communication plugin])
4779 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4780 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4781 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4782 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4783 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4784 AC_PLUGIN([numa], [$plugin_numa], [NUMA virtual memory statistics])
4785 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4786 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4787 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4788 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4789 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4790 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4791 # FIXME: Check for libevent, too.
4792 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4793 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4794 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4795 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4796 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4797 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4798 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4799 AC_PLUGIN([redis], [$with_libcredis], [Redis plugin])
4800 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4801 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4802 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4803 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4804 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4805 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4806 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4807 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4808 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4809 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4810 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4811 AC_PLUGIN([target_notification], [yes], [The notification target])
4812 AC_PLUGIN([target_replace], [yes], [The replace target])
4813 AC_PLUGIN([target_scale],[yes], [The scale target])
4814 AC_PLUGIN([target_set], [yes], [The set target])
4815 AC_PLUGIN([target_v5upgrade], [yes], [The v5upgrade target])
4816 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4817 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4818 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4819 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4820 AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
4821 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4822 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4823 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4824 AC_PLUGIN([users], [$plugin_users], [User statistics])
4825 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4826 AC_PLUGIN([varnish], [$with_libvarnish], [Varnish cache statistics])
4827 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4828 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4829 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4830 AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin])
4831 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4832 AC_PLUGIN([write_redis], [$with_libcredis], [Redis output plugin])
4833 AC_PLUGIN([write_mongodb], [$with_libmongoc], [MongoDB output plugin])
4834 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4835 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4837 dnl Default configuration file
4838 # Load either syslog or logfile
4839 LOAD_PLUGIN_SYSLOG=""
4840 LOAD_PLUGIN_LOGFILE=""
4842 AC_MSG_CHECKING([which default log plugin to load])
4843 default_log_plugin="none"
4844 if test "x$enable_syslog" = "xyes"
4846 default_log_plugin="syslog"
4848 LOAD_PLUGIN_SYSLOG="##"
4851 if test "x$enable_logfile" = "xyes"
4853 if test "x$default_log_plugin" = "xnone"
4855 default_log_plugin="logfile"
4857 LOAD_PLUGIN_LOGFILE="#"
4860 LOAD_PLUGIN_LOGFILE="##"
4862 AC_MSG_RESULT([$default_log_plugin])
4864 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4865 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4867 DEFAULT_LOG_LEVEL="info"
4868 if test "x$enable_debug" = "xyes"
4870 DEFAULT_LOG_LEVEL="debug"
4872 AC_SUBST(DEFAULT_LOG_LEVEL)
4874 # Load only one of rrdtool, network, csv in the default config.
4875 LOAD_PLUGIN_RRDTOOL=""
4876 LOAD_PLUGIN_NETWORK=""
4879 AC_MSG_CHECKING([which default write plugin to load])
4880 default_write_plugin="none"
4881 if test "x$enable_rrdtool" = "xyes"
4883 default_write_plugin="rrdtool"
4885 LOAD_PLUGIN_RRDTOOL="##"
4888 if test "x$enable_network" = "xyes"
4890 if test "x$default_write_plugin" = "xnone"
4892 default_write_plugin="network"
4894 LOAD_PLUGIN_NETWORK="#"
4897 LOAD_PLUGIN_NETWORK="##"
4900 if test "x$enable_csv" = "xyes"
4902 if test "x$default_write_plugin" = "xnone"
4904 default_write_plugin="csv"
4909 LOAD_PLUGIN_CSV="##"
4911 AC_MSG_RESULT([$default_write_plugin])
4913 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4914 AC_SUBST(LOAD_PLUGIN_NETWORK)
4915 AC_SUBST(LOAD_PLUGIN_CSV)
4918 if test "x$ac_system" = "xLinux" \
4919 && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
4921 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4924 if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
4926 enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
4930 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4932 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4934 PERL_BINDINGS_OPTIONS="$withval"
4935 with_perl_bindings="yes"
4937 PERL_BINDINGS_OPTIONS=""
4938 with_perl_bindings="$withval"
4942 PERL_BINDINGS_OPTIONS=""
4943 if test -n "$perl_interpreter"
4945 with_perl_bindings="yes"
4947 with_perl_bindings="no (no perl interpreter found)"
4950 if test "x$with_perl_bindings" = "xyes"
4952 PERL_BINDINGS="perl"
4956 AC_SUBST(PERL_BINDINGS)
4957 AC_SUBST(PERL_BINDINGS_OPTIONS)
4959 dnl libcollectdclient
4960 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4961 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4962 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4964 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4966 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4968 AC_SUBST(LCC_VERSION_MAJOR)
4969 AC_SUBST(LCC_VERSION_MINOR)
4970 AC_SUBST(LCC_VERSION_PATCH)
4971 AC_SUBST(LCC_VERSION_EXTRA)
4972 AC_SUBST(LCC_VERSION_STRING)
4974 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4976 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
4978 if test "x$with_librrd" = "xyes" \
4979 && test "x$librrd_threadsafe" != "xyes"
4981 with_librrd="yes (warning: librrd is not thread-safe)"
4984 if test "x$with_libperl" = "xyes"
4986 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4988 enable_perl="no (needs libperl)"
4991 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4993 enable_perl="no (libperl doesn't support ithreads)"
4996 if test "x$with_perl_bindings" = "xyes" \
4997 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4999 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
5006 libcurl . . . . . . . $with_libcurl
5007 libdbi . . . . . . . $with_libdbi
5008 libcredis . . . . . . $with_libcredis
5009 libesmtp . . . . . . $with_libesmtp
5010 libganglia . . . . . $with_libganglia
5011 libgcrypt . . . . . . $with_libgcrypt
5012 libiokit . . . . . . $with_libiokit
5013 libiptc . . . . . . . $with_libiptc
5014 libjvm . . . . . . . $with_java
5015 libkstat . . . . . . $with_kstat
5016 libkvm . . . . . . . $with_libkvm
5017 libmemcached . . . . $with_libmemcached
5018 libmodbus . . . . . . $with_libmodbus
5019 libmysql . . . . . . $with_libmysql
5020 libnetapp . . . . . . $with_libnetapp
5021 libnetlink . . . . . $with_libnetlink
5022 libnetsnmp . . . . . $with_libnetsnmp
5023 libnotify . . . . . . $with_libnotify
5024 liboconfig . . . . . $with_liboconfig
5025 libopenipmi . . . . . $with_libopenipmipthread
5026 liboping . . . . . . $with_liboping
5027 libpcap . . . . . . . $with_libpcap
5028 libperfstat . . . . . $with_perfstat
5029 libperl . . . . . . . $with_libperl
5030 libpq . . . . . . . . $with_libpq
5031 libpthread . . . . . $with_libpthread
5032 librabbitmq . . . . . $with_librabbitmq
5033 librouteros . . . . . $with_librouteros
5034 librrd . . . . . . . $with_librrd
5035 libsensors . . . . . $with_libsensors
5036 libstatgrab . . . . . $with_libstatgrab
5037 libtokyotyrant . . . $with_libtokyotyrant
5038 libupsclient . . . . $with_libupsclient
5039 libvarnish . . . . . $with_libvarnish
5040 libvirt . . . . . . . $with_libvirt
5041 libxml2 . . . . . . . $with_libxml2
5042 libxmms . . . . . . . $with_libxmms
5043 libyajl . . . . . . . $with_libyajl
5044 libevent . . . . . . $with_libevent
5045 protobuf-c . . . . . $have_protoc_c
5046 oracle . . . . . . . $with_oracle
5047 python . . . . . . . $with_python
5050 daemon mode . . . . . $enable_daemon
5051 debug . . . . . . . . $enable_debug
5054 perl . . . . . . . . $with_perl_bindings
5057 amqp . . . . . . . $enable_amqp
5058 apache . . . . . . . $enable_apache
5059 apcups . . . . . . . $enable_apcups
5060 apple_sensors . . . . $enable_apple_sensors
5061 ascent . . . . . . . $enable_ascent
5062 battery . . . . . . . $enable_battery
5063 bind . . . . . . . . $enable_bind
5064 conntrack . . . . . . $enable_conntrack
5065 contextswitch . . . . $enable_contextswitch
5066 cpu . . . . . . . . . $enable_cpu
5067 cpufreq . . . . . . . $enable_cpufreq
5068 csv . . . . . . . . . $enable_csv
5069 curl . . . . . . . . $enable_curl
5070 curl_json . . . . . . $enable_curl_json
5071 curl_xml . . . . . . $enable_curl_xml
5072 dbi . . . . . . . . . $enable_dbi
5073 df . . . . . . . . . $enable_df
5074 disk . . . . . . . . $enable_disk
5075 dns . . . . . . . . . $enable_dns
5076 email . . . . . . . . $enable_email
5077 entropy . . . . . . . $enable_entropy
5078 exec . . . . . . . . $enable_exec
5079 filecount . . . . . . $enable_filecount
5080 fscache . . . . . . . $enable_fscache
5081 gmond . . . . . . . . $enable_gmond
5082 hddtemp . . . . . . . $enable_hddtemp
5083 interface . . . . . . $enable_interface
5084 ipmi . . . . . . . . $enable_ipmi
5085 iptables . . . . . . $enable_iptables
5086 ipvs . . . . . . . . $enable_ipvs
5087 irq . . . . . . . . . $enable_irq
5088 java . . . . . . . . $enable_java
5089 libvirt . . . . . . . $enable_libvirt
5090 load . . . . . . . . $enable_load
5091 logfile . . . . . . . $enable_logfile
5092 lpar... . . . . . . . $enable_lpar
5093 madwifi . . . . . . . $enable_madwifi
5094 match_empty_counter . $enable_match_empty_counter
5095 match_hashed . . . . $enable_match_hashed
5096 match_regex . . . . . $enable_match_regex
5097 match_timediff . . . $enable_match_timediff
5098 match_value . . . . . $enable_match_value
5099 mbmon . . . . . . . . $enable_mbmon
5100 md . . . . . . . . . $enable_md
5101 memcachec . . . . . . $enable_memcachec
5102 memcached . . . . . . $enable_memcached
5103 memory . . . . . . . $enable_memory
5104 modbus . . . . . . . $enable_modbus
5105 multimeter . . . . . $enable_multimeter
5106 mysql . . . . . . . . $enable_mysql
5107 netapp . . . . . . . $enable_netapp
5108 netlink . . . . . . . $enable_netlink
5109 network . . . . . . . $enable_network
5110 nfs . . . . . . . . . $enable_nfs
5111 nginx . . . . . . . . $enable_nginx
5112 notify_desktop . . . $enable_notify_desktop
5113 notify_email . . . . $enable_notify_email
5114 ntpd . . . . . . . . $enable_ntpd
5115 numa . . . . . . . . $enable_numa
5116 nut . . . . . . . . . $enable_nut
5117 olsrd . . . . . . . . $enable_olsrd
5118 onewire . . . . . . . $enable_onewire
5119 openvpn . . . . . . . $enable_openvpn
5120 oracle . . . . . . . $enable_oracle
5121 perl . . . . . . . . $enable_perl
5122 pinba . . . . . . . . $enable_pinba
5123 ping . . . . . . . . $enable_ping
5124 postgresql . . . . . $enable_postgresql
5125 powerdns . . . . . . $enable_powerdns
5126 processes . . . . . . $enable_processes
5127 protocols . . . . . . $enable_protocols
5128 python . . . . . . . $enable_python
5129 redis . . . . . . . . $enable_redis
5130 routeros . . . . . . $enable_routeros
5131 rrdcached . . . . . . $enable_rrdcached
5132 rrdtool . . . . . . . $enable_rrdtool
5133 sensors . . . . . . . $enable_sensors
5134 serial . . . . . . . $enable_serial
5135 snmp . . . . . . . . $enable_snmp
5136 swap . . . . . . . . $enable_swap
5137 syslog . . . . . . . $enable_syslog
5138 table . . . . . . . . $enable_table
5139 tail . . . . . . . . $enable_tail
5140 tape . . . . . . . . $enable_tape
5141 target_notification . $enable_target_notification
5142 target_replace . . . $enable_target_replace
5143 target_scale . . . . $enable_target_scale
5144 target_set . . . . . $enable_target_set
5145 target_v5upgrade . . $enable_target_v5upgrade
5146 tcpconns . . . . . . $enable_tcpconns
5147 teamspeak2 . . . . . $enable_teamspeak2
5148 ted . . . . . . . . . $enable_ted
5149 thermal . . . . . . . $enable_thermal
5150 threshold . . . . . . $enable_threshold
5151 tokyotyrant . . . . . $enable_tokyotyrant
5152 unixsock . . . . . . $enable_unixsock
5153 uptime . . . . . . . $enable_uptime
5154 users . . . . . . . . $enable_users
5155 uuid . . . . . . . . $enable_uuid
5156 varnish . . . . . . . $enable_varnish
5157 vmem . . . . . . . . $enable_vmem
5158 vserver . . . . . . . $enable_vserver
5159 wireless . . . . . . $enable_wireless
5160 write_graphite . . . $enable_write_graphite
5161 write_http . . . . . $enable_write_http
5162 write_redis . . . . . $enable_write_redis
5163 write_mongodb . . . . $enable_write_mongodb
5164 xmms . . . . . . . . $enable_xmms
5165 zfs_arc . . . . . . . $enable_zfs_arc
5169 if test "x$dependency_error" = "xyes"; then
5170 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
5173 if test "x$dependency_warning" = "xyes"; then
5174 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
5177 # vim: set fdm=marker :