1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AM_INIT_AUTOMAKE(dist-bzip2)
8 AC_PREFIX_DEFAULT("/opt/collectd")
13 # Checks for programs.
21 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
25 AC_LIBLTDL_CONVENIENCE
33 AC_CONFIG_SUBDIRS(libltdl)
35 AC_MSG_CHECKING([for kernel type ($host_os)])
38 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
42 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
54 AC_MSG_RESULT([$ac_system])
56 if test "x$ac_system" = "xLinux"
58 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
59 if test -z "$KERNEL_DIR"
61 KERNEL_DIR="/lib/modules/`uname -r`/source"
64 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
65 AC_SUBST(KERNEL_CFLAGS)
68 if test "x$ac_system" = "xSolaris"
70 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
73 # Where to install .pc files.
74 pkgconfigdir="${libdir}/pkgconfig"
75 AC_SUBST(pkgconfigdir)
78 # Checks for header files.
84 AC_CHECK_HEADERS(stdio.h stdint.h stdbool.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)
87 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
92 # include <sys/types.h>
95 AC_CHECK_HEADERS(netinet/in.h, [], [],
100 # include <sys/types.h>
102 #if HAVE_NETINET_IN_SYSTM_H
103 # include <netinet/in_systm.h>
106 AC_CHECK_HEADERS(netinet/ip.h, [], [],
111 # include <sys/types.h>
113 #if HAVE_NETINET_IN_SYSTM_H
114 # include <netinet/in_systm.h>
116 #if HAVE_NETINET_IN_H
117 # include <netinet/in.h>
120 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
125 # include <sys/types.h>
127 #if HAVE_NETINET_IN_SYSTM_H
128 # include <netinet/in_systm.h>
130 #if HAVE_NETINET_IN_H
131 # include <netinet/in.h>
133 #if HAVE_NETINET_IP_H
134 # include <netinet/ip.h>
137 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
142 # include <sys/types.h>
144 #if HAVE_NETINET_IN_SYSTM_H
145 # include <netinet/in_systm.h>
147 #if HAVE_NETINET_IN_H
148 # include <netinet/in.h>
150 #if HAVE_NETINET_IP_H
151 # include <netinet/ip.h>
154 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
159 # include <sys/types.h>
161 #if HAVE_NETINET_IN_SYSTM_H
162 # include <netinet/in_systm.h>
164 #if HAVE_NETINET_IN_H
165 # include <netinet/in.h>
168 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
173 # include <sys/types.h>
175 #if HAVE_NETINET_IN_SYSTM_H
176 # include <netinet/in_systm.h>
178 #if HAVE_NETINET_IN_H
179 # include <netinet/in.h>
181 #if HAVE_NETINET_IP6_H
182 # include <netinet/ip6.h>
185 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
190 # include <sys/types.h>
192 #if HAVE_NETINET_IN_SYSTM_H
193 # include <netinet/in_systm.h>
195 #if HAVE_NETINET_IN_H
196 # include <netinet/in.h>
198 #if HAVE_NETINET_IP_H
199 # include <netinet/ip.h>
202 AC_CHECK_HEADERS(netinet/udp.h, [], [],
207 # include <sys/types.h>
209 #if HAVE_NETINET_IN_SYSTM_H
210 # include <netinet/in_systm.h>
212 #if HAVE_NETINET_IN_H
213 # include <netinet/in.h>
215 #if HAVE_NETINET_IP_H
216 # include <netinet/ip.h>
221 AC_CHECK_HEADERS(sys/dkstat.h)
222 if test "x$ac_system" = "xDarwin"
224 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)
225 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
227 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
230 # include <sys/types.h>
233 # include <sys/param.h>
238 AC_CHECK_HEADERS(linux/major.h libgen.h)
240 # For the battery plugin
241 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
243 #if HAVE_IOKIT_IOKITLIB_H
244 # include <IOKit/IOKitLib.h>
246 #if HAVE_IOKIT_IOTYPES_H
247 # include <IOKit/IOTypes.h>
251 # For the swap module
252 have_sys_swap_h="yes"
253 AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
256 # include <sys/types.h>
259 # include <sys/param.h>
263 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
265 AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
269 # For the processes plugin
271 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
273 # For interface plugin
274 AC_CHECK_HEADERS(ifaddrs.h)
275 AC_CHECK_HEADERS(net/if.h, [], [],
278 # include <sys/types.h>
280 #if HAVE_SYS_SOCKET_H
281 # include <sys/socket.h>
284 AC_CHECK_HEADERS(linux/if.h, [], [],
287 # include <sys/types.h>
289 #if HAVE_SYS_SOCKET_H
290 # include <sys/socket.h>
293 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
296 # include <sys/types.h>
298 #if HAVE_SYS_SOCKET_H
299 # include <sys/socket.h>
302 # include <linux/if.h>
307 have_net_ip_vs_h="no"
309 if test "x$ac_system" = "xLinux"
312 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
314 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
315 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
321 AC_CHECK_HEADERS(sys/ucred.h, [], [],
324 # include <sys/types.h>
327 # include <sys/param.h>
331 # For mount interface
332 AC_CHECK_HEADERS(sys/mount.h, [], [],
335 # include <sys/types.h>
338 # include <sys/param.h>
342 # For the email plugin
343 AC_CHECK_HEADERS(linux/un.h, [], [],
345 #if HAVE_SYS_SOCKET_H
346 # include <sys/socket.h>
350 AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.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)
353 AC_CHECK_HEADERS(arpa/nameser.h)
354 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
356 #if HAVE_ARPA_NAMESER_H
357 # include <arpa/nameser.h>
361 AC_CHECK_HEADERS(net/if_arp.h, [], [],
362 [#if HAVE_SYS_SOCKET_H
363 # include <sys/socket.h>
366 AC_CHECK_HEADERS(net/ppp_defs.h)
367 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
368 [#if HAVE_NET_PPP_DEFS_H
369 # include <net/ppp_defs.h>
372 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
377 # include <sys/types.h>
379 #if HAVE_SYS_SOCKET_H
380 # include <sys/socket.h>
385 #if HAVE_NETINET_IN_H
386 # include <netinet/in.h>
390 # For the multimeter plugin
392 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
395 # Checks for typedefs, structures, and compiler characteristics.
404 # Checks for library functions.
406 AC_PROG_GCC_TRADITIONAL
407 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
411 AC_CACHE_CHECK([for strtok_r],
412 [have_strtok_r_default],
421 char buffer[] = "foo,bar,baz";
428 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
431 printf ("token = %s;\n", token);
434 [have_strtok_r_default="yes"],
435 [have_strtok_r_default="no"]
439 if test "x$have_strtok_r_default" = "xno"
441 SAVE_CFLAGS="$CFLAGS"
442 CFLAGS="$CFLAGS -D_REENTRANT=1"
444 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
445 [have_strtok_r_reentrant],
454 char buffer[] = "foo,bar,baz";
461 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
464 printf ("token = %s;\n", token);
467 [have_strtok_r_reentrant="yes"],
468 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
473 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
475 socket_needs_socket="no"
476 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
477 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
479 nanosleep_needs_rt="no"
480 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
481 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
483 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
484 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
485 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
486 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
487 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
488 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
489 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
490 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
491 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
492 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
495 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
498 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
500 if test "x$withval" = "xno"; then
502 else if test "x$withval" = "xyes"; then
509 if test "x$nan_type" = "xnone"; then
510 AC_CACHE_CHECK([whether NAN is defined by default],
517 static float foo = NAN;
525 [have_nan_default="yes"],
526 [have_nan_default="no"]
529 if test "x$have_nan_default" = "xyes"
534 if test "x$nan_type" = "xnone"; then
535 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
541 #define __USE_ISOC99 1
543 static float foo = NAN;
551 [have_nan_isoc="yes"],
555 if test "x$have_nan_isoc" = "xyes"
560 if test "x$nan_type" = "xnone"; then
561 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
571 #define NAN (0.0 / 0.0)
573 # define isnan(f) ((f) != (f))
575 static float foo = NAN;
583 [have_nan_zero="yes"],
587 if test "x$have_nan_zero" = "xyes"
593 if test "x$nan_type" = "xdefault"; then
594 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
595 [Define if NAN is defined by default and can initialize static variables.])
596 else if test "x$nan_type" = "xisoc99"; then
597 AC_DEFINE(NAN_STATIC_ISOC, 1,
598 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
599 else if test "x$nan_type" = "xzero"; then
600 AC_DEFINE(NAN_ZERO_ZERO, 1,
601 [Define if NAN can be defined as (0.0 / 0.0)])
603 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
606 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
608 if test "x$withval" = "xnothing"; then
609 fp_layout_type="nothing"
610 else if test "x$withval" = "xendianflip"; then
611 fp_layout_type="endianflip"
612 else if test "x$withval" = "xintswap"; then
613 fp_layout_type="intswap"
615 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
618 [fp_layout_type="unknown"])
620 if test "x$fp_layout_type" = "xunknown"; then
621 AC_CACHE_CHECK([if doubles are stored in x86 representation],
622 [fp_layout_need_nothing],
633 # include <stdbool.h>
643 memcpy ((void *) &i0, (void *) &d, 8);
646 memcpy ((void *) c, (void *) &i1, 8);
648 if ((c[0] == 0x2f) && (c[1] == 0x25)
649 && (c[2] == 0xc0) && (c[3] == 0xc7)
650 && (c[4] == 0x43) && (c[5] == 0x2b)
651 && (c[6] == 0x1f) && (c[7] == 0x5b))
656 [fp_layout_need_nothing="yes"],
657 [fp_layout_need_nothing="no"]
660 if test "x$fp_layout_need_nothing" = "xyes"; then
661 fp_layout_type="nothing"
664 if test "x$fp_layout_type" = "xunknown"; then
665 AC_CACHE_CHECK([if endianflip converts to x86 representation],
666 [fp_layout_need_endianflip],
677 # include <stdbool.h>
679 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
680 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
681 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
682 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
683 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
684 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
685 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
686 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
695 memcpy ((void *) &i0, (void *) &d, 8);
697 i1 = endianflip (i0);
698 memcpy ((void *) c, (void *) &i1, 8);
700 if ((c[0] == 0x2f) && (c[1] == 0x25)
701 && (c[2] == 0xc0) && (c[3] == 0xc7)
702 && (c[4] == 0x43) && (c[5] == 0x2b)
703 && (c[6] == 0x1f) && (c[7] == 0x5b))
708 [fp_layout_need_endianflip="yes"],
709 [fp_layout_need_endianflip="no"]
712 if test "x$fp_layout_need_endianflip" = "xyes"; then
713 fp_layout_type="endianflip"
716 if test "x$fp_layout_type" = "xunknown"; then
717 AC_CACHE_CHECK([if intswap converts to x86 representation],
718 [fp_layout_need_intswap],
729 # include <stdbool.h>
731 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
732 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
741 memcpy ((void *) &i0, (void *) &d, 8);
744 memcpy ((void *) c, (void *) &i1, 8);
746 if ((c[0] == 0x2f) && (c[1] == 0x25)
747 && (c[2] == 0xc0) && (c[3] == 0xc7)
748 && (c[4] == 0x43) && (c[5] == 0x2b)
749 && (c[6] == 0x1f) && (c[7] == 0x5b))
754 [fp_layout_need_intswap="yes"],
755 [fp_layout_need_intswap="no"]
758 if test "x$fp_layout_need_intswap" = "xyes"; then
759 fp_layout_type="intswap"
763 if test "x$fp_layout_type" = "xnothing"; then
764 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
765 [Define if doubles are stored in x86 representation.])
766 else if test "x$fp_layout_type" = "xendianflip"; then
767 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
768 [Define if endianflip is needed to convert to x86 representation.])
769 else if test "x$fp_layout_type" = "xintswap"; then
770 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
771 [Define if intswap is needed to convert to x86 representation.])
773 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
777 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
779 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
781 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
784 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
785 if test "x$have_getmntent" = "xno"; then
786 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
788 if test "x$have_getmntent" = "xno"; then
789 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
791 if test "x$have_getmntent" = "xno"; then
792 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
795 if test "x$have_getmntent" = "xc"; then
796 AC_CACHE_CHECK([whether getmntent takes one argument],
797 [have_one_getmntent],
799 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
801 #include "$srcdir/src/utils_mount.h"]],
805 fh = setmntent ("/etc/mtab", "r");
809 [have_one_getmntent="yes"],
810 [have_one_getmntent="no"]
813 AC_CACHE_CHECK([whether getmntent takes two arguments],
814 [have_two_getmntent],
816 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
817 #include <sys/mnttab.h>
818 #include "$srcdir/src/utils_mount.h"]],
823 fh = fopen ("/etc/mnttab", "r");
824 status = getmntent (fh, &mt);
827 [have_two_getmntent="yes"],
828 [have_two_getmntent="no"]
833 # Check for different versions of `getmntent' here..
835 if test "x$have_getmntent" = "xc"; then
836 if test "x$have_one_getmntent" = "xyes"; then
837 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
838 [Define if the function getmntent exists and takes one argument.])
840 if test "x$have_two_getmntent" = "xyes"; then
841 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
842 [Define if the function getmntent exists and takes two arguments.])
845 if test "x$have_getmntent" = "xsun"; then
846 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
847 [Define if the function getmntent exists. It's the version from libsun.])
849 if test "x$have_getmntent" = "xseq"; then
850 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
851 [Define if the function getmntent exists. It's the version from libseq.])
853 if test "x$have_getmntent" = "xgen"; then
854 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
855 [Define if the function getmntent exists. It's the version from libgen.])
858 # Check for structures
859 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
860 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
863 #include <sys/types.h>
864 #include <sys/socket.h>
867 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
868 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
871 #include <sys/types.h>
872 #include <sys/socket.h>
873 #include <linux/if.h>
874 #include <linux/netdevice.h>
877 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
882 # include <sys/types.h>
884 #if HAVE_NETINET_IN_SYSTM_H
885 # include <netinet/in_systm.h>
887 #if HAVE_NETINET_IN_H
888 # include <netinet/in.h>
890 #if HAVE_NETINET_IP_H
891 # include <netinet/ip.h>
893 #if HAVE_NETINET_UDP_H
894 # include <netinet/udp.h>
897 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
902 # include <sys/types.h>
904 #if HAVE_NETINET_IN_SYSTM_H
905 # include <netinet/in_systm.h>
907 #if HAVE_NETINET_IN_H
908 # include <netinet/in.h>
910 #if HAVE_NETINET_IP_H
911 # include <netinet/ip.h>
913 #if HAVE_NETINET_UDP_H
914 # include <netinet/udp.h>
918 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
928 # Checks for libraries begin here
931 AC_CHECK_LIB(resolv, res_search,
933 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
935 [with_libresolv="no"])
936 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
938 dnl Check for HAL (hardware abstraction library)
940 AC_CHECK_LIB(hal,libhal_device_property_exists,
941 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
943 if test "x$with_libhal" = "xyes"; then
944 if test "x$PKG_CONFIG" != "x"; then
945 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
946 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
947 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
948 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
952 m4_divert_once([HELP_WITH], [
953 collectd additional packages:])
955 if test "x$ac_system" = "xSolaris"
960 with_kstat="no (Solaris only)"
961 with_devinfo="no (Solaris only)"
964 if test "x$with_kstat" = "xyes"
966 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
968 if test "x$with_kstat" = "xyes"
970 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
971 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
973 if test "x$with_kstat" = "xyes"
975 AC_DEFINE(HAVE_LIBKSTAT, 1,
976 [Define to 1 if you have the 'kstat' library (-lkstat)])
978 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
979 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
982 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
989 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
992 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
993 if test "x$with_kvm_getprocs" = "xyes"
995 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
996 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
999 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1001 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1002 if test "x$with_kvm_getswapinfo" = "xyes"
1004 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1005 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1008 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1010 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1011 if test "x$with_kvm_nlist" = "xyes"
1013 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1014 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1017 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1019 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1020 if test "x$with_kvm_openfiles" = "xyes"
1022 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1023 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1026 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1028 # --with-libcurl {{{
1029 with_curl_config="curl-config"
1032 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1034 if test "x$withval" = "xno"
1037 else if test "x$withval" = "xyes"
1041 if test -f "$withval" && test -x "$withval"
1043 with_curl_config="$withval"
1045 else if test -x "$withval/bin/curl-config"
1047 with_curl_config="$withval/bin/curl-config"
1056 if test "x$with_libcurl" = "xyes"
1058 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1059 curl_config_status=$?
1061 if test $curl_config_status -ne 0
1063 with_libcurl="no ($with_curl_config failed)"
1065 SAVE_CPPFLAGS="$CPPFLAGS"
1066 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1068 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1070 CPPFLAGS="$SAVE_CPPFLAGS"
1073 if test "x$with_libcurl" = "xyes"
1075 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1076 curl_config_status=$?
1078 if test $curl_config_status -ne 0
1080 with_libcurl="no ($with_curl_config failed)"
1082 AC_CHECK_LIB(curl, curl_easy_init,
1083 [with_libcurl="yes"],
1084 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1088 if test "x$with_libcurl" = "xyes"
1090 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1091 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1092 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1093 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1095 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1099 with_libdbi_cppflags=""
1100 with_libdbi_ldflags=""
1101 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1103 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1105 with_libdbi_cppflags="-I$withval/include"
1106 with_libdbi_ldflags="-L$withval/lib"
1109 with_libdbi="$withval"
1115 if test "x$with_libdbi" = "xyes"
1117 SAVE_CPPFLAGS="$CPPFLAGS"
1118 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1120 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1122 CPPFLAGS="$SAVE_CPPFLAGS"
1124 if test "x$with_libdbi" = "xyes"
1126 SAVE_CPPFLAGS="$CPPFLAGS"
1127 SAVE_LDFLAGS="$LDFLAGS"
1128 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1129 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1131 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1133 CPPFLAGS="$SAVE_CPPFLAGS"
1134 LDFLAGS="$SAVE_LDFLAGS"
1136 if test "x$with_libdbi" = "xyes"
1138 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1139 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1140 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1141 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1142 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1143 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1145 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1148 # --with-libesmtp {{{
1149 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1151 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1153 LDFLAGS="$LDFLAGS -L$withval/lib"
1154 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1157 with_libesmtp="$withval"
1163 if test "x$with_libesmtp" = "xyes"
1165 AC_CHECK_LIB(esmtp, smtp_create_session,
1167 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1168 ], [with_libesmtp="no (libesmtp not found)"])
1170 if test "x$with_libesmtp" = "xyes"
1172 AC_CHECK_HEADERS(libesmtp.h,
1174 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1175 ], [with_libesmtp="no (libesmtp.h not found)"])
1177 if test "x$with_libesmtp" = "xyes"
1183 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1184 [Wether or not to use the esmtp library])
1185 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1188 # --with-libiptc {{{
1189 with_own_libiptc="no"
1190 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1192 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1194 LDFLAGS="$LDFLAGS -L$withval/lib"
1195 CPPFLAGS="$CPPFLAGS -I$withval/include"
1198 with_libiptc="$withval"
1202 if test "x$ac_system" = "xLinux"
1206 with_libiptc="no (Linux only)"
1209 if test "x$with_libiptc" = "xyes"
1211 AC_CHECK_LIB(iptc, iptc_init,
1213 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1217 with_own_libiptc="yes"
1220 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1222 AC_CHECK_HEADERS(libiptc/libiptc.h,
1224 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1228 with_own_libiptc="yes"
1231 if test "x$with_libiptc" = "xyes"
1234 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1236 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1238 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1239 with_own_libiptc="no"
1242 #include "$srcdir/src/libiptc/ipt_kernel_headers.h"
1247 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1248 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1249 if test "x$with_own_libiptc" = "xyes"
1251 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1255 # --with-libmysql {{{
1256 with_mysql_config="mysql_config"
1257 with_mysql_cflags=""
1259 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1261 if test "x$withval" = "xno"
1264 else if test "x$withval" = "xyes"
1268 if test -f "$withval" && test -x "$withval";
1270 with_mysql_config="$withval"
1271 else if test -x "$withval/bin/mysql_config"
1273 with_mysql_config="$withval/bin/mysql_config"
1281 if test "x$with_libmysql" = "xyes"
1283 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1284 mysql_config_status=$?
1286 if test $mysql_config_status -ne 0
1288 with_libmysql="no ($with_mysql_config failed)"
1290 SAVE_CPPFLAGS="$CPPFLAGS"
1291 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1294 have_mysql_mysql_h="no"
1295 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1297 if test "x$have_mysql_h" = "xno"
1299 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1302 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1304 with_libmysql="no (mysql.h not found)"
1307 CPPFLAGS="$SAVE_CPPFLAGS"
1310 if test "x$with_libmysql" = "xyes"
1312 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1313 mysql_config_status=$?
1315 if test $mysql_config_status -ne 0
1317 with_libmysql="no ($with_mysql_config failed)"
1319 AC_CHECK_LIB(mysqlclient, mysql_init,
1320 [with_libmysql="yes"],
1321 [with_libmysql="no (symbol 'mysql_init' not found)"],
1325 if test "x$with_libmysql" = "xyes"
1327 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1328 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1329 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1330 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1332 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1335 # --with-libnetlink {{{
1336 with_libnetlink_cflags=""
1337 with_libnetlink_libs="-lnetlink"
1338 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1340 echo "libnetlink: withval = $withval"
1341 if test "x$withval" = "xyes"
1343 with_libnetlink="yes"
1344 else if test "x$withval" = "xno"
1346 with_libnetlink="no"
1348 if test -d "$withval/include"
1350 with_libnetlink_cflags="-I$withval/include"
1351 with_libnetlink_libs="-L$withval/lib -lnetlink"
1352 with_libnetlink="yes"
1354 AC_MSG_ERROR("no such directory: $withval/include")
1359 if test "x$ac_system" = "xLinux"
1361 with_libnetlink="yes"
1363 with_libnetlink="no (Linux only library)"
1366 if test "x$with_libnetlink" = "xyes"
1369 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1371 with_libnetlink="no (libnetlink.h not found)"
1373 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1375 with_libnetlink="yes"
1379 #include <sys/types.h>
1380 #include <asm/types.h>
1381 #include <sys/socket.h>
1382 #include <linux/netlink.h>
1383 #include <linux/rtnetlink.h>])
1384 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1386 #include <sys/types.h>
1387 #include <asm/types.h>
1388 #include <sys/socket.h>])
1392 #include <sys/types.h>
1393 #include <asm/types.h>
1394 #include <sys/socket.h>
1395 #include <linux/netlink.h>
1396 #include <linux/rtnetlink.h>
1400 int retval = TCA_STATS2;
1403 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1408 #include <sys/types.h>
1409 #include <asm/types.h>
1410 #include <sys/socket.h>
1411 #include <linux/netlink.h>
1412 #include <linux/rtnetlink.h>
1416 int retval = TCA_STATS;
1419 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1422 CFLAGS="$SAVE_CFLAGS"
1424 if test "x$with_libnetlink" = "xyes"
1426 AC_CHECK_LIB(netlink, rtnl_open,
1427 [with_libnetlink="yes"],
1428 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1429 [$with_libnetlink_libs])
1431 if test "x$with_libnetlink" = "xyes"
1433 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1434 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1435 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1436 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1438 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1441 # --with-libnetsnmp {{{
1442 with_snmp_config="net-snmp-config"
1445 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1447 if test "x$withval" = "xno"
1449 with_libnetsnmp="no"
1450 else if test "x$withval" = "xyes"
1452 with_libnetsnmp="yes"
1454 if test -x "$withval"
1456 with_snmp_config="$withval"
1457 with_libnetsnmp="yes"
1459 with_snmp_config="$withval/bin/net-snmp-config"
1460 with_libnetsnmp="yes"
1464 [with_libnetsnmp="yes"])
1465 if test "x$with_libnetsnmp" = "xyes"
1467 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1468 snmp_config_status=$?
1470 if test $snmp_config_status -ne 0
1472 with_libnetsnmp="no ($with_snmp_config failed)"
1474 SAVE_CPPFLAGS="$CPPFLAGS"
1475 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1477 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1479 CPPFLAGS="$SAVE_CPPFLAGS"
1482 if test "x$with_libnetsnmp" = "xyes"
1484 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1485 snmp_config_status=$?
1487 if test $snmp_config_status -ne 0
1489 with_libnetsnmp="no ($with_snmp_config failed)"
1491 AC_CHECK_LIB(netsnmp, init_snmp,
1492 [with_libnetsnmp="yes"],
1493 [with_libnetsnmp="no (libnetsnmp not found)"],
1497 if test "x$with_libnetsnmp" = "xyes"
1499 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1500 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1501 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1502 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1504 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1507 # --with-liboconfig {{{
1508 with_own_liboconfig="no"
1509 liboconfig_LDFLAGS="$LDFLAGS"
1510 liboconfig_CPPFLAGS="$CPPFLAGS"
1511 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1513 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1515 if test -d "$withval/lib"
1517 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1519 if test -d "$withval/include"
1521 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1524 if test "x$withval" = "xno"
1526 AC_MSG_ERROR("liboconfig is required")
1530 with_liboconfig="yes"
1533 save_LDFLAGS="$LDFLAGS"
1534 save_CPPFLAGS="$CPPFLAGS"
1535 LDFLAGS="$liboconfig_LDFLAGS"
1536 CPPFLAGS="$liboconfig_CPPFLAGS"
1537 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1539 with_liboconfig="yes"
1540 with_own_liboconfig="no"
1543 with_liboconfig="yes"
1544 with_own_liboconfig="yes"
1545 LDFLAGS="$save_LDFLAGS"
1546 CPPFLAGS="$save_CPPFLAGS"
1549 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
1550 if test "x$with_own_liboconfig" = "xyes"
1552 with_liboconfig="yes (shipped version)"
1556 # --with-liboping {{{
1557 with_own_liboping="no"
1558 liboping_LDFLAGS="$LDFLAGS"
1559 liboping_CPPFLAGS="$CPPFLAGS"
1560 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
1562 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1564 if test -d "$withval/lib"
1566 liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
1568 if test -d "$withval/include"
1570 liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
1573 if test "x$withval" = "xno"
1576 with_own_liboping="no"
1577 else if test "x$withval" = "xyes"
1586 if test "x$with_liboping" = "xyes"
1588 save_LDFLAGS="$LDFLAGS"
1589 save_CPPFLAGS="$CPPFLAGS"
1590 LDFLAGS="$liboping_LDFLAGS"
1591 CPPFLAGS="$liboping_CPPFLAGS"
1592 AC_CHECK_LIB(oping, ping_construct,
1595 with_own_liboping="no"
1599 with_own_liboping="yes"
1600 LDFLAGS="$save_LDFLAGS"
1601 CPPFLAGS="$save_CPPFLAGS"
1604 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
1605 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
1609 with_oracle_cppflags=""
1611 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
1613 if test "x$withval" = "xyes"
1615 if test "x$ORACLE_HOME" = "x"
1617 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
1620 else if test "x$withval" = "xno"
1625 ORACLE_HOME="$withval"
1629 if test "x$ORACLE_HOME" = "x"
1631 with_oracle="no (ORACLE_HOME is not set)"
1636 if test "x$ORACLE_HOME" != "x"
1638 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
1640 if test -e "$ORACLE_HOME/lib/ldflags"
1642 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
1644 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
1645 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
1647 if test "x$with_oracle" = "xyes"
1649 SAVE_CPPFLAGS="$CPPFLAGS"
1650 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1652 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
1654 CPPFLAGS="$SAVE_CPPFLAGS"
1656 if test "x$with_oracle" = "xyes"
1658 SAVE_CPPFLAGS="$CPPFLAGS"
1659 SAVE_LDFLAGS="$LDFLAGS"
1660 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
1661 LDFLAGS="$LDFLAGS $with_oracle_libs"
1663 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
1665 CPPFLAGS="$SAVE_CPPFLAGS"
1666 LDFLAGS="$SAVE_LDFLAGS"
1668 if test "x$with_oracle" = "xyes"
1670 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
1671 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
1672 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
1673 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
1677 # --with-libowcapi {{{
1678 with_libowcapi_cppflags=""
1679 with_libowcapi_libs="-lowcapi"
1680 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
1682 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1684 with_libowcapi_cppflags="-I$withval/include"
1685 with_libowcapi_libs="-L$withval/lib -lowcapi"
1686 with_libowcapi="yes"
1688 with_libowcapi="$withval"
1692 with_libowcapi="yes"
1694 if test "x$with_libowcapi" = "xyes"
1696 SAVE_CPPFLAGS="$CPPFLAGS"
1697 CPPFLAGS="$with_libowcapi_cppflags"
1699 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
1701 CPPFLAGS="$SAVE_CPPFLAGS"
1703 if test "x$with_libowcapi" = "xyes"
1705 SAVE_LDFLAGS="$LDFLAGS"
1706 SAVE_CPPFLAGS="$CPPFLAGS"
1707 LDFLAGS="$with_libowcapi_libs"
1708 CPPFLAGS="$with_libowcapi_cppflags"
1710 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
1712 LDFLAGS="$SAVE_LDFLAGS"
1713 CPPFLAGS="$SAVE_CPPFLAGS"
1715 if test "x$with_libowcapi" = "xyes"
1717 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
1718 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
1719 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
1720 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
1724 # --with-libpcap {{{
1725 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
1727 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1729 LDFLAGS="$LDFLAGS -L$withval/lib"
1730 CPPFLAGS="$CPPFLAGS -I$withval/include"
1733 with_libpcap="$withval"
1739 if test "x$with_libpcap" = "xyes"
1741 AC_CHECK_LIB(pcap, pcap_open_live,
1743 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
1744 ], [with_libpcap="no (libpcap not found)"])
1746 if test "x$with_libpcap" = "xyes"
1748 AC_CHECK_HEADERS(pcap.h,
1750 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
1751 ], [with_libpcap="no (pcap.h not found)"])
1753 if test "x$with_libpcap" = "xyes"
1759 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
1760 [Wether or not to use the pcap library])
1761 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
1764 # --with-libpcre {{{
1765 with_pcre_config="pcre-config"
1768 AC_ARG_WITH(libpcre, [AS_HELP_STRING([--with-libpcre@<:@=PREFIX@:>@],
1769 [Path to libpcre.])],
1771 if test "x$withval" = "xno"
1774 else if test "x$withval" = "xyes"
1778 if test -f "$withval" && test -x "$withval"
1780 with_pcre_config="$withval"
1781 else if test -x "$withval/bin/pcre-config"
1783 with_pcre_config="$withval/bin/pcre-config"
1792 if test "x$with_libpcre" = "xyes"
1794 with_pcre_cflags=`$with_pcre_config --cflags 2>/dev/null`
1795 pcre_config_status=$?
1797 if test $pcre_config_status -ne 0
1799 with_libpcre="no ($with_pcre_config failed)"
1801 SAVE_CPPFLAGS="$CPPFLAGS"
1802 CPPFLAGS="$CPPFLAGS $with_pcre_cflags"
1804 AC_CHECK_HEADERS(pcre.h, [], [with_libpcre="no (pcre.h not found)"], [])
1806 CPPFLAGS="$SAVE_CPPFLAGS"
1810 if test "x$with_libpcre" = "xyes"
1812 with_pcre_libs=`$with_pcre_config --libs 2>/dev/null`
1813 pcre_config_status=$?
1815 if test $pcre_config_status -ne 0
1817 with_libpcre="no ($with_pcre_config failed)"
1819 AC_CHECK_LIB(pcre, pcre_compile,
1820 [with_libpcre="yes"],
1821 [with_libpcre="no (symbol 'pcre_compile' not found)"],
1826 if test "x$with_libpcre" = "xyes"
1828 BUILD_WITH_LIBPCRE_CFLAGS="$with_pcre_cflags"
1829 BUILD_WITH_LIBPCRE_LIBS="$with_pcre_libs"
1830 AC_SUBST(BUILD_WITH_LIBPCRE_CFLAGS)
1831 AC_SUBST(BUILD_WITH_LIBPCRE_LIBS)
1833 AM_CONDITIONAL(BUILD_WITH_LIBPCRE, test "x$with_libpcre" = "xyes")
1836 # --with-libperl {{{
1837 perl_interpreter="perl"
1838 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
1840 if test -x "$withval"
1842 perl_interpreter="$withval"
1844 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1846 LDFLAGS="$LDFLAGS -L$withval/lib"
1847 CPPFLAGS="$CPPFLAGS -I$withval/include"
1848 perl_interpreter="$withval/bin/perl"
1851 with_libperl="$withval"
1858 AC_MSG_CHECKING([for perl])
1859 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
1860 if test -x "$perl_interpreter"
1862 AC_MSG_RESULT([yes ($perl_interpreter)])
1868 AC_SUBST(PERL, "$perl_interpreter")
1870 if test "x$with_libperl" = "xyes" \
1871 && test -n "$perl_interpreter"
1874 SAVE_LDFLAGS=$LDFLAGS
1875 PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
1876 PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
1877 CFLAGS="$CFLAGS $PERL_CFLAGS"
1878 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1880 AC_CACHE_CHECK([for libperl],
1885 #define PERL_NO_GET_CONTEXT
1892 load_module (PERL_LOADMOD_NOIMPORT,
1893 newSVpv ("Collectd::Plugin::FooBar", 24),
1896 [have_libperl="yes"],
1901 if test "x$have_libperl" = "xyes"
1903 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
1904 AC_SUBST(PERL_CFLAGS)
1905 AC_SUBST(PERL_LDFLAGS)
1911 LDFLAGS=$SAVE_LDFLAGS
1912 else if test -z "$perl_interpreter"; then
1913 with_libperl="no (no perl interpreter found)"
1916 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
1918 if test "x$with_libperl" = "xyes"
1921 SAVE_LDFLAGS=$LDFLAGS
1922 CFLAGS="$CFLAGS $PERL_CFLAGS"
1923 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1925 AC_CACHE_CHECK([if perl supports ithreads],
1926 [have_perl_ithreads],
1934 #if !defined(USE_ITHREADS)
1935 # error "Perl does not support ithreads!"
1936 #endif /* !defined(USE_ITHREADS) */
1939 [have_perl_ithreads="yes"],
1940 [have_perl_ithreads="no"]
1944 if test "x$have_perl_ithreads" = "xyes"
1946 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
1950 LDFLAGS=$SAVE_LDFLAGS
1953 if test "x$with_libperl" = "xyes"
1956 SAVE_LDFLAGS=$LDFLAGS
1957 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
1958 # (see issues #41 and #42)
1959 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
1960 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
1962 AC_CACHE_CHECK([for broken Perl_load_module()],
1963 [have_broken_perl_load_module],
1967 #define PERL_NO_GET_CONTEXT
1974 load_module (PERL_LOADMOD_NOIMPORT,
1975 newSVpv ("Collectd::Plugin::FooBar", 24),
1978 [have_broken_perl_load_module="no"],
1979 [have_broken_perl_load_module="yes"]
1983 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
1984 test "x$have_broken_perl_load_module" = "xyes")
1987 LDFLAGS=$SAVE_LDFLAGS
1992 with_pg_config="pg_config"
1993 with_libpq_includedir=""
1994 with_libpq_libdir=""
1995 with_libpq_cppflags=""
1996 with_libpq_ldflags=""
1997 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2000 if test "x$withval" = "xno"
2003 else if test "x$withval" = "xyes"
2007 if test -f "$withval" && test -x "$withval";
2009 with_pg_config="$withval"
2010 else if test -x "$withval/bin/pg_config"
2012 with_pg_config="$withval/bin/pg_config"
2020 if test "x$with_libpq" = "xyes"
2022 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2025 if test $pg_config_status -eq 0
2027 if test -n "$with_libpq_includedir"; then
2028 for dir in $with_libpq_includedir; do
2029 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2033 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2036 SAVE_CPPFLAGS="$CPPFLAGS"
2037 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2039 AC_CHECK_HEADERS(libpq-fe.h, [],
2040 [with_libpq="no (libpq-fe.h not found)"], [])
2042 CPPFLAGS="$SAVE_CPPFLAGS"
2044 if test "x$with_libpq" = "xyes"
2046 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2049 if test $pg_config_status -eq 0
2051 if test -n "$with_libpq_libdir"; then
2052 for dir in $with_libpq_libdir; do
2053 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2057 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2060 SAVE_LDFLAGS="$LDFLAGS"
2061 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2063 AC_CHECK_LIB(pq, PQconnectdb,
2065 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2067 LDFLAGS="$SAVE_LDFLAGS"
2069 if test "x$with_libpq" = "xyes"
2071 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2072 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2073 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2074 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2076 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2079 # --with-libpthread {{{
2080 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2081 [ if test "x$withval" != "xno" \
2082 && test "x$withval" != "xyes"
2084 LDFLAGS="$LDFLAGS -L$withval/lib"
2085 CPPFLAGS="$CPPFLAGS -I$withval/include"
2086 with_libpthread="yes"
2088 if test "x$withval" = "xno"
2090 with_libpthread="no (disabled)"
2093 ], [with_libpthread="yes"])
2094 if test "x$with_libpthread" = "xyes"
2096 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2098 if test "x$with_libpthread" = "xyes"
2100 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2102 if test "x$with_libpthread" = "xyes"
2108 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2109 [Wether or not to use pthread (POSIX threads) library])
2110 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2114 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2117 librrd_threadsafe="yes"
2118 librrd_rrdc_update="no"
2119 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2120 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2122 librrd_cflags="-I$withval/include"
2123 librrd_ldflags="-L$withval/lib"
2126 with_librrd="$withval"
2128 ], [with_librrd="yes"])
2129 if test "x$with_librrd" = "xyes"
2131 SAVE_CPPFLAGS="$CPPFLAGS"
2132 SAVE_LDFLAGS="$LDFLAGS"
2134 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2135 LDFLAGS="$LDFLAGS $librrd_ldflags"
2137 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2139 CPPFLAGS="$SAVE_CPPFLAGS"
2140 LDFLAGS="$SAVE_LDFLAGS"
2142 if test "x$with_librrd" = "xyes"
2144 SAVE_CPPFLAGS="$CPPFLAGS"
2145 SAVE_LDFLAGS="$LDFLAGS"
2147 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2148 LDFLAGS="$LDFLAGS $librrd_ldflags"
2150 AC_CHECK_LIB(rrd_th, rrd_update_r,
2152 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2154 [librrd_threadsafe="no"
2155 AC_CHECK_LIB(rrd, rrd_update,
2157 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2159 [with_librrd="no (symbol 'rrd_update' not found)"],
2164 if test "x$librrd_threadsafe" = "xyes"
2166 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2168 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2171 CPPFLAGS="$SAVE_CPPFLAGS"
2172 LDFLAGS="$SAVE_LDFLAGS"
2174 if test "x$with_librrd" = "xyes"
2176 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2177 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2178 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2179 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2181 if test "x$librrd_threadsafe" = "xyes"
2183 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2187 # --with-libsensors {{{
2188 with_sensors_cflags=""
2189 with_sensors_ldflags=""
2190 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2192 if test "x$withval" = "xno"
2194 with_libsensors="no"
2196 with_libsensors="yes"
2197 if test "x$withval" != "xyes"
2199 with_sensors_cflags="-I$withval/include"
2200 with_sensors_ldflags="-L$withval/lib"
2201 with_libsensors="yes"
2206 if test "x$ac_system" = "xLinux"
2208 with_libsensors="yes"
2210 with_libsensors="no (Linux only library)"
2213 if test "x$with_libsensors" = "xyes"
2215 SAVE_CPPFLAGS="$CPPFLAGS"
2216 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2218 # AC_CHECK_HEADERS(sensors/sensors.h,
2220 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2222 # [with_libsensors="no (sensors/sensors.h not found)"])
2223 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2225 CPPFLAGS="$SAVE_CPPFLAGS"
2227 if test "x$with_libsensors" = "xyes"
2229 SAVE_CPPFLAGS="$CPPFLAGS"
2230 SAVE_LDFLAGS="$LDFLAGS"
2231 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2232 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2234 AC_CHECK_LIB(sensors, sensors_init,
2236 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2238 [with_libsensors="no (libsensors not found)"])
2240 CPPFLAGS="$SAVE_CPPFLAGS"
2241 LDFLAGS="$SAVE_LDFLAGS"
2243 if test "x$with_libsensors" = "xyes"
2245 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2246 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2247 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2248 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2250 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2253 # --with-libstatgrab {{{
2254 with_libstatgrab_cflags=""
2255 with_libstatgrab_ldflags=""
2256 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2258 if test "x$withval" != "xno" \
2259 && test "x$withval" != "xyes"
2261 with_libstatgrab_cflags="-I$withval/include"
2262 with_libstatgrab_ldflags="-L$withval/lib"
2263 with_libstatgrab="yes"
2265 with_libstatgrab="$withval"
2269 if test "x$ac_system" = "xunknown"
2271 with_libstatgrab="yes"
2273 with_libstatgrab="no"
2276 with_libstatgrab_pkg_config="yes"
2277 if test "x$with_libstatgrab" = "xyes" \
2278 && test "x$PKG_CONFIG" != "x"
2280 AC_MSG_CHECKING([pkg-config for libstatgrab])
2282 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2285 with_libstatgrab_pkg_config="no"
2286 temp_result="not found"
2288 AC_MSG_RESULT([$temp_result])
2290 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2291 with_libstatgrab_pkg_config="no"
2292 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2295 if test "x$with_libstatgrab" = "xyes" \
2296 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2297 && test "x$with_libstatgrab_cflags" = "x"
2299 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2300 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2303 with_libstatgrab_cflags="$temp_result"
2305 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2306 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2308 AC_MSG_RESULT([$temp_result])
2311 if test "x$with_libstatgrab" = "xyes" \
2312 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2313 && test "x$with_libstatgrab_ldflags" = "x"
2315 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2316 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2319 with_libstatgrab_ldflags="$temp_result"
2321 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2322 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2324 AC_MSG_RESULT([$temp_result])
2327 if test "x$with_libstatgrab" = "xyes"
2329 SAVE_CPPFLAGS="$CPPFLAGS"
2330 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2332 AC_CHECK_HEADERS(statgrab.h,
2333 [with_libstatgrab="yes"],
2334 [with_libstatgrab="no (statgrab.h not found)"])
2336 CPPFLAGS="$SAVE_CPPFLAGS"
2339 if test "x$with_libstatgrab" = "xyes"
2341 SAVE_CFLAGS="$CFLAGS"
2342 SAVE_LDFLAGS="$LDFLAGS"
2344 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2345 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2347 AC_CHECK_LIB(statgrab, sg_init,
2348 [with_libstatgrab="yes"],
2349 [with_libstatgrab="no (symbol sg_init not found)"])
2351 CFLAGS="$SAVE_CFLAGS"
2352 LDFLAGS="$SAVE_LDFLAGS"
2355 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2356 if test "x$with_libstatgrab" = "xyes"
2358 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2359 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2360 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2361 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2362 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2366 # --with-libxmms {{{
2367 with_xmms_config="xmms-config"
2370 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2372 if test "x$withval" != "xno" \
2373 && test "x$withval" != "xyes"
2375 if test -f "$withval" && test -x "$withval";
2377 with_xmms_config="$withval"
2378 else if test -x "$withval/bin/xmms-config"
2380 with_xmms_config="$withval/bin/xmms-config"
2383 else if test "x$withval" = "xno"
2393 if test "x$with_libxmms" = "xyes"
2395 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2396 xmms_config_status=$?
2398 if test $xmms_config_status -ne 0
2403 if test "x$with_libxmms" = "xyes"
2405 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2406 xmms_config_status=$?
2408 if test $xmms_config_status -ne 0
2413 if test "x$with_libxmms" = "xyes"
2415 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2417 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2418 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2419 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2420 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2427 with_libxmms_numeric=0
2428 if test "x$with_libxmms" = "xyes"
2430 with_libxmms_numeric=1
2432 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2433 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2436 # pkg-config --exists 'libupsclient' {{{
2437 with_libupsclient="no (pkg-config isn't available)"
2438 with_libupsclient_cflags=""
2439 with_libupsclient_libs=""
2440 if test "x$PKG_CONFIG" != "x"
2442 pkg-config --exists 'libupsclient' 2>/dev/null
2445 with_libupsclient="yes"
2447 with_libupsclient="no (pkg-config doesn't know library)"
2450 if test "x$with_libupsclient" = "xyes"
2452 with_libupsclient_cflags="`pkg-config --cflags 'libupsclient'`"
2455 with_libupsclient="no"
2457 with_libupsclient_libs="`pkg-config --libs 'libupsclient'`"
2460 with_libupsclient="no"
2463 if test "x$with_libupsclient" = "xyes"
2465 SAVE_CPPFLAGS="$CPPFLAGS"
2466 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2468 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2470 CPPFLAGS="$SAVE_CPPFLAGS"
2472 if test "x$with_libupsclient" = "xyes"
2474 SAVE_CPPFLAGS="$CPPFLAGS"
2475 SAVE_LDFLAGS="$LDFLAGS"
2477 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2478 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2480 AC_CHECK_LIB(upsclient, upscli_connect,
2481 [with_libupsclient="yes"],
2482 [with_libupsclient="no (symbol upscli_connect not found)"])
2484 CPPFLAGS="$SAVE_CPPFLAGS"
2485 LDFLAGS="$SAVE_LDFLAGS"
2487 if test "x$with_libupsclient" = "xyes"
2489 SAVE_CPPFLAGS="$CPPFLAGS"
2490 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2492 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2493 [#include <stdlib.h>
2495 #include <upsclient.h>])
2497 CPPFLAGS="$SAVE_CPPFLAGS"
2499 if test "x$with_libupsclient" = "xyes"
2501 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2502 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2503 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2504 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2508 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
2509 with_libxml2="no (pkg-config isn't available)"
2510 with_libxml2_cflags=""
2511 with_libxml2_ldflags=""
2512 with_libvirt="no (pkg-config isn't available)"
2513 with_libvirt_cflags=""
2514 with_libvirt_ldflags=""
2515 if test "x$PKG_CONFIG" != "x"
2517 pkg-config --exists 'libxml-2.0' 2>/dev/null
2522 with_libxml2="no (pkg-config doesn't know library)"
2525 pkg-config --exists libvirt 2>/dev/null
2530 with_libvirt="no (pkg-config doesn't know library)"
2533 if test "x$with_libxml2" = "xyes"
2535 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
2540 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
2546 if test "x$with_libxml2" = "xyes"
2548 SAVE_CPPFLAGS="$CPPFLAGS"
2549 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
2551 AC_CHECK_HEADERS(libxml/parser.h, [],
2552 [with_libxml2="no (libxml/parser.h not found)"])
2554 CPPFLAGS="$SAVE_CPPFLAGS"
2556 if test "x$with_libxml2" = "xyes"
2558 SAVE_CFLAGS="$CFLAGS"
2559 SAVE_LDFLAGS="$LDFLAGS"
2561 CFLAGS="$CFLAGS $with_libxml2_cflags"
2562 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
2564 AC_CHECK_LIB(xml2, xmlXPathEval,
2565 [with_libxml2="yes"],
2566 [with_libxml2="no (symbol xmlXPathEval not found)"])
2568 CFLAGS="$SAVE_CFLAGS"
2569 LDFLAGS="$SAVE_LDFLAGS"
2571 dnl Add the right compiler flags and libraries.
2572 if test "x$with_libxml2" = "xyes"; then
2573 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
2574 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
2575 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
2576 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
2578 if test "x$with_libvirt" = "xyes"
2580 with_libvirt_cflags="`pkg-config --cflags libvirt`"
2585 with_libvirt_ldflags="`pkg-config --libs libvirt`"
2591 if test "x$with_libvirt" = "xyes"
2593 SAVE_CPPFLAGS="$CPPFLAGS"
2594 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
2596 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
2597 [with_libvirt="no (libvirt/libvirt.h not found)"])
2599 CPPFLAGS="$SAVE_CPPFLAGS"
2601 if test "x$with_libvirt" = "xyes"
2603 SAVE_CFLAGS="$CFLAGS"
2604 SAVE_LDFLAGS="$LDFLAGS"
2606 CFLAGS="$CFLAGS $with_libvirt_cflags"
2607 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
2609 AC_CHECK_LIB(virt, virDomainBlockStats,
2610 [with_libvirt="yes"],
2611 [with_libvirt="no (symbol virDomainBlockStats not found)"])
2613 CFLAGS="$SAVE_CFLAGS"
2614 LDFLAGS="$SAVE_LDFLAGS"
2616 dnl Add the right compiler flags and libraries.
2617 if test "x$with_libvirt" = "xyes"; then
2618 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
2619 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
2620 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
2621 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
2625 # $PKG_CONFIG --exists OpenIPMIpthread {{{
2626 with_libopenipmipthread="yes"
2627 with_libopenipmipthread_cflags=""
2628 with_libopenipmipthread_libs=""
2630 AC_MSG_CHECKING([for pkg-config])
2632 if test "x$PKG_CONFIG" = "x"
2634 with_libopenipmipthread="no"
2637 temp_result="$PKG_CONFIG"
2639 AC_MSG_RESULT([$temp_result])
2641 if test "x$with_libopenipmipthread" = "xyes"
2643 AC_MSG_CHECKING([for libOpenIPMIpthread])
2644 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
2647 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
2649 AC_MSG_RESULT([$with_libopenipmipthread])
2652 if test "x$with_libopenipmipthread" = "xyes"
2654 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
2655 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
2658 with_libopenipmipthread_cflags="$temp_result"
2660 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
2661 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
2663 AC_MSG_RESULT([$temp_result])
2666 if test "x$with_libopenipmipthread" = "xyes"
2668 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
2669 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
2672 with_libopenipmipthread_ldflags="$temp_result"
2674 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
2675 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
2677 AC_MSG_RESULT([$temp_result])
2680 if test "x$with_libopenipmipthread" = "xyes"
2682 SAVE_CPPFLAGS="$CPPFLAGS"
2683 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
2685 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
2686 [with_libopenipmipthread="yes"],
2687 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
2688 [#include <OpenIPMI/ipmiif.h>
2689 #include <OpenIPMI/ipmi_err.h>
2690 #include <OpenIPMI/ipmi_posix.h>
2691 #include <OpenIPMI/ipmi_conn.h>
2694 CPPFLAGS="$SAVE_CPPFLAGS"
2697 if test "x$with_libopenipmipthread" = "xyes"
2699 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
2700 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
2701 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
2702 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
2706 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
2707 [with_libnotify="yes"],
2708 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
2710 # Check for enabled/disabled features
2713 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
2714 # ------------------------------------------------------------
2716 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
2721 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
2726 m4_define([EnDis],[disabled])dnl
2727 m4_define([YesNo],[no])dnl
2733 m4_define([EnDis],[enabled])dnl
2734 m4_define([YesNo],[yes])dnl
2737 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
2741 m4_if([$3], [feature], [],
2745 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
2751 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
2753 enable_$1='[YesNo]'dnl
2755 if test "x$enable_$1" = "xno"
2759 if test "x$enable_$1" = "xyes"
2763 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
2768 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
2769 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
2771 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
2773 # AC_PLUGIN(name, default, info)
2774 # ------------------------------------------------------------
2780 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
2782 if test "x$enableval" = "xyes"
2790 if test "x$2" = "xyes"
2797 if test "x$enable_plugin" = "xyes"
2799 if test "x$2" = "xyes"
2801 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
2802 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
2803 dependency_error="yes"
2804 enable_plugin="no (dependency error)"
2807 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
2808 enable_$1="$enable_plugin"
2810 )# AC_PLUGIN(name, default, info)
2812 m4_divert_once([HELP_ENABLE], [
2813 collectd features:])
2814 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
2815 AC_COLLECTD([debug], [enable], [feature], [debugging])
2816 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
2817 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
2819 dependency_error="no"
2828 plugin_interface="no"
2835 plugin_multimeter="no"
2838 plugin_processes="no"
2842 plugin_tcpconns="no"
2847 plugin_wireless="no"
2850 if test "x$ac_system" = "xLinux"
2852 plugin_battery="yes"
2854 plugin_cpufreq="yes"
2856 plugin_entropy="yes"
2857 plugin_interface="yes"
2862 plugin_processes="yes"
2865 plugin_tcpconns="yes"
2866 plugin_thermal="yes"
2868 plugin_vserver="yes"
2869 plugin_wireless="yes"
2871 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
2877 if test "x$ac_system" = "xOpenBSD"
2879 plugin_tcpconns="yes"
2883 if test "x$with_libiokit" = "xyes"
2885 plugin_battery="yes"
2890 if test "x$with_devinfo$with_kstat" = "xyesyes"
2894 plugin_interface="yes"
2899 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
2905 if test "x$with_libstatgrab" = "xyes"
2909 plugin_interface="yes"
2916 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
2922 if test "x$with_libopenipmipthread" = "xyes"
2927 if test "x$have_processor_info" = "xyes"
2931 if test "x$have_sysctlbyname" = "xyes"
2935 plugin_tcpconns="yes"
2938 if test "x$have_statfs" = "xyes"
2942 if test "x$have_statvfs" = "xyes"
2947 if test "x$have_getifaddrs" = "xyes"
2949 plugin_interface="yes"
2952 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
2954 plugin_libvirt="yes"
2957 if test "x$have_getloadavg" = "xyes"
2962 if test "x$have_libperl$have_perl_ithreads" = "xyesyes"
2967 # Mac OS X memory interface
2968 if test "x$have_host_statistics" = "xyes"
2973 if test "x$have_termios_h" = "xyes"
2975 plugin_multimeter="yes"
2978 if test "x$have_thread_info" = "xyes"
2980 plugin_processes="yes"
2983 if test "x$with_kvm_getprocs" = "xyes"
2985 plugin_processes="yes"
2988 if test "x$with_kvm_getswapinfo" = "xyes"
2993 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
2995 plugin_tcpconns="yes"
2998 if test "x$have_getutent" = "xyes"
3002 if test "x$have_getutxent" = "xyes"
3007 # FIXME: sysctl for swap plugin
3009 m4_divert_once([HELP_ENABLE], [
3012 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3013 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3014 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3015 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3016 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3017 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3018 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3019 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3020 AC_PLUGIN([csv], [yes], [CSV output plugin])
3021 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3022 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3023 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3024 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3025 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3026 AC_PLUGIN([email], [yes], [EMail statistics])
3027 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3028 AC_PLUGIN([exec], [yes], [Execution of external programs])
3029 AC_PLUGIN([filecount], [yes], [Count files in directories])
3030 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3031 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3032 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3033 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3034 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3035 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3036 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3037 AC_PLUGIN([load], [$plugin_load], [System load])
3038 AC_PLUGIN([logfile], [yes], [File logging plugin])
3039 AC_PLUGIN([match_regex], [yes], [The regex match])
3040 AC_PLUGIN([match_value], [yes], [The value match])
3041 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3042 AC_PLUGIN([memcached], [yes], [memcached statistics])
3043 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3044 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3045 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3046 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3047 AC_PLUGIN([network], [yes], [Network communication plugin])
3048 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3049 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3050 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3051 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3052 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3053 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3054 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3055 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3056 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3057 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3058 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3059 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3060 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3061 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3062 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3063 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3064 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3065 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3066 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3067 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3068 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3069 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3070 AC_PLUGIN([target_notification], [yes], [The notification target])
3071 AC_PLUGIN([target_replace], [yes], [The replace target])
3072 AC_PLUGIN([target_set], [yes], [The set target])
3073 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3074 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3075 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3076 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3077 AC_PLUGIN([users], [$plugin_users], [User statistics])
3078 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3079 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3080 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3081 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3082 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3085 if test "x$ac_system" = "xLinux" \
3086 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3088 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3092 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3094 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3096 PERL_BINDINGS_OPTIONS="$withval"
3097 with_perl_bindings="yes"
3099 PERL_BINDINGS_OPTIONS=""
3100 with_perl_bindings="$withval"
3104 PERL_BINDINGS_OPTIONS=""
3105 if test -n "$perl_interpreter"
3107 with_perl_bindings="yes"
3109 with_perl_bindings="no (no perl interpreter found)"
3112 if test "x$with_perl_bindings" = "xyes"
3114 PERL_BINDINGS="perl"
3118 AC_SUBST(PERL_BINDINGS)
3119 AC_SUBST(PERL_BINDINGS_OPTIONS)
3121 dnl libcollectdclient
3122 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3123 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3124 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3126 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3128 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3130 AC_SUBST(LCC_VERSION_MAJOR)
3131 AC_SUBST(LCC_VERSION_MINOR)
3132 AC_SUBST(LCC_VERSION_PATCH)
3133 AC_SUBST(LCC_VERSION_EXTRA)
3134 AC_SUBST(LCC_VERSION_STRING)
3136 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3138 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile src/liboping/Makefile bindings/Makefile)
3140 if test "x$with_librrd" = "xyes" \
3141 && test "x$librrd_threadsafe" != "xyes"
3143 with_librrd="yes (warning: librrd is not thread-safe)"
3146 if test "x$with_liboping" = "xyes" \
3147 && test "x$with_own_liboping" = "xyes"
3149 with_liboping="yes (shipped version)"
3152 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3154 with_libiptc="yes (shipped version)"
3157 if test "x$with_libperl" = "xyes"
3159 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3161 enable_perl="no (needs libperl)"
3164 if test "x$with_perl_bindings" = "xyes" \
3165 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3167 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3174 libcurl . . . . . . . $with_libcurl
3175 libdbi . . . . . . . $with_libdbi
3176 libesmtp . . . . . . $with_libesmtp
3177 libiokit . . . . . . $with_libiokit
3178 libiptc . . . . . . . $with_libiptc
3179 libkstat . . . . . . $with_kstat
3180 libkvm . . . . . . . $with_libkvm
3181 libmysql . . . . . . $with_libmysql
3182 libnetlink . . . . . $with_libnetlink
3183 libnetsnmp . . . . . $with_libnetsnmp
3184 libnotify . . . . . . $with_libnotify
3185 liboconfig . . . . . $with_liboconfig
3186 libopenipmi . . . . . $with_libopenipmipthread
3187 liboping . . . . . . $with_liboping
3188 libpcap . . . . . . . $with_libpcap
3189 libpcre . . . . . . . $with_libpcre
3190 libperl . . . . . . . $with_libperl
3191 libpthread . . . . . $with_libpthread
3192 libpq . . . . . . . . $with_libpq
3193 librrd . . . . . . . $with_librrd
3194 libsensors . . . . . $with_libsensors
3195 libstatgrab . . . . . $with_libstatgrab
3196 libupsclient . . . . $with_libupsclient
3197 libvirt . . . . . . . $with_libvirt
3198 libxml2 . . . . . . . $with_libxml2
3199 libxmms . . . . . . . $with_libxmms
3200 oracle . . . . . . . $with_oracle
3203 daemon mode . . . . . $enable_daemon
3204 debug . . . . . . . . $enable_debug
3207 perl . . . . . . . . $with_perl_bindings
3210 apache . . . . . . . $enable_apache
3211 apcups . . . . . . . $enable_apcups
3212 apple_sensors . . . . $enable_apple_sensors
3213 ascent . . . . . . . $enable_ascent
3214 battery . . . . . . . $enable_battery
3215 bind . . . . . . . . $enable_bind
3216 cpu . . . . . . . . . $enable_cpu
3217 cpufreq . . . . . . . $enable_cpufreq
3218 csv . . . . . . . . . $enable_csv
3219 dbi . . . . . . . . . $enable_dbi
3220 df . . . . . . . . . $enable_df
3221 disk . . . . . . . . $enable_disk
3222 dns . . . . . . . . . $enable_dns
3223 email . . . . . . . . $enable_email
3224 entropy . . . . . . . $enable_entropy
3225 exec . . . . . . . . $enable_exec
3226 filecount . . . . . . $enable_filecount
3227 hddtemp . . . . . . . $enable_hddtemp
3228 interface . . . . . . $enable_interface
3229 iptables . . . . . . $enable_iptables
3230 ipmi . . . . . . . . $enable_ipmi
3231 ipvs . . . . . . . . $enable_ipvs
3232 irq . . . . . . . . . $enable_irq
3233 libvirt . . . . . . . $enable_libvirt
3234 load . . . . . . . . $enable_load
3235 logfile . . . . . . . $enable_logfile
3236 match_regex . . . . . $enable_match_regex
3237 match_value . . . . . $enable_match_value
3238 mbmon . . . . . . . . $enable_mbmon
3239 memcached . . . . . . $enable_memcached
3240 memory . . . . . . . $enable_memory
3241 multimeter . . . . . $enable_multimeter
3242 mysql . . . . . . . . $enable_mysql
3243 netlink . . . . . . . $enable_netlink
3244 network . . . . . . . $enable_network
3245 nfs . . . . . . . . . $enable_nfs
3246 nginx . . . . . . . . $enable_nginx
3247 notify_desktop . . . $enable_notify_desktop
3248 notify_email . . . . $enable_notify_email
3249 ntpd . . . . . . . . $enable_ntpd
3250 nut . . . . . . . . . $enable_nut
3251 onewire . . . . . . . $enable_onewire
3252 openvpn . . . . . . . $enable_openvpn
3253 oracle . . . . . . . $enable_oracle
3254 perl . . . . . . . . $enable_perl
3255 ping . . . . . . . . $enable_ping
3256 postgresql . . . . . $enable_postgresql
3257 powerdns . . . . . . $enable_powerdns
3258 processes . . . . . . $enable_processes
3259 rrdtool . . . . . . . $enable_rrdtool
3260 rrdcached . . . . . . $enable_rrdcached
3261 sensors . . . . . . . $enable_sensors
3262 serial . . . . . . . $enable_serial
3263 snmp . . . . . . . . $enable_snmp
3264 swap . . . . . . . . $enable_swap
3265 syslog . . . . . . . $enable_syslog
3266 tail . . . . . . . . $enable_tail
3267 tape . . . . . . . . $enable_tape
3268 target_notification . $enable_target_notification
3269 target_replace . . . $enable_target_replace
3270 target_set . . . . . $enable_target_set
3271 tcpconns . . . . . . $enable_tcpconns
3272 teamspeak2 . . . . . $enable_teamspeak2
3273 thermal . . . . . . . $enable_thermal
3274 unixsock . . . . . . $enable_unixsock
3275 users . . . . . . . . $enable_users
3276 uuid . . . . . . . . $enable_uuid
3277 vmem . . . . . . . . $enable_vmem
3278 vserver . . . . . . . $enable_vserver
3279 wireless . . . . . . $enable_wireless
3280 xmms . . . . . . . . $enable_xmms
3284 if test "x$dependency_error" = "xyes"; then
3285 AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
3288 # vim: set fdm=marker :