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)
6 m4_ifdef([LT_PACKAGE_VERSION],
9 LT_CONFIG_LTDL_DIR([libltdl])
11 LTDL_INIT([convenience])
16 AC_LIBLTDL_CONVENIENCE
20 AC_CONFIG_SUBDIRS(libltdl)
24 AM_INIT_AUTOMAKE(dist-bzip2)
27 AC_PREFIX_DEFAULT("/opt/collectd")
32 # Checks for programs.
40 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
48 AC_MSG_CHECKING([for kernel type ($host_os)])
51 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
55 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
67 AC_MSG_RESULT([$ac_system])
69 if test "x$ac_system" = "xLinux"
71 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
72 if test -z "$KERNEL_DIR"
74 KERNEL_DIR="/lib/modules/`uname -r`/source"
77 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
78 AC_SUBST(KERNEL_CFLAGS)
81 if test "x$ac_system" = "xSolaris"
83 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
86 # Where to install .pc files.
87 pkgconfigdir="${libdir}/pkgconfig"
88 AC_SUBST(pkgconfigdir)
90 # Check for standards compliance mode
91 AC_ARG_ENABLE(standards,
92 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
93 [enable_standards="$enableval"],
94 [enable_standards="no"])
95 if test "x$enable_standards" = "xyes"
97 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
98 AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
99 AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
100 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
102 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
105 # Checks for header files.
112 AC_CHECK_HEADERS(stdio.h stdint.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)
115 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
120 # include <sys/types.h>
123 AC_CHECK_HEADERS(netinet/in.h, [], [],
128 # include <sys/types.h>
130 #if HAVE_NETINET_IN_SYSTM_H
131 # include <netinet/in_systm.h>
134 AC_CHECK_HEADERS(netinet/ip.h, [], [],
139 # include <sys/types.h>
141 #if HAVE_NETINET_IN_SYSTM_H
142 # include <netinet/in_systm.h>
144 #if HAVE_NETINET_IN_H
145 # include <netinet/in.h>
148 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
153 # include <sys/types.h>
155 #if HAVE_NETINET_IN_SYSTM_H
156 # include <netinet/in_systm.h>
158 #if HAVE_NETINET_IN_H
159 # include <netinet/in.h>
161 #if HAVE_NETINET_IP_H
162 # include <netinet/ip.h>
165 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
170 # include <sys/types.h>
172 #if HAVE_NETINET_IN_SYSTM_H
173 # include <netinet/in_systm.h>
175 #if HAVE_NETINET_IN_H
176 # include <netinet/in.h>
178 #if HAVE_NETINET_IP_H
179 # include <netinet/ip.h>
182 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
187 # include <sys/types.h>
189 #if HAVE_NETINET_IN_SYSTM_H
190 # include <netinet/in_systm.h>
192 #if HAVE_NETINET_IN_H
193 # include <netinet/in.h>
196 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
201 # include <sys/types.h>
203 #if HAVE_NETINET_IN_SYSTM_H
204 # include <netinet/in_systm.h>
206 #if HAVE_NETINET_IN_H
207 # include <netinet/in.h>
209 #if HAVE_NETINET_IP6_H
210 # include <netinet/ip6.h>
213 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
218 # include <sys/types.h>
220 #if HAVE_NETINET_IN_SYSTM_H
221 # include <netinet/in_systm.h>
223 #if HAVE_NETINET_IN_H
224 # include <netinet/in.h>
226 #if HAVE_NETINET_IP_H
227 # include <netinet/ip.h>
230 AC_CHECK_HEADERS(netinet/udp.h, [], [],
235 # include <sys/types.h>
237 #if HAVE_NETINET_IN_SYSTM_H
238 # include <netinet/in_systm.h>
240 #if HAVE_NETINET_IN_H
241 # include <netinet/in.h>
243 #if HAVE_NETINET_IP_H
244 # include <netinet/ip.h>
249 AC_CHECK_HEADERS(sys/dkstat.h)
250 if test "x$ac_system" = "xDarwin"
252 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)
253 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
255 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
258 # include <sys/types.h>
261 # include <sys/param.h>
266 AC_CHECK_HEADERS(linux/major.h libgen.h)
268 # For the battery plugin
269 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
271 #if HAVE_IOKIT_IOKITLIB_H
272 # include <IOKit/IOKitLib.h>
274 #if HAVE_IOKIT_IOTYPES_H
275 # include <IOKit/IOTypes.h>
279 # For the swap module
280 have_sys_swap_h="yes"
281 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
284 # include <sys/types.h>
287 # include <sys/param.h>
291 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
294 if test "x$GCC" = "xyes"
296 hint_64="CFLAGS='-m64'"
298 hint_64="CFLAGS='-xarch=v9'"
300 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
304 # For the processes plugin
306 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
308 # For interface plugin
309 AC_CHECK_HEADERS(ifaddrs.h)
310 AC_CHECK_HEADERS(net/if.h, [], [],
313 # include <sys/types.h>
315 #if HAVE_SYS_SOCKET_H
316 # include <sys/socket.h>
319 AC_CHECK_HEADERS(linux/if.h, [], [],
322 # include <sys/types.h>
324 #if HAVE_SYS_SOCKET_H
325 # include <sys/socket.h>
328 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
331 # include <sys/types.h>
333 #if HAVE_SYS_SOCKET_H
334 # include <sys/socket.h>
337 # include <linux/if.h>
342 have_net_ip_vs_h="no"
344 if test "x$ac_system" = "xLinux"
347 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
349 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
350 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
356 AC_CHECK_HEADERS(sys/ucred.h, [], [],
359 # include <sys/types.h>
362 # include <sys/param.h>
366 # For mount interface
367 AC_CHECK_HEADERS(sys/mount.h, [], [],
370 # include <sys/types.h>
373 # include <sys/param.h>
377 # For the email plugin
378 AC_CHECK_HEADERS(linux/un.h, [], [],
380 #if HAVE_SYS_SOCKET_H
381 # include <sys/socket.h>
385 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)
388 AC_CHECK_HEADERS(arpa/nameser.h)
389 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
391 #if HAVE_ARPA_NAMESER_H
392 # include <arpa/nameser.h>
396 AC_CHECK_HEADERS(net/if_arp.h, [], [],
397 [#if HAVE_SYS_SOCKET_H
398 # include <sys/socket.h>
401 AC_CHECK_HEADERS(net/ppp_defs.h)
402 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
403 [#if HAVE_NET_PPP_DEFS_H
404 # include <net/ppp_defs.h>
407 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
412 # include <sys/types.h>
414 #if HAVE_SYS_SOCKET_H
415 # include <sys/socket.h>
420 #if HAVE_NETINET_IN_H
421 # include <netinet/in.h>
425 # For the multimeter plugin
427 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
430 # Checks for typedefs, structures, and compiler characteristics.
439 # Checks for library functions.
441 AC_PROG_GCC_TRADITIONAL
442 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
446 AC_CACHE_CHECK([for strtok_r],
447 [c_cv_have_strtok_r_default],
456 char buffer[] = "foo,bar,baz";
463 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
466 printf ("token = %s;\n", token);
469 [c_cv_have_strtok_r_default="yes"],
470 [c_cv_have_strtok_r_default="no"]
474 if test "x$c_cv_have_strtok_r_default" = "xno"
476 SAVE_CFLAGS="$CFLAGS"
477 CFLAGS="$CFLAGS -D_REENTRANT=1"
479 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
480 [c_cv_have_strtok_r_reentrant],
489 char buffer[] = "foo,bar,baz";
496 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
499 printf ("token = %s;\n", token);
502 [c_cv_have_strtok_r_reentrant="yes"],
503 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
508 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
510 socket_needs_socket="no"
511 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
512 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
514 nanosleep_needs_rt="no"
515 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
516 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
518 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
519 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
520 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
521 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
522 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
523 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
524 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
525 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
526 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
527 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
528 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
529 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
532 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
535 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
537 if test "x$withval" = "xno"; then
539 else if test "x$withval" = "xyes"; then
546 if test "x$nan_type" = "xnone"; then
547 AC_CACHE_CHECK([whether NAN is defined by default],
548 [c_cv_have_nan_default],
554 static float foo = NAN;
562 [c_cv_have_nan_default="yes"],
563 [c_cv_have_nan_default="no"]
566 if test "x$c_cv_have_nan_default" = "xyes"
571 if test "x$nan_type" = "xnone"; then
572 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
573 [c_cv_have_nan_isoc],
578 #define __USE_ISOC99 1
580 static float foo = NAN;
588 [c_cv_have_nan_isoc="yes"],
589 [c_cv_have_nan_isoc="no"]
592 if test "x$c_cv_have_nan_isoc" = "xyes"
597 if test "x$nan_type" = "xnone"; then
598 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
599 [c_cv_have_nan_zero],
608 #define NAN (0.0 / 0.0)
610 # define isnan(f) ((f) != (f))
612 static float foo = NAN;
620 [c_cv_have_nan_zero="yes"],
621 [c_cv_have_nan_zero="no"]
624 if test "x$c_cv_have_nan_zero" = "xyes"
630 if test "x$nan_type" = "xdefault"; then
631 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
632 [Define if NAN is defined by default and can initialize static variables.])
633 else if test "x$nan_type" = "xisoc99"; then
634 AC_DEFINE(NAN_STATIC_ISOC, 1,
635 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
636 else if test "x$nan_type" = "xzero"; then
637 AC_DEFINE(NAN_ZERO_ZERO, 1,
638 [Define if NAN can be defined as (0.0 / 0.0)])
640 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
643 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
645 if test "x$withval" = "xnothing"; then
646 fp_layout_type="nothing"
647 else if test "x$withval" = "xendianflip"; then
648 fp_layout_type="endianflip"
649 else if test "x$withval" = "xintswap"; then
650 fp_layout_type="intswap"
652 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
655 [fp_layout_type="unknown"])
657 if test "x$fp_layout_type" = "xunknown"; then
658 AC_CACHE_CHECK([if doubles are stored in x86 representation],
659 [c_cv_fp_layout_need_nothing],
670 # include <stdbool.h>
680 memcpy ((void *) &i0, (void *) &d, 8);
683 memcpy ((void *) c, (void *) &i1, 8);
685 if ((c[0] == 0x2f) && (c[1] == 0x25)
686 && (c[2] == 0xc0) && (c[3] == 0xc7)
687 && (c[4] == 0x43) && (c[5] == 0x2b)
688 && (c[6] == 0x1f) && (c[7] == 0x5b))
693 [c_cv_fp_layout_need_nothing="yes"],
694 [c_cv_fp_layout_need_nothing="no"]
697 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
698 fp_layout_type="nothing"
701 if test "x$fp_layout_type" = "xunknown"; then
702 AC_CACHE_CHECK([if endianflip converts to x86 representation],
703 [c_cv_fp_layout_need_endianflip],
714 # include <stdbool.h>
716 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
717 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
718 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
719 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
720 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
721 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
722 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
723 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
732 memcpy ((void *) &i0, (void *) &d, 8);
734 i1 = endianflip (i0);
735 memcpy ((void *) c, (void *) &i1, 8);
737 if ((c[0] == 0x2f) && (c[1] == 0x25)
738 && (c[2] == 0xc0) && (c[3] == 0xc7)
739 && (c[4] == 0x43) && (c[5] == 0x2b)
740 && (c[6] == 0x1f) && (c[7] == 0x5b))
745 [c_cv_fp_layout_need_endianflip="yes"],
746 [c_cv_fp_layout_need_endianflip="no"]
749 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
750 fp_layout_type="endianflip"
753 if test "x$fp_layout_type" = "xunknown"; then
754 AC_CACHE_CHECK([if intswap converts to x86 representation],
755 [c_cv_fp_layout_need_intswap],
766 # include <stdbool.h>
768 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
769 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
778 memcpy ((void *) &i0, (void *) &d, 8);
781 memcpy ((void *) c, (void *) &i1, 8);
783 if ((c[0] == 0x2f) && (c[1] == 0x25)
784 && (c[2] == 0xc0) && (c[3] == 0xc7)
785 && (c[4] == 0x43) && (c[5] == 0x2b)
786 && (c[6] == 0x1f) && (c[7] == 0x5b))
791 [c_cv_fp_layout_need_intswap="yes"],
792 [c_cv_fp_layout_need_intswap="no"]
795 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
796 fp_layout_type="intswap"
800 if test "x$fp_layout_type" = "xnothing"; then
801 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
802 [Define if doubles are stored in x86 representation.])
803 else if test "x$fp_layout_type" = "xendianflip"; then
804 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
805 [Define if endianflip is needed to convert to x86 representation.])
806 else if test "x$fp_layout_type" = "xintswap"; then
807 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
808 [Define if intswap is needed to convert to x86 representation.])
810 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
814 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
816 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
818 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
821 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
822 if test "x$have_getmntent" = "xno"; then
823 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
825 if test "x$have_getmntent" = "xno"; then
826 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
828 if test "x$have_getmntent" = "xno"; then
829 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
832 if test "x$have_getmntent" = "xc"; then
833 AC_CACHE_CHECK([whether getmntent takes one argument],
834 [c_cv_have_one_getmntent],
836 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
837 #include "$srcdir/src/utils_mount.h"]],
841 fh = setmntent ("/etc/mtab", "r");
845 [c_cv_have_one_getmntent="yes"],
846 [c_cv_have_one_getmntent="no"]
849 AC_CACHE_CHECK([whether getmntent takes two arguments],
850 [c_cv_have_two_getmntent],
852 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
853 #include "$srcdir/src/utils_mount.h"]],
858 fh = fopen ("/etc/mnttab", "r");
859 status = getmntent (fh, &mt);
862 [c_cv_have_two_getmntent="yes"],
863 [c_cv_have_two_getmntent="no"]
868 # Check for different versions of `getmntent' here..
870 if test "x$have_getmntent" = "xc"; then
871 if test "x$c_cv_have_one_getmntent" = "xyes"; then
872 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
873 [Define if the function getmntent exists and takes one argument.])
875 if test "x$c_cv_have_two_getmntent" = "xyes"; then
876 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
877 [Define if the function getmntent exists and takes two arguments.])
880 if test "x$have_getmntent" = "xsun"; then
881 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
882 [Define if the function getmntent exists. It's the version from libsun.])
884 if test "x$have_getmntent" = "xseq"; then
885 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
886 [Define if the function getmntent exists. It's the version from libseq.])
888 if test "x$have_getmntent" = "xgen"; then
889 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
890 [Define if the function getmntent exists. It's the version from libgen.])
893 # Check for structures
894 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
895 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
898 #include <sys/types.h>
899 #include <sys/socket.h>
902 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
903 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
906 #include <sys/types.h>
907 #include <sys/socket.h>
908 #include <linux/if.h>
909 #include <linux/netdevice.h>
912 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
914 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
915 [Define if struct kinfo_proc exists in the FreeBSD variant.])
916 have_struct_kinfo_proc_freebsd="yes"
919 have_struct_kinfo_proc_freebsd="no"
923 #include <sys/param.h>
924 #include <sys/sysctl.h>
925 #include <sys/user.h>
928 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
930 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
931 [Define if struct kinfo_proc exists in the OpenBSD variant.])
932 have_struct_kinfo_proc_openbsd="yes"
935 have_struct_kinfo_proc_openbsd="no"
938 #include <sys/param.h>
939 #include <sys/sysctl.h>
943 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
949 # include <sys/types.h>
951 #if HAVE_NETINET_IN_SYSTM_H
952 # include <netinet/in_systm.h>
954 #if HAVE_NETINET_IN_H
955 # include <netinet/in.h>
957 #if HAVE_NETINET_IP_H
958 # include <netinet/ip.h>
960 #if HAVE_NETINET_UDP_H
961 # include <netinet/udp.h>
964 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
970 # include <sys/types.h>
972 #if HAVE_NETINET_IN_SYSTM_H
973 # include <netinet/in_systm.h>
975 #if HAVE_NETINET_IN_H
976 # include <netinet/in.h>
978 #if HAVE_NETINET_IP_H
979 # include <netinet/ip.h>
981 #if HAVE_NETINET_UDP_H
982 # include <netinet/udp.h>
986 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
996 # Checks for libraries begin here
999 AC_CHECK_LIB(resolv, res_search,
1001 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1003 [with_libresolv="no"])
1004 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1006 dnl Check for HAL (hardware abstraction library)
1008 AC_CHECK_LIB(hal,libhal_device_property_exists,
1009 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1011 if test "x$with_libhal" = "xyes"; then
1012 if test "x$PKG_CONFIG" != "x"; then
1013 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1014 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1015 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1016 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1020 m4_divert_once([HELP_WITH], [
1021 collectd additional packages:])
1023 if test "x$ac_system" = "xSolaris"
1028 with_kstat="no (Solaris only)"
1029 with_devinfo="no (Solaris only)"
1032 if test "x$with_kstat" = "xyes"
1034 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1036 if test "x$with_kstat" = "xyes"
1038 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1039 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1041 if test "x$with_kstat" = "xyes"
1043 AC_DEFINE(HAVE_LIBKSTAT, 1,
1044 [Define to 1 if you have the 'kstat' library (-lkstat)])
1046 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1047 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1050 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1057 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1060 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1061 if test "x$with_kvm_getprocs" = "xyes"
1063 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1064 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1067 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1069 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1070 if test "x$with_kvm_getswapinfo" = "xyes"
1072 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1073 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1076 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1078 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1079 if test "x$with_kvm_nlist" = "xyes"
1081 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1082 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1085 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1087 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1088 if test "x$with_kvm_openfiles" = "xyes"
1090 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1091 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1094 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1096 # --with-libcurl {{{
1097 with_curl_config="curl-config"
1100 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1102 if test "x$withval" = "xno"
1105 else if test "x$withval" = "xyes"
1109 if test -f "$withval" && test -x "$withval"
1111 with_curl_config="$withval"
1113 else if test -x "$withval/bin/curl-config"
1115 with_curl_config="$withval/bin/curl-config"
1124 if test "x$with_libcurl" = "xyes"
1126 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1127 curl_config_status=$?
1129 if test $curl_config_status -ne 0
1131 with_libcurl="no ($with_curl_config failed)"
1133 SAVE_CPPFLAGS="$CPPFLAGS"
1134 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1136 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1138 CPPFLAGS="$SAVE_CPPFLAGS"
1141 if test "x$with_libcurl" = "xyes"
1143 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1144 curl_config_status=$?
1146 if test $curl_config_status -ne 0
1148 with_libcurl="no ($with_curl_config failed)"
1150 AC_CHECK_LIB(curl, curl_easy_init,
1151 [with_libcurl="yes"],
1152 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1156 if test "x$with_libcurl" = "xyes"
1158 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1159 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1160 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1161 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1163 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1167 with_libdbi_cppflags=""
1168 with_libdbi_ldflags=""
1169 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1171 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1173 with_libdbi_cppflags="-I$withval/include"
1174 with_libdbi_ldflags="-L$withval/lib"
1177 with_libdbi="$withval"
1183 if test "x$with_libdbi" = "xyes"
1185 SAVE_CPPFLAGS="$CPPFLAGS"
1186 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1188 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1190 CPPFLAGS="$SAVE_CPPFLAGS"
1192 if test "x$with_libdbi" = "xyes"
1194 SAVE_CPPFLAGS="$CPPFLAGS"
1195 SAVE_LDFLAGS="$LDFLAGS"
1196 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1197 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1199 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1201 CPPFLAGS="$SAVE_CPPFLAGS"
1202 LDFLAGS="$SAVE_LDFLAGS"
1204 if test "x$with_libdbi" = "xyes"
1206 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1207 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1208 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1209 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1210 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1211 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1213 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1216 # --with-libesmtp {{{
1217 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1219 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1221 LDFLAGS="$LDFLAGS -L$withval/lib"
1222 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1225 with_libesmtp="$withval"
1231 if test "x$with_libesmtp" = "xyes"
1233 AC_CHECK_LIB(esmtp, smtp_create_session,
1235 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1236 ], [with_libesmtp="no (libesmtp not found)"])
1238 if test "x$with_libesmtp" = "xyes"
1240 AC_CHECK_HEADERS(libesmtp.h,
1242 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1243 ], [with_libesmtp="no (libesmtp.h not found)"])
1245 if test "x$with_libesmtp" = "xyes"
1251 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1252 [Wether or not to use the esmtp library])
1253 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1256 # --with-libganglia {{{
1257 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1259 if test -f "$withval" && test -x "$withval"
1261 with_libganglia_config="$withval"
1262 with_libganglia="yes"
1263 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1265 with_libganglia_config="$withval/bin/ganglia-config"
1266 with_libganglia="yes"
1267 else if test -d "$withval"
1269 GANGLIA_CPPFLAGS="-I$withval/include"
1270 GANGLIA_LDFLAGS="-L$withval/lib"
1271 with_libganglia="yes"
1273 with_libganglia_config="ganglia-config"
1274 with_libganglia="$withval"
1278 with_libganglia_config="ganglia-config"
1279 with_libganglia="yes"
1282 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1284 if test "x$GANGLIA_CPPFLAGS" = "x"
1286 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1289 if test "x$GANGLIA_LDFLAGS" = "x"
1291 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1294 if test "x$GANGLIA_LIBS" = "x"
1296 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1300 SAVE_CPPFLAGS="$CPPFLAGS"
1301 SAVE_LDFLAGS="$LDFLAGS"
1302 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1303 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1305 if test "x$with_libganglia" = "xyes"
1307 AC_CHECK_HEADERS(gm_protocol.h,
1309 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1310 [Define to 1 if you have the <gm_protocol.h> header file.])
1311 ], [with_libganglia="no (gm_protocol.h not found)"])
1314 if test "x$with_libganglia" = "xyes"
1316 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1318 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1319 [Define to 1 if you have the ganglia library (-lganglia).])
1320 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1323 CPPFLAGS="$SAVE_CPPFLAGS"
1324 LDFLAGS="$SAVE_LDFLAGS"
1326 AC_SUBST(GANGLIA_CPPFLAGS)
1327 AC_SUBST(GANGLIA_LDFLAGS)
1328 AC_SUBST(GANGLIA_LIBS)
1329 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1332 # --with-libgcrypt {{{
1333 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1334 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1335 GCRYPT_LIBS="$GCRYPT_LIBS"
1336 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1338 if test -f "$withval" && test -x "$withval"
1340 with_libgcrypt_config="$withval"
1341 with_libgcrypt="yes"
1342 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1344 with_libgcrypt_config="$withval/bin/gcrypt-config"
1345 with_libgcrypt="yes"
1346 else if test -d "$withval"
1348 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1349 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1350 with_libgcrypt="yes"
1352 with_libgcrypt_config="gcrypt-config"
1353 with_libgcrypt="$withval"
1357 with_libgcrypt_config="libgcrypt-config"
1358 with_libgcrypt="yes"
1361 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1363 if test "x$GCRYPT_CPPFLAGS" = "x"
1365 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1368 if test "x$GCRYPT_LDFLAGS" = "x"
1370 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1371 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1374 if test "x$GCRYPT_LIBS" = "x"
1376 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1380 SAVE_CPPFLAGS="$CPPFLAGS"
1381 SAVE_LDFLAGS="$LDFLAGS"
1382 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1383 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1385 if test "x$with_libgcrypt" = "xyes"
1387 if test "x$GCRYPT_CPPFLAGS" != "x"
1389 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1391 AC_CHECK_HEADERS(gcrypt.h,
1392 [with_libgcrypt="yes"],
1393 [with_libgcrypt="no (gcrypt.h not found)"])
1396 if test "x$with_libgcrypt" = "xyes"
1398 if test "x$GCRYPT_LDFLAGS" != "x"
1400 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1402 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1403 [with_libgcrypt="yes"],
1404 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1406 if test "$with_libgcrypt" != "no"; then
1407 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1411 CPPFLAGS="$SAVE_CPPFLAGS"
1412 LDFLAGS="$SAVE_LDFLAGS"
1414 if test "x$with_libgcrypt" = "xyes"
1416 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1419 AC_SUBST(GCRYPT_CPPFLAGS)
1420 AC_SUBST(GCRYPT_LDFLAGS)
1421 AC_SUBST(GCRYPT_LIBS)
1422 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1425 # --with-libiptc {{{
1426 with_own_libiptc="no"
1427 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1429 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1431 LDFLAGS="$LDFLAGS -L$withval/lib"
1432 CPPFLAGS="$CPPFLAGS -I$withval/include"
1435 with_libiptc="$withval"
1439 if test "x$ac_system" = "xLinux"
1443 with_libiptc="no (Linux only)"
1446 if test "x$with_libiptc" = "xyes"
1448 AC_CHECK_LIB(iptc, iptc_init,
1450 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1454 with_own_libiptc="yes"
1457 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1459 AC_CHECK_HEADERS(libiptc/libiptc.h,
1461 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1465 with_own_libiptc="yes"
1468 if test "x$with_libiptc" = "xyes"
1471 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1473 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1475 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1476 with_own_libiptc="no"
1479 #include "$srcdir/src/libiptc/ipt_kernel_headers.h"
1484 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1485 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1486 if test "x$with_own_libiptc" = "xyes"
1488 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1493 with_java_home="$JAVA_HOME"
1494 with_java_vmtype="client"
1498 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1500 if test "x$withval" = "xno"
1503 else if test "x$withval" = "xyes"
1507 with_java_home="$withval"
1512 if test "x$with_java" = "xyes"
1514 if test -d "$with_java_home"
1516 AC_MSG_CHECKING([for jni.h])
1517 TMPDIR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1518 if test "x$TMPDIR" != "x"
1520 AC_MSG_RESULT([found in $TMPDIR])
1521 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1523 AC_MSG_RESULT([not found])
1526 AC_MSG_CHECKING([for jni_md.h])
1527 TMPDIR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1528 if test "x$TMPDIR" != "x"
1530 AC_MSG_RESULT([found in $TMPDIR])
1531 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1533 AC_MSG_RESULT([not found])
1536 AC_MSG_CHECKING([for libjvm.so])
1537 TMPDIR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1538 if test "x$TMPDIR" != "x"
1540 AC_MSG_RESULT([found in $TMPDIR])
1541 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR"
1543 AC_MSG_RESULT([not found])
1546 if test "x$JAVAC" = "x"
1548 AC_MSG_CHECKING([for javac])
1549 TMPDIR=`find -L "$with_java_home" -name javac -type f | head -n 1`
1550 if test "x$TMPDIR" != "x"
1553 AC_MSG_RESULT([$JAVAC])
1555 AC_MSG_RESULT([not found])
1558 else if test "x$with_java_home" != "x"
1560 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1564 if test "x$JAVA_CPPFLAGS" != "x"
1566 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1568 if test "x$JAVA_CFLAGS" != "x"
1570 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1572 if test "x$JAVA_LDFLAGS" != "x"
1574 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1576 if test "x$JAVAC" = "x"
1578 with_javac_path="$PATH"
1579 if test "x$with_java_home" != "x"
1581 with_javac_path="$with_java_home:with_javac_path"
1582 if test -d "$with_java_home/bin"
1584 with_javac_path="$with_java_home/bin:with_javac_path"
1588 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1590 if test "x$JAVAC" = "x"
1592 with_java="no (javac not found)"
1595 SAVE_CPPFLAGS="$CPPFLAGS"
1596 SAVE_CFLAGS="$CFLAGS"
1597 SAVE_LDFLAGS="$LDFLAGS"
1598 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1599 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1600 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1602 if test "x$with_java" = "xyes"
1604 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1606 if test "x$with_java" = "xyes"
1608 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1610 [with_java="no (libjvm not found)"],
1613 if test "x$with_java" = "xyes"
1615 JAVA_LIBS="$JAVA_LIBS -ljvm"
1616 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1619 CPPFLAGS="$SAVE_CPPFLAGS"
1620 CFLAGS="$SAVE_CFLAGS"
1621 LDFLAGS="$SAVE_LDFLAGS"
1623 AC_SUBST(JAVA_CPPFLAGS)
1624 AC_SUBST(JAVA_CFLAGS)
1625 AC_SUBST(JAVA_LDFLAGS)
1627 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1630 # --with-libmemcached {{{
1631 with_libmemcached_cppflags=""
1632 with_libmemcached_ldflags=""
1633 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
1635 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1637 with_libmemcached_cppflags="-I$withval/include"
1638 with_libmemcached_ldflags="-L$withval/lib"
1639 with_libmemcached="yes"
1641 with_libmemcached="$withval"
1645 with_libmemcached="yes"
1647 if test "x$with_libmemcached" = "xyes"
1649 SAVE_CPPFLAGS="$CPPFLAGS"
1650 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1652 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
1654 CPPFLAGS="$SAVE_CPPFLAGS"
1656 if test "x$with_libmemcached" = "xyes"
1658 SAVE_CPPFLAGS="$CPPFLAGS"
1659 SAVE_LDFLAGS="$LDFLAGS"
1660 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1661 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
1663 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
1665 CPPFLAGS="$SAVE_CPPFLAGS"
1666 LDFLAGS="$SAVE_LDFLAGS"
1668 if test "x$with_libmemcached" = "xyes"
1670 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
1671 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
1672 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
1673 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1674 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1675 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
1676 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
1678 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
1681 # --with-libmysql {{{
1682 with_mysql_config="mysql_config"
1683 with_mysql_cflags=""
1685 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1687 if test "x$withval" = "xno"
1690 else if test "x$withval" = "xyes"
1694 if test -f "$withval" && test -x "$withval";
1696 with_mysql_config="$withval"
1697 else if test -x "$withval/bin/mysql_config"
1699 with_mysql_config="$withval/bin/mysql_config"
1707 if test "x$with_libmysql" = "xyes"
1709 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1710 mysql_config_status=$?
1712 if test $mysql_config_status -ne 0
1714 with_libmysql="no ($with_mysql_config failed)"
1716 SAVE_CPPFLAGS="$CPPFLAGS"
1717 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1720 have_mysql_mysql_h="no"
1721 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1723 if test "x$have_mysql_h" = "xno"
1725 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1728 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1730 with_libmysql="no (mysql.h not found)"
1733 CPPFLAGS="$SAVE_CPPFLAGS"
1736 if test "x$with_libmysql" = "xyes"
1738 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1739 mysql_config_status=$?
1741 if test $mysql_config_status -ne 0
1743 with_libmysql="no ($with_mysql_config failed)"
1745 AC_CHECK_LIB(mysqlclient, mysql_init,
1746 [with_libmysql="yes"],
1747 [with_libmysql="no (symbol 'mysql_init' not found)"],
1750 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1751 [with_libmysql="yes"],
1752 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1756 if test "x$with_libmysql" = "xyes"
1758 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1759 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1760 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1761 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1763 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1766 # --with-libnetlink {{{
1767 with_libnetlink_cflags=""
1768 with_libnetlink_libs="-lnetlink"
1769 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1771 echo "libnetlink: withval = $withval"
1772 if test "x$withval" = "xyes"
1774 with_libnetlink="yes"
1775 else if test "x$withval" = "xno"
1777 with_libnetlink="no"
1779 if test -d "$withval/include"
1781 with_libnetlink_cflags="-I$withval/include"
1782 with_libnetlink_libs="-L$withval/lib -lnetlink"
1783 with_libnetlink="yes"
1785 AC_MSG_ERROR("no such directory: $withval/include")
1790 if test "x$ac_system" = "xLinux"
1792 with_libnetlink="yes"
1794 with_libnetlink="no (Linux only library)"
1797 if test "x$with_libnetlink" = "xyes"
1800 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1802 with_libnetlink="no (libnetlink.h not found)"
1804 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1806 with_libnetlink="yes"
1810 #include <sys/types.h>
1811 #include <asm/types.h>
1812 #include <sys/socket.h>
1813 #include <linux/netlink.h>
1814 #include <linux/rtnetlink.h>])
1815 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1817 #include <sys/types.h>
1818 #include <asm/types.h>
1819 #include <sys/socket.h>])
1823 #include <sys/types.h>
1824 #include <asm/types.h>
1825 #include <sys/socket.h>
1826 #include <linux/netlink.h>
1827 #include <linux/rtnetlink.h>
1831 int retval = TCA_STATS2;
1834 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1839 #include <sys/types.h>
1840 #include <asm/types.h>
1841 #include <sys/socket.h>
1842 #include <linux/netlink.h>
1843 #include <linux/rtnetlink.h>
1847 int retval = TCA_STATS;
1850 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1853 CFLAGS="$SAVE_CFLAGS"
1855 if test "x$with_libnetlink" = "xyes"
1857 AC_CHECK_LIB(netlink, rtnl_open,
1858 [with_libnetlink="yes"],
1859 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1860 [$with_libnetlink_libs])
1862 if test "x$with_libnetlink" = "xyes"
1864 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1865 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1866 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1867 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1869 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1872 # --with-libnetsnmp {{{
1873 with_snmp_config="net-snmp-config"
1876 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1878 if test "x$withval" = "xno"
1880 with_libnetsnmp="no"
1881 else if test "x$withval" = "xyes"
1883 with_libnetsnmp="yes"
1885 if test -x "$withval"
1887 with_snmp_config="$withval"
1888 with_libnetsnmp="yes"
1890 with_snmp_config="$withval/bin/net-snmp-config"
1891 with_libnetsnmp="yes"
1895 [with_libnetsnmp="yes"])
1896 if test "x$with_libnetsnmp" = "xyes"
1898 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1899 snmp_config_status=$?
1901 if test $snmp_config_status -ne 0
1903 with_libnetsnmp="no ($with_snmp_config failed)"
1905 SAVE_CPPFLAGS="$CPPFLAGS"
1906 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1908 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1910 CPPFLAGS="$SAVE_CPPFLAGS"
1913 if test "x$with_libnetsnmp" = "xyes"
1915 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1916 snmp_config_status=$?
1918 if test $snmp_config_status -ne 0
1920 with_libnetsnmp="no ($with_snmp_config failed)"
1922 AC_CHECK_LIB(netsnmp, init_snmp,
1923 [with_libnetsnmp="yes"],
1924 [with_libnetsnmp="no (libnetsnmp not found)"],
1928 if test "x$with_libnetsnmp" = "xyes"
1930 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1931 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1932 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1933 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1935 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1938 # --with-liboconfig {{{
1939 with_own_liboconfig="no"
1940 liboconfig_LDFLAGS="$LDFLAGS"
1941 liboconfig_CPPFLAGS="$CPPFLAGS"
1942 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1944 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1946 if test -d "$withval/lib"
1948 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1950 if test -d "$withval/include"
1952 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1955 if test "x$withval" = "xno"
1957 AC_MSG_ERROR("liboconfig is required")
1961 with_liboconfig="yes"
1964 save_LDFLAGS="$LDFLAGS"
1965 save_CPPFLAGS="$CPPFLAGS"
1966 LDFLAGS="$liboconfig_LDFLAGS"
1967 CPPFLAGS="$liboconfig_CPPFLAGS"
1968 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1970 with_liboconfig="yes"
1971 with_own_liboconfig="no"
1974 with_liboconfig="yes"
1975 with_own_liboconfig="yes"
1976 LDFLAGS="$save_LDFLAGS"
1977 CPPFLAGS="$save_CPPFLAGS"
1980 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1981 if test "x$with_own_liboconfig" = "xyes"
1983 with_liboconfig="yes (shipped version)"
1987 # --with-liboping {{{
1988 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1990 if test "x$withval" = "xyes"
1993 else if test "x$withval" = "xno"
1998 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
1999 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2002 [with_liboping="yes"])
2004 SAVE_CPPFLAGS="$CPPFLAGS"
2005 SAVE_LDFLAGS="$LDFLAGS"
2007 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2008 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2010 if test "x$with_liboping" = "xyes"
2012 if test "x$LIBOPING_CPPFLAGS" != "x"
2014 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2016 AC_CHECK_HEADERS(oping.h,
2017 [with_liboping="yes"],
2018 [with_liboping="no ('oping.h' not found)"])
2020 if test "x$with_liboping" = "xyes"
2022 if test "x$LIBOPING_LDFLAGS" != "x"
2024 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2026 AC_CHECK_LIB(oping, ping_construct,
2027 [with_liboping="yes"],
2028 [with_liboping="no (symbol 'ping_construct' not found)"])
2031 CPPFLAGS="$SAVE_CPPFLAGS"
2032 LDFLAGS="$SAVE_LDFLAGS"
2034 if test "x$with_liboping" = "xyes"
2036 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2037 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2038 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2039 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2041 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2045 with_oracle_cppflags=""
2047 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2049 if test "x$withval" = "xyes"
2051 if test "x$ORACLE_HOME" = "x"
2053 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2056 else if test "x$withval" = "xno"
2061 ORACLE_HOME="$withval"
2065 if test "x$ORACLE_HOME" = "x"
2067 with_oracle="no (ORACLE_HOME is not set)"
2072 if test "x$ORACLE_HOME" != "x"
2074 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2076 if test -e "$ORACLE_HOME/lib/ldflags"
2078 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2080 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2081 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2083 if test "x$with_oracle" = "xyes"
2085 SAVE_CPPFLAGS="$CPPFLAGS"
2086 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2088 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2090 CPPFLAGS="$SAVE_CPPFLAGS"
2092 if test "x$with_oracle" = "xyes"
2094 SAVE_CPPFLAGS="$CPPFLAGS"
2095 SAVE_LDFLAGS="$LDFLAGS"
2096 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2097 LDFLAGS="$LDFLAGS $with_oracle_libs"
2099 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2101 CPPFLAGS="$SAVE_CPPFLAGS"
2102 LDFLAGS="$SAVE_LDFLAGS"
2104 if test "x$with_oracle" = "xyes"
2106 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2107 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2108 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2109 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2113 # --with-libowcapi {{{
2114 with_libowcapi_cppflags=""
2115 with_libowcapi_libs="-lowcapi"
2116 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2118 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2120 with_libowcapi_cppflags="-I$withval/include"
2121 with_libowcapi_libs="-L$withval/lib -lowcapi"
2122 with_libowcapi="yes"
2124 with_libowcapi="$withval"
2128 with_libowcapi="yes"
2130 if test "x$with_libowcapi" = "xyes"
2132 SAVE_CPPFLAGS="$CPPFLAGS"
2133 CPPFLAGS="$with_libowcapi_cppflags"
2135 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2137 CPPFLAGS="$SAVE_CPPFLAGS"
2139 if test "x$with_libowcapi" = "xyes"
2141 SAVE_LDFLAGS="$LDFLAGS"
2142 SAVE_CPPFLAGS="$CPPFLAGS"
2143 LDFLAGS="$with_libowcapi_libs"
2144 CPPFLAGS="$with_libowcapi_cppflags"
2146 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2148 LDFLAGS="$SAVE_LDFLAGS"
2149 CPPFLAGS="$SAVE_CPPFLAGS"
2151 if test "x$with_libowcapi" = "xyes"
2153 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2154 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2155 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2156 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2160 # --with-libpcap {{{
2161 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2163 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2165 LDFLAGS="$LDFLAGS -L$withval/lib"
2166 CPPFLAGS="$CPPFLAGS -I$withval/include"
2169 with_libpcap="$withval"
2175 if test "x$with_libpcap" = "xyes"
2177 AC_CHECK_LIB(pcap, pcap_open_live,
2179 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2180 ], [with_libpcap="no (libpcap not found)"])
2182 if test "x$with_libpcap" = "xyes"
2184 AC_CHECK_HEADERS(pcap.h,
2186 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
2187 ], [with_libpcap="no (pcap.h not found)"])
2189 if test "x$with_libpcap" = "xyes"
2195 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
2196 [Wether or not to use the pcap library])
2197 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2200 # --with-libperl {{{
2201 perl_interpreter="perl"
2202 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2204 if test -x "$withval"
2206 perl_interpreter="$withval"
2208 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2210 LDFLAGS="$LDFLAGS -L$withval/lib"
2211 CPPFLAGS="$CPPFLAGS -I$withval/include"
2212 perl_interpreter="$withval/bin/perl"
2215 with_libperl="$withval"
2222 AC_MSG_CHECKING([for perl])
2223 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2224 if test -x "$perl_interpreter"
2226 AC_MSG_RESULT([yes ($perl_interpreter)])
2232 AC_SUBST(PERL, "$perl_interpreter")
2234 if test "x$with_libperl" = "xyes" \
2235 && test -n "$perl_interpreter"
2238 SAVE_LDFLAGS=$LDFLAGS
2239 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2240 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2241 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2242 CFLAGS="$CFLAGS $PERL_CFLAGS"
2243 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2245 AC_CACHE_CHECK([for libperl],
2246 [c_cv_have_libperl],
2250 #define PERL_NO_GET_CONTEXT
2257 load_module (PERL_LOADMOD_NOIMPORT,
2258 newSVpv ("Collectd::Plugin::FooBar", 24),
2261 [c_cv_have_libperl="yes"],
2262 [c_cv_have_libperl="no"]
2266 if test "x$c_cv_have_libperl" = "xyes"
2268 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2269 AC_SUBST(PERL_CFLAGS)
2270 AC_SUBST(PERL_LDFLAGS)
2276 LDFLAGS=$SAVE_LDFLAGS
2277 else if test -z "$perl_interpreter"; then
2278 with_libperl="no (no perl interpreter found)"
2279 c_cv_have_libperl="no"
2281 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2283 if test "x$with_libperl" = "xyes"
2286 SAVE_LDFLAGS=$LDFLAGS
2287 CFLAGS="$CFLAGS $PERL_CFLAGS"
2288 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2290 AC_CACHE_CHECK([if perl supports ithreads],
2291 [c_cv_have_perl_ithreads],
2299 #if !defined(USE_ITHREADS)
2300 # error "Perl does not support ithreads!"
2301 #endif /* !defined(USE_ITHREADS) */
2304 [c_cv_have_perl_ithreads="yes"],
2305 [c_cv_have_perl_ithreads="no"]
2309 if test "x$c_cv_have_perl_ithreads" = "xyes"
2311 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2315 LDFLAGS=$SAVE_LDFLAGS
2318 if test "x$with_libperl" = "xyes"
2321 SAVE_LDFLAGS=$LDFLAGS
2322 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2323 # (see issues #41 and #42)
2324 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2325 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2327 AC_CACHE_CHECK([for broken Perl_load_module()],
2328 [c_cv_have_broken_perl_load_module],
2332 #define PERL_NO_GET_CONTEXT
2339 load_module (PERL_LOADMOD_NOIMPORT,
2340 newSVpv ("Collectd::Plugin::FooBar", 24),
2343 [c_cv_have_broken_perl_load_module="no"],
2344 [c_cv_have_broken_perl_load_module="yes"]
2349 LDFLAGS=$SAVE_LDFLAGS
2351 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2352 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2354 if test "x$with_libperl" = "xyes"
2357 SAVE_LDFLAGS=$LDFLAGS
2358 CFLAGS="$CFLAGS $PERL_CFLAGS"
2359 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2362 [struct mgvtbl.svt_local],
2363 [have_struct_mgvtbl_svt_local="yes"],
2364 [have_struct_mgvtbl_svt_local="no"],
2371 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2373 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2374 [Define if Perl's struct mgvtbl has member svt_local.])
2378 LDFLAGS=$SAVE_LDFLAGS
2383 with_pg_config="pg_config"
2384 with_libpq_includedir=""
2385 with_libpq_libdir=""
2386 with_libpq_cppflags=""
2387 with_libpq_ldflags=""
2388 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2391 if test "x$withval" = "xno"
2394 else if test "x$withval" = "xyes"
2398 if test -f "$withval" && test -x "$withval";
2400 with_pg_config="$withval"
2401 else if test -x "$withval/bin/pg_config"
2403 with_pg_config="$withval/bin/pg_config"
2411 if test "x$with_libpq" = "xyes"
2413 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2416 if test $pg_config_status -eq 0
2418 if test -n "$with_libpq_includedir"; then
2419 for dir in $with_libpq_includedir; do
2420 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2424 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2427 SAVE_CPPFLAGS="$CPPFLAGS"
2428 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2430 AC_CHECK_HEADERS(libpq-fe.h, [],
2431 [with_libpq="no (libpq-fe.h not found)"], [])
2433 CPPFLAGS="$SAVE_CPPFLAGS"
2435 if test "x$with_libpq" = "xyes"
2437 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2440 if test $pg_config_status -eq 0
2442 if test -n "$with_libpq_libdir"; then
2443 for dir in $with_libpq_libdir; do
2444 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2448 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2451 SAVE_LDFLAGS="$LDFLAGS"
2452 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2454 AC_CHECK_LIB(pq, PQconnectdb,
2456 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2458 AC_CHECK_LIB(pq, PQserverVersion,
2460 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2462 LDFLAGS="$SAVE_LDFLAGS"
2464 if test "x$with_libpq" = "xyes"
2466 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2467 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2468 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2469 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2471 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2474 # --with-libpthread {{{
2475 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2476 [ if test "x$withval" != "xno" \
2477 && test "x$withval" != "xyes"
2479 LDFLAGS="$LDFLAGS -L$withval/lib"
2480 CPPFLAGS="$CPPFLAGS -I$withval/include"
2481 with_libpthread="yes"
2483 if test "x$withval" = "xno"
2485 with_libpthread="no (disabled)"
2488 ], [with_libpthread="yes"])
2489 if test "x$with_libpthread" = "xyes"
2491 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2494 if test "x$with_libpthread" = "xyes"
2496 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2498 if test "x$with_libpthread" = "xyes"
2504 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2505 [Wether or not to use pthread (POSIX threads) library])
2506 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2510 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2513 librrd_threadsafe="yes"
2514 librrd_rrdc_update="no"
2515 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2516 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2518 librrd_cflags="-I$withval/include"
2519 librrd_ldflags="-L$withval/lib"
2522 with_librrd="$withval"
2524 ], [with_librrd="yes"])
2525 if test "x$with_librrd" = "xyes"
2527 SAVE_CPPFLAGS="$CPPFLAGS"
2528 SAVE_LDFLAGS="$LDFLAGS"
2530 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2531 LDFLAGS="$LDFLAGS $librrd_ldflags"
2533 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2535 CPPFLAGS="$SAVE_CPPFLAGS"
2536 LDFLAGS="$SAVE_LDFLAGS"
2538 if test "x$with_librrd" = "xyes"
2540 SAVE_CPPFLAGS="$CPPFLAGS"
2541 SAVE_LDFLAGS="$LDFLAGS"
2543 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2544 LDFLAGS="$LDFLAGS $librrd_ldflags"
2546 AC_CHECK_LIB(rrd_th, rrd_update_r,
2548 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2550 [librrd_threadsafe="no"
2551 AC_CHECK_LIB(rrd, rrd_update,
2553 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2555 [with_librrd="no (symbol 'rrd_update' not found)"],
2560 if test "x$librrd_threadsafe" = "xyes"
2562 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2564 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2567 CPPFLAGS="$SAVE_CPPFLAGS"
2568 LDFLAGS="$SAVE_LDFLAGS"
2570 if test "x$with_librrd" = "xyes"
2572 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2573 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2574 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2575 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2577 if test "x$librrd_threadsafe" = "xyes"
2579 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2583 # --with-libsensors {{{
2584 with_sensors_cflags=""
2585 with_sensors_ldflags=""
2586 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2588 if test "x$withval" = "xno"
2590 with_libsensors="no"
2592 with_libsensors="yes"
2593 if test "x$withval" != "xyes"
2595 with_sensors_cflags="-I$withval/include"
2596 with_sensors_ldflags="-L$withval/lib"
2597 with_libsensors="yes"
2602 if test "x$ac_system" = "xLinux"
2604 with_libsensors="yes"
2606 with_libsensors="no (Linux only library)"
2609 if test "x$with_libsensors" = "xyes"
2611 SAVE_CPPFLAGS="$CPPFLAGS"
2612 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2614 # AC_CHECK_HEADERS(sensors/sensors.h,
2616 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2618 # [with_libsensors="no (sensors/sensors.h not found)"])
2619 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2621 CPPFLAGS="$SAVE_CPPFLAGS"
2623 if test "x$with_libsensors" = "xyes"
2625 SAVE_CPPFLAGS="$CPPFLAGS"
2626 SAVE_LDFLAGS="$LDFLAGS"
2627 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2628 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2630 AC_CHECK_LIB(sensors, sensors_init,
2632 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2634 [with_libsensors="no (libsensors not found)"])
2636 CPPFLAGS="$SAVE_CPPFLAGS"
2637 LDFLAGS="$SAVE_LDFLAGS"
2639 if test "x$with_libsensors" = "xyes"
2641 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2642 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2643 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2644 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2646 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2649 # --with-libstatgrab {{{
2650 with_libstatgrab_cflags=""
2651 with_libstatgrab_ldflags=""
2652 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2654 if test "x$withval" != "xno" \
2655 && test "x$withval" != "xyes"
2657 with_libstatgrab_cflags="-I$withval/include"
2658 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
2659 with_libstatgrab="yes"
2660 with_libstatgrab_pkg_config="no"
2662 with_libstatgrab="$withval"
2663 with_libstatgrab_pkg_config="yes"
2667 with_libstatgrab="yes"
2668 with_libstatgrab_pkg_config="yes"
2671 if test "x$with_libstatgrab" = "xyes" \
2672 && test "x$with_libstatgrab_pkg_config" = "xyes"
2674 if test "x$PKG_CONFIG" != "x"
2676 AC_MSG_CHECKING([pkg-config for libstatgrab])
2678 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2681 with_libstatgrab_pkg_config="no"
2682 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
2683 temp_result="not found"
2685 AC_MSG_RESULT([$temp_result])
2687 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2688 with_libstatgrab_pkg_config="no"
2689 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2693 if test "x$with_libstatgrab" = "xyes" \
2694 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2695 && test "x$with_libstatgrab_cflags" = "x"
2697 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2698 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2701 with_libstatgrab_cflags="$temp_result"
2703 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2704 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2706 AC_MSG_RESULT([$temp_result])
2709 if test "x$with_libstatgrab" = "xyes" \
2710 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2711 && test "x$with_libstatgrab_ldflags" = "x"
2713 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2714 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2717 with_libstatgrab_ldflags="$temp_result"
2719 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2720 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2722 AC_MSG_RESULT([$temp_result])
2725 if test "x$with_libstatgrab" = "xyes"
2727 SAVE_CPPFLAGS="$CPPFLAGS"
2728 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2730 AC_CHECK_HEADERS(statgrab.h,
2731 [with_libstatgrab="yes"],
2732 [with_libstatgrab="no (statgrab.h not found)"])
2734 CPPFLAGS="$SAVE_CPPFLAGS"
2737 if test "x$with_libstatgrab" = "xyes"
2739 SAVE_CFLAGS="$CFLAGS"
2740 SAVE_LDFLAGS="$LDFLAGS"
2742 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2743 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2745 AC_CHECK_LIB(statgrab, sg_init,
2746 [with_libstatgrab="yes"],
2747 [with_libstatgrab="no (symbol sg_init not found)"])
2749 CFLAGS="$SAVE_CFLAGS"
2750 LDFLAGS="$SAVE_LDFLAGS"
2753 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2754 if test "x$with_libstatgrab" = "xyes"
2756 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2757 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2758 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2759 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2760 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2764 # --with-libupsclient {{{
2765 with_libupsclient_config=""
2766 with_libupsclient_cflags=""
2767 with_libupsclient_libs=""
2768 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2770 if test "x$withval" = "xno"
2772 with_libupsclient="no"
2773 else if test "x$withval" = "xyes"
2775 with_libupsclient="use_pkgconfig"
2777 if test -x "$withval"
2779 with_libupsclient_config="$withval"
2780 with_libupsclient="use_libupsclient_config"
2781 else if test -x "$withval/bin/libupsclient-config"
2783 with_libupsclient_config="$withval/bin/net-snmp-config"
2784 with_libupsclient="use_libupsclient_config"
2786 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
2787 with_libupsclient_cflags="-I$withval/include"
2788 with_libupsclient_libs="-L$withval/lib -lupsclient"
2789 with_libupsclient="yes"
2793 [with_libupsclient="use_pkgconfig"])
2795 # configure using libupsclient-config
2796 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2798 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
2799 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
2802 with_libupsclient="no ($with_libupsclient_config failed)"
2804 with_libupsclient_libs="`$with_libupsclient_config --libs`"
2807 with_libupsclient="no ($with_libupsclient_config failed)"
2810 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2812 with_libupsclient="yes"
2815 # configure using pkg-config
2816 if test "x$with_libupsclient" = "xuse_pkgconfig"
2818 if test "x$PKG_CONFIG" = "x"
2820 with_libupsclient="no (Don't have pkg-config)"
2823 if test "x$with_libupsclient" = "xuse_pkgconfig"
2825 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
2826 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
2829 with_libupsclient="no (pkg-config doesn't know library)"
2832 if test "x$with_libupsclient" = "xuse_pkgconfig"
2834 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
2837 with_libupsclient="no ($PKG_CONFIG failed)"
2839 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
2842 with_libupsclient="no ($PKG_CONFIG failed)"
2845 if test "x$with_libupsclient" = "xuse_pkgconfig"
2847 with_libupsclient="yes"
2850 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
2851 # the actual checks.
2852 if test "x$with_libupsclient" = "xyes"
2854 SAVE_CPPFLAGS="$CPPFLAGS"
2855 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2857 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2859 CPPFLAGS="$SAVE_CPPFLAGS"
2861 if test "x$with_libupsclient" = "xyes"
2863 SAVE_CPPFLAGS="$CPPFLAGS"
2864 SAVE_LDFLAGS="$LDFLAGS"
2866 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2867 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2869 AC_CHECK_LIB(upsclient, upscli_connect,
2870 [with_libupsclient="yes"],
2871 [with_libupsclient="no (symbol upscli_connect not found)"])
2873 CPPFLAGS="$SAVE_CPPFLAGS"
2874 LDFLAGS="$SAVE_LDFLAGS"
2876 if test "x$with_libupsclient" = "xyes"
2878 SAVE_CPPFLAGS="$CPPFLAGS"
2879 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2881 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2882 [#include <stdlib.h>
2884 #include <upsclient.h>])
2886 CPPFLAGS="$SAVE_CPPFLAGS"
2888 if test "x$with_libupsclient" = "xyes"
2890 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2891 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2892 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2893 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2897 # --with-libxmms {{{
2898 with_xmms_config="xmms-config"
2901 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2903 if test "x$withval" != "xno" \
2904 && test "x$withval" != "xyes"
2906 if test -f "$withval" && test -x "$withval";
2908 with_xmms_config="$withval"
2909 else if test -x "$withval/bin/xmms-config"
2911 with_xmms_config="$withval/bin/xmms-config"
2914 else if test "x$withval" = "xno"
2924 if test "x$with_libxmms" = "xyes"
2926 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2927 xmms_config_status=$?
2929 if test $xmms_config_status -ne 0
2934 if test "x$with_libxmms" = "xyes"
2936 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2937 xmms_config_status=$?
2939 if test $xmms_config_status -ne 0
2944 if test "x$with_libxmms" = "xyes"
2946 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2948 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2949 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2950 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2951 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2958 with_libxmms_numeric=0
2959 if test "x$with_libxmms" = "xyes"
2961 with_libxmms_numeric=1
2963 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2964 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2967 # --with-libyajl {{{
2968 with_libyajl_cppflags=""
2969 with_libyajl_ldflags=""
2970 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
2972 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2974 with_libyajl_cppflags="-I$withval/include"
2975 with_libyajl_ldflags="-L$withval/lib"
2978 with_libyajl="$withval"
2984 if test "x$with_libyajl" = "xyes"
2986 SAVE_CPPFLAGS="$CPPFLAGS"
2987 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
2989 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
2991 CPPFLAGS="$SAVE_CPPFLAGS"
2993 if test "x$with_libyajl" = "xyes"
2995 SAVE_CPPFLAGS="$CPPFLAGS"
2996 SAVE_LDFLAGS="$LDFLAGS"
2997 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
2998 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3000 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3002 CPPFLAGS="$SAVE_CPPFLAGS"
3003 LDFLAGS="$SAVE_LDFLAGS"
3005 if test "x$with_libyajl" = "xyes"
3007 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3008 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3009 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3010 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3011 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3012 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3013 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3015 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3018 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3019 with_libxml2="no (pkg-config isn't available)"
3020 with_libxml2_cflags=""
3021 with_libxml2_ldflags=""
3022 with_libvirt="no (pkg-config isn't available)"
3023 with_libvirt_cflags=""
3024 with_libvirt_ldflags=""
3025 if test "x$PKG_CONFIG" != "x"
3027 pkg-config --exists 'libxml-2.0' 2>/dev/null
3032 with_libxml2="no (pkg-config doesn't know library)"
3035 pkg-config --exists libvirt 2>/dev/null
3040 with_libvirt="no (pkg-config doesn't know library)"
3043 if test "x$with_libxml2" = "xyes"
3045 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3050 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3056 if test "x$with_libxml2" = "xyes"
3058 SAVE_CPPFLAGS="$CPPFLAGS"
3059 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3061 AC_CHECK_HEADERS(libxml/parser.h, [],
3062 [with_libxml2="no (libxml/parser.h not found)"])
3064 CPPFLAGS="$SAVE_CPPFLAGS"
3066 if test "x$with_libxml2" = "xyes"
3068 SAVE_CFLAGS="$CFLAGS"
3069 SAVE_LDFLAGS="$LDFLAGS"
3071 CFLAGS="$CFLAGS $with_libxml2_cflags"
3072 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3074 AC_CHECK_LIB(xml2, xmlXPathEval,
3075 [with_libxml2="yes"],
3076 [with_libxml2="no (symbol xmlXPathEval not found)"])
3078 CFLAGS="$SAVE_CFLAGS"
3079 LDFLAGS="$SAVE_LDFLAGS"
3081 dnl Add the right compiler flags and libraries.
3082 if test "x$with_libxml2" = "xyes"; then
3083 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3084 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3085 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3086 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3088 if test "x$with_libvirt" = "xyes"
3090 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3095 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3101 if test "x$with_libvirt" = "xyes"
3103 SAVE_CPPFLAGS="$CPPFLAGS"
3104 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3106 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3107 [with_libvirt="no (libvirt/libvirt.h not found)"])
3109 CPPFLAGS="$SAVE_CPPFLAGS"
3111 if test "x$with_libvirt" = "xyes"
3113 SAVE_CFLAGS="$CFLAGS"
3114 SAVE_LDFLAGS="$LDFLAGS"
3116 CFLAGS="$CFLAGS $with_libvirt_cflags"
3117 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3119 AC_CHECK_LIB(virt, virDomainBlockStats,
3120 [with_libvirt="yes"],
3121 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3123 CFLAGS="$SAVE_CFLAGS"
3124 LDFLAGS="$SAVE_LDFLAGS"
3126 dnl Add the right compiler flags and libraries.
3127 if test "x$with_libvirt" = "xyes"; then
3128 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3129 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3130 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3131 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3135 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3136 with_libopenipmipthread="yes"
3137 with_libopenipmipthread_cflags=""
3138 with_libopenipmipthread_libs=""
3140 AC_MSG_CHECKING([for pkg-config])
3142 if test "x$PKG_CONFIG" = "x"
3144 with_libopenipmipthread="no"
3147 temp_result="$PKG_CONFIG"
3149 AC_MSG_RESULT([$temp_result])
3151 if test "x$with_libopenipmipthread" = "xyes"
3153 AC_MSG_CHECKING([for libOpenIPMIpthread])
3154 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3157 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3159 AC_MSG_RESULT([$with_libopenipmipthread])
3162 if test "x$with_libopenipmipthread" = "xyes"
3164 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3165 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3168 with_libopenipmipthread_cflags="$temp_result"
3170 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3171 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3173 AC_MSG_RESULT([$temp_result])
3176 if test "x$with_libopenipmipthread" = "xyes"
3178 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3179 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3182 with_libopenipmipthread_ldflags="$temp_result"
3184 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3185 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3187 AC_MSG_RESULT([$temp_result])
3190 if test "x$with_libopenipmipthread" = "xyes"
3192 SAVE_CPPFLAGS="$CPPFLAGS"
3193 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3195 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3196 [with_libopenipmipthread="yes"],
3197 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3198 [#include <OpenIPMI/ipmiif.h>
3199 #include <OpenIPMI/ipmi_err.h>
3200 #include <OpenIPMI/ipmi_posix.h>
3201 #include <OpenIPMI/ipmi_conn.h>
3204 CPPFLAGS="$SAVE_CPPFLAGS"
3207 if test "x$with_libopenipmipthread" = "xyes"
3209 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3210 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3211 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3212 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3216 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3217 [with_libnotify="yes"],
3218 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3220 # Check for enabled/disabled features
3223 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3224 # ------------------------------------------------------------
3226 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3231 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3236 m4_define([EnDis],[disabled])dnl
3237 m4_define([YesNo],[no])dnl
3243 m4_define([EnDis],[enabled])dnl
3244 m4_define([YesNo],[yes])dnl
3247 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3251 m4_if([$3], [feature], [],
3255 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3261 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3263 enable_$1='[YesNo]'dnl
3265 if test "x$enable_$1" = "xno"
3269 if test "x$enable_$1" = "xyes"
3273 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3278 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3279 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3281 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3283 # AC_PLUGIN(name, default, info)
3284 # ------------------------------------------------------------
3291 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3293 if test "x$enableval" = "xyes"
3296 else if test "x$enableval" = "xforce"
3305 if test "x$enable_all_plugins" = "xauto"
3307 if test "x$2" = "xyes"
3314 enable_plugin="$enable_all_plugins"
3317 if test "x$enable_plugin" = "xyes"
3319 if test "x$2" = "xyes" || test "x$force" = "xyes"
3321 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3322 if test "x$2" != "xyes"
3324 dependency_warning="yes"
3326 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3327 dependency_error="yes"
3328 enable_plugin="no (dependency error)"
3331 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3332 enable_$1="$enable_plugin"
3334 )# AC_PLUGIN(name, default, info)
3336 m4_divert_once([HELP_ENABLE], [
3337 collectd features:])
3338 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3339 AC_COLLECTD([debug], [enable], [feature], [debugging])
3340 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3341 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3343 dependency_warning="no"
3344 dependency_error="no"
3349 plugin_conntrack="no"
3356 plugin_interface="no"
3363 plugin_multimeter="no"
3367 plugin_processes="no"
3368 plugin_protocols="no"
3372 plugin_tcpconns="no"
3379 plugin_wireless="no"
3382 if test "x$ac_system" = "xLinux"
3384 plugin_battery="yes"
3385 plugin_conntrack="yes"
3387 plugin_cpufreq="yes"
3389 plugin_entropy="yes"
3390 plugin_interface="yes"
3395 plugin_fscache="yes"
3396 plugin_processes="yes"
3397 plugin_protocols="yes"
3400 plugin_tcpconns="yes"
3401 plugin_thermal="yes"
3404 plugin_vserver="yes"
3405 plugin_wireless="yes"
3407 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
3413 if test "x$ac_system" = "xOpenBSD"
3415 plugin_tcpconns="yes"
3419 if test "x$with_libiokit" = "xyes"
3421 plugin_battery="yes"
3426 if test "x$with_kstat" = "xyes"
3431 if test "x$with_devinfo$with_kstat" = "xyesyes"
3435 plugin_interface="yes"
3440 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
3446 if test "x$with_libstatgrab" = "xyes"
3450 plugin_interface="yes"
3457 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
3463 if test "x$with_libopenipmipthread" = "xyes"
3468 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
3470 plugin_couchdb="yes"
3473 if test "x$have_processor_info" = "xyes"
3477 if test "x$have_sysctl" = "xyes"
3484 if test "x$have_sysctlbyname" = "xyes"
3488 plugin_tcpconns="yes"
3491 # Df plugin: Check if we know how to determine mount points first.
3492 #if test "x$have_listmntent" = "xyes"; then
3495 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
3499 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
3503 #if test "x$have_getmntent" = "xseq"
3507 if test "x$c_cv_have_one_getmntent" = "xyes"
3512 # Df plugin: Check if we have either `statfs' or `statvfs' second.
3513 if test "x$plugin_df" = "xyes"
3516 if test "x$have_statfs" = "xyes"
3520 if test "x$have_statvfs" = "xyes"
3526 if test "x$have_getifaddrs" = "xyes"
3528 plugin_interface="yes"
3531 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
3533 plugin_libvirt="yes"
3536 if test "x$have_getloadavg" = "xyes"
3541 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
3546 # Mac OS X memory interface
3547 if test "x$have_host_statistics" = "xyes"
3552 if test "x$have_termios_h" = "xyes"
3554 plugin_multimeter="yes"
3558 if test "x$have_thread_info" = "xyes"
3560 plugin_processes="yes"
3563 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
3565 plugin_processes="yes"
3568 if test "x$with_kvm_getswapinfo" = "xyes"
3573 if test "x$have_swapctl" = "xyes"
3578 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
3580 plugin_tcpconns="yes"
3583 if test "x$have_getutent" = "xyes"
3587 if test "x$have_getutxent" = "xyes"
3592 m4_divert_once([HELP_ENABLE], [
3595 AC_ARG_ENABLE([all-plugins],
3596 AC_HELP_STRING([--enable-all-plugins],
3597 [enable all plugins (auto by def)]),
3599 if test "x$enableval" = "xyes"
3601 enable_all_plugins="yes"
3602 else if test "x$enableval" = "xauto"
3604 enable_all_plugins="auto"
3606 enable_all_plugins="no"
3609 [enable_all_plugins="auto"])
3611 m4_divert_once([HELP_ENABLE], [])
3613 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3614 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3615 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3616 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3617 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3618 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3619 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
3620 AC_PLUGIN([couchdb], [$plugin_couchdb], [CouchDB statistics])
3621 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3622 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3623 AC_PLUGIN([csv], [yes], [CSV output plugin])
3624 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
3625 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3626 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3627 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3628 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3629 AC_PLUGIN([email], [yes], [EMail statistics])
3630 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3631 AC_PLUGIN([exec], [yes], [Execution of external programs])
3632 AC_PLUGIN([filecount], [yes], [Count files in directories])
3633 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
3634 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
3635 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3636 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3637 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3638 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3639 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3640 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3641 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
3642 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3643 AC_PLUGIN([load], [$plugin_load], [System load])
3644 AC_PLUGIN([logfile], [yes], [File logging plugin])
3645 AC_PLUGIN([match_regex], [yes], [The regex match])
3646 AC_PLUGIN([match_timediff], [yes], [The timediff match])
3647 AC_PLUGIN([match_value], [yes], [The value match])
3648 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3649 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
3650 AC_PLUGIN([memcached], [yes], [memcached statistics])
3651 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3652 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3653 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3654 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3655 AC_PLUGIN([network], [yes], [Network communication plugin])
3656 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3657 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3658 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3659 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3660 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3661 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3662 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3663 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3664 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3665 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3666 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3667 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3668 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3669 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3670 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
3671 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3672 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3673 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3674 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3675 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3676 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3677 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3678 AC_PLUGIN([table], [yes], [Parsing of tabular data])
3679 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3680 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3681 AC_PLUGIN([target_notification], [yes], [The notification target])
3682 AC_PLUGIN([target_replace], [yes], [The replace target])
3683 AC_PLUGIN([target_set], [yes], [The set target])
3684 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3685 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3686 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
3687 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3688 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3689 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
3690 AC_PLUGIN([users], [$plugin_users], [User statistics])
3691 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3692 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3693 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3694 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3695 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3697 dnl Default configuration file
3698 # Load either syslog or logfile
3699 LOAD_PLUGIN_SYSLOG=""
3700 LOAD_PLUGIN_LOGFILE=""
3702 AC_MSG_CHECKING([which default log plugin to load])
3703 default_log_plugin="none"
3704 if test "x$enable_syslog" = "xyes"
3706 default_log_plugin="syslog"
3708 LOAD_PLUGIN_SYSLOG="##"
3711 if test "x$enable_logfile" = "xyes"
3713 if test "x$default_log_plugin" = "xnone"
3715 default_log_plugin="logfile"
3717 LOAD_PLUGIN_LOGFILE="#"
3720 LOAD_PLUGIN_LOGFILE="##"
3722 AC_MSG_RESULT([$default_log_plugin])
3724 AC_SUBST(LOAD_PLUGIN_SYSLOG)
3725 AC_SUBST(LOAD_PLUGIN_LOGFILE)
3727 DEFAULT_LOG_LEVEL="info"
3728 if test "x$enable_debug" = "xyes"
3730 DEFAULT_LOG_LEVEL="debug"
3732 AC_SUBST(DEFAULT_LOG_LEVEL)
3734 # Load only one of rrdtool, network, csv in the default config.
3735 LOAD_PLUGIN_RRDTOOL=""
3736 LOAD_PLUGIN_NETWORK=""
3739 AC_MSG_CHECKING([which default write plugin to load])
3740 default_write_plugin="none"
3741 if test "x$enable_rrdtool" = "xyes"
3743 default_write_plugin="rrdtool"
3745 LOAD_PLUGIN_RRDTOOL="##"
3748 if test "x$enable_network" = "xyes"
3750 if test "x$default_write_plugin" = "xnone"
3752 default_write_plugin="network"
3754 LOAD_PLUGIN_NETWORK="#"
3757 LOAD_PLUGIN_NETWORK="##"
3760 if test "x$enable_csv" = "xyes"
3762 if test "x$default_write_plugin" = "xnone"
3764 default_write_plugin="csv"
3769 LOAD_PLUGIN_CSV="##"
3771 AC_MSG_RESULT([$default_write_plugin])
3773 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
3774 AC_SUBST(LOAD_PLUGIN_NETWORK)
3775 AC_SUBST(LOAD_PLUGIN_CSV)
3778 if test "x$ac_system" = "xLinux" \
3779 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3781 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3785 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3787 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3789 PERL_BINDINGS_OPTIONS="$withval"
3790 with_perl_bindings="yes"
3792 PERL_BINDINGS_OPTIONS=""
3793 with_perl_bindings="$withval"
3797 PERL_BINDINGS_OPTIONS=""
3798 if test -n "$perl_interpreter"
3800 with_perl_bindings="yes"
3802 with_perl_bindings="no (no perl interpreter found)"
3805 if test "x$with_perl_bindings" = "xyes"
3807 PERL_BINDINGS="perl"
3811 AC_SUBST(PERL_BINDINGS)
3812 AC_SUBST(PERL_BINDINGS_OPTIONS)
3814 dnl libcollectdclient
3815 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3816 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3817 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3819 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3821 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3823 AC_SUBST(LCC_VERSION_MAJOR)
3824 AC_SUBST(LCC_VERSION_MINOR)
3825 AC_SUBST(LCC_VERSION_PATCH)
3826 AC_SUBST(LCC_VERSION_EXTRA)
3827 AC_SUBST(LCC_VERSION_STRING)
3829 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3831 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
3833 if test "x$with_librrd" = "xyes" \
3834 && test "x$librrd_threadsafe" != "xyes"
3836 with_librrd="yes (warning: librrd is not thread-safe)"
3839 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3841 with_libiptc="yes (shipped version)"
3844 if test "x$with_libperl" = "xyes"
3846 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3848 enable_perl="no (needs libperl)"
3851 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
3853 enable_perl="no (libperl doesn't support ithreads)"
3856 if test "x$with_perl_bindings" = "xyes" \
3857 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3859 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3866 libcurl . . . . . . . $with_libcurl
3867 libdbi . . . . . . . $with_libdbi
3868 libesmtp . . . . . . $with_libesmtp
3869 libgcrypt . . . . . . $with_libgcrypt
3870 libiokit . . . . . . $with_libiokit
3871 libiptc . . . . . . . $with_libiptc
3872 libjvm . . . . . . . $with_java
3873 libkstat . . . . . . $with_kstat
3874 libkvm . . . . . . . $with_libkvm
3875 libmysql . . . . . . $with_libmysql
3876 libnetlink . . . . . $with_libnetlink
3877 libnetsnmp . . . . . $with_libnetsnmp
3878 libnotify . . . . . . $with_libnotify
3879 liboconfig . . . . . $with_liboconfig
3880 libopenipmi . . . . . $with_libopenipmipthread
3881 liboping . . . . . . $with_liboping
3882 libpcap . . . . . . . $with_libpcap
3883 libperl . . . . . . . $with_libperl
3884 libpq . . . . . . . . $with_libpq
3885 libpthread . . . . . $with_libpthread
3886 librrd . . . . . . . $with_librrd
3887 libsensors . . . . . $with_libsensors
3888 libstatgrab . . . . . $with_libstatgrab
3889 libupsclient . . . . $with_libupsclient
3890 libvirt . . . . . . . $with_libvirt
3891 libxml2 . . . . . . . $with_libxml2
3892 libxmms . . . . . . . $with_libxmms
3893 oracle . . . . . . . $with_oracle
3896 daemon mode . . . . . $enable_daemon
3897 debug . . . . . . . . $enable_debug
3900 perl . . . . . . . . $with_perl_bindings
3903 apache . . . . . . . $enable_apache
3904 apcups . . . . . . . $enable_apcups
3905 apple_sensors . . . . $enable_apple_sensors
3906 ascent . . . . . . . $enable_ascent
3907 battery . . . . . . . $enable_battery
3908 bind . . . . . . . . $enable_bind
3909 conntrack . . . . . . $enable_conntrack
3910 couchdb . . . . . . . $enable_couchdb
3911 cpu . . . . . . . . . $enable_cpu
3912 cpufreq . . . . . . . $enable_cpufreq
3913 csv . . . . . . . . . $enable_csv
3914 curl . . . . . . . . $enable_curl
3915 dbi . . . . . . . . . $enable_dbi
3916 df . . . . . . . . . $enable_df
3917 disk . . . . . . . . $enable_disk
3918 dns . . . . . . . . . $enable_dns
3919 email . . . . . . . . $enable_email
3920 entropy . . . . . . . $enable_entropy
3921 exec . . . . . . . . $enable_exec
3922 filecount . . . . . . $enable_filecount
3923 fscache . . . . . . . $enable_fscache
3924 gmond . . . . . . . . $enable_gmond
3925 hddtemp . . . . . . . $enable_hddtemp
3926 interface . . . . . . $enable_interface
3927 ipmi . . . . . . . . $enable_ipmi
3928 iptables . . . . . . $enable_iptables
3929 ipvs . . . . . . . . $enable_ipvs
3930 irq . . . . . . . . . $enable_irq
3931 java . . . . . . . . $enable_java
3932 libvirt . . . . . . . $enable_libvirt
3933 load . . . . . . . . $enable_load
3934 logfile . . . . . . . $enable_logfile
3935 match_regex . . . . . $enable_match_regex
3936 match_timediff . . . $enable_match_timediff
3937 match_value . . . . . $enable_match_value
3938 mbmon . . . . . . . . $enable_mbmon
3939 memcachec . . . . . . $enable_memcachec
3940 memcached . . . . . . $enable_memcached
3941 memory . . . . . . . $enable_memory
3942 multimeter . . . . . $enable_multimeter
3943 mysql . . . . . . . . $enable_mysql
3944 netlink . . . . . . . $enable_netlink
3945 network . . . . . . . $enable_network
3946 nfs . . . . . . . . . $enable_nfs
3947 nginx . . . . . . . . $enable_nginx
3948 notify_desktop . . . $enable_notify_desktop
3949 notify_email . . . . $enable_notify_email
3950 ntpd . . . . . . . . $enable_ntpd
3951 nut . . . . . . . . . $enable_nut
3952 onewire . . . . . . . $enable_onewire
3953 openvpn . . . . . . . $enable_openvpn
3954 oracle . . . . . . . $enable_oracle
3955 perl . . . . . . . . $enable_perl
3956 ping . . . . . . . . $enable_ping
3957 postgresql . . . . . $enable_postgresql
3958 powerdns . . . . . . $enable_powerdns
3959 processes . . . . . . $enable_processes
3960 protocols . . . . . . $enable_protocols
3961 rrdcached . . . . . . $enable_rrdcached
3962 rrdtool . . . . . . . $enable_rrdtool
3963 sensors . . . . . . . $enable_sensors
3964 serial . . . . . . . $enable_serial
3965 snmp . . . . . . . . $enable_snmp
3966 swap . . . . . . . . $enable_swap
3967 syslog . . . . . . . $enable_syslog
3968 table . . . . . . . . $enable_table
3969 tail . . . . . . . . $enable_tail
3970 tape . . . . . . . . $enable_tape
3971 target_notification . $enable_target_notification
3972 target_replace . . . $enable_target_replace
3973 target_set . . . . . $enable_target_set
3974 tcpconns . . . . . . $enable_tcpconns
3975 teamspeak2 . . . . . $enable_teamspeak2
3976 ted . . . . . . . . . $enable_ted
3977 thermal . . . . . . . $enable_thermal
3978 unixsock . . . . . . $enable_unixsock
3979 uptime . . . . . . . $enable_uptime
3980 users . . . . . . . . $enable_users
3981 uuid . . . . . . . . $enable_uuid
3982 vmem . . . . . . . . $enable_vmem
3983 vserver . . . . . . . $enable_vserver
3984 wireless . . . . . . $enable_wireless
3985 xmms . . . . . . . . $enable_xmms
3989 if test "x$dependency_error" = "xyes"; then
3990 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
3993 if test "x$dependency_warning" = "xyes"; then
3994 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
3997 # vim: set fdm=marker :