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])
12 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
17 AC_LIBLTDL_CONVENIENCE
21 AC_CONFIG_SUBDIRS(libltdl)
22 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
26 AM_INIT_AUTOMAKE(dist-bzip2)
29 AC_PREFIX_DEFAULT("/opt/collectd")
34 # Checks for programs.
42 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
50 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
51 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
53 AC_MSG_CHECKING([for kernel type ($host_os)])
56 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
60 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
70 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
76 AC_MSG_RESULT([$ac_system])
78 if test "x$ac_system" = "xLinux"
80 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
81 if test -z "$KERNEL_DIR"
83 KERNEL_DIR="/lib/modules/`uname -r`/source"
86 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
87 AC_SUBST(KERNEL_CFLAGS)
90 if test "x$ac_system" = "xSolaris"
92 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
95 # Where to install .pc files.
96 pkgconfigdir="${libdir}/pkgconfig"
97 AC_SUBST(pkgconfigdir)
99 # Check for standards compliance mode
100 AC_ARG_ENABLE(standards,
101 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
102 [enable_standards="$enableval"],
103 [enable_standards="no"])
104 if test "x$enable_standards" = "xyes"
106 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
107 AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
108 AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
109 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
111 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
114 # Checks for header files.
121 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)
124 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
129 # include <sys/types.h>
132 AC_CHECK_HEADERS(netinet/in.h, [], [],
137 # include <sys/types.h>
139 #if HAVE_NETINET_IN_SYSTM_H
140 # include <netinet/in_systm.h>
143 AC_CHECK_HEADERS(netinet/ip.h, [], [],
148 # include <sys/types.h>
150 #if HAVE_NETINET_IN_SYSTM_H
151 # include <netinet/in_systm.h>
153 #if HAVE_NETINET_IN_H
154 # include <netinet/in.h>
157 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
162 # include <sys/types.h>
164 #if HAVE_NETINET_IN_SYSTM_H
165 # include <netinet/in_systm.h>
167 #if HAVE_NETINET_IN_H
168 # include <netinet/in.h>
170 #if HAVE_NETINET_IP_H
171 # include <netinet/ip.h>
174 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
179 # include <sys/types.h>
181 #if HAVE_NETINET_IN_SYSTM_H
182 # include <netinet/in_systm.h>
184 #if HAVE_NETINET_IN_H
185 # include <netinet/in.h>
187 #if HAVE_NETINET_IP_H
188 # include <netinet/ip.h>
191 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
196 # include <sys/types.h>
198 #if HAVE_NETINET_IN_SYSTM_H
199 # include <netinet/in_systm.h>
201 #if HAVE_NETINET_IN_H
202 # include <netinet/in.h>
205 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
210 # include <sys/types.h>
212 #if HAVE_NETINET_IN_SYSTM_H
213 # include <netinet/in_systm.h>
215 #if HAVE_NETINET_IN_H
216 # include <netinet/in.h>
218 #if HAVE_NETINET_IP6_H
219 # include <netinet/ip6.h>
222 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
227 # include <sys/types.h>
229 #if HAVE_NETINET_IN_SYSTM_H
230 # include <netinet/in_systm.h>
232 #if HAVE_NETINET_IN_H
233 # include <netinet/in.h>
235 #if HAVE_NETINET_IP_H
236 # include <netinet/ip.h>
239 AC_CHECK_HEADERS(netinet/udp.h, [], [],
244 # include <sys/types.h>
246 #if HAVE_NETINET_IN_SYSTM_H
247 # include <netinet/in_systm.h>
249 #if HAVE_NETINET_IN_H
250 # include <netinet/in.h>
252 #if HAVE_NETINET_IP_H
253 # include <netinet/ip.h>
258 AC_CHECK_HEADERS(sys/dkstat.h)
259 if test "x$ac_system" = "xDarwin"
261 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)
262 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
264 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
267 # include <sys/types.h>
270 # include <sys/param.h>
274 AC_MSG_CHECKING([for sysctl kern.cp_times])
275 if test -x /sbin/sysctl
277 /sbin/sysctl kern.cp_times 2>/dev/null
281 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
282 [Define if sysctl supports kern.cp_times])
291 AC_CHECK_HEADERS(linux/major.h libgen.h)
293 # For the battery plugin
294 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
296 #if HAVE_IOKIT_IOKITLIB_H
297 # include <IOKit/IOKitLib.h>
299 #if HAVE_IOKIT_IOTYPES_H
300 # include <IOKit/IOTypes.h>
304 # For the swap module
305 have_linux_wireless_h="no"
306 if test "x$ac_system" = "xLinux"
308 AC_CHECK_HEADERS(linux/wireless.h,
309 [have_linux_wireless_h="yes"],
310 [have_linux_wireless_h="no"],
313 #include <sys/ioctl.h>
314 #include <sys/socket.h>
318 # For the swap module
319 have_sys_swap_h="yes"
320 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
322 #undef _FILE_OFFSET_BITS
323 #undef _LARGEFILE64_SOURCE
325 # include <sys/types.h>
328 # include <sys/param.h>
332 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
335 if test "x$GCC" = "xyes"
337 hint_64="CFLAGS='-m64'"
339 hint_64="CFLAGS='-xarch=v9'"
341 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
345 # For the processes plugin
347 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
349 # For interface plugin
350 AC_CHECK_HEADERS(ifaddrs.h)
351 AC_CHECK_HEADERS(net/if.h, [], [],
354 # include <sys/types.h>
356 #if HAVE_SYS_SOCKET_H
357 # include <sys/socket.h>
360 AC_CHECK_HEADERS(linux/if.h, [], [],
363 # include <sys/types.h>
365 #if HAVE_SYS_SOCKET_H
366 # include <sys/socket.h>
369 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
372 # include <sys/types.h>
374 #if HAVE_SYS_SOCKET_H
375 # include <sys/socket.h>
378 # include <linux/if.h>
383 have_net_ip_vs_h="no"
385 if test "x$ac_system" = "xLinux"
387 SAVE_CFLAGS="$CFLAGS"
388 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
390 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
391 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
393 CFLAGS="$SAVE_CFLAGS"
397 AC_CHECK_HEADERS(sys/ucred.h, [], [],
400 # include <sys/types.h>
403 # include <sys/param.h>
407 # For mount interface
408 AC_CHECK_HEADERS(sys/mount.h, [], [],
411 # include <sys/types.h>
414 # include <sys/param.h>
418 # For the email plugin
419 AC_CHECK_HEADERS(linux/un.h, [], [],
421 #if HAVE_SYS_SOCKET_H
422 # include <sys/socket.h>
426 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)
429 AC_CHECK_HEADERS(arpa/nameser.h)
430 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
432 #if HAVE_ARPA_NAMESER_H
433 # include <arpa/nameser.h>
437 AC_CHECK_HEADERS(net/if_arp.h, [], [],
438 [#if HAVE_SYS_SOCKET_H
439 # include <sys/socket.h>
442 AC_CHECK_HEADERS(net/ppp_defs.h)
443 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
444 [#if HAVE_NET_PPP_DEFS_H
445 # include <net/ppp_defs.h>
448 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
453 # include <sys/types.h>
455 #if HAVE_SYS_SOCKET_H
456 # include <sys/socket.h>
461 #if HAVE_NETINET_IN_H
462 # include <netinet/in.h>
466 # For the multimeter plugin
468 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
471 # Checks for typedefs, structures, and compiler characteristics.
480 # Checks for library functions.
482 AC_PROG_GCC_TRADITIONAL
483 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf if_indextoname)
487 AC_CACHE_CHECK([for strtok_r],
488 [c_cv_have_strtok_r_default],
497 char buffer[] = "foo,bar,baz";
504 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
507 printf ("token = %s;\n", token);
510 [c_cv_have_strtok_r_default="yes"],
511 [c_cv_have_strtok_r_default="no"]
515 if test "x$c_cv_have_strtok_r_default" = "xno"
517 SAVE_CFLAGS="$CFLAGS"
518 CFLAGS="$CFLAGS -D_REENTRANT=1"
520 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
521 [c_cv_have_strtok_r_reentrant],
530 char buffer[] = "foo,bar,baz";
537 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
540 printf ("token = %s;\n", token);
543 [c_cv_have_strtok_r_reentrant="yes"],
544 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
549 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
551 socket_needs_socket="no"
552 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
553 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
555 nanosleep_needs_rt="no"
556 nanosleep_needs_posix4="no"
557 AC_CHECK_FUNCS(nanosleep,
559 AC_CHECK_LIB(rt, nanosleep,
560 [nanosleep_needs_rt="yes"],
561 AC_CHECK_LIB(posix4, nanosleep,
562 [nanosleep_needs_posix4="yes"],
563 AC_MSG_ERROR(cannot find nanosleep))))
564 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
565 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$nanosleep_needs_posix4" = "xyes")
567 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
568 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
569 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
570 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
571 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
572 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
573 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
574 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
575 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
576 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
577 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
578 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
581 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
584 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
586 if test "x$withval" = "xno"; then
588 else if test "x$withval" = "xyes"; then
595 if test "x$nan_type" = "xnone"; then
596 AC_CACHE_CHECK([whether NAN is defined by default],
597 [c_cv_have_nan_default],
603 static float foo = NAN;
611 [c_cv_have_nan_default="yes"],
612 [c_cv_have_nan_default="no"]
615 if test "x$c_cv_have_nan_default" = "xyes"
620 if test "x$nan_type" = "xnone"; then
621 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
622 [c_cv_have_nan_isoc],
627 #define __USE_ISOC99 1
629 static float foo = NAN;
637 [c_cv_have_nan_isoc="yes"],
638 [c_cv_have_nan_isoc="no"]
641 if test "x$c_cv_have_nan_isoc" = "xyes"
646 if test "x$nan_type" = "xnone"; then
647 SAVE_LDFLAGS=$LDFLAGS
648 LDFLAGS="$LDFLAGS -lm"
649 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
650 [c_cv_have_nan_zero],
659 #define NAN (0.0 / 0.0)
661 # define isnan(f) ((f) != (f))
663 static float foo = NAN;
671 [c_cv_have_nan_zero="yes"],
672 [c_cv_have_nan_zero="no"]
675 LDFLAGS=$SAVE_LDFLAGS
676 if test "x$c_cv_have_nan_zero" = "xyes"
682 if test "x$nan_type" = "xdefault"; then
683 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
684 [Define if NAN is defined by default and can initialize static variables.])
685 else if test "x$nan_type" = "xisoc99"; then
686 AC_DEFINE(NAN_STATIC_ISOC, 1,
687 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
688 else if test "x$nan_type" = "xzero"; then
689 AC_DEFINE(NAN_ZERO_ZERO, 1,
690 [Define if NAN can be defined as (0.0 / 0.0)])
692 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
695 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
697 if test "x$withval" = "xnothing"; then
698 fp_layout_type="nothing"
699 else if test "x$withval" = "xendianflip"; then
700 fp_layout_type="endianflip"
701 else if test "x$withval" = "xintswap"; then
702 fp_layout_type="intswap"
704 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
707 [fp_layout_type="unknown"])
709 if test "x$fp_layout_type" = "xunknown"; then
710 AC_CACHE_CHECK([if doubles are stored in x86 representation],
711 [c_cv_fp_layout_need_nothing],
722 # include <stdbool.h>
732 memcpy ((void *) &i0, (void *) &d, 8);
735 memcpy ((void *) c, (void *) &i1, 8);
737 if ((c[0] == 0x2f) && (c[1] == 0x25)
738 && (c[2] == 0xc0) && (c[3] == 0xc7)
739 && (c[4] == 0x43) && (c[5] == 0x2b)
740 && (c[6] == 0x1f) && (c[7] == 0x5b))
745 [c_cv_fp_layout_need_nothing="yes"],
746 [c_cv_fp_layout_need_nothing="no"]
749 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
750 fp_layout_type="nothing"
753 if test "x$fp_layout_type" = "xunknown"; then
754 AC_CACHE_CHECK([if endianflip converts to x86 representation],
755 [c_cv_fp_layout_need_endianflip],
766 # include <stdbool.h>
768 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
769 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
770 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
771 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
772 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
773 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
774 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
775 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
784 memcpy ((void *) &i0, (void *) &d, 8);
786 i1 = endianflip (i0);
787 memcpy ((void *) c, (void *) &i1, 8);
789 if ((c[0] == 0x2f) && (c[1] == 0x25)
790 && (c[2] == 0xc0) && (c[3] == 0xc7)
791 && (c[4] == 0x43) && (c[5] == 0x2b)
792 && (c[6] == 0x1f) && (c[7] == 0x5b))
797 [c_cv_fp_layout_need_endianflip="yes"],
798 [c_cv_fp_layout_need_endianflip="no"]
801 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
802 fp_layout_type="endianflip"
805 if test "x$fp_layout_type" = "xunknown"; then
806 AC_CACHE_CHECK([if intswap converts to x86 representation],
807 [c_cv_fp_layout_need_intswap],
818 # include <stdbool.h>
820 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
821 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
830 memcpy ((void *) &i0, (void *) &d, 8);
833 memcpy ((void *) c, (void *) &i1, 8);
835 if ((c[0] == 0x2f) && (c[1] == 0x25)
836 && (c[2] == 0xc0) && (c[3] == 0xc7)
837 && (c[4] == 0x43) && (c[5] == 0x2b)
838 && (c[6] == 0x1f) && (c[7] == 0x5b))
843 [c_cv_fp_layout_need_intswap="yes"],
844 [c_cv_fp_layout_need_intswap="no"]
847 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
848 fp_layout_type="intswap"
852 if test "x$fp_layout_type" = "xnothing"; then
853 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
854 [Define if doubles are stored in x86 representation.])
855 else if test "x$fp_layout_type" = "xendianflip"; then
856 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
857 [Define if endianflip is needed to convert to x86 representation.])
858 else if test "x$fp_layout_type" = "xintswap"; then
859 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
860 [Define if intswap is needed to convert to x86 representation.])
862 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
866 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
868 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
870 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
873 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
874 if test "x$have_getmntent" = "xno"; then
875 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
877 if test "x$have_getmntent" = "xno"; then
878 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
880 if test "x$have_getmntent" = "xno"; then
881 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
884 if test "x$have_getmntent" = "xc"; then
885 AC_CACHE_CHECK([whether getmntent takes one argument],
886 [c_cv_have_one_getmntent],
888 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
889 #include "$srcdir/src/utils_mount.h"]],
893 fh = setmntent ("/etc/mtab", "r");
897 [c_cv_have_one_getmntent="yes"],
898 [c_cv_have_one_getmntent="no"]
901 AC_CACHE_CHECK([whether getmntent takes two arguments],
902 [c_cv_have_two_getmntent],
904 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
905 #include "$srcdir/src/utils_mount.h"]],
910 fh = fopen ("/etc/mnttab", "r");
911 status = getmntent (fh, &mt);
914 [c_cv_have_two_getmntent="yes"],
915 [c_cv_have_two_getmntent="no"]
920 # Check for different versions of `getmntent' here..
922 if test "x$have_getmntent" = "xc"; then
923 if test "x$c_cv_have_one_getmntent" = "xyes"; then
924 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
925 [Define if the function getmntent exists and takes one argument.])
927 if test "x$c_cv_have_two_getmntent" = "xyes"; then
928 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
929 [Define if the function getmntent exists and takes two arguments.])
932 if test "x$have_getmntent" = "xsun"; then
933 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
934 [Define if the function getmntent exists. It's the version from libsun.])
936 if test "x$have_getmntent" = "xseq"; then
937 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
938 [Define if the function getmntent exists. It's the version from libseq.])
940 if test "x$have_getmntent" = "xgen"; then
941 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
942 [Define if the function getmntent exists. It's the version from libgen.])
946 AC_MSG_CHECKING([if have htonll defined])
951 #include <sys/types.h>
952 #include <netinet/in.h>
953 #ifdef HAVE_INTTYPES_H
954 #include <inttypes.h>
961 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
964 AC_MSG_RESULT([$have_htonll])
966 # Check for structures
967 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
968 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
971 #include <sys/types.h>
972 #include <sys/socket.h>
975 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
976 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
979 #include <sys/types.h>
980 #include <sys/socket.h>
981 #include <linux/if.h>
982 #include <linux/netdevice.h>
985 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
988 #include <netinet/in.h>
992 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
994 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
995 [Define if struct kinfo_proc exists in the FreeBSD variant.])
996 have_struct_kinfo_proc_freebsd="yes"
999 have_struct_kinfo_proc_freebsd="no"
1003 #include <sys/param.h>
1004 #include <sys/sysctl.h>
1005 #include <sys/user.h>
1008 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1010 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1011 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1012 have_struct_kinfo_proc_openbsd="yes"
1015 have_struct_kinfo_proc_openbsd="no"
1018 #include <sys/param.h>
1019 #include <sys/sysctl.h>
1023 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1024 [#define _BSD_SOURCE
1026 # include <stdint.h>
1028 #if HAVE_SYS_TYPES_H
1029 # include <sys/types.h>
1031 #if HAVE_NETINET_IN_SYSTM_H
1032 # include <netinet/in_systm.h>
1034 #if HAVE_NETINET_IN_H
1035 # include <netinet/in.h>
1037 #if HAVE_NETINET_IP_H
1038 # include <netinet/ip.h>
1040 #if HAVE_NETINET_UDP_H
1041 # include <netinet/udp.h>
1044 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1045 [#define _BSD_SOURCE
1047 # include <stdint.h>
1049 #if HAVE_SYS_TYPES_H
1050 # include <sys/types.h>
1052 #if HAVE_NETINET_IN_SYSTM_H
1053 # include <netinet/in_systm.h>
1055 #if HAVE_NETINET_IN_H
1056 # include <netinet/in.h>
1058 #if HAVE_NETINET_IP_H
1059 # include <netinet/ip.h>
1061 #if HAVE_NETINET_UDP_H
1062 # include <netinet/udp.h>
1066 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1076 # Checks for libraries begin here
1078 with_libresolv="yes"
1079 AC_CHECK_LIB(resolv, res_search,
1081 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1083 [with_libresolv="no"])
1084 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1086 dnl Check for HAL (hardware abstraction library)
1088 AC_CHECK_LIB(hal,libhal_device_property_exists,
1089 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1091 if test "x$with_libhal" = "xyes"; then
1092 if test "x$PKG_CONFIG" != "x"; then
1093 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1094 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1095 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1096 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1100 m4_divert_once([HELP_WITH], [
1101 collectd additional packages:])
1103 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1105 if test "x$ac_system" = "xAIX"
1110 with_perfstat="no (AIX only)"
1111 with_procinfo="no (AIX only)"
1114 if test "x$with_perfstat" = "xyes"
1116 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1117 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1119 if test "x$with_perfstat" = "xyes"
1121 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1123 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1125 # Processes plugin under AIX.
1126 if test "x$with_procinfo" = "xyes"
1128 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1130 if test "x$with_procinfo" = "xyes"
1132 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1135 if test "x$ac_system" = "xSolaris"
1140 with_kstat="no (Solaris only)"
1141 with_devinfo="no (Solaris only)"
1144 if test "x$with_kstat" = "xyes"
1146 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1148 if test "x$with_kstat" = "xyes"
1150 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1151 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1153 if test "x$with_kstat" = "xyes"
1155 AC_DEFINE(HAVE_LIBKSTAT, 1,
1156 [Define to 1 if you have the 'kstat' library (-lkstat)])
1158 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1159 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1162 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1169 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1172 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1173 if test "x$with_kvm_getprocs" = "xyes"
1175 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1176 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1179 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1181 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1182 if test "x$with_kvm_getswapinfo" = "xyes"
1184 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1185 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1188 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1190 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1191 if test "x$with_kvm_nlist" = "xyes"
1193 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1194 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1197 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1199 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1200 if test "x$with_kvm_openfiles" = "xyes"
1202 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1203 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1206 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1208 # --with-libcurl {{{
1209 with_curl_config="curl-config"
1212 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1214 if test "x$withval" = "xno"
1217 else if test "x$withval" = "xyes"
1221 if test -f "$withval" && test -x "$withval"
1223 with_curl_config="$withval"
1225 else if test -x "$withval/bin/curl-config"
1227 with_curl_config="$withval/bin/curl-config"
1236 if test "x$with_libcurl" = "xyes"
1238 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1239 curl_config_status=$?
1241 if test $curl_config_status -ne 0
1243 with_libcurl="no ($with_curl_config failed)"
1245 SAVE_CPPFLAGS="$CPPFLAGS"
1246 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1248 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1250 CPPFLAGS="$SAVE_CPPFLAGS"
1253 if test "x$with_libcurl" = "xyes"
1255 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1256 curl_config_status=$?
1258 if test $curl_config_status -ne 0
1260 with_libcurl="no ($with_curl_config failed)"
1262 AC_CHECK_LIB(curl, curl_easy_init,
1263 [with_libcurl="yes"],
1264 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1268 if test "x$with_libcurl" = "xyes"
1270 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1271 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1272 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1273 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1275 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1279 with_libdbi_cppflags=""
1280 with_libdbi_ldflags=""
1281 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1283 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1285 with_libdbi_cppflags="-I$withval/include"
1286 with_libdbi_ldflags="-L$withval/lib"
1289 with_libdbi="$withval"
1295 if test "x$with_libdbi" = "xyes"
1297 SAVE_CPPFLAGS="$CPPFLAGS"
1298 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1300 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1302 CPPFLAGS="$SAVE_CPPFLAGS"
1304 if test "x$with_libdbi" = "xyes"
1306 SAVE_CPPFLAGS="$CPPFLAGS"
1307 SAVE_LDFLAGS="$LDFLAGS"
1308 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1309 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1311 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1313 CPPFLAGS="$SAVE_CPPFLAGS"
1314 LDFLAGS="$SAVE_LDFLAGS"
1316 if test "x$with_libdbi" = "xyes"
1318 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1319 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1320 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1321 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1322 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1323 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1325 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1328 # --with-libesmtp {{{
1329 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1331 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1333 LDFLAGS="$LDFLAGS -L$withval/lib"
1334 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1337 with_libesmtp="$withval"
1343 if test "x$with_libesmtp" = "xyes"
1345 AC_CHECK_LIB(esmtp, smtp_create_session,
1347 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1348 ], [with_libesmtp="no (libesmtp not found)"])
1350 if test "x$with_libesmtp" = "xyes"
1352 AC_CHECK_HEADERS(libesmtp.h,
1354 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1355 ], [with_libesmtp="no (libesmtp.h not found)"])
1357 if test "x$with_libesmtp" = "xyes"
1363 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1364 [Wether or not to use the esmtp library])
1365 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1368 # --with-libganglia {{{
1369 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1371 if test -f "$withval" && test -x "$withval"
1373 with_libganglia_config="$withval"
1374 with_libganglia="yes"
1375 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1377 with_libganglia_config="$withval/bin/ganglia-config"
1378 with_libganglia="yes"
1379 else if test -d "$withval"
1381 GANGLIA_CPPFLAGS="-I$withval/include"
1382 GANGLIA_LDFLAGS="-L$withval/lib"
1383 with_libganglia="yes"
1385 with_libganglia_config="ganglia-config"
1386 with_libganglia="$withval"
1390 with_libganglia_config="ganglia-config"
1391 with_libganglia="yes"
1394 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1396 if test "x$GANGLIA_CPPFLAGS" = "x"
1398 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1401 if test "x$GANGLIA_LDFLAGS" = "x"
1403 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1406 if test "x$GANGLIA_LIBS" = "x"
1408 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1412 SAVE_CPPFLAGS="$CPPFLAGS"
1413 SAVE_LDFLAGS="$LDFLAGS"
1414 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1415 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1417 if test "x$with_libganglia" = "xyes"
1419 AC_CHECK_HEADERS(gm_protocol.h,
1421 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1422 [Define to 1 if you have the <gm_protocol.h> header file.])
1423 ], [with_libganglia="no (gm_protocol.h not found)"])
1426 if test "x$with_libganglia" = "xyes"
1428 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1430 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1431 [Define to 1 if you have the ganglia library (-lganglia).])
1432 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1435 CPPFLAGS="$SAVE_CPPFLAGS"
1436 LDFLAGS="$SAVE_LDFLAGS"
1438 AC_SUBST(GANGLIA_CPPFLAGS)
1439 AC_SUBST(GANGLIA_LDFLAGS)
1440 AC_SUBST(GANGLIA_LIBS)
1441 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1444 # --with-libgcrypt {{{
1445 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1446 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1447 GCRYPT_LIBS="$GCRYPT_LIBS"
1448 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1450 if test -f "$withval" && test -x "$withval"
1452 with_libgcrypt_config="$withval"
1453 with_libgcrypt="yes"
1454 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1456 with_libgcrypt_config="$withval/bin/gcrypt-config"
1457 with_libgcrypt="yes"
1458 else if test -d "$withval"
1460 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1461 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1462 with_libgcrypt="yes"
1464 with_libgcrypt_config="gcrypt-config"
1465 with_libgcrypt="$withval"
1469 with_libgcrypt_config="libgcrypt-config"
1470 with_libgcrypt="yes"
1473 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1475 if test "x$GCRYPT_CPPFLAGS" = "x"
1477 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1480 if test "x$GCRYPT_LDFLAGS" = "x"
1482 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1483 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1486 if test "x$GCRYPT_LIBS" = "x"
1488 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1492 SAVE_CPPFLAGS="$CPPFLAGS"
1493 SAVE_LDFLAGS="$LDFLAGS"
1494 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1495 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1497 if test "x$with_libgcrypt" = "xyes"
1499 if test "x$GCRYPT_CPPFLAGS" != "x"
1501 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1503 AC_CHECK_HEADERS(gcrypt.h,
1504 [with_libgcrypt="yes"],
1505 [with_libgcrypt="no (gcrypt.h not found)"])
1508 if test "x$with_libgcrypt" = "xyes"
1510 if test "x$GCRYPT_LDFLAGS" != "x"
1512 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1514 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1515 [with_libgcrypt="yes"],
1516 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1518 if test "$with_libgcrypt" != "no"; then
1519 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1523 CPPFLAGS="$SAVE_CPPFLAGS"
1524 LDFLAGS="$SAVE_LDFLAGS"
1526 if test "x$with_libgcrypt" = "xyes"
1528 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1531 AC_SUBST(GCRYPT_CPPFLAGS)
1532 AC_SUBST(GCRYPT_LDFLAGS)
1533 AC_SUBST(GCRYPT_LIBS)
1534 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1537 # --with-libiptc {{{
1538 with_own_libiptc="no"
1539 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1541 if test "x$withval" = "xshipped"
1543 with_own_libiptc="yes"
1545 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1547 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1548 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1551 with_libiptc="$withval"
1555 if test "x$ac_system" = "xLinux"
1559 with_libiptc="no (Linux only)"
1562 SAVE_CPPFLAGS="$CPPFLAGS"
1563 SAVE_LDFLAGS="$LDFLAGS"
1564 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1565 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1566 # check whether the header file for libiptc is available.
1567 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1569 AC_CHECK_HEADERS(libiptc/libiptc.h,
1571 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1575 with_own_libiptc="yes"
1578 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1580 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1582 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1586 with_own_libiptc="yes"
1589 # If the header file is available, check for the required type declaractions.
1590 # They may be missing in old versions of libiptc. In that case, they will be
1591 # declared in the iptables plugin.
1592 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1594 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1597 # include "$srcdir/src/owniptc/libiptc.h"
1598 # include "$srcdir/src/owniptc/libip6tc.h"
1600 # include <libiptc/libiptc.h>
1601 # include <libiptc/libip6tc.h>
1605 # Check for the iptc_init symbol in the library.
1606 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1608 AC_CHECK_LIB(iptc, iptc_init,
1610 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1614 with_own_libiptc="yes"
1617 # The system wide version failed for some reason. Check if we have the required
1618 # headers to build the shipped version.
1619 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1621 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1623 with_libiptc="no (Linux iptables headers not found)"
1624 with_own_libiptc="no"
1627 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1630 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1631 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1632 if test "x$with_libiptc" = "xyes"
1634 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1635 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1636 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1637 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1639 if test "x$with_own_libiptc" = "xyes"
1641 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1643 CPPFLAGS="$SAVE_CPPFLAGS"
1644 LDFLAGS="$SAVE_LDFLAGS"
1648 with_java_home="$JAVA_HOME"
1649 with_java_vmtype="client"
1654 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1656 if test "x$withval" = "xno"
1659 else if test "x$withval" = "xyes"
1663 with_java_home="$withval"
1668 if test "x$with_java" = "xyes"
1670 if test -d "$with_java_home"
1672 AC_MSG_CHECKING([for jni.h])
1673 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1674 if test "x$TMPDIR" != "x"
1676 AC_MSG_RESULT([found in $TMPDIR])
1677 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1679 AC_MSG_RESULT([not found])
1682 AC_MSG_CHECKING([for jni_md.h])
1683 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1684 if test "x$TMPDIR" != "x"
1686 AC_MSG_RESULT([found in $TMPDIR])
1687 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1689 AC_MSG_RESULT([not found])
1692 AC_MSG_CHECKING([for libjvm.so])
1693 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1694 if test "x$TMPDIR" != "x"
1696 AC_MSG_RESULT([found in $TMPDIR])
1697 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1699 AC_MSG_RESULT([not found])
1702 if test "x$JAVAC" = "x"
1704 AC_MSG_CHECKING([for javac])
1705 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1706 if test "x$TMPDIR" != "x"
1709 AC_MSG_RESULT([$JAVAC])
1711 AC_MSG_RESULT([not found])
1714 if test "x$JAR" = "x"
1716 AC_MSG_CHECKING([for jar])
1717 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1718 if test "x$TMPDIR" != "x"
1721 AC_MSG_RESULT([$JAR])
1723 AC_MSG_RESULT([not found])
1726 else if test "x$with_java_home" != "x"
1728 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1732 if test "x$JAVA_CPPFLAGS" != "x"
1734 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1736 if test "x$JAVA_CFLAGS" != "x"
1738 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1740 if test "x$JAVA_LDFLAGS" != "x"
1742 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1744 if test "x$JAVAC" = "x"
1746 with_javac_path="$PATH"
1747 if test "x$with_java_home" != "x"
1749 with_javac_path="$with_java_home:with_javac_path"
1750 if test -d "$with_java_home/bin"
1752 with_javac_path="$with_java_home/bin:with_javac_path"
1756 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1758 if test "x$JAVAC" = "x"
1760 with_java="no (javac not found)"
1762 if test "x$JAR" = "x"
1764 with_jar_path="$PATH"
1765 if test "x$with_java_home" != "x"
1767 with_jar_path="$with_java_home:$with_jar_path"
1768 if test -d "$with_java_home/bin"
1770 with_jar_path="$with_java_home/bin:$with_jar_path"
1774 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
1776 if test "x$JAR" = "x"
1778 with_java="no (jar not found)"
1781 SAVE_CPPFLAGS="$CPPFLAGS"
1782 SAVE_CFLAGS="$CFLAGS"
1783 SAVE_LDFLAGS="$LDFLAGS"
1784 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1785 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1786 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1788 if test "x$with_java" = "xyes"
1790 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1792 if test "x$with_java" = "xyes"
1794 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1796 [with_java="no (libjvm not found)"],
1799 if test "x$with_java" = "xyes"
1801 JAVA_LIBS="$JAVA_LIBS -ljvm"
1802 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1805 CPPFLAGS="$SAVE_CPPFLAGS"
1806 CFLAGS="$SAVE_CFLAGS"
1807 LDFLAGS="$SAVE_LDFLAGS"
1809 AC_SUBST(JAVA_CPPFLAGS)
1810 AC_SUBST(JAVA_CFLAGS)
1811 AC_SUBST(JAVA_LDFLAGS)
1813 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1816 # --with-libmemcached {{{
1817 with_libmemcached_cppflags=""
1818 with_libmemcached_ldflags=""
1819 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
1821 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1823 with_libmemcached_cppflags="-I$withval/include"
1824 with_libmemcached_ldflags="-L$withval/lib"
1825 with_libmemcached="yes"
1827 with_libmemcached="$withval"
1831 with_libmemcached="yes"
1833 if test "x$with_libmemcached" = "xyes"
1835 SAVE_CPPFLAGS="$CPPFLAGS"
1836 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1838 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
1840 CPPFLAGS="$SAVE_CPPFLAGS"
1842 if test "x$with_libmemcached" = "xyes"
1844 SAVE_CPPFLAGS="$CPPFLAGS"
1845 SAVE_LDFLAGS="$LDFLAGS"
1846 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1847 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
1849 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
1851 CPPFLAGS="$SAVE_CPPFLAGS"
1852 LDFLAGS="$SAVE_LDFLAGS"
1854 if test "x$with_libmemcached" = "xyes"
1856 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
1857 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
1858 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
1859 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1860 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1861 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
1862 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
1864 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
1867 # --with-libmodbus {{{
1868 with_libmodbus_config=""
1869 with_libmodbus_cflags=""
1870 with_libmodbus_libs=""
1871 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
1873 if test "x$withval" = "xno"
1876 else if test "x$withval" = "xyes"
1878 with_libmodbus="use_pkgconfig"
1879 else if test -d "$with_libmodbus/lib"
1881 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
1882 with_libmodbus_cflags="-I$withval/include"
1883 with_libmodbus_libs="-L$withval/lib -lmodbus"
1884 with_libmodbus="yes"
1887 [with_libmodbus="use_pkgconfig"])
1889 # configure using pkg-config
1890 if test "x$with_libmodbus" = "xuse_pkgconfig"
1892 if test "x$PKG_CONFIG" = "x"
1894 with_libmodbus="no (Don't have pkg-config)"
1897 if test "x$with_libmodbus" = "xuse_pkgconfig"
1899 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
1900 $PKG_CONFIG --exists 'modbus' 2>/dev/null
1903 with_libmodbus="no (pkg-config doesn't know library)"
1906 if test "x$with_libmodbus" = "xuse_pkgconfig"
1908 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
1911 with_libmodbus="no ($PKG_CONFIG failed)"
1913 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
1916 with_libmodbus="no ($PKG_CONFIG failed)"
1919 if test "x$with_libmodbus" = "xuse_pkgconfig"
1921 with_libmodbus="yes"
1924 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
1925 # the actual checks.
1926 if test "x$with_libmodbus" = "xyes"
1928 SAVE_CPPFLAGS="$CPPFLAGS"
1929 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
1931 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
1933 CPPFLAGS="$SAVE_CPPFLAGS"
1935 if test "x$with_libmodbus" = "xyes"
1937 SAVE_CPPFLAGS="$CPPFLAGS"
1938 SAVE_LDFLAGS="$LDFLAGS"
1940 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
1941 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
1943 AC_CHECK_LIB(modbus, modbus_init_tcp,
1944 [with_libmodbus="yes"],
1945 [with_libmodbus="no (symbol modbus_init_tcp not found)"])
1947 CPPFLAGS="$SAVE_CPPFLAGS"
1948 LDFLAGS="$SAVE_LDFLAGS"
1950 if test "x$with_libmodbus" = "xyes"
1952 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
1953 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
1954 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
1955 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
1959 # --with-libmysql {{{
1960 with_mysql_config="mysql_config"
1961 with_mysql_cflags=""
1963 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1965 if test "x$withval" = "xno"
1968 else if test "x$withval" = "xyes"
1972 if test -f "$withval" && test -x "$withval";
1974 with_mysql_config="$withval"
1975 else if test -x "$withval/bin/mysql_config"
1977 with_mysql_config="$withval/bin/mysql_config"
1985 if test "x$with_libmysql" = "xyes"
1987 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1988 mysql_config_status=$?
1990 if test $mysql_config_status -ne 0
1992 with_libmysql="no ($with_mysql_config failed)"
1994 SAVE_CPPFLAGS="$CPPFLAGS"
1995 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1998 have_mysql_mysql_h="no"
1999 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2001 if test "x$have_mysql_h" = "xno"
2003 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2006 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2008 with_libmysql="no (mysql.h not found)"
2011 CPPFLAGS="$SAVE_CPPFLAGS"
2014 if test "x$with_libmysql" = "xyes"
2016 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
2017 mysql_config_status=$?
2019 if test $mysql_config_status -ne 0
2021 with_libmysql="no ($with_mysql_config failed)"
2023 AC_CHECK_LIB(mysqlclient, mysql_init,
2024 [with_libmysql="yes"],
2025 [with_libmysql="no (symbol 'mysql_init' not found)"],
2028 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2029 [with_libmysql="yes"],
2030 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2034 if test "x$with_libmysql" = "xyes"
2036 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2037 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2038 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2039 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2041 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2044 # --with-libnetlink {{{
2045 with_libnetlink_cflags=""
2046 with_libnetlink_libs="-lnetlink"
2047 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2049 echo "libnetlink: withval = $withval"
2050 if test "x$withval" = "xyes"
2052 with_libnetlink="yes"
2053 else if test "x$withval" = "xno"
2055 with_libnetlink="no"
2057 if test -d "$withval/include"
2059 with_libnetlink_cflags="-I$withval/include"
2060 with_libnetlink_libs="-L$withval/lib -lnetlink"
2061 with_libnetlink="yes"
2063 AC_MSG_ERROR("no such directory: $withval/include")
2068 if test "x$ac_system" = "xLinux"
2070 with_libnetlink="yes"
2072 with_libnetlink="no (Linux only library)"
2075 if test "x$with_libnetlink" = "xyes"
2077 SAVE_CFLAGS="$CFLAGS"
2078 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2080 with_libnetlink="no (libnetlink.h not found)"
2082 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2084 with_libnetlink="yes"
2088 #include <sys/types.h>
2089 #include <asm/types.h>
2090 #include <sys/socket.h>
2091 #include <linux/netlink.h>
2092 #include <linux/rtnetlink.h>])
2093 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2095 #include <sys/types.h>
2096 #include <asm/types.h>
2097 #include <sys/socket.h>])
2101 #include <sys/types.h>
2102 #include <asm/types.h>
2103 #include <sys/socket.h>
2104 #include <linux/netlink.h>
2105 #include <linux/rtnetlink.h>
2109 int retval = TCA_STATS2;
2112 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2117 #include <sys/types.h>
2118 #include <asm/types.h>
2119 #include <sys/socket.h>
2120 #include <linux/netlink.h>
2121 #include <linux/rtnetlink.h>
2125 int retval = TCA_STATS;
2128 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2131 CFLAGS="$SAVE_CFLAGS"
2133 if test "x$with_libnetlink" = "xyes"
2135 AC_CHECK_LIB(netlink, rtnl_open,
2136 [with_libnetlink="yes"],
2137 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2138 [$with_libnetlink_libs])
2140 if test "x$with_libnetlink" = "xyes"
2142 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2143 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2144 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2145 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2147 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2150 # --with-libnetapp {{{
2151 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2152 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2153 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2154 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2155 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2156 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2157 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2159 if test -d "$withval"
2161 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2162 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2163 with_libnetapp="yes"
2165 with_libnetapp="$withval"
2169 with_libnetapp="yes"
2172 SAVE_CPPFLAGS="$CPPFLAGS"
2173 SAVE_LDFLAGS="$LDFLAGS"
2174 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2175 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2177 if test "x$with_libnetapp" = "xyes"
2179 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2181 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2183 AC_CHECK_HEADERS(netapp_api.h,
2184 [with_libnetapp="yes"],
2185 [with_libnetapp="no (netapp_api.h not found)"])
2188 if test "x$with_libnetapp" = "xyes"
2190 if test "x$LIBNETAPP_LDFLAGS" != "x"
2192 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2195 if test "x$LIBNETAPP_LIBS" = "x"
2197 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2199 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2201 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2202 [with_libnetapp="yes"],
2203 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2205 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2208 CPPFLAGS="$SAVE_CPPFLAGS"
2209 LDFLAGS="$SAVE_LDFLAGS"
2211 if test "x$with_libnetapp" = "xyes"
2213 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2216 AC_SUBST(LIBNETAPP_CPPFLAGS)
2217 AC_SUBST(LIBNETAPP_LDFLAGS)
2218 AC_SUBST(LIBNETAPP_LIBS)
2219 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2222 # --with-libnetsnmp {{{
2223 with_snmp_config="net-snmp-config"
2226 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2228 if test "x$withval" = "xno"
2230 with_libnetsnmp="no"
2231 else if test "x$withval" = "xyes"
2233 with_libnetsnmp="yes"
2235 if test -x "$withval"
2237 with_snmp_config="$withval"
2238 with_libnetsnmp="yes"
2240 with_snmp_config="$withval/bin/net-snmp-config"
2241 with_libnetsnmp="yes"
2245 [with_libnetsnmp="yes"])
2246 if test "x$with_libnetsnmp" = "xyes"
2248 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2249 snmp_config_status=$?
2251 if test $snmp_config_status -ne 0
2253 with_libnetsnmp="no ($with_snmp_config failed)"
2255 SAVE_CPPFLAGS="$CPPFLAGS"
2256 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2258 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2260 CPPFLAGS="$SAVE_CPPFLAGS"
2263 if test "x$with_libnetsnmp" = "xyes"
2265 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2266 snmp_config_status=$?
2268 if test $snmp_config_status -ne 0
2270 with_libnetsnmp="no ($with_snmp_config failed)"
2272 AC_CHECK_LIB(netsnmp, init_snmp,
2273 [with_libnetsnmp="yes"],
2274 [with_libnetsnmp="no (libnetsnmp not found)"],
2278 if test "x$with_libnetsnmp" = "xyes"
2280 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2281 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2282 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2283 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2285 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2288 # --with-liboconfig {{{
2289 with_own_liboconfig="no"
2290 liboconfig_LDFLAGS="$LDFLAGS"
2291 liboconfig_CPPFLAGS="$CPPFLAGS"
2292 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2294 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2296 if test -d "$withval/lib"
2298 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2300 if test -d "$withval/include"
2302 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2305 if test "x$withval" = "xno"
2307 AC_MSG_ERROR("liboconfig is required")
2311 with_liboconfig="yes"
2314 save_LDFLAGS="$LDFLAGS"
2315 save_CPPFLAGS="$CPPFLAGS"
2316 LDFLAGS="$liboconfig_LDFLAGS"
2317 CPPFLAGS="$liboconfig_CPPFLAGS"
2318 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2320 with_liboconfig="yes"
2321 with_own_liboconfig="no"
2324 with_liboconfig="yes"
2325 with_own_liboconfig="yes"
2326 LDFLAGS="$save_LDFLAGS"
2327 CPPFLAGS="$save_CPPFLAGS"
2330 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2331 if test "x$with_own_liboconfig" = "xyes"
2333 with_liboconfig="yes (shipped version)"
2337 # --with-liboping {{{
2338 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2340 if test "x$withval" = "xyes"
2343 else if test "x$withval" = "xno"
2348 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2349 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2352 [with_liboping="yes"])
2354 SAVE_CPPFLAGS="$CPPFLAGS"
2355 SAVE_LDFLAGS="$LDFLAGS"
2357 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2358 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2360 if test "x$with_liboping" = "xyes"
2362 if test "x$LIBOPING_CPPFLAGS" != "x"
2364 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2366 AC_CHECK_HEADERS(oping.h,
2367 [with_liboping="yes"],
2368 [with_liboping="no ('oping.h' not found)"])
2370 if test "x$with_liboping" = "xyes"
2372 if test "x$LIBOPING_LDFLAGS" != "x"
2374 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2376 AC_CHECK_LIB(oping, ping_construct,
2377 [with_liboping="yes"],
2378 [with_liboping="no (symbol 'ping_construct' not found)"])
2381 CPPFLAGS="$SAVE_CPPFLAGS"
2382 LDFLAGS="$SAVE_LDFLAGS"
2384 if test "x$with_liboping" = "xyes"
2386 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2387 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2388 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2389 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2391 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2395 with_oracle_cppflags=""
2397 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2399 if test "x$withval" = "xyes"
2401 if test "x$ORACLE_HOME" = "x"
2403 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2406 else if test "x$withval" = "xno"
2411 ORACLE_HOME="$withval"
2415 if test "x$ORACLE_HOME" = "x"
2417 with_oracle="no (ORACLE_HOME is not set)"
2422 if test "x$ORACLE_HOME" != "x"
2424 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2426 if test -e "$ORACLE_HOME/lib/ldflags"
2428 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2430 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2431 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2433 if test "x$with_oracle" = "xyes"
2435 SAVE_CPPFLAGS="$CPPFLAGS"
2436 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2438 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2440 CPPFLAGS="$SAVE_CPPFLAGS"
2442 if test "x$with_oracle" = "xyes"
2444 SAVE_CPPFLAGS="$CPPFLAGS"
2445 SAVE_LDFLAGS="$LDFLAGS"
2446 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2447 LDFLAGS="$LDFLAGS $with_oracle_libs"
2449 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2451 CPPFLAGS="$SAVE_CPPFLAGS"
2452 LDFLAGS="$SAVE_LDFLAGS"
2454 if test "x$with_oracle" = "xyes"
2456 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2457 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2458 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2459 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2463 # --with-libowcapi {{{
2464 with_libowcapi_cppflags=""
2465 with_libowcapi_libs="-lowcapi"
2466 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2468 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2470 with_libowcapi_cppflags="-I$withval/include"
2471 with_libowcapi_libs="-L$withval/lib -lowcapi"
2472 with_libowcapi="yes"
2474 with_libowcapi="$withval"
2478 with_libowcapi="yes"
2480 if test "x$with_libowcapi" = "xyes"
2482 SAVE_CPPFLAGS="$CPPFLAGS"
2483 CPPFLAGS="$with_libowcapi_cppflags"
2485 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2487 CPPFLAGS="$SAVE_CPPFLAGS"
2489 if test "x$with_libowcapi" = "xyes"
2491 SAVE_LDFLAGS="$LDFLAGS"
2492 SAVE_CPPFLAGS="$CPPFLAGS"
2493 LDFLAGS="$with_libowcapi_libs"
2494 CPPFLAGS="$with_libowcapi_cppflags"
2496 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2498 LDFLAGS="$SAVE_LDFLAGS"
2499 CPPFLAGS="$SAVE_CPPFLAGS"
2501 if test "x$with_libowcapi" = "xyes"
2503 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2504 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2505 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2506 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2510 # --with-libpcap {{{
2511 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2513 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2515 LDFLAGS="$LDFLAGS -L$withval/lib"
2516 CPPFLAGS="$CPPFLAGS -I$withval/include"
2519 with_libpcap="$withval"
2525 if test "x$with_libpcap" = "xyes"
2527 AC_CHECK_LIB(pcap, pcap_open_live,
2529 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2530 ], [with_libpcap="no (libpcap not found)"])
2532 if test "x$with_libpcap" = "xyes"
2534 AC_CHECK_HEADERS(pcap.h,
2536 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
2537 ], [with_libpcap="no (pcap.h not found)"])
2539 if test "x$with_libpcap" = "xyes"
2545 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
2546 [Wether or not to use the pcap library])
2547 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2550 # --with-libperl {{{
2551 perl_interpreter="perl"
2552 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2554 if test -x "$withval"
2556 perl_interpreter="$withval"
2558 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2560 LDFLAGS="$LDFLAGS -L$withval/lib"
2561 CPPFLAGS="$CPPFLAGS -I$withval/include"
2562 perl_interpreter="$withval/bin/perl"
2565 with_libperl="$withval"
2572 AC_MSG_CHECKING([for perl])
2573 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2574 if test -x "$perl_interpreter"
2576 AC_MSG_RESULT([yes ($perl_interpreter)])
2582 AC_SUBST(PERL, "$perl_interpreter")
2584 if test "x$with_libperl" = "xyes" \
2585 && test -n "$perl_interpreter"
2587 SAVE_CFLAGS="$CFLAGS"
2588 SAVE_LDFLAGS="$LDFLAGS"
2589 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2590 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2591 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2592 CFLAGS="$CFLAGS $PERL_CFLAGS"
2593 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2595 AC_CACHE_CHECK([for libperl],
2596 [c_cv_have_libperl],
2600 #define PERL_NO_GET_CONTEXT
2607 load_module (PERL_LOADMOD_NOIMPORT,
2608 newSVpv ("Collectd::Plugin::FooBar", 24),
2611 [c_cv_have_libperl="yes"],
2612 [c_cv_have_libperl="no"]
2616 if test "x$c_cv_have_libperl" = "xyes"
2618 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2619 AC_SUBST(PERL_CFLAGS)
2620 AC_SUBST(PERL_LDFLAGS)
2625 CFLAGS="$SAVE_CFLAGS"
2626 LDFLAGS="$SAVE_LDFLAGS"
2627 else if test -z "$perl_interpreter"; then
2628 with_libperl="no (no perl interpreter found)"
2629 c_cv_have_libperl="no"
2631 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2633 if test "x$with_libperl" = "xyes"
2635 SAVE_CFLAGS="$CFLAGS"
2636 SAVE_LDFLAGS="$LDFLAGS"
2637 CFLAGS="$CFLAGS $PERL_CFLAGS"
2638 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2640 AC_CACHE_CHECK([if perl supports ithreads],
2641 [c_cv_have_perl_ithreads],
2649 #if !defined(USE_ITHREADS)
2650 # error "Perl does not support ithreads!"
2651 #endif /* !defined(USE_ITHREADS) */
2654 [c_cv_have_perl_ithreads="yes"],
2655 [c_cv_have_perl_ithreads="no"]
2659 if test "x$c_cv_have_perl_ithreads" = "xyes"
2661 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2664 CFLAGS="$SAVE_CFLAGS"
2665 LDFLAGS="$SAVE_LDFLAGS"
2668 if test "x$with_libperl" = "xyes"
2670 SAVE_CFLAGS="$CFLAGS"
2671 SAVE_LDFLAGS="$LDFLAGS"
2672 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2673 # (see issues #41 and #42)
2674 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2675 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2677 AC_CACHE_CHECK([for broken Perl_load_module()],
2678 [c_cv_have_broken_perl_load_module],
2682 #define PERL_NO_GET_CONTEXT
2689 load_module (PERL_LOADMOD_NOIMPORT,
2690 newSVpv ("Collectd::Plugin::FooBar", 24),
2693 [c_cv_have_broken_perl_load_module="no"],
2694 [c_cv_have_broken_perl_load_module="yes"]
2698 CFLAGS="$SAVE_CFLAGS"
2699 LDFLAGS="$SAVE_LDFLAGS"
2701 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2702 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2704 if test "x$with_libperl" = "xyes"
2706 SAVE_CFLAGS="$CFLAGS"
2707 SAVE_LDFLAGS="$LDFLAGS"
2708 CFLAGS="$CFLAGS $PERL_CFLAGS"
2709 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2712 [struct mgvtbl.svt_local],
2713 [have_struct_mgvtbl_svt_local="yes"],
2714 [have_struct_mgvtbl_svt_local="no"],
2721 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2723 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2724 [Define if Perl's struct mgvtbl has member svt_local.])
2727 CFLAGS="$SAVE_CFLAGS"
2728 LDFLAGS="$SAVE_LDFLAGS"
2733 with_pg_config="pg_config"
2734 with_libpq_includedir=""
2735 with_libpq_libdir=""
2736 with_libpq_cppflags=""
2737 with_libpq_ldflags=""
2738 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2741 if test "x$withval" = "xno"
2744 else if test "x$withval" = "xyes"
2748 if test -f "$withval" && test -x "$withval";
2750 with_pg_config="$withval"
2751 else if test -x "$withval/bin/pg_config"
2753 with_pg_config="$withval/bin/pg_config"
2761 if test "x$with_libpq" = "xyes"
2763 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2766 if test $pg_config_status -eq 0
2768 if test -n "$with_libpq_includedir"; then
2769 for dir in $with_libpq_includedir; do
2770 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2774 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2777 SAVE_CPPFLAGS="$CPPFLAGS"
2778 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2780 AC_CHECK_HEADERS(libpq-fe.h, [],
2781 [with_libpq="no (libpq-fe.h not found)"], [])
2783 CPPFLAGS="$SAVE_CPPFLAGS"
2785 if test "x$with_libpq" = "xyes"
2787 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2790 if test $pg_config_status -eq 0
2792 if test -n "$with_libpq_libdir"; then
2793 for dir in $with_libpq_libdir; do
2794 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2798 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2801 SAVE_LDFLAGS="$LDFLAGS"
2802 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2804 AC_CHECK_LIB(pq, PQconnectdb,
2806 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2808 AC_CHECK_LIB(pq, PQserverVersion,
2810 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2812 LDFLAGS="$SAVE_LDFLAGS"
2814 if test "x$with_libpq" = "xyes"
2816 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2817 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2818 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2819 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2821 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2824 # --with-libpthread {{{
2825 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2826 [ if test "x$withval" != "xno" \
2827 && test "x$withval" != "xyes"
2829 LDFLAGS="$LDFLAGS -L$withval/lib"
2830 CPPFLAGS="$CPPFLAGS -I$withval/include"
2831 with_libpthread="yes"
2833 if test "x$withval" = "xno"
2835 with_libpthread="no (disabled)"
2838 ], [with_libpthread="yes"])
2839 if test "x$with_libpthread" = "xyes"
2841 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2844 if test "x$with_libpthread" = "xyes"
2846 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2848 if test "x$with_libpthread" = "xyes"
2854 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2855 [Wether or not to use pthread (POSIX threads) library])
2856 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2861 with_python_path="$PATH"
2862 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
2864 if test "x$withval" = "xyes" || test "x$withval" = "xno"
2866 with_python="$withval"
2867 else if test -x "$withval"
2869 with_python_prog="$withval"
2870 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
2872 else if test -d "$withval"
2874 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
2877 AC_MSG_WARN([Argument not recognized: $withval])
2879 ], [with_python="yes"])
2882 SAVE_CPPFLAGS="$CPPFLAGS"
2883 SAVE_LDFLAGS="$LDFLAGS"
2886 PATH="$with_python_path"
2888 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
2890 AC_MSG_CHECKING([for python])
2891 with_python_prog="`which python 2>/dev/null`"
2892 if test "x$with_python_prog" = "x"
2894 AC_MSG_RESULT([not found])
2895 with_python="no (interpreter not found)"
2897 AC_MSG_RESULT([$with_python_prog])
2901 if test "x$with_python" = "xyes"
2903 AC_MSG_CHECKING([for Python CPPFLAGS])
2904 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
2905 python_config_status=$?
2907 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
2909 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
2912 AC_MSG_RESULT([$python_include_path])
2916 if test "x$with_python" = "xyes"
2918 CPPFLAGS="-I$python_include_path $CPPFLAGS"
2919 AC_CHECK_HEADERS(Python.h,
2920 [with_python="yes"],
2921 [with_python="no ('Python.h' not found)"])
2924 if test "x$with_python" = "xyes"
2926 AC_MSG_CHECKING([for Python LDFLAGS])
2927 python_library_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0))" | "$with_python_prog" 2>&1`
2928 python_config_status=$?
2930 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
2932 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
2935 AC_MSG_RESULT([$python_library_path])
2939 if test "x$with_python" = "xyes"
2941 AC_MSG_CHECKING([for Python LIBS])
2942 python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>&1`
2943 python_config_status=$?
2945 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
2947 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
2950 AC_MSG_RESULT([$python_library_flags])
2954 if test "x$with_python" = "xyes"
2956 LDFLAGS="-L$python_library_path $LDFLAGS"
2957 LIBS="$python_library_flags $LIBS"
2959 AC_CHECK_FUNC(PyObject_CallFunction,
2960 [with_python="yes"],
2961 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
2965 CPPFLAGS="$SAVE_CPPFLAGS"
2966 LDFLAGS="$SAVE_LDFLAGS"
2969 if test "x$with_python" = "xyes"
2971 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
2972 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
2973 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
2974 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
2975 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
2976 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
2980 # --with-librouteros {{{
2981 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
2983 if test "x$withval" = "xyes"
2985 with_librouteros="yes"
2986 else if test "x$withval" = "xno"
2988 with_librouteros="no"
2990 with_librouteros="yes"
2991 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
2992 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
2995 [with_librouteros="yes"])
2997 SAVE_CPPFLAGS="$CPPFLAGS"
2998 SAVE_LDFLAGS="$LDFLAGS"
3000 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3001 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3003 if test "x$with_librouteros" = "xyes"
3005 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3007 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3009 AC_CHECK_HEADERS(routeros_api.h,
3010 [with_librouteros="yes"],
3011 [with_librouteros="no ('routeros_api.h' not found)"])
3013 if test "x$with_librouteros" = "xyes"
3015 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3017 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3019 AC_CHECK_LIB(routeros, ros_interface,
3020 [with_librouteros="yes"],
3021 [with_librouteros="no (symbol 'ros_interface' not found)"])
3024 CPPFLAGS="$SAVE_CPPFLAGS"
3025 LDFLAGS="$SAVE_LDFLAGS"
3027 if test "x$with_librouteros" = "xyes"
3029 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3030 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3031 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3032 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3034 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3038 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3041 librrd_threadsafe="yes"
3042 librrd_rrdc_update="no"
3043 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3044 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3046 librrd_cflags="-I$withval/include"
3047 librrd_ldflags="-L$withval/lib"
3050 with_librrd="$withval"
3052 ], [with_librrd="yes"])
3053 if test "x$with_librrd" = "xyes"
3055 SAVE_CPPFLAGS="$CPPFLAGS"
3056 SAVE_LDFLAGS="$LDFLAGS"
3058 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3059 LDFLAGS="$LDFLAGS $librrd_ldflags"
3061 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3063 CPPFLAGS="$SAVE_CPPFLAGS"
3064 LDFLAGS="$SAVE_LDFLAGS"
3066 if test "x$with_librrd" = "xyes"
3068 SAVE_CPPFLAGS="$CPPFLAGS"
3069 SAVE_LDFLAGS="$LDFLAGS"
3071 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3072 LDFLAGS="$LDFLAGS $librrd_ldflags"
3074 AC_CHECK_LIB(rrd_th, rrd_update_r,
3076 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3078 [librrd_threadsafe="no"
3079 AC_CHECK_LIB(rrd, rrd_update,
3081 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3083 [with_librrd="no (symbol 'rrd_update' not found)"],
3088 if test "x$librrd_threadsafe" = "xyes"
3090 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3092 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3095 CPPFLAGS="$SAVE_CPPFLAGS"
3096 LDFLAGS="$SAVE_LDFLAGS"
3098 if test "x$with_librrd" = "xyes"
3100 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3101 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3102 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3103 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3105 if test "x$librrd_threadsafe" = "xyes"
3107 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3111 # --with-libsensors {{{
3112 with_sensors_cflags=""
3113 with_sensors_ldflags=""
3114 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3116 if test "x$withval" = "xno"
3118 with_libsensors="no"
3120 with_libsensors="yes"
3121 if test "x$withval" != "xyes"
3123 with_sensors_cflags="-I$withval/include"
3124 with_sensors_ldflags="-L$withval/lib"
3125 with_libsensors="yes"
3130 if test "x$ac_system" = "xLinux"
3132 with_libsensors="yes"
3134 with_libsensors="no (Linux only library)"
3137 if test "x$with_libsensors" = "xyes"
3139 SAVE_CPPFLAGS="$CPPFLAGS"
3140 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3142 # AC_CHECK_HEADERS(sensors/sensors.h,
3144 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3146 # [with_libsensors="no (sensors/sensors.h not found)"])
3147 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3149 CPPFLAGS="$SAVE_CPPFLAGS"
3151 if test "x$with_libsensors" = "xyes"
3153 SAVE_CPPFLAGS="$CPPFLAGS"
3154 SAVE_LDFLAGS="$LDFLAGS"
3155 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3156 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3158 AC_CHECK_LIB(sensors, sensors_init,
3160 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3162 [with_libsensors="no (libsensors not found)"])
3164 CPPFLAGS="$SAVE_CPPFLAGS"
3165 LDFLAGS="$SAVE_LDFLAGS"
3167 if test "x$with_libsensors" = "xyes"
3169 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3170 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3171 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3172 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3174 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3177 # --with-libstatgrab {{{
3178 with_libstatgrab_cflags=""
3179 with_libstatgrab_ldflags=""
3180 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3182 if test "x$withval" != "xno" \
3183 && test "x$withval" != "xyes"
3185 with_libstatgrab_cflags="-I$withval/include"
3186 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3187 with_libstatgrab="yes"
3188 with_libstatgrab_pkg_config="no"
3190 with_libstatgrab="$withval"
3191 with_libstatgrab_pkg_config="yes"
3195 with_libstatgrab="yes"
3196 with_libstatgrab_pkg_config="yes"
3199 if test "x$with_libstatgrab" = "xyes" \
3200 && test "x$with_libstatgrab_pkg_config" = "xyes"
3202 if test "x$PKG_CONFIG" != "x"
3204 AC_MSG_CHECKING([pkg-config for libstatgrab])
3206 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3209 with_libstatgrab_pkg_config="no"
3210 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
3211 temp_result="not found"
3213 AC_MSG_RESULT([$temp_result])
3215 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3216 with_libstatgrab_pkg_config="no"
3217 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3221 if test "x$with_libstatgrab" = "xyes" \
3222 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3223 && test "x$with_libstatgrab_cflags" = "x"
3225 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3226 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3229 with_libstatgrab_cflags="$temp_result"
3231 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3232 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3234 AC_MSG_RESULT([$temp_result])
3237 if test "x$with_libstatgrab" = "xyes" \
3238 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3239 && test "x$with_libstatgrab_ldflags" = "x"
3241 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3242 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3245 with_libstatgrab_ldflags="$temp_result"
3247 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3248 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3250 AC_MSG_RESULT([$temp_result])
3253 if test "x$with_libstatgrab" = "xyes"
3255 SAVE_CPPFLAGS="$CPPFLAGS"
3256 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3258 AC_CHECK_HEADERS(statgrab.h,
3259 [with_libstatgrab="yes"],
3260 [with_libstatgrab="no (statgrab.h not found)"])
3262 CPPFLAGS="$SAVE_CPPFLAGS"
3265 if test "x$with_libstatgrab" = "xyes"
3267 SAVE_CFLAGS="$CFLAGS"
3268 SAVE_LDFLAGS="$LDFLAGS"
3270 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3271 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3273 AC_CHECK_LIB(statgrab, sg_init,
3274 [with_libstatgrab="yes"],
3275 [with_libstatgrab="no (symbol sg_init not found)"])
3277 CFLAGS="$SAVE_CFLAGS"
3278 LDFLAGS="$SAVE_LDFLAGS"
3281 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3282 if test "x$with_libstatgrab" = "xyes"
3284 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3285 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3286 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3287 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3288 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3292 # --with-libtokyotyrant {{{
3293 with_libtokyotyrant_cppflags=""
3294 with_libtokyotyrant_ldflags=""
3295 with_libtokyotyrant_libs=""
3296 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3298 if test "x$withval" = "xno"
3300 with_libtokyotyrant="no"
3301 else if test "x$withval" = "xyes"
3303 with_libtokyotyrant="yes"
3305 with_libtokyotyrant_cppflags="-I$withval/include"
3306 with_libtokyotyrant_ldflags="-L$withval/include"
3307 with_libtokyotyrant_libs="-ltokyotyrant"
3308 with_libtokyotyrant="yes"
3312 with_libtokyotyrant="yes"
3315 if test "x$with_libtokyotyrant" = "xyes"
3317 if $PKG_CONFIG --exists tokyotyrant
3319 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3320 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3321 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3325 SAVE_CPPFLAGS="$CPPFLAGS"
3326 SAVE_LDFLAGS="$LDFLAGS"
3327 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3328 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3330 if test "x$with_libtokyotyrant" = "xyes"
3332 AC_CHECK_HEADERS(tcrdb.h,
3334 AC_DEFINE(HAVE_TCRDB_H, 1,
3335 [Define to 1 if you have the <tcrdb.h> header file.])
3336 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3339 if test "x$with_libtokyotyrant" = "xyes"
3341 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3343 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3344 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3346 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3347 [$with_libtokyotyrant_libs])
3350 CPPFLAGS="$SAVE_CPPFLAGS"
3351 LDFLAGS="$SAVE_LDFLAGS"
3353 if test "x$with_libtokyotyrant" = "xyes"
3355 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3356 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3357 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3358 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3359 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3360 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3362 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3365 # --with-libupsclient {{{
3366 with_libupsclient_config=""
3367 with_libupsclient_cflags=""
3368 with_libupsclient_libs=""
3369 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3371 if test "x$withval" = "xno"
3373 with_libupsclient="no"
3374 else if test "x$withval" = "xyes"
3376 with_libupsclient="use_pkgconfig"
3378 if test -x "$withval"
3380 with_libupsclient_config="$withval"
3381 with_libupsclient="use_libupsclient_config"
3382 else if test -x "$withval/bin/libupsclient-config"
3384 with_libupsclient_config="$withval/bin/libupsclient-config"
3385 with_libupsclient="use_libupsclient_config"
3387 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3388 with_libupsclient_cflags="-I$withval/include"
3389 with_libupsclient_libs="-L$withval/lib -lupsclient"
3390 with_libupsclient="yes"
3394 [with_libupsclient="use_pkgconfig"])
3396 # configure using libupsclient-config
3397 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3399 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3400 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3403 with_libupsclient="no ($with_libupsclient_config failed)"
3405 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3408 with_libupsclient="no ($with_libupsclient_config failed)"
3411 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3413 with_libupsclient="yes"
3416 # configure using pkg-config
3417 if test "x$with_libupsclient" = "xuse_pkgconfig"
3419 if test "x$PKG_CONFIG" = "x"
3421 with_libupsclient="no (Don't have pkg-config)"
3424 if test "x$with_libupsclient" = "xuse_pkgconfig"
3426 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3427 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3430 with_libupsclient="no (pkg-config doesn't know library)"
3433 if test "x$with_libupsclient" = "xuse_pkgconfig"
3435 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3438 with_libupsclient="no ($PKG_CONFIG failed)"
3440 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3443 with_libupsclient="no ($PKG_CONFIG failed)"
3446 if test "x$with_libupsclient" = "xuse_pkgconfig"
3448 with_libupsclient="yes"
3451 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3452 # the actual checks.
3453 if test "x$with_libupsclient" = "xyes"
3455 SAVE_CPPFLAGS="$CPPFLAGS"
3456 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3458 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3460 CPPFLAGS="$SAVE_CPPFLAGS"
3462 if test "x$with_libupsclient" = "xyes"
3464 SAVE_CPPFLAGS="$CPPFLAGS"
3465 SAVE_LDFLAGS="$LDFLAGS"
3467 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3468 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3470 AC_CHECK_LIB(upsclient, upscli_connect,
3471 [with_libupsclient="yes"],
3472 [with_libupsclient="no (symbol upscli_connect not found)"])
3474 CPPFLAGS="$SAVE_CPPFLAGS"
3475 LDFLAGS="$SAVE_LDFLAGS"
3477 if test "x$with_libupsclient" = "xyes"
3479 SAVE_CPPFLAGS="$CPPFLAGS"
3480 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3482 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3483 [#include <stdlib.h>
3485 #include <upsclient.h>])
3487 CPPFLAGS="$SAVE_CPPFLAGS"
3489 if test "x$with_libupsclient" = "xyes"
3491 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3492 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3493 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3494 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3498 # --with-libxmms {{{
3499 with_xmms_config="xmms-config"
3502 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3504 if test "x$withval" != "xno" \
3505 && test "x$withval" != "xyes"
3507 if test -f "$withval" && test -x "$withval";
3509 with_xmms_config="$withval"
3510 else if test -x "$withval/bin/xmms-config"
3512 with_xmms_config="$withval/bin/xmms-config"
3515 else if test "x$withval" = "xno"
3525 if test "x$with_libxmms" = "xyes"
3527 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3528 xmms_config_status=$?
3530 if test $xmms_config_status -ne 0
3535 if test "x$with_libxmms" = "xyes"
3537 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3538 xmms_config_status=$?
3540 if test $xmms_config_status -ne 0
3545 if test "x$with_libxmms" = "xyes"
3547 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3549 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3550 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3551 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3552 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3559 with_libxmms_numeric=0
3560 if test "x$with_libxmms" = "xyes"
3562 with_libxmms_numeric=1
3564 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3565 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3568 # --with-libyajl {{{
3569 with_libyajl_cppflags=""
3570 with_libyajl_ldflags=""
3571 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3573 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3575 with_libyajl_cppflags="-I$withval/include"
3576 with_libyajl_ldflags="-L$withval/lib"
3579 with_libyajl="$withval"
3585 if test "x$with_libyajl" = "xyes"
3587 SAVE_CPPFLAGS="$CPPFLAGS"
3588 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3590 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3592 CPPFLAGS="$SAVE_CPPFLAGS"
3594 if test "x$with_libyajl" = "xyes"
3596 SAVE_CPPFLAGS="$CPPFLAGS"
3597 SAVE_LDFLAGS="$LDFLAGS"
3598 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3599 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3601 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3603 CPPFLAGS="$SAVE_CPPFLAGS"
3604 LDFLAGS="$SAVE_LDFLAGS"
3606 if test "x$with_libyajl" = "xyes"
3608 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3609 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3610 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3611 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3612 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3613 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3614 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3616 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3619 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3620 with_libxml2="no (pkg-config isn't available)"
3621 with_libxml2_cflags=""
3622 with_libxml2_ldflags=""
3623 with_libvirt="no (pkg-config isn't available)"
3624 with_libvirt_cflags=""
3625 with_libvirt_ldflags=""
3626 if test "x$PKG_CONFIG" != "x"
3628 pkg-config --exists 'libxml-2.0' 2>/dev/null
3633 with_libxml2="no (pkg-config doesn't know library)"
3636 pkg-config --exists libvirt 2>/dev/null
3641 with_libvirt="no (pkg-config doesn't know library)"
3644 if test "x$with_libxml2" = "xyes"
3646 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3651 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3657 if test "x$with_libxml2" = "xyes"
3659 SAVE_CPPFLAGS="$CPPFLAGS"
3660 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3662 AC_CHECK_HEADERS(libxml/parser.h, [],
3663 [with_libxml2="no (libxml/parser.h not found)"])
3665 CPPFLAGS="$SAVE_CPPFLAGS"
3667 if test "x$with_libxml2" = "xyes"
3669 SAVE_CFLAGS="$CFLAGS"
3670 SAVE_LDFLAGS="$LDFLAGS"
3672 CFLAGS="$CFLAGS $with_libxml2_cflags"
3673 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3675 AC_CHECK_LIB(xml2, xmlXPathEval,
3676 [with_libxml2="yes"],
3677 [with_libxml2="no (symbol xmlXPathEval not found)"])
3679 CFLAGS="$SAVE_CFLAGS"
3680 LDFLAGS="$SAVE_LDFLAGS"
3682 dnl Add the right compiler flags and libraries.
3683 if test "x$with_libxml2" = "xyes"; then
3684 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3685 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3686 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3687 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3689 if test "x$with_libvirt" = "xyes"
3691 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3696 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3702 if test "x$with_libvirt" = "xyes"
3704 SAVE_CPPFLAGS="$CPPFLAGS"
3705 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3707 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3708 [with_libvirt="no (libvirt/libvirt.h not found)"])
3710 CPPFLAGS="$SAVE_CPPFLAGS"
3712 if test "x$with_libvirt" = "xyes"
3714 SAVE_CFLAGS="$CFLAGS"
3715 SAVE_LDFLAGS="$LDFLAGS"
3717 CFLAGS="$CFLAGS $with_libvirt_cflags"
3718 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3720 AC_CHECK_LIB(virt, virDomainBlockStats,
3721 [with_libvirt="yes"],
3722 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3724 CFLAGS="$SAVE_CFLAGS"
3725 LDFLAGS="$SAVE_LDFLAGS"
3727 dnl Add the right compiler flags and libraries.
3728 if test "x$with_libvirt" = "xyes"; then
3729 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3730 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3731 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3732 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3736 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3737 with_libopenipmipthread="yes"
3738 with_libopenipmipthread_cflags=""
3739 with_libopenipmipthread_libs=""
3741 AC_MSG_CHECKING([for pkg-config])
3743 if test "x$PKG_CONFIG" = "x"
3745 with_libopenipmipthread="no"
3748 temp_result="$PKG_CONFIG"
3750 AC_MSG_RESULT([$temp_result])
3752 if test "x$with_libopenipmipthread" = "xyes"
3754 AC_MSG_CHECKING([for libOpenIPMIpthread])
3755 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3758 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3760 AC_MSG_RESULT([$with_libopenipmipthread])
3763 if test "x$with_libopenipmipthread" = "xyes"
3765 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3766 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3769 with_libopenipmipthread_cflags="$temp_result"
3771 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3772 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3774 AC_MSG_RESULT([$temp_result])
3777 if test "x$with_libopenipmipthread" = "xyes"
3779 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3780 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3783 with_libopenipmipthread_ldflags="$temp_result"
3785 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3786 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3788 AC_MSG_RESULT([$temp_result])
3791 if test "x$with_libopenipmipthread" = "xyes"
3793 SAVE_CPPFLAGS="$CPPFLAGS"
3794 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3796 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3797 [with_libopenipmipthread="yes"],
3798 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3799 [#include <OpenIPMI/ipmiif.h>
3800 #include <OpenIPMI/ipmi_err.h>
3801 #include <OpenIPMI/ipmi_posix.h>
3802 #include <OpenIPMI/ipmi_conn.h>
3805 CPPFLAGS="$SAVE_CPPFLAGS"
3808 if test "x$with_libopenipmipthread" = "xyes"
3810 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3811 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3812 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3813 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3817 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3818 [with_libnotify="yes"],
3819 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3821 # Check for enabled/disabled features
3824 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3825 # ------------------------------------------------------------
3827 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3832 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3837 m4_define([EnDis],[disabled])dnl
3838 m4_define([YesNo],[no])dnl
3844 m4_define([EnDis],[enabled])dnl
3845 m4_define([YesNo],[yes])dnl
3848 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3852 m4_if([$3], [feature], [],
3856 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3862 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3864 enable_$1='[YesNo]'dnl
3866 if test "x$enable_$1" = "xno"
3870 if test "x$enable_$1" = "xyes"
3874 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3879 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3880 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3882 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3884 # AC_PLUGIN(name, default, info)
3885 # ------------------------------------------------------------
3892 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3894 if test "x$enableval" = "xyes"
3897 else if test "x$enableval" = "xforce"
3902 enable_plugin="no (disabled on command line)"
3906 if test "x$enable_all_plugins" = "xauto"
3908 if test "x$2" = "xyes"
3915 enable_plugin="$enable_all_plugins"
3918 if test "x$enable_plugin" = "xyes"
3920 if test "x$2" = "xyes" || test "x$force" = "xyes"
3922 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3923 if test "x$2" != "xyes"
3925 dependency_warning="yes"
3927 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3928 dependency_error="yes"
3929 enable_plugin="no (dependency error)"
3932 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3933 enable_$1="$enable_plugin"
3935 )# AC_PLUGIN(name, default, info)
3937 m4_divert_once([HELP_ENABLE], [
3938 collectd features:])
3939 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3940 AC_COLLECTD([debug], [enable], [feature], [debugging])
3941 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3942 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3944 dependency_warning="no"
3945 dependency_error="no"
3950 plugin_conntrack="no"
3951 plugin_contextswitch="no"
3954 plugin_curl_json="no"
3955 plugin_curl_xml="no"
3959 plugin_interface="no"
3966 plugin_multimeter="no"
3970 plugin_processes="no"
3971 plugin_protocols="no"
3975 plugin_tcpconns="no"
3982 plugin_wireless="no"
3986 if test "x$ac_system" = "xLinux"
3988 plugin_battery="yes"
3989 plugin_conntrack="yes"
3990 plugin_contextswitch="yes"
3992 plugin_cpufreq="yes"
3994 plugin_entropy="yes"
3995 plugin_interface="yes"
4000 plugin_fscache="yes"
4001 plugin_processes="yes"
4002 plugin_protocols="yes"
4005 plugin_tcpconns="yes"
4006 plugin_thermal="yes"
4009 plugin_vserver="yes"
4010 plugin_wireless="yes"
4012 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
4018 if test "x$ac_system" = "xOpenBSD"
4020 plugin_tcpconns="yes"
4024 if test "x$with_libiokit" = "xyes"
4026 plugin_battery="yes"
4031 if test "x$with_perfstat" = "xyes"
4037 plugin_interface="yes"
4041 if test "x$with_procinfo" = "xyes"
4043 plugin_processes="yes"
4047 if test "x$with_kstat" = "xyes"
4050 plugin_zfs_arc="yes"
4053 if test "x$with_devinfo$with_kstat" = "xyesyes"
4057 plugin_interface="yes"
4062 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
4068 if test "x$with_libstatgrab" = "xyes"
4072 plugin_interface="yes"
4079 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4085 if test "x$with_libopenipmipthread" = "xyes"
4090 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4092 plugin_curl_json="yes"
4095 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4097 plugin_curl_xml="yes"
4100 if test "x$have_processor_info" = "xyes"
4104 if test "x$have_sysctl" = "xyes"
4111 if test "x$have_sysctlbyname" = "xyes"
4115 plugin_tcpconns="yes"
4118 # Df plugin: Check if we know how to determine mount points first.
4119 #if test "x$have_listmntent" = "xyes"; then
4122 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4126 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4130 #if test "x$have_getmntent" = "xseq"
4134 if test "x$c_cv_have_one_getmntent" = "xyes"
4139 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4140 if test "x$plugin_df" = "xyes"
4143 if test "x$have_statfs" = "xyes"
4147 if test "x$have_statvfs" = "xyes"
4153 if test "x$have_getifaddrs" = "xyes"
4155 plugin_interface="yes"
4158 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4160 plugin_libvirt="yes"
4163 if test "x$have_getloadavg" = "xyes"
4168 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4173 # Mac OS X memory interface
4174 if test "x$have_host_statistics" = "xyes"
4179 if test "x$have_termios_h" = "xyes"
4181 plugin_multimeter="yes"
4185 if test "x$have_thread_info" = "xyes"
4187 plugin_processes="yes"
4190 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4192 plugin_processes="yes"
4195 if test "x$with_kvm_getswapinfo" = "xyes"
4200 if test "x$have_swapctl" = "xyes"
4205 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4207 plugin_tcpconns="yes"
4210 if test "x$have_getutent" = "xyes"
4214 if test "x$have_getutxent" = "xyes"
4219 m4_divert_once([HELP_ENABLE], [
4222 AC_ARG_ENABLE([all-plugins],
4223 AC_HELP_STRING([--enable-all-plugins],
4224 [enable all plugins (auto by def)]),
4226 if test "x$enableval" = "xyes"
4228 enable_all_plugins="yes"
4229 else if test "x$enableval" = "xauto"
4231 enable_all_plugins="auto"
4233 enable_all_plugins="no"
4236 [enable_all_plugins="auto"])
4238 m4_divert_once([HELP_ENABLE], [])
4240 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4241 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4242 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4243 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4244 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4245 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4246 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4247 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4248 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4249 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4250 AC_PLUGIN([csv], [yes], [CSV output plugin])
4251 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4252 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4253 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4254 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4255 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4256 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4257 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4258 AC_PLUGIN([email], [yes], [EMail statistics])
4259 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4260 AC_PLUGIN([exec], [yes], [Execution of external programs])
4261 AC_PLUGIN([filecount], [yes], [Count files in directories])
4262 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4263 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4264 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4265 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4266 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4267 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4268 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4269 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4270 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4271 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4272 AC_PLUGIN([load], [$plugin_load], [System load])
4273 AC_PLUGIN([logfile], [yes], [File logging plugin])
4274 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4275 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4276 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4277 AC_PLUGIN([match_regex], [yes], [The regex match])
4278 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4279 AC_PLUGIN([match_value], [yes], [The value match])
4280 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4281 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4282 AC_PLUGIN([memcached], [yes], [memcached statistics])
4283 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4284 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4285 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4286 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4287 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4288 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4289 AC_PLUGIN([network], [yes], [Network communication plugin])
4290 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4291 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4292 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4293 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4294 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4295 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4296 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4297 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4298 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4299 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4300 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4301 # FIXME: Check for libevent, too.
4302 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4303 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4304 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4305 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4306 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4307 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4308 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4309 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4310 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4311 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4312 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4313 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4314 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4315 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4316 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4317 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4318 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4319 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4320 AC_PLUGIN([target_notification], [yes], [The notification target])
4321 AC_PLUGIN([target_replace], [yes], [The replace target])
4322 AC_PLUGIN([target_scale],[yes], [The scale target])
4323 AC_PLUGIN([target_set], [yes], [The set target])
4324 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4325 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4326 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4327 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4328 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4329 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4330 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4331 AC_PLUGIN([users], [$plugin_users], [User statistics])
4332 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4333 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4334 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4335 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4336 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4337 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4338 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4340 dnl Default configuration file
4341 # Load either syslog or logfile
4342 LOAD_PLUGIN_SYSLOG=""
4343 LOAD_PLUGIN_LOGFILE=""
4345 AC_MSG_CHECKING([which default log plugin to load])
4346 default_log_plugin="none"
4347 if test "x$enable_syslog" = "xyes"
4349 default_log_plugin="syslog"
4351 LOAD_PLUGIN_SYSLOG="##"
4354 if test "x$enable_logfile" = "xyes"
4356 if test "x$default_log_plugin" = "xnone"
4358 default_log_plugin="logfile"
4360 LOAD_PLUGIN_LOGFILE="#"
4363 LOAD_PLUGIN_LOGFILE="##"
4365 AC_MSG_RESULT([$default_log_plugin])
4367 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4368 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4370 DEFAULT_LOG_LEVEL="info"
4371 if test "x$enable_debug" = "xyes"
4373 DEFAULT_LOG_LEVEL="debug"
4375 AC_SUBST(DEFAULT_LOG_LEVEL)
4377 # Load only one of rrdtool, network, csv in the default config.
4378 LOAD_PLUGIN_RRDTOOL=""
4379 LOAD_PLUGIN_NETWORK=""
4382 AC_MSG_CHECKING([which default write plugin to load])
4383 default_write_plugin="none"
4384 if test "x$enable_rrdtool" = "xyes"
4386 default_write_plugin="rrdtool"
4388 LOAD_PLUGIN_RRDTOOL="##"
4391 if test "x$enable_network" = "xyes"
4393 if test "x$default_write_plugin" = "xnone"
4395 default_write_plugin="network"
4397 LOAD_PLUGIN_NETWORK="#"
4400 LOAD_PLUGIN_NETWORK="##"
4403 if test "x$enable_csv" = "xyes"
4405 if test "x$default_write_plugin" = "xnone"
4407 default_write_plugin="csv"
4412 LOAD_PLUGIN_CSV="##"
4414 AC_MSG_RESULT([$default_write_plugin])
4416 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4417 AC_SUBST(LOAD_PLUGIN_NETWORK)
4418 AC_SUBST(LOAD_PLUGIN_CSV)
4421 if test "x$ac_system" = "xLinux" \
4422 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4424 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4428 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4430 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4432 PERL_BINDINGS_OPTIONS="$withval"
4433 with_perl_bindings="yes"
4435 PERL_BINDINGS_OPTIONS=""
4436 with_perl_bindings="$withval"
4440 PERL_BINDINGS_OPTIONS=""
4441 if test -n "$perl_interpreter"
4443 with_perl_bindings="yes"
4445 with_perl_bindings="no (no perl interpreter found)"
4448 if test "x$with_perl_bindings" = "xyes"
4450 PERL_BINDINGS="perl"
4454 AC_SUBST(PERL_BINDINGS)
4455 AC_SUBST(PERL_BINDINGS_OPTIONS)
4457 dnl libcollectdclient
4458 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4459 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4460 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4462 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4464 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4466 AC_SUBST(LCC_VERSION_MAJOR)
4467 AC_SUBST(LCC_VERSION_MINOR)
4468 AC_SUBST(LCC_VERSION_PATCH)
4469 AC_SUBST(LCC_VERSION_EXTRA)
4470 AC_SUBST(LCC_VERSION_STRING)
4472 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4474 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)
4476 if test "x$with_librrd" = "xyes" \
4477 && test "x$librrd_threadsafe" != "xyes"
4479 with_librrd="yes (warning: librrd is not thread-safe)"
4482 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
4484 with_libiptc="yes (shipped version)"
4487 if test "x$with_libperl" = "xyes"
4489 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4491 enable_perl="no (needs libperl)"
4494 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4496 enable_perl="no (libperl doesn't support ithreads)"
4499 if test "x$with_perl_bindings" = "xyes" \
4500 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4502 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4509 libcurl . . . . . . . $with_libcurl
4510 libdbi . . . . . . . $with_libdbi
4511 libesmtp . . . . . . $with_libesmtp
4512 libganglia . . . . . $with_libganglia
4513 libgcrypt . . . . . . $with_libgcrypt
4514 libiokit . . . . . . $with_libiokit
4515 libiptc . . . . . . . $with_libiptc
4516 libjvm . . . . . . . $with_java
4517 libkstat . . . . . . $with_kstat
4518 libkvm . . . . . . . $with_libkvm
4519 libmemcached . . . . $with_libmemcached
4520 libmodbus . . . . . . $with_libmodbus
4521 libmysql . . . . . . $with_libmysql
4522 libnetapp . . . . . . $with_libnetapp
4523 libnetlink . . . . . $with_libnetlink
4524 libnetsnmp . . . . . $with_libnetsnmp
4525 libnotify . . . . . . $with_libnotify
4526 liboconfig . . . . . $with_liboconfig
4527 libopenipmi . . . . . $with_libopenipmipthread
4528 liboping . . . . . . $with_liboping
4529 libpcap . . . . . . . $with_libpcap
4530 libperfstat . . . . . $with_perfstat
4531 libperl . . . . . . . $with_libperl
4532 libpq . . . . . . . . $with_libpq
4533 libpthread . . . . . $with_libpthread
4534 librouteros . . . . . $with_librouteros
4535 librrd . . . . . . . $with_librrd
4536 libsensors . . . . . $with_libsensors
4537 libstatgrab . . . . . $with_libstatgrab
4538 libtokyotyrant . . . $with_libtokyotyrant
4539 libupsclient . . . . $with_libupsclient
4540 libvirt . . . . . . . $with_libvirt
4541 libxml2 . . . . . . . $with_libxml2
4542 libxmms . . . . . . . $with_libxmms
4543 libyajl . . . . . . . $with_libyajl
4544 libevent . . . . . . $with_libevent
4545 protobuf-c . . . . . $have_protoc_c
4546 oracle . . . . . . . $with_oracle
4547 python . . . . . . . $with_python
4550 daemon mode . . . . . $enable_daemon
4551 debug . . . . . . . . $enable_debug
4554 perl . . . . . . . . $with_perl_bindings
4557 apache . . . . . . . $enable_apache
4558 apcups . . . . . . . $enable_apcups
4559 apple_sensors . . . . $enable_apple_sensors
4560 ascent . . . . . . . $enable_ascent
4561 battery . . . . . . . $enable_battery
4562 bind . . . . . . . . $enable_bind
4563 conntrack . . . . . . $enable_conntrack
4564 contextswitch . . . . $enable_contextswitch
4565 cpu . . . . . . . . . $enable_cpu
4566 cpufreq . . . . . . . $enable_cpufreq
4567 csv . . . . . . . . . $enable_csv
4568 curl . . . . . . . . $enable_curl
4569 curl_json . . . . . . $enable_curl_json
4570 curl_xml . . . . . . $enable_curl_xml
4571 dbi . . . . . . . . . $enable_dbi
4572 df . . . . . . . . . $enable_df
4573 disk . . . . . . . . $enable_disk
4574 dns . . . . . . . . . $enable_dns
4575 email . . . . . . . . $enable_email
4576 entropy . . . . . . . $enable_entropy
4577 exec . . . . . . . . $enable_exec
4578 filecount . . . . . . $enable_filecount
4579 fscache . . . . . . . $enable_fscache
4580 gmond . . . . . . . . $enable_gmond
4581 hddtemp . . . . . . . $enable_hddtemp
4582 interface . . . . . . $enable_interface
4583 ipmi . . . . . . . . $enable_ipmi
4584 iptables . . . . . . $enable_iptables
4585 ipvs . . . . . . . . $enable_ipvs
4586 irq . . . . . . . . . $enable_irq
4587 java . . . . . . . . $enable_java
4588 libvirt . . . . . . . $enable_libvirt
4589 load . . . . . . . . $enable_load
4590 logfile . . . . . . . $enable_logfile
4591 madwifi . . . . . . . $enable_madwifi
4592 match_empty_counter . $enable_match_empty_counter
4593 match_hashed . . . . $enable_match_hashed
4594 match_regex . . . . . $enable_match_regex
4595 match_timediff . . . $enable_match_timediff
4596 match_value . . . . . $enable_match_value
4597 mbmon . . . . . . . . $enable_mbmon
4598 memcachec . . . . . . $enable_memcachec
4599 memcached . . . . . . $enable_memcached
4600 memory . . . . . . . $enable_memory
4601 modbus . . . . . . . $enable_modbus
4602 multimeter . . . . . $enable_multimeter
4603 mysql . . . . . . . . $enable_mysql
4604 netapp . . . . . . . $enable_netapp
4605 netlink . . . . . . . $enable_netlink
4606 network . . . . . . . $enable_network
4607 nfs . . . . . . . . . $enable_nfs
4608 nginx . . . . . . . . $enable_nginx
4609 notify_desktop . . . $enable_notify_desktop
4610 notify_email . . . . $enable_notify_email
4611 ntpd . . . . . . . . $enable_ntpd
4612 nut . . . . . . . . . $enable_nut
4613 olsrd . . . . . . . . $enable_olsrd
4614 onewire . . . . . . . $enable_onewire
4615 openvpn . . . . . . . $enable_openvpn
4616 oracle . . . . . . . $enable_oracle
4617 perl . . . . . . . . $enable_perl
4618 pinba . . . . . . . . $enable_pinba
4619 ping . . . . . . . . $enable_ping
4620 postgresql . . . . . $enable_postgresql
4621 powerdns . . . . . . $enable_powerdns
4622 processes . . . . . . $enable_processes
4623 protocols . . . . . . $enable_protocols
4624 python . . . . . . . $enable_python
4625 routeros . . . . . . $enable_routeros
4626 rrdcached . . . . . . $enable_rrdcached
4627 rrdtool . . . . . . . $enable_rrdtool
4628 sensors . . . . . . . $enable_sensors
4629 serial . . . . . . . $enable_serial
4630 snmp . . . . . . . . $enable_snmp
4631 swap . . . . . . . . $enable_swap
4632 syslog . . . . . . . $enable_syslog
4633 table . . . . . . . . $enable_table
4634 tail . . . . . . . . $enable_tail
4635 tape . . . . . . . . $enable_tape
4636 target_notification . $enable_target_notification
4637 target_replace . . . $enable_target_replace
4638 target_scale . . . . $enable_target_scale
4639 target_set . . . . . $enable_target_set
4640 tcpconns . . . . . . $enable_tcpconns
4641 teamspeak2 . . . . . $enable_teamspeak2
4642 ted . . . . . . . . . $enable_ted
4643 thermal . . . . . . . $enable_thermal
4644 tokyotyrant . . . . . $enable_tokyotyrant
4645 unixsock . . . . . . $enable_unixsock
4646 uptime . . . . . . . $enable_uptime
4647 users . . . . . . . . $enable_users
4648 uuid . . . . . . . . $enable_uuid
4649 vmem . . . . . . . . $enable_vmem
4650 vserver . . . . . . . $enable_vserver
4651 wireless . . . . . . $enable_wireless
4652 write_http . . . . . $enable_write_http
4653 xmms . . . . . . . . $enable_xmms
4654 zfs_arc . . . . . . . $enable_zfs_arc
4658 if test "x$dependency_error" = "xyes"; then
4659 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
4662 if test "x$dependency_warning" = "xyes"; then
4663 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
4666 # vim: set fdm=marker :