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"],
283 #undef _FILE_OFFSET_BITS
284 #undef _LARGEFILE64_SOURCE
286 # include <sys/types.h>
289 # include <sys/param.h>
293 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
296 if test "x$GCC" = "xyes"
298 hint_64="CFLAGS='-m64'"
300 hint_64="CFLAGS='-xarch=v9'"
302 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
306 # For the processes plugin
308 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
310 # For interface plugin
311 AC_CHECK_HEADERS(ifaddrs.h)
312 AC_CHECK_HEADERS(net/if.h, [], [],
315 # include <sys/types.h>
317 #if HAVE_SYS_SOCKET_H
318 # include <sys/socket.h>
321 AC_CHECK_HEADERS(linux/if.h, [], [],
324 # include <sys/types.h>
326 #if HAVE_SYS_SOCKET_H
327 # include <sys/socket.h>
330 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
333 # include <sys/types.h>
335 #if HAVE_SYS_SOCKET_H
336 # include <sys/socket.h>
339 # include <linux/if.h>
344 have_net_ip_vs_h="no"
346 if test "x$ac_system" = "xLinux"
349 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
351 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
352 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
358 AC_CHECK_HEADERS(sys/ucred.h, [], [],
361 # include <sys/types.h>
364 # include <sys/param.h>
368 # For mount interface
369 AC_CHECK_HEADERS(sys/mount.h, [], [],
372 # include <sys/types.h>
375 # include <sys/param.h>
379 # For the email plugin
380 AC_CHECK_HEADERS(linux/un.h, [], [],
382 #if HAVE_SYS_SOCKET_H
383 # include <sys/socket.h>
387 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)
390 AC_CHECK_HEADERS(arpa/nameser.h)
391 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
393 #if HAVE_ARPA_NAMESER_H
394 # include <arpa/nameser.h>
398 AC_CHECK_HEADERS(net/if_arp.h, [], [],
399 [#if HAVE_SYS_SOCKET_H
400 # include <sys/socket.h>
403 AC_CHECK_HEADERS(net/ppp_defs.h)
404 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
405 [#if HAVE_NET_PPP_DEFS_H
406 # include <net/ppp_defs.h>
409 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
414 # include <sys/types.h>
416 #if HAVE_SYS_SOCKET_H
417 # include <sys/socket.h>
422 #if HAVE_NETINET_IN_H
423 # include <netinet/in.h>
427 # For the multimeter plugin
429 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
432 # Checks for typedefs, structures, and compiler characteristics.
441 # Checks for library functions.
443 AC_PROG_GCC_TRADITIONAL
444 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
448 AC_CACHE_CHECK([for strtok_r],
449 [c_cv_have_strtok_r_default],
458 char buffer[] = "foo,bar,baz";
465 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
468 printf ("token = %s;\n", token);
471 [c_cv_have_strtok_r_default="yes"],
472 [c_cv_have_strtok_r_default="no"]
476 if test "x$c_cv_have_strtok_r_default" = "xno"
478 SAVE_CFLAGS="$CFLAGS"
479 CFLAGS="$CFLAGS -D_REENTRANT=1"
481 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
482 [c_cv_have_strtok_r_reentrant],
491 char buffer[] = "foo,bar,baz";
498 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
501 printf ("token = %s;\n", token);
504 [c_cv_have_strtok_r_reentrant="yes"],
505 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
510 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
512 socket_needs_socket="no"
513 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
514 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
516 nanosleep_needs_rt="no"
517 AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep)))
518 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
520 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
521 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
522 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
523 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
524 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
525 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
526 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
527 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
528 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
529 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
530 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
531 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
534 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
537 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
539 if test "x$withval" = "xno"; then
541 else if test "x$withval" = "xyes"; then
548 if test "x$nan_type" = "xnone"; then
549 AC_CACHE_CHECK([whether NAN is defined by default],
550 [c_cv_have_nan_default],
556 static float foo = NAN;
564 [c_cv_have_nan_default="yes"],
565 [c_cv_have_nan_default="no"]
568 if test "x$c_cv_have_nan_default" = "xyes"
573 if test "x$nan_type" = "xnone"; then
574 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
575 [c_cv_have_nan_isoc],
580 #define __USE_ISOC99 1
582 static float foo = NAN;
590 [c_cv_have_nan_isoc="yes"],
591 [c_cv_have_nan_isoc="no"]
594 if test "x$c_cv_have_nan_isoc" = "xyes"
599 if test "x$nan_type" = "xnone"; then
600 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
601 [c_cv_have_nan_zero],
610 #define NAN (0.0 / 0.0)
612 # define isnan(f) ((f) != (f))
614 static float foo = NAN;
622 [c_cv_have_nan_zero="yes"],
623 [c_cv_have_nan_zero="no"]
626 if test "x$c_cv_have_nan_zero" = "xyes"
632 if test "x$nan_type" = "xdefault"; then
633 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
634 [Define if NAN is defined by default and can initialize static variables.])
635 else if test "x$nan_type" = "xisoc99"; then
636 AC_DEFINE(NAN_STATIC_ISOC, 1,
637 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
638 else if test "x$nan_type" = "xzero"; then
639 AC_DEFINE(NAN_ZERO_ZERO, 1,
640 [Define if NAN can be defined as (0.0 / 0.0)])
642 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
645 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
647 if test "x$withval" = "xnothing"; then
648 fp_layout_type="nothing"
649 else if test "x$withval" = "xendianflip"; then
650 fp_layout_type="endianflip"
651 else if test "x$withval" = "xintswap"; then
652 fp_layout_type="intswap"
654 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
657 [fp_layout_type="unknown"])
659 if test "x$fp_layout_type" = "xunknown"; then
660 AC_CACHE_CHECK([if doubles are stored in x86 representation],
661 [c_cv_fp_layout_need_nothing],
672 # include <stdbool.h>
682 memcpy ((void *) &i0, (void *) &d, 8);
685 memcpy ((void *) c, (void *) &i1, 8);
687 if ((c[0] == 0x2f) && (c[1] == 0x25)
688 && (c[2] == 0xc0) && (c[3] == 0xc7)
689 && (c[4] == 0x43) && (c[5] == 0x2b)
690 && (c[6] == 0x1f) && (c[7] == 0x5b))
695 [c_cv_fp_layout_need_nothing="yes"],
696 [c_cv_fp_layout_need_nothing="no"]
699 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
700 fp_layout_type="nothing"
703 if test "x$fp_layout_type" = "xunknown"; then
704 AC_CACHE_CHECK([if endianflip converts to x86 representation],
705 [c_cv_fp_layout_need_endianflip],
716 # include <stdbool.h>
718 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
719 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
720 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
721 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
722 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
723 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
724 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
725 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
734 memcpy ((void *) &i0, (void *) &d, 8);
736 i1 = endianflip (i0);
737 memcpy ((void *) c, (void *) &i1, 8);
739 if ((c[0] == 0x2f) && (c[1] == 0x25)
740 && (c[2] == 0xc0) && (c[3] == 0xc7)
741 && (c[4] == 0x43) && (c[5] == 0x2b)
742 && (c[6] == 0x1f) && (c[7] == 0x5b))
747 [c_cv_fp_layout_need_endianflip="yes"],
748 [c_cv_fp_layout_need_endianflip="no"]
751 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
752 fp_layout_type="endianflip"
755 if test "x$fp_layout_type" = "xunknown"; then
756 AC_CACHE_CHECK([if intswap converts to x86 representation],
757 [c_cv_fp_layout_need_intswap],
768 # include <stdbool.h>
770 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
771 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
780 memcpy ((void *) &i0, (void *) &d, 8);
783 memcpy ((void *) c, (void *) &i1, 8);
785 if ((c[0] == 0x2f) && (c[1] == 0x25)
786 && (c[2] == 0xc0) && (c[3] == 0xc7)
787 && (c[4] == 0x43) && (c[5] == 0x2b)
788 && (c[6] == 0x1f) && (c[7] == 0x5b))
793 [c_cv_fp_layout_need_intswap="yes"],
794 [c_cv_fp_layout_need_intswap="no"]
797 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
798 fp_layout_type="intswap"
802 if test "x$fp_layout_type" = "xnothing"; then
803 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
804 [Define if doubles are stored in x86 representation.])
805 else if test "x$fp_layout_type" = "xendianflip"; then
806 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
807 [Define if endianflip is needed to convert to x86 representation.])
808 else if test "x$fp_layout_type" = "xintswap"; then
809 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
810 [Define if intswap is needed to convert to x86 representation.])
812 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
816 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
818 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
820 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
823 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
824 if test "x$have_getmntent" = "xno"; then
825 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
827 if test "x$have_getmntent" = "xno"; then
828 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
830 if test "x$have_getmntent" = "xno"; then
831 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
834 if test "x$have_getmntent" = "xc"; then
835 AC_CACHE_CHECK([whether getmntent takes one argument],
836 [c_cv_have_one_getmntent],
838 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
839 #include "$srcdir/src/utils_mount.h"]],
843 fh = setmntent ("/etc/mtab", "r");
847 [c_cv_have_one_getmntent="yes"],
848 [c_cv_have_one_getmntent="no"]
851 AC_CACHE_CHECK([whether getmntent takes two arguments],
852 [c_cv_have_two_getmntent],
854 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
855 #include "$srcdir/src/utils_mount.h"]],
860 fh = fopen ("/etc/mnttab", "r");
861 status = getmntent (fh, &mt);
864 [c_cv_have_two_getmntent="yes"],
865 [c_cv_have_two_getmntent="no"]
870 # Check for different versions of `getmntent' here..
872 if test "x$have_getmntent" = "xc"; then
873 if test "x$c_cv_have_one_getmntent" = "xyes"; then
874 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
875 [Define if the function getmntent exists and takes one argument.])
877 if test "x$c_cv_have_two_getmntent" = "xyes"; then
878 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
879 [Define if the function getmntent exists and takes two arguments.])
882 if test "x$have_getmntent" = "xsun"; then
883 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
884 [Define if the function getmntent exists. It's the version from libsun.])
886 if test "x$have_getmntent" = "xseq"; then
887 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
888 [Define if the function getmntent exists. It's the version from libseq.])
890 if test "x$have_getmntent" = "xgen"; then
891 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
892 [Define if the function getmntent exists. It's the version from libgen.])
895 # Check for structures
896 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
897 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
900 #include <sys/types.h>
901 #include <sys/socket.h>
904 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
905 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
908 #include <sys/types.h>
909 #include <sys/socket.h>
910 #include <linux/if.h>
911 #include <linux/netdevice.h>
914 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
916 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
917 [Define if struct kinfo_proc exists in the FreeBSD variant.])
918 have_struct_kinfo_proc_freebsd="yes"
921 have_struct_kinfo_proc_freebsd="no"
925 #include <sys/param.h>
926 #include <sys/sysctl.h>
927 #include <sys/user.h>
930 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
932 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
933 [Define if struct kinfo_proc exists in the OpenBSD variant.])
934 have_struct_kinfo_proc_openbsd="yes"
937 have_struct_kinfo_proc_openbsd="no"
940 #include <sys/param.h>
941 #include <sys/sysctl.h>
945 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
951 # include <sys/types.h>
953 #if HAVE_NETINET_IN_SYSTM_H
954 # include <netinet/in_systm.h>
956 #if HAVE_NETINET_IN_H
957 # include <netinet/in.h>
959 #if HAVE_NETINET_IP_H
960 # include <netinet/ip.h>
962 #if HAVE_NETINET_UDP_H
963 # include <netinet/udp.h>
966 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
972 # include <sys/types.h>
974 #if HAVE_NETINET_IN_SYSTM_H
975 # include <netinet/in_systm.h>
977 #if HAVE_NETINET_IN_H
978 # include <netinet/in.h>
980 #if HAVE_NETINET_IP_H
981 # include <netinet/ip.h>
983 #if HAVE_NETINET_UDP_H
984 # include <netinet/udp.h>
988 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
998 # Checks for libraries begin here
1000 with_libresolv="yes"
1001 AC_CHECK_LIB(resolv, res_search,
1003 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1005 [with_libresolv="no"])
1006 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1008 dnl Check for HAL (hardware abstraction library)
1010 AC_CHECK_LIB(hal,libhal_device_property_exists,
1011 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1013 if test "x$with_libhal" = "xyes"; then
1014 if test "x$PKG_CONFIG" != "x"; then
1015 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1016 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1017 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1018 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1022 m4_divert_once([HELP_WITH], [
1023 collectd additional packages:])
1025 if test "x$ac_system" = "xSolaris"
1030 with_kstat="no (Solaris only)"
1031 with_devinfo="no (Solaris only)"
1034 if test "x$with_kstat" = "xyes"
1036 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1038 if test "x$with_kstat" = "xyes"
1040 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1041 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1043 if test "x$with_kstat" = "xyes"
1045 AC_DEFINE(HAVE_LIBKSTAT, 1,
1046 [Define to 1 if you have the 'kstat' library (-lkstat)])
1048 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1049 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1052 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1059 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1062 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1063 if test "x$with_kvm_getprocs" = "xyes"
1065 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1066 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1069 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1071 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1072 if test "x$with_kvm_getswapinfo" = "xyes"
1074 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1075 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1078 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1080 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1081 if test "x$with_kvm_nlist" = "xyes"
1083 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1084 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1087 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1089 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1090 if test "x$with_kvm_openfiles" = "xyes"
1092 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1093 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1096 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1098 # --with-libcurl {{{
1099 with_curl_config="curl-config"
1102 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1104 if test "x$withval" = "xno"
1107 else if test "x$withval" = "xyes"
1111 if test -f "$withval" && test -x "$withval"
1113 with_curl_config="$withval"
1115 else if test -x "$withval/bin/curl-config"
1117 with_curl_config="$withval/bin/curl-config"
1126 if test "x$with_libcurl" = "xyes"
1128 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1129 curl_config_status=$?
1131 if test $curl_config_status -ne 0
1133 with_libcurl="no ($with_curl_config failed)"
1135 SAVE_CPPFLAGS="$CPPFLAGS"
1136 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1138 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1140 CPPFLAGS="$SAVE_CPPFLAGS"
1143 if test "x$with_libcurl" = "xyes"
1145 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1146 curl_config_status=$?
1148 if test $curl_config_status -ne 0
1150 with_libcurl="no ($with_curl_config failed)"
1152 AC_CHECK_LIB(curl, curl_easy_init,
1153 [with_libcurl="yes"],
1154 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1158 if test "x$with_libcurl" = "xyes"
1160 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1161 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1162 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1163 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1165 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1169 with_libdbi_cppflags=""
1170 with_libdbi_ldflags=""
1171 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1173 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1175 with_libdbi_cppflags="-I$withval/include"
1176 with_libdbi_ldflags="-L$withval/lib"
1179 with_libdbi="$withval"
1185 if test "x$with_libdbi" = "xyes"
1187 SAVE_CPPFLAGS="$CPPFLAGS"
1188 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1190 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1192 CPPFLAGS="$SAVE_CPPFLAGS"
1194 if test "x$with_libdbi" = "xyes"
1196 SAVE_CPPFLAGS="$CPPFLAGS"
1197 SAVE_LDFLAGS="$LDFLAGS"
1198 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1199 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1201 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1203 CPPFLAGS="$SAVE_CPPFLAGS"
1204 LDFLAGS="$SAVE_LDFLAGS"
1206 if test "x$with_libdbi" = "xyes"
1208 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1209 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1210 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1211 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1212 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1213 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1215 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1218 # --with-libesmtp {{{
1219 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1221 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1223 LDFLAGS="$LDFLAGS -L$withval/lib"
1224 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1227 with_libesmtp="$withval"
1233 if test "x$with_libesmtp" = "xyes"
1235 AC_CHECK_LIB(esmtp, smtp_create_session,
1237 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1238 ], [with_libesmtp="no (libesmtp not found)"])
1240 if test "x$with_libesmtp" = "xyes"
1242 AC_CHECK_HEADERS(libesmtp.h,
1244 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1245 ], [with_libesmtp="no (libesmtp.h not found)"])
1247 if test "x$with_libesmtp" = "xyes"
1253 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1254 [Wether or not to use the esmtp library])
1255 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1258 # --with-libganglia {{{
1259 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1261 if test -f "$withval" && test -x "$withval"
1263 with_libganglia_config="$withval"
1264 with_libganglia="yes"
1265 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1267 with_libganglia_config="$withval/bin/ganglia-config"
1268 with_libganglia="yes"
1269 else if test -d "$withval"
1271 GANGLIA_CPPFLAGS="-I$withval/include"
1272 GANGLIA_LDFLAGS="-L$withval/lib"
1273 with_libganglia="yes"
1275 with_libganglia_config="ganglia-config"
1276 with_libganglia="$withval"
1280 with_libganglia_config="ganglia-config"
1281 with_libganglia="yes"
1284 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1286 if test "x$GANGLIA_CPPFLAGS" = "x"
1288 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1291 if test "x$GANGLIA_LDFLAGS" = "x"
1293 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1296 if test "x$GANGLIA_LIBS" = "x"
1298 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1302 SAVE_CPPFLAGS="$CPPFLAGS"
1303 SAVE_LDFLAGS="$LDFLAGS"
1304 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1305 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1307 if test "x$with_libganglia" = "xyes"
1309 AC_CHECK_HEADERS(gm_protocol.h,
1311 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1312 [Define to 1 if you have the <gm_protocol.h> header file.])
1313 ], [with_libganglia="no (gm_protocol.h not found)"])
1316 if test "x$with_libganglia" = "xyes"
1318 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1320 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1321 [Define to 1 if you have the ganglia library (-lganglia).])
1322 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1325 CPPFLAGS="$SAVE_CPPFLAGS"
1326 LDFLAGS="$SAVE_LDFLAGS"
1328 AC_SUBST(GANGLIA_CPPFLAGS)
1329 AC_SUBST(GANGLIA_LDFLAGS)
1330 AC_SUBST(GANGLIA_LIBS)
1331 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1334 # --with-libgcrypt {{{
1335 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1336 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1337 GCRYPT_LIBS="$GCRYPT_LIBS"
1338 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1340 if test -f "$withval" && test -x "$withval"
1342 with_libgcrypt_config="$withval"
1343 with_libgcrypt="yes"
1344 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1346 with_libgcrypt_config="$withval/bin/gcrypt-config"
1347 with_libgcrypt="yes"
1348 else if test -d "$withval"
1350 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1351 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1352 with_libgcrypt="yes"
1354 with_libgcrypt_config="gcrypt-config"
1355 with_libgcrypt="$withval"
1359 with_libgcrypt_config="libgcrypt-config"
1360 with_libgcrypt="yes"
1363 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1365 if test "x$GCRYPT_CPPFLAGS" = "x"
1367 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1370 if test "x$GCRYPT_LDFLAGS" = "x"
1372 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1373 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1376 if test "x$GCRYPT_LIBS" = "x"
1378 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1382 SAVE_CPPFLAGS="$CPPFLAGS"
1383 SAVE_LDFLAGS="$LDFLAGS"
1384 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1385 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1387 if test "x$with_libgcrypt" = "xyes"
1389 if test "x$GCRYPT_CPPFLAGS" != "x"
1391 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1393 AC_CHECK_HEADERS(gcrypt.h,
1394 [with_libgcrypt="yes"],
1395 [with_libgcrypt="no (gcrypt.h not found)"])
1398 if test "x$with_libgcrypt" = "xyes"
1400 if test "x$GCRYPT_LDFLAGS" != "x"
1402 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1404 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1405 [with_libgcrypt="yes"],
1406 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1408 if test "$with_libgcrypt" != "no"; then
1409 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1413 CPPFLAGS="$SAVE_CPPFLAGS"
1414 LDFLAGS="$SAVE_LDFLAGS"
1416 if test "x$with_libgcrypt" = "xyes"
1418 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1421 AC_SUBST(GCRYPT_CPPFLAGS)
1422 AC_SUBST(GCRYPT_LDFLAGS)
1423 AC_SUBST(GCRYPT_LIBS)
1424 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1427 # --with-libiptc {{{
1428 with_own_libiptc="no"
1429 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1431 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1433 LDFLAGS="$LDFLAGS -L$withval/lib"
1434 CPPFLAGS="$CPPFLAGS -I$withval/include"
1437 with_libiptc="$withval"
1441 if test "x$ac_system" = "xLinux"
1445 with_libiptc="no (Linux only)"
1448 if test "x$with_libiptc" = "xyes"
1450 AC_CHECK_LIB(iptc, iptc_init,
1452 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1456 with_own_libiptc="yes"
1459 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" != "xyes"
1461 AC_CHECK_HEADERS(libiptc/libiptc.h,
1463 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1467 with_own_libiptc="yes"
1470 if test "x$with_libiptc" = "xyes"
1473 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1475 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h, [],
1477 with_libiptc="no (Linux iptables headers not found - check KERNEL_DIR)"
1478 with_own_libiptc="no"
1481 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1486 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1487 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1488 if test "x$with_own_libiptc" = "xyes"
1490 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1492 if test "x$with_libiptc" = "xyes"
1495 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
1497 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1500 # include "$srcdir/src/owniptc/libiptc.h"
1501 # include "$srcdir/src/owniptc/libip6tc.h"
1503 # include <libiptc/libiptc.h>
1504 # include <libiptc/libip6tc.h>
1513 with_java_home="$JAVA_HOME"
1514 with_java_vmtype="client"
1518 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1520 if test "x$withval" = "xno"
1523 else if test "x$withval" = "xyes"
1527 with_java_home="$withval"
1532 if test "x$with_java" = "xyes"
1534 if test -d "$with_java_home"
1536 AC_MSG_CHECKING([for jni.h])
1537 TMPDIR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1538 if test "x$TMPDIR" != "x"
1540 AC_MSG_RESULT([found in $TMPDIR])
1541 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1543 AC_MSG_RESULT([not found])
1546 AC_MSG_CHECKING([for jni_md.h])
1547 TMPDIR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1548 if test "x$TMPDIR" != "x"
1550 AC_MSG_RESULT([found in $TMPDIR])
1551 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1553 AC_MSG_RESULT([not found])
1556 AC_MSG_CHECKING([for libjvm.so])
1557 TMPDIR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1558 if test "x$TMPDIR" != "x"
1560 AC_MSG_RESULT([found in $TMPDIR])
1561 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1563 AC_MSG_RESULT([not found])
1566 if test "x$JAVAC" = "x"
1568 AC_MSG_CHECKING([for javac])
1569 TMPDIR=`find -L "$with_java_home" -name javac -type f | head -n 1`
1570 if test "x$TMPDIR" != "x"
1573 AC_MSG_RESULT([$JAVAC])
1575 AC_MSG_RESULT([not found])
1578 else if test "x$with_java_home" != "x"
1580 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1584 if test "x$JAVA_CPPFLAGS" != "x"
1586 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1588 if test "x$JAVA_CFLAGS" != "x"
1590 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1592 if test "x$JAVA_LDFLAGS" != "x"
1594 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1596 if test "x$JAVAC" = "x"
1598 with_javac_path="$PATH"
1599 if test "x$with_java_home" != "x"
1601 with_javac_path="$with_java_home:with_javac_path"
1602 if test -d "$with_java_home/bin"
1604 with_javac_path="$with_java_home/bin:with_javac_path"
1608 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1610 if test "x$JAVAC" = "x"
1612 with_java="no (javac not found)"
1615 SAVE_CPPFLAGS="$CPPFLAGS"
1616 SAVE_CFLAGS="$CFLAGS"
1617 SAVE_LDFLAGS="$LDFLAGS"
1618 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1619 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1620 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1622 if test "x$with_java" = "xyes"
1624 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1626 if test "x$with_java" = "xyes"
1628 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1630 [with_java="no (libjvm not found)"],
1633 if test "x$with_java" = "xyes"
1635 JAVA_LIBS="$JAVA_LIBS -ljvm"
1636 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1639 CPPFLAGS="$SAVE_CPPFLAGS"
1640 CFLAGS="$SAVE_CFLAGS"
1641 LDFLAGS="$SAVE_LDFLAGS"
1643 AC_SUBST(JAVA_CPPFLAGS)
1644 AC_SUBST(JAVA_CFLAGS)
1645 AC_SUBST(JAVA_LDFLAGS)
1647 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1650 # --with-libmemcached {{{
1651 with_libmemcached_cppflags=""
1652 with_libmemcached_ldflags=""
1653 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
1655 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1657 with_libmemcached_cppflags="-I$withval/include"
1658 with_libmemcached_ldflags="-L$withval/lib"
1659 with_libmemcached="yes"
1661 with_libmemcached="$withval"
1665 with_libmemcached="yes"
1667 if test "x$with_libmemcached" = "xyes"
1669 SAVE_CPPFLAGS="$CPPFLAGS"
1670 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1672 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
1674 CPPFLAGS="$SAVE_CPPFLAGS"
1676 if test "x$with_libmemcached" = "xyes"
1678 SAVE_CPPFLAGS="$CPPFLAGS"
1679 SAVE_LDFLAGS="$LDFLAGS"
1680 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1681 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
1683 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
1685 CPPFLAGS="$SAVE_CPPFLAGS"
1686 LDFLAGS="$SAVE_LDFLAGS"
1688 if test "x$with_libmemcached" = "xyes"
1690 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
1691 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
1692 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
1693 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1694 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1695 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
1696 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
1698 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
1701 # --with-libmysql {{{
1702 with_mysql_config="mysql_config"
1703 with_mysql_cflags=""
1705 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1707 if test "x$withval" = "xno"
1710 else if test "x$withval" = "xyes"
1714 if test -f "$withval" && test -x "$withval";
1716 with_mysql_config="$withval"
1717 else if test -x "$withval/bin/mysql_config"
1719 with_mysql_config="$withval/bin/mysql_config"
1727 if test "x$with_libmysql" = "xyes"
1729 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1730 mysql_config_status=$?
1732 if test $mysql_config_status -ne 0
1734 with_libmysql="no ($with_mysql_config failed)"
1736 SAVE_CPPFLAGS="$CPPFLAGS"
1737 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1740 have_mysql_mysql_h="no"
1741 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1743 if test "x$have_mysql_h" = "xno"
1745 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1748 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1750 with_libmysql="no (mysql.h not found)"
1753 CPPFLAGS="$SAVE_CPPFLAGS"
1756 if test "x$with_libmysql" = "xyes"
1758 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1759 mysql_config_status=$?
1761 if test $mysql_config_status -ne 0
1763 with_libmysql="no ($with_mysql_config failed)"
1765 AC_CHECK_LIB(mysqlclient, mysql_init,
1766 [with_libmysql="yes"],
1767 [with_libmysql="no (symbol 'mysql_init' not found)"],
1770 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1771 [with_libmysql="yes"],
1772 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1776 if test "x$with_libmysql" = "xyes"
1778 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1779 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1780 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1781 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1783 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1786 # --with-libnetlink {{{
1787 with_libnetlink_cflags=""
1788 with_libnetlink_libs="-lnetlink"
1789 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1791 echo "libnetlink: withval = $withval"
1792 if test "x$withval" = "xyes"
1794 with_libnetlink="yes"
1795 else if test "x$withval" = "xno"
1797 with_libnetlink="no"
1799 if test -d "$withval/include"
1801 with_libnetlink_cflags="-I$withval/include"
1802 with_libnetlink_libs="-L$withval/lib -lnetlink"
1803 with_libnetlink="yes"
1805 AC_MSG_ERROR("no such directory: $withval/include")
1810 if test "x$ac_system" = "xLinux"
1812 with_libnetlink="yes"
1814 with_libnetlink="no (Linux only library)"
1817 if test "x$with_libnetlink" = "xyes"
1820 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1822 with_libnetlink="no (libnetlink.h not found)"
1824 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1826 with_libnetlink="yes"
1830 #include <sys/types.h>
1831 #include <asm/types.h>
1832 #include <sys/socket.h>
1833 #include <linux/netlink.h>
1834 #include <linux/rtnetlink.h>])
1835 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
1837 #include <sys/types.h>
1838 #include <asm/types.h>
1839 #include <sys/socket.h>])
1843 #include <sys/types.h>
1844 #include <asm/types.h>
1845 #include <sys/socket.h>
1846 #include <linux/netlink.h>
1847 #include <linux/rtnetlink.h>
1851 int retval = TCA_STATS2;
1854 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
1859 #include <sys/types.h>
1860 #include <asm/types.h>
1861 #include <sys/socket.h>
1862 #include <linux/netlink.h>
1863 #include <linux/rtnetlink.h>
1867 int retval = TCA_STATS;
1870 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
1873 CFLAGS="$SAVE_CFLAGS"
1875 if test "x$with_libnetlink" = "xyes"
1877 AC_CHECK_LIB(netlink, rtnl_open,
1878 [with_libnetlink="yes"],
1879 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
1880 [$with_libnetlink_libs])
1882 if test "x$with_libnetlink" = "xyes"
1884 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
1885 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
1886 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
1887 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
1889 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
1892 # --with-libnetsnmp {{{
1893 with_snmp_config="net-snmp-config"
1896 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
1898 if test "x$withval" = "xno"
1900 with_libnetsnmp="no"
1901 else if test "x$withval" = "xyes"
1903 with_libnetsnmp="yes"
1905 if test -x "$withval"
1907 with_snmp_config="$withval"
1908 with_libnetsnmp="yes"
1910 with_snmp_config="$withval/bin/net-snmp-config"
1911 with_libnetsnmp="yes"
1915 [with_libnetsnmp="yes"])
1916 if test "x$with_libnetsnmp" = "xyes"
1918 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
1919 snmp_config_status=$?
1921 if test $snmp_config_status -ne 0
1923 with_libnetsnmp="no ($with_snmp_config failed)"
1925 SAVE_CPPFLAGS="$CPPFLAGS"
1926 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
1928 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
1930 CPPFLAGS="$SAVE_CPPFLAGS"
1933 if test "x$with_libnetsnmp" = "xyes"
1935 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
1936 snmp_config_status=$?
1938 if test $snmp_config_status -ne 0
1940 with_libnetsnmp="no ($with_snmp_config failed)"
1942 AC_CHECK_LIB(netsnmp, init_snmp,
1943 [with_libnetsnmp="yes"],
1944 [with_libnetsnmp="no (libnetsnmp not found)"],
1948 if test "x$with_libnetsnmp" = "xyes"
1950 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
1951 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
1952 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
1953 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
1955 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
1958 # --with-liboconfig {{{
1959 with_own_liboconfig="no"
1960 liboconfig_LDFLAGS="$LDFLAGS"
1961 liboconfig_CPPFLAGS="$CPPFLAGS"
1962 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
1964 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1966 if test -d "$withval/lib"
1968 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
1970 if test -d "$withval/include"
1972 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
1975 if test "x$withval" = "xno"
1977 AC_MSG_ERROR("liboconfig is required")
1981 with_liboconfig="yes"
1984 save_LDFLAGS="$LDFLAGS"
1985 save_CPPFLAGS="$CPPFLAGS"
1986 LDFLAGS="$liboconfig_LDFLAGS"
1987 CPPFLAGS="$liboconfig_CPPFLAGS"
1988 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
1990 with_liboconfig="yes"
1991 with_own_liboconfig="no"
1994 with_liboconfig="yes"
1995 with_own_liboconfig="yes"
1996 LDFLAGS="$save_LDFLAGS"
1997 CPPFLAGS="$save_CPPFLAGS"
2000 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2001 if test "x$with_own_liboconfig" = "xyes"
2003 with_liboconfig="yes (shipped version)"
2007 # --with-liboping {{{
2008 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2010 if test "x$withval" = "xyes"
2013 else if test "x$withval" = "xno"
2018 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2019 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2022 [with_liboping="yes"])
2024 SAVE_CPPFLAGS="$CPPFLAGS"
2025 SAVE_LDFLAGS="$LDFLAGS"
2027 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2028 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2030 if test "x$with_liboping" = "xyes"
2032 if test "x$LIBOPING_CPPFLAGS" != "x"
2034 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2036 AC_CHECK_HEADERS(oping.h,
2037 [with_liboping="yes"],
2038 [with_liboping="no ('oping.h' not found)"])
2040 if test "x$with_liboping" = "xyes"
2042 if test "x$LIBOPING_LDFLAGS" != "x"
2044 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2046 AC_CHECK_LIB(oping, ping_construct,
2047 [with_liboping="yes"],
2048 [with_liboping="no (symbol 'ping_construct' not found)"])
2051 CPPFLAGS="$SAVE_CPPFLAGS"
2052 LDFLAGS="$SAVE_LDFLAGS"
2054 if test "x$with_liboping" = "xyes"
2056 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2057 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2058 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2059 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2061 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2065 with_oracle_cppflags=""
2067 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2069 if test "x$withval" = "xyes"
2071 if test "x$ORACLE_HOME" = "x"
2073 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2076 else if test "x$withval" = "xno"
2081 ORACLE_HOME="$withval"
2085 if test "x$ORACLE_HOME" = "x"
2087 with_oracle="no (ORACLE_HOME is not set)"
2092 if test "x$ORACLE_HOME" != "x"
2094 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2096 if test -e "$ORACLE_HOME/lib/ldflags"
2098 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2100 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2101 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2103 if test "x$with_oracle" = "xyes"
2105 SAVE_CPPFLAGS="$CPPFLAGS"
2106 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2108 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2110 CPPFLAGS="$SAVE_CPPFLAGS"
2112 if test "x$with_oracle" = "xyes"
2114 SAVE_CPPFLAGS="$CPPFLAGS"
2115 SAVE_LDFLAGS="$LDFLAGS"
2116 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2117 LDFLAGS="$LDFLAGS $with_oracle_libs"
2119 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2121 CPPFLAGS="$SAVE_CPPFLAGS"
2122 LDFLAGS="$SAVE_LDFLAGS"
2124 if test "x$with_oracle" = "xyes"
2126 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2127 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2128 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2129 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2133 # --with-libowcapi {{{
2134 with_libowcapi_cppflags=""
2135 with_libowcapi_libs="-lowcapi"
2136 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2138 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2140 with_libowcapi_cppflags="-I$withval/include"
2141 with_libowcapi_libs="-L$withval/lib -lowcapi"
2142 with_libowcapi="yes"
2144 with_libowcapi="$withval"
2148 with_libowcapi="yes"
2150 if test "x$with_libowcapi" = "xyes"
2152 SAVE_CPPFLAGS="$CPPFLAGS"
2153 CPPFLAGS="$with_libowcapi_cppflags"
2155 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2157 CPPFLAGS="$SAVE_CPPFLAGS"
2159 if test "x$with_libowcapi" = "xyes"
2161 SAVE_LDFLAGS="$LDFLAGS"
2162 SAVE_CPPFLAGS="$CPPFLAGS"
2163 LDFLAGS="$with_libowcapi_libs"
2164 CPPFLAGS="$with_libowcapi_cppflags"
2166 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2168 LDFLAGS="$SAVE_LDFLAGS"
2169 CPPFLAGS="$SAVE_CPPFLAGS"
2171 if test "x$with_libowcapi" = "xyes"
2173 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2174 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2175 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2176 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2180 # --with-libpcap {{{
2181 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2183 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2185 LDFLAGS="$LDFLAGS -L$withval/lib"
2186 CPPFLAGS="$CPPFLAGS -I$withval/include"
2189 with_libpcap="$withval"
2195 if test "x$with_libpcap" = "xyes"
2197 AC_CHECK_LIB(pcap, pcap_open_live,
2199 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2200 ], [with_libpcap="no (libpcap not found)"])
2202 if test "x$with_libpcap" = "xyes"
2204 AC_CHECK_HEADERS(pcap.h,
2206 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
2207 ], [with_libpcap="no (pcap.h not found)"])
2209 if test "x$with_libpcap" = "xyes"
2215 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
2216 [Wether or not to use the pcap library])
2217 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2220 # --with-libperl {{{
2221 perl_interpreter="perl"
2222 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2224 if test -x "$withval"
2226 perl_interpreter="$withval"
2228 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2230 LDFLAGS="$LDFLAGS -L$withval/lib"
2231 CPPFLAGS="$CPPFLAGS -I$withval/include"
2232 perl_interpreter="$withval/bin/perl"
2235 with_libperl="$withval"
2242 AC_MSG_CHECKING([for perl])
2243 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2244 if test -x "$perl_interpreter"
2246 AC_MSG_RESULT([yes ($perl_interpreter)])
2252 AC_SUBST(PERL, "$perl_interpreter")
2254 if test "x$with_libperl" = "xyes" \
2255 && test -n "$perl_interpreter"
2258 SAVE_LDFLAGS=$LDFLAGS
2259 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2260 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2261 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2262 CFLAGS="$CFLAGS $PERL_CFLAGS"
2263 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2265 AC_CACHE_CHECK([for libperl],
2266 [c_cv_have_libperl],
2270 #define PERL_NO_GET_CONTEXT
2277 load_module (PERL_LOADMOD_NOIMPORT,
2278 newSVpv ("Collectd::Plugin::FooBar", 24),
2281 [c_cv_have_libperl="yes"],
2282 [c_cv_have_libperl="no"]
2286 if test "x$c_cv_have_libperl" = "xyes"
2288 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2289 AC_SUBST(PERL_CFLAGS)
2290 AC_SUBST(PERL_LDFLAGS)
2296 LDFLAGS=$SAVE_LDFLAGS
2297 else if test -z "$perl_interpreter"; then
2298 with_libperl="no (no perl interpreter found)"
2299 c_cv_have_libperl="no"
2301 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2303 if test "x$with_libperl" = "xyes"
2306 SAVE_LDFLAGS=$LDFLAGS
2307 CFLAGS="$CFLAGS $PERL_CFLAGS"
2308 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2310 AC_CACHE_CHECK([if perl supports ithreads],
2311 [c_cv_have_perl_ithreads],
2319 #if !defined(USE_ITHREADS)
2320 # error "Perl does not support ithreads!"
2321 #endif /* !defined(USE_ITHREADS) */
2324 [c_cv_have_perl_ithreads="yes"],
2325 [c_cv_have_perl_ithreads="no"]
2329 if test "x$c_cv_have_perl_ithreads" = "xyes"
2331 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2335 LDFLAGS=$SAVE_LDFLAGS
2338 if test "x$with_libperl" = "xyes"
2341 SAVE_LDFLAGS=$LDFLAGS
2342 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2343 # (see issues #41 and #42)
2344 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2345 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2347 AC_CACHE_CHECK([for broken Perl_load_module()],
2348 [c_cv_have_broken_perl_load_module],
2352 #define PERL_NO_GET_CONTEXT
2359 load_module (PERL_LOADMOD_NOIMPORT,
2360 newSVpv ("Collectd::Plugin::FooBar", 24),
2363 [c_cv_have_broken_perl_load_module="no"],
2364 [c_cv_have_broken_perl_load_module="yes"]
2369 LDFLAGS=$SAVE_LDFLAGS
2371 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2372 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2374 if test "x$with_libperl" = "xyes"
2377 SAVE_LDFLAGS=$LDFLAGS
2378 CFLAGS="$CFLAGS $PERL_CFLAGS"
2379 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2382 [struct mgvtbl.svt_local],
2383 [have_struct_mgvtbl_svt_local="yes"],
2384 [have_struct_mgvtbl_svt_local="no"],
2391 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2393 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2394 [Define if Perl's struct mgvtbl has member svt_local.])
2398 LDFLAGS=$SAVE_LDFLAGS
2403 with_pg_config="pg_config"
2404 with_libpq_includedir=""
2405 with_libpq_libdir=""
2406 with_libpq_cppflags=""
2407 with_libpq_ldflags=""
2408 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2411 if test "x$withval" = "xno"
2414 else if test "x$withval" = "xyes"
2418 if test -f "$withval" && test -x "$withval";
2420 with_pg_config="$withval"
2421 else if test -x "$withval/bin/pg_config"
2423 with_pg_config="$withval/bin/pg_config"
2431 if test "x$with_libpq" = "xyes"
2433 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2436 if test $pg_config_status -eq 0
2438 if test -n "$with_libpq_includedir"; then
2439 for dir in $with_libpq_includedir; do
2440 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2444 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2447 SAVE_CPPFLAGS="$CPPFLAGS"
2448 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2450 AC_CHECK_HEADERS(libpq-fe.h, [],
2451 [with_libpq="no (libpq-fe.h not found)"], [])
2453 CPPFLAGS="$SAVE_CPPFLAGS"
2455 if test "x$with_libpq" = "xyes"
2457 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2460 if test $pg_config_status -eq 0
2462 if test -n "$with_libpq_libdir"; then
2463 for dir in $with_libpq_libdir; do
2464 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2468 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2471 SAVE_LDFLAGS="$LDFLAGS"
2472 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2474 AC_CHECK_LIB(pq, PQconnectdb,
2476 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2478 AC_CHECK_LIB(pq, PQserverVersion,
2480 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2482 LDFLAGS="$SAVE_LDFLAGS"
2484 if test "x$with_libpq" = "xyes"
2486 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2487 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2488 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2489 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2491 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2494 # --with-libpthread {{{
2495 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2496 [ if test "x$withval" != "xno" \
2497 && test "x$withval" != "xyes"
2499 LDFLAGS="$LDFLAGS -L$withval/lib"
2500 CPPFLAGS="$CPPFLAGS -I$withval/include"
2501 with_libpthread="yes"
2503 if test "x$withval" = "xno"
2505 with_libpthread="no (disabled)"
2508 ], [with_libpthread="yes"])
2509 if test "x$with_libpthread" = "xyes"
2511 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2514 if test "x$with_libpthread" = "xyes"
2516 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2518 if test "x$with_libpthread" = "xyes"
2524 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2525 [Wether or not to use pthread (POSIX threads) library])
2526 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2530 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2533 librrd_threadsafe="yes"
2534 librrd_rrdc_update="no"
2535 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2536 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2538 librrd_cflags="-I$withval/include"
2539 librrd_ldflags="-L$withval/lib"
2542 with_librrd="$withval"
2544 ], [with_librrd="yes"])
2545 if test "x$with_librrd" = "xyes"
2547 SAVE_CPPFLAGS="$CPPFLAGS"
2548 SAVE_LDFLAGS="$LDFLAGS"
2550 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2551 LDFLAGS="$LDFLAGS $librrd_ldflags"
2553 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2555 CPPFLAGS="$SAVE_CPPFLAGS"
2556 LDFLAGS="$SAVE_LDFLAGS"
2558 if test "x$with_librrd" = "xyes"
2560 SAVE_CPPFLAGS="$CPPFLAGS"
2561 SAVE_LDFLAGS="$LDFLAGS"
2563 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2564 LDFLAGS="$LDFLAGS $librrd_ldflags"
2566 AC_CHECK_LIB(rrd_th, rrd_update_r,
2568 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2570 [librrd_threadsafe="no"
2571 AC_CHECK_LIB(rrd, rrd_update,
2573 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2575 [with_librrd="no (symbol 'rrd_update' not found)"],
2580 if test "x$librrd_threadsafe" = "xyes"
2582 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2584 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2587 CPPFLAGS="$SAVE_CPPFLAGS"
2588 LDFLAGS="$SAVE_LDFLAGS"
2590 if test "x$with_librrd" = "xyes"
2592 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
2593 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
2594 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
2595 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
2597 if test "x$librrd_threadsafe" = "xyes"
2599 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
2603 # --with-libsensors {{{
2604 with_sensors_cflags=""
2605 with_sensors_ldflags=""
2606 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
2608 if test "x$withval" = "xno"
2610 with_libsensors="no"
2612 with_libsensors="yes"
2613 if test "x$withval" != "xyes"
2615 with_sensors_cflags="-I$withval/include"
2616 with_sensors_ldflags="-L$withval/lib"
2617 with_libsensors="yes"
2622 if test "x$ac_system" = "xLinux"
2624 with_libsensors="yes"
2626 with_libsensors="no (Linux only library)"
2629 if test "x$with_libsensors" = "xyes"
2631 SAVE_CPPFLAGS="$CPPFLAGS"
2632 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2634 # AC_CHECK_HEADERS(sensors/sensors.h,
2636 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
2638 # [with_libsensors="no (sensors/sensors.h not found)"])
2639 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
2641 CPPFLAGS="$SAVE_CPPFLAGS"
2643 if test "x$with_libsensors" = "xyes"
2645 SAVE_CPPFLAGS="$CPPFLAGS"
2646 SAVE_LDFLAGS="$LDFLAGS"
2647 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
2648 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
2650 AC_CHECK_LIB(sensors, sensors_init,
2652 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
2654 [with_libsensors="no (libsensors not found)"])
2656 CPPFLAGS="$SAVE_CPPFLAGS"
2657 LDFLAGS="$SAVE_LDFLAGS"
2659 if test "x$with_libsensors" = "xyes"
2661 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
2662 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
2663 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
2664 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
2666 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
2669 # --with-libstatgrab {{{
2670 with_libstatgrab_cflags=""
2671 with_libstatgrab_ldflags=""
2672 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
2674 if test "x$withval" != "xno" \
2675 && test "x$withval" != "xyes"
2677 with_libstatgrab_cflags="-I$withval/include"
2678 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
2679 with_libstatgrab="yes"
2680 with_libstatgrab_pkg_config="no"
2682 with_libstatgrab="$withval"
2683 with_libstatgrab_pkg_config="yes"
2687 with_libstatgrab="yes"
2688 with_libstatgrab_pkg_config="yes"
2691 if test "x$with_libstatgrab" = "xyes" \
2692 && test "x$with_libstatgrab_pkg_config" = "xyes"
2694 if test "x$PKG_CONFIG" != "x"
2696 AC_MSG_CHECKING([pkg-config for libstatgrab])
2698 $PKG_CONFIG --exists libstatgrab 2>/dev/null
2701 with_libstatgrab_pkg_config="no"
2702 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
2703 temp_result="not found"
2705 AC_MSG_RESULT([$temp_result])
2707 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
2708 with_libstatgrab_pkg_config="no"
2709 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
2713 if test "x$with_libstatgrab" = "xyes" \
2714 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2715 && test "x$with_libstatgrab_cflags" = "x"
2717 AC_MSG_CHECKING([for libstatgrab CFLAGS])
2718 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
2721 with_libstatgrab_cflags="$temp_result"
2723 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
2724 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
2726 AC_MSG_RESULT([$temp_result])
2729 if test "x$with_libstatgrab" = "xyes" \
2730 && test "x$with_libstatgrab_pkg_config" = "xyes" \
2731 && test "x$with_libstatgrab_ldflags" = "x"
2733 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
2734 temp_result="`$PKG_CONFIG --libs libstatgrab`"
2737 with_libstatgrab_ldflags="$temp_result"
2739 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
2740 temp_result="$PKG_CONFIG --libs libstatgrab failed"
2742 AC_MSG_RESULT([$temp_result])
2745 if test "x$with_libstatgrab" = "xyes"
2747 SAVE_CPPFLAGS="$CPPFLAGS"
2748 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
2750 AC_CHECK_HEADERS(statgrab.h,
2751 [with_libstatgrab="yes"],
2752 [with_libstatgrab="no (statgrab.h not found)"])
2754 CPPFLAGS="$SAVE_CPPFLAGS"
2757 if test "x$with_libstatgrab" = "xyes"
2759 SAVE_CFLAGS="$CFLAGS"
2760 SAVE_LDFLAGS="$LDFLAGS"
2762 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
2763 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
2765 AC_CHECK_LIB(statgrab, sg_init,
2766 [with_libstatgrab="yes"],
2767 [with_libstatgrab="no (symbol sg_init not found)"])
2769 CFLAGS="$SAVE_CFLAGS"
2770 LDFLAGS="$SAVE_LDFLAGS"
2773 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
2774 if test "x$with_libstatgrab" = "xyes"
2776 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
2777 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
2778 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
2779 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
2780 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
2784 # --with-libupsclient {{{
2785 with_libupsclient_config=""
2786 with_libupsclient_cflags=""
2787 with_libupsclient_libs=""
2788 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2790 if test "x$withval" = "xno"
2792 with_libupsclient="no"
2793 else if test "x$withval" = "xyes"
2795 with_libupsclient="use_pkgconfig"
2797 if test -x "$withval"
2799 with_libupsclient_config="$withval"
2800 with_libupsclient="use_libupsclient_config"
2801 else if test -x "$withval/bin/libupsclient-config"
2803 with_libupsclient_config="$withval/bin/net-snmp-config"
2804 with_libupsclient="use_libupsclient_config"
2806 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
2807 with_libupsclient_cflags="-I$withval/include"
2808 with_libupsclient_libs="-L$withval/lib -lupsclient"
2809 with_libupsclient="yes"
2813 [with_libupsclient="use_pkgconfig"])
2815 # configure using libupsclient-config
2816 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2818 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
2819 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
2822 with_libupsclient="no ($with_libupsclient_config failed)"
2824 with_libupsclient_libs="`$with_libupsclient_config --libs`"
2827 with_libupsclient="no ($with_libupsclient_config failed)"
2830 if test "x$with_libupsclient" = "xuse_libupsclient_config"
2832 with_libupsclient="yes"
2835 # configure using pkg-config
2836 if test "x$with_libupsclient" = "xuse_pkgconfig"
2838 if test "x$PKG_CONFIG" = "x"
2840 with_libupsclient="no (Don't have pkg-config)"
2843 if test "x$with_libupsclient" = "xuse_pkgconfig"
2845 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
2846 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
2849 with_libupsclient="no (pkg-config doesn't know library)"
2852 if test "x$with_libupsclient" = "xuse_pkgconfig"
2854 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
2857 with_libupsclient="no ($PKG_CONFIG failed)"
2859 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
2862 with_libupsclient="no ($PKG_CONFIG failed)"
2865 if test "x$with_libupsclient" = "xuse_pkgconfig"
2867 with_libupsclient="yes"
2870 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
2871 # the actual checks.
2872 if test "x$with_libupsclient" = "xyes"
2874 SAVE_CPPFLAGS="$CPPFLAGS"
2875 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2877 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
2879 CPPFLAGS="$SAVE_CPPFLAGS"
2881 if test "x$with_libupsclient" = "xyes"
2883 SAVE_CPPFLAGS="$CPPFLAGS"
2884 SAVE_LDFLAGS="$LDFLAGS"
2886 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2887 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
2889 AC_CHECK_LIB(upsclient, upscli_connect,
2890 [with_libupsclient="yes"],
2891 [with_libupsclient="no (symbol upscli_connect not found)"])
2893 CPPFLAGS="$SAVE_CPPFLAGS"
2894 LDFLAGS="$SAVE_LDFLAGS"
2896 if test "x$with_libupsclient" = "xyes"
2898 SAVE_CPPFLAGS="$CPPFLAGS"
2899 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
2901 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
2902 [#include <stdlib.h>
2904 #include <upsclient.h>])
2906 CPPFLAGS="$SAVE_CPPFLAGS"
2908 if test "x$with_libupsclient" = "xyes"
2910 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
2911 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
2912 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
2913 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
2917 # --with-libxmms {{{
2918 with_xmms_config="xmms-config"
2921 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
2923 if test "x$withval" != "xno" \
2924 && test "x$withval" != "xyes"
2926 if test -f "$withval" && test -x "$withval";
2928 with_xmms_config="$withval"
2929 else if test -x "$withval/bin/xmms-config"
2931 with_xmms_config="$withval/bin/xmms-config"
2934 else if test "x$withval" = "xno"
2944 if test "x$with_libxmms" = "xyes"
2946 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
2947 xmms_config_status=$?
2949 if test $xmms_config_status -ne 0
2954 if test "x$with_libxmms" = "xyes"
2956 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
2957 xmms_config_status=$?
2959 if test $xmms_config_status -ne 0
2964 if test "x$with_libxmms" = "xyes"
2966 AC_CHECK_LIB(xmms, xmms_remote_get_info,
2968 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
2969 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
2970 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
2971 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
2978 with_libxmms_numeric=0
2979 if test "x$with_libxmms" = "xyes"
2981 with_libxmms_numeric=1
2983 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
2984 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
2987 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
2988 with_libxml2="no (pkg-config isn't available)"
2989 with_libxml2_cflags=""
2990 with_libxml2_ldflags=""
2991 with_libvirt="no (pkg-config isn't available)"
2992 with_libvirt_cflags=""
2993 with_libvirt_ldflags=""
2994 if test "x$PKG_CONFIG" != "x"
2996 pkg-config --exists 'libxml-2.0' 2>/dev/null
3001 with_libxml2="no (pkg-config doesn't know library)"
3004 pkg-config --exists libvirt 2>/dev/null
3009 with_libvirt="no (pkg-config doesn't know library)"
3012 if test "x$with_libxml2" = "xyes"
3014 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3019 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3025 if test "x$with_libxml2" = "xyes"
3027 SAVE_CPPFLAGS="$CPPFLAGS"
3028 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3030 AC_CHECK_HEADERS(libxml/parser.h, [],
3031 [with_libxml2="no (libxml/parser.h not found)"])
3033 CPPFLAGS="$SAVE_CPPFLAGS"
3035 if test "x$with_libxml2" = "xyes"
3037 SAVE_CFLAGS="$CFLAGS"
3038 SAVE_LDFLAGS="$LDFLAGS"
3040 CFLAGS="$CFLAGS $with_libxml2_cflags"
3041 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3043 AC_CHECK_LIB(xml2, xmlXPathEval,
3044 [with_libxml2="yes"],
3045 [with_libxml2="no (symbol xmlXPathEval not found)"])
3047 CFLAGS="$SAVE_CFLAGS"
3048 LDFLAGS="$SAVE_LDFLAGS"
3050 dnl Add the right compiler flags and libraries.
3051 if test "x$with_libxml2" = "xyes"; then
3052 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3053 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3054 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3055 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3057 if test "x$with_libvirt" = "xyes"
3059 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3064 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3070 if test "x$with_libvirt" = "xyes"
3072 SAVE_CPPFLAGS="$CPPFLAGS"
3073 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3075 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3076 [with_libvirt="no (libvirt/libvirt.h not found)"])
3078 CPPFLAGS="$SAVE_CPPFLAGS"
3080 if test "x$with_libvirt" = "xyes"
3082 SAVE_CFLAGS="$CFLAGS"
3083 SAVE_LDFLAGS="$LDFLAGS"
3085 CFLAGS="$CFLAGS $with_libvirt_cflags"
3086 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3088 AC_CHECK_LIB(virt, virDomainBlockStats,
3089 [with_libvirt="yes"],
3090 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3092 CFLAGS="$SAVE_CFLAGS"
3093 LDFLAGS="$SAVE_LDFLAGS"
3095 dnl Add the right compiler flags and libraries.
3096 if test "x$with_libvirt" = "xyes"; then
3097 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3098 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3099 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3100 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3104 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3105 with_libopenipmipthread="yes"
3106 with_libopenipmipthread_cflags=""
3107 with_libopenipmipthread_libs=""
3109 AC_MSG_CHECKING([for pkg-config])
3111 if test "x$PKG_CONFIG" = "x"
3113 with_libopenipmipthread="no"
3116 temp_result="$PKG_CONFIG"
3118 AC_MSG_RESULT([$temp_result])
3120 if test "x$with_libopenipmipthread" = "xyes"
3122 AC_MSG_CHECKING([for libOpenIPMIpthread])
3123 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3126 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3128 AC_MSG_RESULT([$with_libopenipmipthread])
3131 if test "x$with_libopenipmipthread" = "xyes"
3133 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3134 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3137 with_libopenipmipthread_cflags="$temp_result"
3139 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3140 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3142 AC_MSG_RESULT([$temp_result])
3145 if test "x$with_libopenipmipthread" = "xyes"
3147 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3148 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3151 with_libopenipmipthread_ldflags="$temp_result"
3153 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3154 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3156 AC_MSG_RESULT([$temp_result])
3159 if test "x$with_libopenipmipthread" = "xyes"
3161 SAVE_CPPFLAGS="$CPPFLAGS"
3162 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3164 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3165 [with_libopenipmipthread="yes"],
3166 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3167 [#include <OpenIPMI/ipmiif.h>
3168 #include <OpenIPMI/ipmi_err.h>
3169 #include <OpenIPMI/ipmi_posix.h>
3170 #include <OpenIPMI/ipmi_conn.h>
3173 CPPFLAGS="$SAVE_CPPFLAGS"
3176 if test "x$with_libopenipmipthread" = "xyes"
3178 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3179 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3180 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3181 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3185 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3186 [with_libnotify="yes"],
3187 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3189 # Check for enabled/disabled features
3192 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3193 # ------------------------------------------------------------
3195 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3200 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3205 m4_define([EnDis],[disabled])dnl
3206 m4_define([YesNo],[no])dnl
3212 m4_define([EnDis],[enabled])dnl
3213 m4_define([YesNo],[yes])dnl
3216 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3220 m4_if([$3], [feature], [],
3224 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3230 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3232 enable_$1='[YesNo]'dnl
3234 if test "x$enable_$1" = "xno"
3238 if test "x$enable_$1" = "xyes"
3242 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3247 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3248 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3250 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3252 # AC_PLUGIN(name, default, info)
3253 # ------------------------------------------------------------
3260 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3262 if test "x$enableval" = "xyes"
3265 else if test "x$enableval" = "xforce"
3274 if test "x$enable_all_plugins" = "xauto"
3276 if test "x$2" = "xyes"
3283 enable_plugin="$enable_all_plugins"
3286 if test "x$enable_plugin" = "xyes"
3288 if test "x$2" = "xyes" || test "x$force" = "xyes"
3290 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3291 if test "x$2" != "xyes"
3293 dependency_warning="yes"
3295 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3296 dependency_error="yes"
3297 enable_plugin="no (dependency error)"
3300 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3301 enable_$1="$enable_plugin"
3303 )# AC_PLUGIN(name, default, info)
3305 m4_divert_once([HELP_ENABLE], [
3306 collectd features:])
3307 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3308 AC_COLLECTD([debug], [enable], [feature], [debugging])
3309 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3310 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3312 dependency_warning="no"
3313 dependency_error="no"
3318 plugin_conntrack="no"
3324 plugin_interface="no"
3331 plugin_multimeter="no"
3335 plugin_processes="no"
3336 plugin_protocols="no"
3340 plugin_tcpconns="no"
3347 plugin_wireless="no"
3350 if test "x$ac_system" = "xLinux"
3352 plugin_battery="yes"
3353 plugin_conntrack="yes"
3355 plugin_cpufreq="yes"
3357 plugin_entropy="yes"
3358 plugin_interface="yes"
3363 plugin_fscache="yes"
3364 plugin_processes="yes"
3365 plugin_protocols="yes"
3368 plugin_tcpconns="yes"
3369 plugin_thermal="yes"
3372 plugin_vserver="yes"
3373 plugin_wireless="yes"
3375 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
3381 if test "x$ac_system" = "xOpenBSD"
3383 plugin_tcpconns="yes"
3387 if test "x$with_libiokit" = "xyes"
3389 plugin_battery="yes"
3394 if test "x$with_kstat" = "xyes"
3399 if test "x$with_devinfo$with_kstat" = "xyesyes"
3403 plugin_interface="yes"
3408 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
3414 if test "x$with_libstatgrab" = "xyes"
3418 plugin_interface="yes"
3425 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
3431 if test "x$with_libopenipmipthread" = "xyes"
3436 if test "x$have_processor_info" = "xyes"
3440 if test "x$have_sysctl" = "xyes"
3447 if test "x$have_sysctlbyname" = "xyes"
3451 plugin_tcpconns="yes"
3454 # Df plugin: Check if we know how to determine mount points first.
3455 #if test "x$have_listmntent" = "xyes"; then
3458 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
3462 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
3466 #if test "x$have_getmntent" = "xseq"
3470 if test "x$c_cv_have_one_getmntent" = "xyes"
3475 # Df plugin: Check if we have either `statfs' or `statvfs' second.
3476 if test "x$plugin_df" = "xyes"
3479 if test "x$have_statfs" = "xyes"
3483 if test "x$have_statvfs" = "xyes"
3489 if test "x$have_getifaddrs" = "xyes"
3491 plugin_interface="yes"
3494 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
3496 plugin_libvirt="yes"
3499 if test "x$have_getloadavg" = "xyes"
3504 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
3509 # Mac OS X memory interface
3510 if test "x$have_host_statistics" = "xyes"
3515 if test "x$have_termios_h" = "xyes"
3517 plugin_multimeter="yes"
3521 if test "x$have_thread_info" = "xyes"
3523 plugin_processes="yes"
3526 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
3528 plugin_processes="yes"
3531 if test "x$with_kvm_getswapinfo" = "xyes"
3536 if test "x$have_swapctl" = "xyes"
3541 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
3543 plugin_tcpconns="yes"
3546 if test "x$have_getutent" = "xyes"
3550 if test "x$have_getutxent" = "xyes"
3555 m4_divert_once([HELP_ENABLE], [
3558 AC_ARG_ENABLE([all-plugins],
3559 AC_HELP_STRING([--enable-all-plugins],
3560 [enable all plugins (auto by def)]),
3562 if test "x$enableval" = "xyes"
3564 enable_all_plugins="yes"
3565 else if test "x$enableval" = "xauto"
3567 enable_all_plugins="auto"
3569 enable_all_plugins="no"
3572 [enable_all_plugins="auto"])
3574 m4_divert_once([HELP_ENABLE], [])
3576 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
3577 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
3578 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
3579 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
3580 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
3581 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
3582 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
3583 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
3584 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
3585 AC_PLUGIN([csv], [yes], [CSV output plugin])
3586 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
3587 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
3588 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
3589 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
3590 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
3591 AC_PLUGIN([email], [yes], [EMail statistics])
3592 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
3593 AC_PLUGIN([exec], [yes], [Execution of external programs])
3594 AC_PLUGIN([filecount], [yes], [Count files in directories])
3595 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
3596 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
3597 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
3598 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
3599 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
3600 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
3601 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
3602 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
3603 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
3604 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
3605 AC_PLUGIN([load], [$plugin_load], [System load])
3606 AC_PLUGIN([logfile], [yes], [File logging plugin])
3607 AC_PLUGIN([match_regex], [yes], [The regex match])
3608 AC_PLUGIN([match_timediff], [yes], [The timediff match])
3609 AC_PLUGIN([match_value], [yes], [The value match])
3610 AC_PLUGIN([mbmon], [yes], [Query mbmond])
3611 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
3612 AC_PLUGIN([memcached], [yes], [memcached statistics])
3613 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
3614 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
3615 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
3616 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
3617 AC_PLUGIN([network], [yes], [Network communication plugin])
3618 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
3619 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
3620 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
3621 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
3622 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
3623 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
3624 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
3625 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
3626 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
3627 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
3628 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
3629 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
3630 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
3631 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
3632 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
3633 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
3634 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
3635 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
3636 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
3637 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
3638 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
3639 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
3640 AC_PLUGIN([table], [yes], [Parsing of tabular data])
3641 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
3642 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
3643 AC_PLUGIN([target_notification], [yes], [The notification target])
3644 AC_PLUGIN([target_replace], [yes], [The replace target])
3645 AC_PLUGIN([target_set], [yes], [The set target])
3646 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
3647 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
3648 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
3649 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
3650 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
3651 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
3652 AC_PLUGIN([users], [$plugin_users], [User statistics])
3653 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
3654 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
3655 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
3656 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
3657 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
3659 dnl Default configuration file
3660 # Load either syslog or logfile
3661 LOAD_PLUGIN_SYSLOG=""
3662 LOAD_PLUGIN_LOGFILE=""
3664 AC_MSG_CHECKING([which default log plugin to load])
3665 default_log_plugin="none"
3666 if test "x$enable_syslog" = "xyes"
3668 default_log_plugin="syslog"
3670 LOAD_PLUGIN_SYSLOG="##"
3673 if test "x$enable_logfile" = "xyes"
3675 if test "x$default_log_plugin" = "xnone"
3677 default_log_plugin="logfile"
3679 LOAD_PLUGIN_LOGFILE="#"
3682 LOAD_PLUGIN_LOGFILE="##"
3684 AC_MSG_RESULT([$default_log_plugin])
3686 AC_SUBST(LOAD_PLUGIN_SYSLOG)
3687 AC_SUBST(LOAD_PLUGIN_LOGFILE)
3689 DEFAULT_LOG_LEVEL="info"
3690 if test "x$enable_debug" = "xyes"
3692 DEFAULT_LOG_LEVEL="debug"
3694 AC_SUBST(DEFAULT_LOG_LEVEL)
3696 # Load only one of rrdtool, network, csv in the default config.
3697 LOAD_PLUGIN_RRDTOOL=""
3698 LOAD_PLUGIN_NETWORK=""
3701 AC_MSG_CHECKING([which default write plugin to load])
3702 default_write_plugin="none"
3703 if test "x$enable_rrdtool" = "xyes"
3705 default_write_plugin="rrdtool"
3707 LOAD_PLUGIN_RRDTOOL="##"
3710 if test "x$enable_network" = "xyes"
3712 if test "x$default_write_plugin" = "xnone"
3714 default_write_plugin="network"
3716 LOAD_PLUGIN_NETWORK="#"
3719 LOAD_PLUGIN_NETWORK="##"
3722 if test "x$enable_csv" = "xyes"
3724 if test "x$default_write_plugin" = "xnone"
3726 default_write_plugin="csv"
3731 LOAD_PLUGIN_CSV="##"
3733 AC_MSG_RESULT([$default_write_plugin])
3735 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
3736 AC_SUBST(LOAD_PLUGIN_NETWORK)
3737 AC_SUBST(LOAD_PLUGIN_CSV)
3740 if test "x$ac_system" = "xLinux" \
3741 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
3743 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
3747 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
3749 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3751 PERL_BINDINGS_OPTIONS="$withval"
3752 with_perl_bindings="yes"
3754 PERL_BINDINGS_OPTIONS=""
3755 with_perl_bindings="$withval"
3759 PERL_BINDINGS_OPTIONS=""
3760 if test -n "$perl_interpreter"
3762 with_perl_bindings="yes"
3764 with_perl_bindings="no (no perl interpreter found)"
3767 if test "x$with_perl_bindings" = "xyes"
3769 PERL_BINDINGS="perl"
3773 AC_SUBST(PERL_BINDINGS)
3774 AC_SUBST(PERL_BINDINGS_OPTIONS)
3776 dnl libcollectdclient
3777 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
3778 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
3779 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
3781 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
3783 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
3785 AC_SUBST(LCC_VERSION_MAJOR)
3786 AC_SUBST(LCC_VERSION_MINOR)
3787 AC_SUBST(LCC_VERSION_PATCH)
3788 AC_SUBST(LCC_VERSION_EXTRA)
3789 AC_SUBST(LCC_VERSION_STRING)
3791 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
3793 AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
3795 if test "x$with_librrd" = "xyes" \
3796 && test "x$librrd_threadsafe" != "xyes"
3798 with_librrd="yes (warning: librrd is not thread-safe)"
3801 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
3803 with_libiptc="yes (shipped version)"
3806 if test "x$with_libperl" = "xyes"
3808 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
3810 enable_perl="no (needs libperl)"
3813 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
3815 enable_perl="no (libperl doesn't support ithreads)"
3818 if test "x$with_perl_bindings" = "xyes" \
3819 && test "x$PERL_BINDINGS_OPTIONS" != "x"
3821 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
3828 libcurl . . . . . . . $with_libcurl
3829 libdbi . . . . . . . $with_libdbi
3830 libesmtp . . . . . . $with_libesmtp
3831 libganglia . . . . . $with_libganglia
3832 libgcrypt . . . . . . $with_libgcrypt
3833 libiokit . . . . . . $with_libiokit
3834 libiptc . . . . . . . $with_libiptc
3835 libjvm . . . . . . . $with_java
3836 libkstat . . . . . . $with_kstat
3837 libkvm . . . . . . . $with_libkvm
3838 libmemcached . . . . $with_libmemcached
3839 libmysql . . . . . . $with_libmysql
3840 libnetlink . . . . . $with_libnetlink
3841 libnetsnmp . . . . . $with_libnetsnmp
3842 libnotify . . . . . . $with_libnotify
3843 liboconfig . . . . . $with_liboconfig
3844 libopenipmi . . . . . $with_libopenipmipthread
3845 liboping . . . . . . $with_liboping
3846 libpcap . . . . . . . $with_libpcap
3847 libperl . . . . . . . $with_libperl
3848 libpq . . . . . . . . $with_libpq
3849 libpthread . . . . . $with_libpthread
3850 librrd . . . . . . . $with_librrd
3851 libsensors . . . . . $with_libsensors
3852 libstatgrab . . . . . $with_libstatgrab
3853 libupsclient . . . . $with_libupsclient
3854 libvirt . . . . . . . $with_libvirt
3855 libxml2 . . . . . . . $with_libxml2
3856 libxmms . . . . . . . $with_libxmms
3857 oracle . . . . . . . $with_oracle
3860 daemon mode . . . . . $enable_daemon
3861 debug . . . . . . . . $enable_debug
3864 perl . . . . . . . . $with_perl_bindings
3867 apache . . . . . . . $enable_apache
3868 apcups . . . . . . . $enable_apcups
3869 apple_sensors . . . . $enable_apple_sensors
3870 ascent . . . . . . . $enable_ascent
3871 battery . . . . . . . $enable_battery
3872 bind . . . . . . . . $enable_bind
3873 conntrack . . . . . . $enable_conntrack
3874 cpu . . . . . . . . . $enable_cpu
3875 cpufreq . . . . . . . $enable_cpufreq
3876 csv . . . . . . . . . $enable_csv
3877 curl . . . . . . . . $enable_curl
3878 dbi . . . . . . . . . $enable_dbi
3879 df . . . . . . . . . $enable_df
3880 disk . . . . . . . . $enable_disk
3881 dns . . . . . . . . . $enable_dns
3882 email . . . . . . . . $enable_email
3883 entropy . . . . . . . $enable_entropy
3884 exec . . . . . . . . $enable_exec
3885 filecount . . . . . . $enable_filecount
3886 fscache . . . . . . . $enable_fscache
3887 gmond . . . . . . . . $enable_gmond
3888 hddtemp . . . . . . . $enable_hddtemp
3889 interface . . . . . . $enable_interface
3890 ipmi . . . . . . . . $enable_ipmi
3891 iptables . . . . . . $enable_iptables
3892 ipvs . . . . . . . . $enable_ipvs
3893 irq . . . . . . . . . $enable_irq
3894 java . . . . . . . . $enable_java
3895 libvirt . . . . . . . $enable_libvirt
3896 load . . . . . . . . $enable_load
3897 logfile . . . . . . . $enable_logfile
3898 match_regex . . . . . $enable_match_regex
3899 match_timediff . . . $enable_match_timediff
3900 match_value . . . . . $enable_match_value
3901 mbmon . . . . . . . . $enable_mbmon
3902 memcachec . . . . . . $enable_memcachec
3903 memcached . . . . . . $enable_memcached
3904 memory . . . . . . . $enable_memory
3905 multimeter . . . . . $enable_multimeter
3906 mysql . . . . . . . . $enable_mysql
3907 netlink . . . . . . . $enable_netlink
3908 network . . . . . . . $enable_network
3909 nfs . . . . . . . . . $enable_nfs
3910 nginx . . . . . . . . $enable_nginx
3911 notify_desktop . . . $enable_notify_desktop
3912 notify_email . . . . $enable_notify_email
3913 ntpd . . . . . . . . $enable_ntpd
3914 nut . . . . . . . . . $enable_nut
3915 onewire . . . . . . . $enable_onewire
3916 openvpn . . . . . . . $enable_openvpn
3917 oracle . . . . . . . $enable_oracle
3918 perl . . . . . . . . $enable_perl
3919 ping . . . . . . . . $enable_ping
3920 postgresql . . . . . $enable_postgresql
3921 powerdns . . . . . . $enable_powerdns
3922 processes . . . . . . $enable_processes
3923 protocols . . . . . . $enable_protocols
3924 rrdcached . . . . . . $enable_rrdcached
3925 rrdtool . . . . . . . $enable_rrdtool
3926 sensors . . . . . . . $enable_sensors
3927 serial . . . . . . . $enable_serial
3928 snmp . . . . . . . . $enable_snmp
3929 swap . . . . . . . . $enable_swap
3930 syslog . . . . . . . $enable_syslog
3931 table . . . . . . . . $enable_table
3932 tail . . . . . . . . $enable_tail
3933 tape . . . . . . . . $enable_tape
3934 target_notification . $enable_target_notification
3935 target_replace . . . $enable_target_replace
3936 target_set . . . . . $enable_target_set
3937 tcpconns . . . . . . $enable_tcpconns
3938 teamspeak2 . . . . . $enable_teamspeak2
3939 ted . . . . . . . . . $enable_ted
3940 thermal . . . . . . . $enable_thermal
3941 unixsock . . . . . . $enable_unixsock
3942 uptime . . . . . . . $enable_uptime
3943 users . . . . . . . . $enable_users
3944 uuid . . . . . . . . $enable_uuid
3945 vmem . . . . . . . . $enable_vmem
3946 vserver . . . . . . . $enable_vserver
3947 wireless . . . . . . $enable_wireless
3948 xmms . . . . . . . . $enable_xmms
3952 if test "x$dependency_error" = "xyes"; then
3953 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
3956 if test "x$dependency_warning" = "xyes"; then
3957 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
3960 # vim: set fdm=marker :