1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
5 AC_CONFIG_AUX_DIR([libltdl/config])
7 m4_ifdef([LT_PACKAGE_VERSION],
10 LT_CONFIG_LTDL_DIR([libltdl])
12 LTDL_INIT([convenience])
13 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
18 AC_LIBLTDL_CONVENIENCE
22 AC_CONFIG_SUBDIRS(libltdl)
23 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
27 AM_INIT_AUTOMAKE(dist-bzip2)
30 AC_PREFIX_DEFAULT("/opt/collectd")
35 # Checks for programs.
43 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
51 AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
52 AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
54 AC_MSG_CHECKING([for kernel type ($host_os)])
57 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
61 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
71 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
77 AC_MSG_RESULT([$ac_system])
79 if test "x$ac_system" = "xLinux"
81 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
82 if test -z "$KERNEL_DIR"
84 KERNEL_DIR="/lib/modules/`uname -r`/source"
87 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
88 AC_SUBST(KERNEL_CFLAGS)
91 if test "x$ac_system" = "xSolaris"
93 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
95 if test "x$ac_system" = "xAIX"
97 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
100 # Where to install .pc files.
101 pkgconfigdir="${libdir}/pkgconfig"
102 AC_SUBST(pkgconfigdir)
104 # Check for standards compliance mode
105 AC_ARG_ENABLE(standards,
106 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
107 [enable_standards="$enableval"],
108 [enable_standards="no"])
109 if test "x$enable_standards" = "xyes"
111 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
112 AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
113 AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
114 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
116 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
119 # Checks for header files.
126 AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h)
129 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
134 # include <sys/types.h>
137 AC_CHECK_HEADERS(netinet/in.h, [], [],
142 # include <sys/types.h>
144 #if HAVE_NETINET_IN_SYSTM_H
145 # include <netinet/in_systm.h>
148 AC_CHECK_HEADERS(netinet/ip.h, [], [],
153 # include <sys/types.h>
155 #if HAVE_NETINET_IN_SYSTM_H
156 # include <netinet/in_systm.h>
158 #if HAVE_NETINET_IN_H
159 # include <netinet/in.h>
162 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
167 # include <sys/types.h>
169 #if HAVE_NETINET_IN_SYSTM_H
170 # include <netinet/in_systm.h>
172 #if HAVE_NETINET_IN_H
173 # include <netinet/in.h>
175 #if HAVE_NETINET_IP_H
176 # include <netinet/ip.h>
179 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
184 # include <sys/types.h>
186 #if HAVE_NETINET_IN_SYSTM_H
187 # include <netinet/in_systm.h>
189 #if HAVE_NETINET_IN_H
190 # include <netinet/in.h>
192 #if HAVE_NETINET_IP_H
193 # include <netinet/ip.h>
196 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
201 # include <sys/types.h>
203 #if HAVE_NETINET_IN_SYSTM_H
204 # include <netinet/in_systm.h>
206 #if HAVE_NETINET_IN_H
207 # include <netinet/in.h>
210 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
215 # include <sys/types.h>
217 #if HAVE_NETINET_IN_SYSTM_H
218 # include <netinet/in_systm.h>
220 #if HAVE_NETINET_IN_H
221 # include <netinet/in.h>
223 #if HAVE_NETINET_IP6_H
224 # include <netinet/ip6.h>
227 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
232 # include <sys/types.h>
234 #if HAVE_NETINET_IN_SYSTM_H
235 # include <netinet/in_systm.h>
237 #if HAVE_NETINET_IN_H
238 # include <netinet/in.h>
240 #if HAVE_NETINET_IP_H
241 # include <netinet/ip.h>
244 AC_CHECK_HEADERS(netinet/udp.h, [], [],
249 # include <sys/types.h>
251 #if HAVE_NETINET_IN_SYSTM_H
252 # include <netinet/in_systm.h>
254 #if HAVE_NETINET_IN_H
255 # include <netinet/in.h>
257 #if HAVE_NETINET_IP_H
258 # include <netinet/ip.h>
263 AC_CHECK_HEADERS(sys/dkstat.h)
264 if test "x$ac_system" = "xDarwin"
266 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)
267 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
269 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
272 # include <sys/types.h>
275 # include <sys/param.h>
279 AC_MSG_CHECKING([for sysctl kern.cp_times])
280 if test -x /sbin/sysctl
282 /sbin/sysctl kern.cp_times 2>/dev/null
286 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
287 [Define if sysctl supports kern.cp_times])
296 AC_CHECK_HEADERS(linux/major.h libgen.h)
298 # For the battery plugin
299 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
301 #if HAVE_IOKIT_IOKITLIB_H
302 # include <IOKit/IOKitLib.h>
304 #if HAVE_IOKIT_IOTYPES_H
305 # include <IOKit/IOTypes.h>
309 # For the swap module
310 have_linux_wireless_h="no"
311 if test "x$ac_system" = "xLinux"
313 AC_CHECK_HEADERS(linux/wireless.h,
314 [have_linux_wireless_h="yes"],
315 [have_linux_wireless_h="no"],
318 #include <sys/ioctl.h>
319 #include <sys/socket.h>
323 # For the swap module
324 have_sys_swap_h="yes"
325 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
327 #undef _FILE_OFFSET_BITS
328 #undef _LARGEFILE64_SOURCE
330 # include <sys/types.h>
333 # include <sys/param.h>
337 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
340 if test "x$GCC" = "xyes"
342 hint_64="CFLAGS='-m64'"
344 hint_64="CFLAGS='-xarch=v9'"
346 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
350 # For the processes plugin
352 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
354 # For interface plugin
355 AC_CHECK_HEADERS(ifaddrs.h)
356 AC_CHECK_HEADERS(net/if.h, [], [],
359 # include <sys/types.h>
361 #if HAVE_SYS_SOCKET_H
362 # include <sys/socket.h>
365 AC_CHECK_HEADERS(linux/if.h, [], [],
368 # include <sys/types.h>
370 #if HAVE_SYS_SOCKET_H
371 # include <sys/socket.h>
374 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
377 # include <sys/types.h>
379 #if HAVE_SYS_SOCKET_H
380 # include <sys/socket.h>
383 # include <linux/if.h>
388 have_net_ip_vs_h="no"
390 if test "x$ac_system" = "xLinux"
392 SAVE_CFLAGS="$CFLAGS"
393 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
395 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
396 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
398 CFLAGS="$SAVE_CFLAGS"
402 AC_CHECK_HEADERS(sys/ucred.h, [], [],
405 # include <sys/types.h>
408 # include <sys/param.h>
412 # For mount interface
413 AC_CHECK_HEADERS(sys/mount.h, [], [],
416 # include <sys/types.h>
419 # include <sys/param.h>
423 # For the email plugin
424 AC_CHECK_HEADERS(linux/un.h, [], [],
426 #if HAVE_SYS_SOCKET_H
427 # include <sys/socket.h>
431 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)
434 AC_CHECK_HEADERS(arpa/nameser.h)
435 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
437 #if HAVE_ARPA_NAMESER_H
438 # include <arpa/nameser.h>
442 AC_CHECK_HEADERS(net/if_arp.h, [], [],
443 [#if HAVE_SYS_SOCKET_H
444 # include <sys/socket.h>
447 AC_CHECK_HEADERS(net/ppp_defs.h)
448 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
449 [#if HAVE_NET_PPP_DEFS_H
450 # include <net/ppp_defs.h>
453 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
458 # include <sys/types.h>
460 #if HAVE_SYS_SOCKET_H
461 # include <sys/socket.h>
466 #if HAVE_NETINET_IN_H
467 # include <netinet/in.h>
471 # For the multimeter plugin
473 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
476 # Checks for typedefs, structures, and compiler characteristics.
485 # Checks for library functions.
487 AC_PROG_GCC_TRADITIONAL
488 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname)
492 SAVE_CFLAGS="$CFLAGS"
493 # Emulate behavior of src/Makefile.am
494 if test "x$GCC" = "xyes"
496 CFLAGS="$CFLAGS -Wall -Werror"
499 AC_CACHE_CHECK([for strtok_r],
500 [c_cv_have_strtok_r_default],
509 char buffer[] = "foo,bar,baz";
516 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
519 printf ("token = %s;\n", token);
522 [c_cv_have_strtok_r_default="yes"],
523 [c_cv_have_strtok_r_default="no"]
527 if test "x$c_cv_have_strtok_r_default" = "xno"
529 CFLAGS="$CFLAGS -D_REENTRANT=1"
531 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
532 [c_cv_have_strtok_r_reentrant],
541 char buffer[] = "foo,bar,baz";
548 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
551 printf ("token = %s;\n", token);
554 [c_cv_have_strtok_r_reentrant="yes"],
555 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
560 CFLAGS="$SAVE_CFLAGS"
561 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
563 CFLAGS="$CFLAGS -D_REENTRANT=1"
566 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
568 socket_needs_socket="no"
569 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
570 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
572 nanosleep_needs_rt="no"
573 nanosleep_needs_posix4="no"
574 AC_CHECK_FUNCS(nanosleep,
576 AC_CHECK_LIB(rt, nanosleep,
577 [nanosleep_needs_rt="yes"],
578 AC_CHECK_LIB(posix4, nanosleep,
579 [nanosleep_needs_posix4="yes"],
580 AC_MSG_ERROR(cannot find nanosleep))))
581 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
582 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$nanosleep_needs_posix4" = "xyes")
584 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
585 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
586 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
587 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
588 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
589 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
590 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
591 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
592 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
593 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
594 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
595 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
598 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
601 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
603 if test "x$withval" = "xno"; then
605 else if test "x$withval" = "xyes"; then
612 if test "x$nan_type" = "xnone"; then
613 AC_CACHE_CHECK([whether NAN is defined by default],
614 [c_cv_have_nan_default],
620 static float foo = NAN;
628 [c_cv_have_nan_default="yes"],
629 [c_cv_have_nan_default="no"]
632 if test "x$c_cv_have_nan_default" = "xyes"
637 if test "x$nan_type" = "xnone"; then
638 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
639 [c_cv_have_nan_isoc],
644 #define __USE_ISOC99 1
646 static float foo = NAN;
654 [c_cv_have_nan_isoc="yes"],
655 [c_cv_have_nan_isoc="no"]
658 if test "x$c_cv_have_nan_isoc" = "xyes"
663 if test "x$nan_type" = "xnone"; then
664 SAVE_LDFLAGS=$LDFLAGS
665 LDFLAGS="$LDFLAGS -lm"
666 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
667 [c_cv_have_nan_zero],
676 #define NAN (0.0 / 0.0)
678 # define isnan(f) ((f) != (f))
680 static float foo = NAN;
688 [c_cv_have_nan_zero="yes"],
689 [c_cv_have_nan_zero="no"]
692 LDFLAGS=$SAVE_LDFLAGS
693 if test "x$c_cv_have_nan_zero" = "xyes"
699 if test "x$nan_type" = "xdefault"; then
700 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
701 [Define if NAN is defined by default and can initialize static variables.])
702 else if test "x$nan_type" = "xisoc99"; then
703 AC_DEFINE(NAN_STATIC_ISOC, 1,
704 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
705 else if test "x$nan_type" = "xzero"; then
706 AC_DEFINE(NAN_ZERO_ZERO, 1,
707 [Define if NAN can be defined as (0.0 / 0.0)])
709 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
712 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
714 if test "x$withval" = "xnothing"; then
715 fp_layout_type="nothing"
716 else if test "x$withval" = "xendianflip"; then
717 fp_layout_type="endianflip"
718 else if test "x$withval" = "xintswap"; then
719 fp_layout_type="intswap"
721 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
724 [fp_layout_type="unknown"])
726 if test "x$fp_layout_type" = "xunknown"; then
727 AC_CACHE_CHECK([if doubles are stored in x86 representation],
728 [c_cv_fp_layout_need_nothing],
739 # include <inttypes.h>
742 # include <stdbool.h>
752 memcpy ((void *) &i0, (void *) &d, 8);
755 memcpy ((void *) c, (void *) &i1, 8);
757 if ((c[0] == 0x2f) && (c[1] == 0x25)
758 && (c[2] == 0xc0) && (c[3] == 0xc7)
759 && (c[4] == 0x43) && (c[5] == 0x2b)
760 && (c[6] == 0x1f) && (c[7] == 0x5b))
765 [c_cv_fp_layout_need_nothing="yes"],
766 [c_cv_fp_layout_need_nothing="no"]
769 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
770 fp_layout_type="nothing"
773 if test "x$fp_layout_type" = "xunknown"; then
774 AC_CACHE_CHECK([if endianflip converts to x86 representation],
775 [c_cv_fp_layout_need_endianflip],
786 # include <inttypes.h>
789 # include <stdbool.h>
791 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
792 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
793 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
794 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
795 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
796 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
797 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
798 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
807 memcpy ((void *) &i0, (void *) &d, 8);
809 i1 = endianflip (i0);
810 memcpy ((void *) c, (void *) &i1, 8);
812 if ((c[0] == 0x2f) && (c[1] == 0x25)
813 && (c[2] == 0xc0) && (c[3] == 0xc7)
814 && (c[4] == 0x43) && (c[5] == 0x2b)
815 && (c[6] == 0x1f) && (c[7] == 0x5b))
820 [c_cv_fp_layout_need_endianflip="yes"],
821 [c_cv_fp_layout_need_endianflip="no"]
824 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
825 fp_layout_type="endianflip"
828 if test "x$fp_layout_type" = "xunknown"; then
829 AC_CACHE_CHECK([if intswap converts to x86 representation],
830 [c_cv_fp_layout_need_intswap],
841 # include <inttypes.h>
844 # include <stdbool.h>
846 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
847 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
856 memcpy ((void *) &i0, (void *) &d, 8);
859 memcpy ((void *) c, (void *) &i1, 8);
861 if ((c[0] == 0x2f) && (c[1] == 0x25)
862 && (c[2] == 0xc0) && (c[3] == 0xc7)
863 && (c[4] == 0x43) && (c[5] == 0x2b)
864 && (c[6] == 0x1f) && (c[7] == 0x5b))
869 [c_cv_fp_layout_need_intswap="yes"],
870 [c_cv_fp_layout_need_intswap="no"]
873 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
874 fp_layout_type="intswap"
878 if test "x$fp_layout_type" = "xnothing"; then
879 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
880 [Define if doubles are stored in x86 representation.])
881 else if test "x$fp_layout_type" = "xendianflip"; then
882 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
883 [Define if endianflip is needed to convert to x86 representation.])
884 else if test "x$fp_layout_type" = "xintswap"; then
885 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
886 [Define if intswap is needed to convert to x86 representation.])
888 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
892 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
894 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
896 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
899 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
900 if test "x$have_getmntent" = "xno"; then
901 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
903 if test "x$have_getmntent" = "xno"; then
904 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
906 if test "x$have_getmntent" = "xno"; then
907 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
910 if test "x$have_getmntent" = "xc"; then
911 AC_CACHE_CHECK([whether getmntent takes one argument],
912 [c_cv_have_one_getmntent],
914 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
915 #include "$srcdir/src/utils_mount.h"]],
919 fh = setmntent ("/etc/mtab", "r");
923 [c_cv_have_one_getmntent="yes"],
924 [c_cv_have_one_getmntent="no"]
927 AC_CACHE_CHECK([whether getmntent takes two arguments],
928 [c_cv_have_two_getmntent],
930 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
931 #include "$srcdir/src/utils_mount.h"]],
936 fh = fopen ("/etc/mnttab", "r");
937 status = getmntent (fh, &mt);
940 [c_cv_have_two_getmntent="yes"],
941 [c_cv_have_two_getmntent="no"]
946 # Check for different versions of `getmntent' here..
948 if test "x$have_getmntent" = "xc"; then
949 if test "x$c_cv_have_one_getmntent" = "xyes"; then
950 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
951 [Define if the function getmntent exists and takes one argument.])
953 if test "x$c_cv_have_two_getmntent" = "xyes"; then
954 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
955 [Define if the function getmntent exists and takes two arguments.])
958 if test "x$have_getmntent" = "xsun"; then
959 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
960 [Define if the function getmntent exists. It's the version from libsun.])
962 if test "x$have_getmntent" = "xseq"; then
963 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
964 [Define if the function getmntent exists. It's the version from libseq.])
966 if test "x$have_getmntent" = "xgen"; then
967 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
968 [Define if the function getmntent exists. It's the version from libgen.])
972 AC_MSG_CHECKING([if have htonll defined])
977 #include <sys/types.h>
978 #include <netinet/in.h>
980 # include <inttypes.h>
987 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
990 AC_MSG_RESULT([$have_htonll])
992 # Check for structures
993 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
994 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
997 #include <sys/types.h>
998 #include <sys/socket.h>
1001 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1002 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1005 #include <sys/types.h>
1006 #include <sys/socket.h>
1007 #include <linux/if.h>
1008 #include <linux/netdevice.h>
1011 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1014 #include <netinet/in.h>
1018 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1020 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1021 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1022 have_struct_kinfo_proc_freebsd="yes"
1025 have_struct_kinfo_proc_freebsd="no"
1029 #include <sys/param.h>
1030 #include <sys/sysctl.h>
1031 #include <sys/user.h>
1034 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1036 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1037 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1038 have_struct_kinfo_proc_openbsd="yes"
1041 have_struct_kinfo_proc_openbsd="no"
1044 #include <sys/param.h>
1045 #include <sys/sysctl.h>
1049 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1050 [#define _BSD_SOURCE
1052 # include <stdint.h>
1054 #if HAVE_SYS_TYPES_H
1055 # include <sys/types.h>
1057 #if HAVE_NETINET_IN_SYSTM_H
1058 # include <netinet/in_systm.h>
1060 #if HAVE_NETINET_IN_H
1061 # include <netinet/in.h>
1063 #if HAVE_NETINET_IP_H
1064 # include <netinet/ip.h>
1066 #if HAVE_NETINET_UDP_H
1067 # include <netinet/udp.h>
1070 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1071 [#define _BSD_SOURCE
1073 # include <stdint.h>
1075 #if HAVE_SYS_TYPES_H
1076 # include <sys/types.h>
1078 #if HAVE_NETINET_IN_SYSTM_H
1079 # include <netinet/in_systm.h>
1081 #if HAVE_NETINET_IN_H
1082 # include <netinet/in.h>
1084 #if HAVE_NETINET_IP_H
1085 # include <netinet/ip.h>
1087 #if HAVE_NETINET_UDP_H
1088 # include <netinet/udp.h>
1092 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1102 # Checks for libraries begin here
1104 with_libresolv="yes"
1105 AC_CHECK_LIB(resolv, res_search,
1107 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1109 [with_libresolv="no"])
1110 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1112 dnl Check for HAL (hardware abstraction library)
1114 AC_CHECK_LIB(hal,libhal_device_property_exists,
1115 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1117 if test "x$with_libhal" = "xyes"; then
1118 if test "x$PKG_CONFIG" != "x"; then
1119 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1120 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1121 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1122 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1126 m4_divert_once([HELP_WITH], [
1127 collectd additional packages:])
1129 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1131 if test "x$ac_system" = "xAIX"
1136 with_perfstat="no (AIX only)"
1137 with_procinfo="no (AIX only)"
1140 if test "x$with_perfstat" = "xyes"
1142 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1143 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1145 if test "x$with_perfstat" = "xyes"
1147 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1149 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1151 # Processes plugin under AIX.
1152 if test "x$with_procinfo" = "xyes"
1154 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1156 if test "x$with_procinfo" = "xyes"
1158 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1161 if test "x$ac_system" = "xSolaris"
1166 with_kstat="no (Solaris only)"
1167 with_devinfo="no (Solaris only)"
1170 if test "x$with_kstat" = "xyes"
1172 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1174 if test "x$with_kstat" = "xyes"
1176 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1177 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1179 if test "x$with_kstat" = "xyes"
1181 AC_DEFINE(HAVE_LIBKSTAT, 1,
1182 [Define to 1 if you have the 'kstat' library (-lkstat)])
1184 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1185 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1188 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1195 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1198 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1199 if test "x$with_kvm_getprocs" = "xyes"
1201 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1202 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1205 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1207 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1208 if test "x$with_kvm_getswapinfo" = "xyes"
1210 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1211 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1214 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1216 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1217 if test "x$with_kvm_nlist" = "xyes"
1219 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1220 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1223 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1225 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1226 if test "x$with_kvm_openfiles" = "xyes"
1228 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1229 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1232 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1234 # --with-libcurl {{{
1235 with_curl_config="curl-config"
1238 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1240 if test "x$withval" = "xno"
1243 else if test "x$withval" = "xyes"
1247 if test -f "$withval" && test -x "$withval"
1249 with_curl_config="$withval"
1251 else if test -x "$withval/bin/curl-config"
1253 with_curl_config="$withval/bin/curl-config"
1262 if test "x$with_libcurl" = "xyes"
1264 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1265 curl_config_status=$?
1267 if test $curl_config_status -ne 0
1269 with_libcurl="no ($with_curl_config failed)"
1271 SAVE_CPPFLAGS="$CPPFLAGS"
1272 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1274 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1276 CPPFLAGS="$SAVE_CPPFLAGS"
1279 if test "x$with_libcurl" = "xyes"
1281 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1282 curl_config_status=$?
1284 if test $curl_config_status -ne 0
1286 with_libcurl="no ($with_curl_config failed)"
1288 AC_CHECK_LIB(curl, curl_easy_init,
1289 [with_libcurl="yes"],
1290 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1294 if test "x$with_libcurl" = "xyes"
1296 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1297 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1298 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1299 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1301 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1305 with_libdbi_cppflags=""
1306 with_libdbi_ldflags=""
1307 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1309 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1311 with_libdbi_cppflags="-I$withval/include"
1312 with_libdbi_ldflags="-L$withval/lib"
1315 with_libdbi="$withval"
1321 if test "x$with_libdbi" = "xyes"
1323 SAVE_CPPFLAGS="$CPPFLAGS"
1324 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1326 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1328 CPPFLAGS="$SAVE_CPPFLAGS"
1330 if test "x$with_libdbi" = "xyes"
1332 SAVE_CPPFLAGS="$CPPFLAGS"
1333 SAVE_LDFLAGS="$LDFLAGS"
1334 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1335 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1337 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1339 CPPFLAGS="$SAVE_CPPFLAGS"
1340 LDFLAGS="$SAVE_LDFLAGS"
1342 if test "x$with_libdbi" = "xyes"
1344 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1345 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1346 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1347 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1348 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1349 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1351 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1354 # --with-libesmtp {{{
1355 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1357 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1359 LDFLAGS="$LDFLAGS -L$withval/lib"
1360 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1363 with_libesmtp="$withval"
1369 if test "x$with_libesmtp" = "xyes"
1371 AC_CHECK_LIB(esmtp, smtp_create_session,
1373 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1374 ], [with_libesmtp="no (libesmtp not found)"])
1376 if test "x$with_libesmtp" = "xyes"
1378 AC_CHECK_HEADERS(libesmtp.h,
1380 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1381 ], [with_libesmtp="no (libesmtp.h not found)"])
1383 if test "x$with_libesmtp" = "xyes"
1389 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1390 [Wether or not to use the esmtp library])
1391 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1394 # --with-libganglia {{{
1395 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1397 if test -f "$withval" && test -x "$withval"
1399 with_libganglia_config="$withval"
1400 with_libganglia="yes"
1401 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1403 with_libganglia_config="$withval/bin/ganglia-config"
1404 with_libganglia="yes"
1405 else if test -d "$withval"
1407 GANGLIA_CPPFLAGS="-I$withval/include"
1408 GANGLIA_LDFLAGS="-L$withval/lib"
1409 with_libganglia="yes"
1411 with_libganglia_config="ganglia-config"
1412 with_libganglia="$withval"
1416 with_libganglia_config="ganglia-config"
1417 with_libganglia="yes"
1420 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1422 if test "x$GANGLIA_CPPFLAGS" = "x"
1424 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1427 if test "x$GANGLIA_LDFLAGS" = "x"
1429 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1432 if test "x$GANGLIA_LIBS" = "x"
1434 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1438 SAVE_CPPFLAGS="$CPPFLAGS"
1439 SAVE_LDFLAGS="$LDFLAGS"
1440 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1441 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1443 if test "x$with_libganglia" = "xyes"
1445 AC_CHECK_HEADERS(gm_protocol.h,
1447 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1448 [Define to 1 if you have the <gm_protocol.h> header file.])
1449 ], [with_libganglia="no (gm_protocol.h not found)"])
1452 if test "x$with_libganglia" = "xyes"
1454 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1456 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1457 [Define to 1 if you have the ganglia library (-lganglia).])
1458 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1461 CPPFLAGS="$SAVE_CPPFLAGS"
1462 LDFLAGS="$SAVE_LDFLAGS"
1464 AC_SUBST(GANGLIA_CPPFLAGS)
1465 AC_SUBST(GANGLIA_LDFLAGS)
1466 AC_SUBST(GANGLIA_LIBS)
1467 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1470 # --with-libgcrypt {{{
1471 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1472 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1473 GCRYPT_LIBS="$GCRYPT_LIBS"
1474 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1476 if test -f "$withval" && test -x "$withval"
1478 with_libgcrypt_config="$withval"
1479 with_libgcrypt="yes"
1480 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1482 with_libgcrypt_config="$withval/bin/gcrypt-config"
1483 with_libgcrypt="yes"
1484 else if test -d "$withval"
1486 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1487 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1488 with_libgcrypt="yes"
1490 with_libgcrypt_config="gcrypt-config"
1491 with_libgcrypt="$withval"
1495 with_libgcrypt_config="libgcrypt-config"
1496 with_libgcrypt="yes"
1499 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1501 if test "x$GCRYPT_CPPFLAGS" = "x"
1503 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1506 if test "x$GCRYPT_LDFLAGS" = "x"
1508 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1509 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1512 if test "x$GCRYPT_LIBS" = "x"
1514 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1518 SAVE_CPPFLAGS="$CPPFLAGS"
1519 SAVE_LDFLAGS="$LDFLAGS"
1520 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1521 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1523 if test "x$with_libgcrypt" = "xyes"
1525 if test "x$GCRYPT_CPPFLAGS" != "x"
1527 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1529 AC_CHECK_HEADERS(gcrypt.h,
1530 [with_libgcrypt="yes"],
1531 [with_libgcrypt="no (gcrypt.h not found)"])
1534 if test "x$with_libgcrypt" = "xyes"
1536 if test "x$GCRYPT_LDFLAGS" != "x"
1538 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1540 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1541 [with_libgcrypt="yes"],
1542 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1544 if test "$with_libgcrypt" != "no"; then
1545 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1549 CPPFLAGS="$SAVE_CPPFLAGS"
1550 LDFLAGS="$SAVE_LDFLAGS"
1552 if test "x$with_libgcrypt" = "xyes"
1554 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1557 AC_SUBST(GCRYPT_CPPFLAGS)
1558 AC_SUBST(GCRYPT_LDFLAGS)
1559 AC_SUBST(GCRYPT_LIBS)
1560 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1563 # --with-libiptc {{{
1564 with_own_libiptc="no"
1565 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1567 if test "x$withval" = "xshipped"
1569 with_own_libiptc="yes"
1571 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1573 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1574 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1577 with_libiptc="$withval"
1581 if test "x$ac_system" = "xLinux"
1585 with_libiptc="no (Linux only)"
1588 SAVE_CPPFLAGS="$CPPFLAGS"
1589 SAVE_LDFLAGS="$LDFLAGS"
1590 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1591 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1592 # check whether the header file for libiptc is available.
1593 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1595 AC_CHECK_HEADERS(libiptc/libiptc.h,
1597 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1601 with_own_libiptc="yes"
1604 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1606 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1608 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1612 with_own_libiptc="yes"
1615 # If the header file is available, check for the required type declaractions.
1616 # They may be missing in old versions of libiptc. In that case, they will be
1617 # declared in the iptables plugin.
1618 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1620 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1623 # include "$srcdir/src/owniptc/libiptc.h"
1624 # include "$srcdir/src/owniptc/libip6tc.h"
1626 # include <libiptc/libiptc.h>
1627 # include <libiptc/libip6tc.h>
1631 # Check for the iptc_init symbol in the library.
1632 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1634 AC_CHECK_LIB(iptc, iptc_init,
1636 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1640 with_own_libiptc="yes"
1644 # The system wide version failed for some reason. Check if we have the required
1645 # headers to build the shipped version.
1646 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1648 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1650 with_libiptc="no (Linux iptables headers not found)"
1651 with_own_libiptc="no"
1654 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1657 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1658 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1659 if test "x$with_libiptc" = "xyes"
1661 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1662 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1663 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1664 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1666 if test "x$with_own_libiptc" = "xyes"
1668 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1670 CPPFLAGS="$SAVE_CPPFLAGS"
1671 LDFLAGS="$SAVE_LDFLAGS"
1675 with_java_home="$JAVA_HOME"
1676 with_java_vmtype="client"
1681 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1683 if test "x$withval" = "xno"
1686 else if test "x$withval" = "xyes"
1690 with_java_home="$withval"
1695 if test "x$with_java" = "xyes"
1697 if test -d "$with_java_home"
1699 AC_MSG_CHECKING([for jni.h])
1700 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1701 if test "x$TMPDIR" != "x"
1703 AC_MSG_RESULT([found in $TMPDIR])
1704 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1706 AC_MSG_RESULT([not found])
1709 AC_MSG_CHECKING([for jni_md.h])
1710 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1711 if test "x$TMPDIR" != "x"
1713 AC_MSG_RESULT([found in $TMPDIR])
1714 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1716 AC_MSG_RESULT([not found])
1719 AC_MSG_CHECKING([for libjvm.so])
1720 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1721 if test "x$TMPDIR" != "x"
1723 AC_MSG_RESULT([found in $TMPDIR])
1724 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1726 AC_MSG_RESULT([not found])
1729 if test "x$JAVAC" = "x"
1731 AC_MSG_CHECKING([for javac])
1732 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1733 if test "x$TMPDIR" != "x"
1736 AC_MSG_RESULT([$JAVAC])
1738 AC_MSG_RESULT([not found])
1741 if test "x$JAR" = "x"
1743 AC_MSG_CHECKING([for jar])
1744 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1745 if test "x$TMPDIR" != "x"
1748 AC_MSG_RESULT([$JAR])
1750 AC_MSG_RESULT([not found])
1753 else if test "x$with_java_home" != "x"
1755 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1759 if test "x$JAVA_CPPFLAGS" != "x"
1761 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1763 if test "x$JAVA_CFLAGS" != "x"
1765 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1767 if test "x$JAVA_LDFLAGS" != "x"
1769 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1771 if test "x$JAVAC" = "x"
1773 with_javac_path="$PATH"
1774 if test "x$with_java_home" != "x"
1776 with_javac_path="$with_java_home:with_javac_path"
1777 if test -d "$with_java_home/bin"
1779 with_javac_path="$with_java_home/bin:with_javac_path"
1783 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1785 if test "x$JAVAC" = "x"
1787 with_java="no (javac not found)"
1789 if test "x$JAR" = "x"
1791 with_jar_path="$PATH"
1792 if test "x$with_java_home" != "x"
1794 with_jar_path="$with_java_home:$with_jar_path"
1795 if test -d "$with_java_home/bin"
1797 with_jar_path="$with_java_home/bin:$with_jar_path"
1801 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
1803 if test "x$JAR" = "x"
1805 with_java="no (jar not found)"
1808 SAVE_CPPFLAGS="$CPPFLAGS"
1809 SAVE_CFLAGS="$CFLAGS"
1810 SAVE_LDFLAGS="$LDFLAGS"
1811 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1812 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1813 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1815 if test "x$with_java" = "xyes"
1817 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1819 if test "x$with_java" = "xyes"
1821 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1823 [with_java="no (libjvm not found)"],
1826 if test "x$with_java" = "xyes"
1828 JAVA_LIBS="$JAVA_LIBS -ljvm"
1829 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1832 CPPFLAGS="$SAVE_CPPFLAGS"
1833 CFLAGS="$SAVE_CFLAGS"
1834 LDFLAGS="$SAVE_LDFLAGS"
1836 AC_SUBST(JAVA_CPPFLAGS)
1837 AC_SUBST(JAVA_CFLAGS)
1838 AC_SUBST(JAVA_LDFLAGS)
1840 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1843 # --with-libmemcached {{{
1844 with_libmemcached_cppflags=""
1845 with_libmemcached_ldflags=""
1846 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
1848 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1850 with_libmemcached_cppflags="-I$withval/include"
1851 with_libmemcached_ldflags="-L$withval/lib"
1852 with_libmemcached="yes"
1854 with_libmemcached="$withval"
1858 with_libmemcached="yes"
1860 if test "x$with_libmemcached" = "xyes"
1862 SAVE_CPPFLAGS="$CPPFLAGS"
1863 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1865 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
1867 CPPFLAGS="$SAVE_CPPFLAGS"
1869 if test "x$with_libmemcached" = "xyes"
1871 SAVE_CPPFLAGS="$CPPFLAGS"
1872 SAVE_LDFLAGS="$LDFLAGS"
1873 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1874 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
1876 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
1878 CPPFLAGS="$SAVE_CPPFLAGS"
1879 LDFLAGS="$SAVE_LDFLAGS"
1881 if test "x$with_libmemcached" = "xyes"
1883 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
1884 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
1885 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
1886 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1887 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1888 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
1889 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
1891 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
1894 # --with-libmodbus {{{
1895 with_libmodbus_config=""
1896 with_libmodbus_cflags=""
1897 with_libmodbus_libs=""
1898 AC_ARG_WITH(libmodbus, [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
1900 if test "x$withval" = "xno"
1903 else if test "x$withval" = "xyes"
1905 with_libmodbus="use_pkgconfig"
1906 else if test -d "$with_libmodbus/lib"
1908 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
1909 with_libmodbus_cflags="-I$withval/include"
1910 with_libmodbus_libs="-L$withval/lib -lmodbus"
1911 with_libmodbus="yes"
1914 [with_libmodbus="use_pkgconfig"])
1916 # configure using pkg-config
1917 if test "x$with_libmodbus" = "xuse_pkgconfig"
1919 if test "x$PKG_CONFIG" = "x"
1921 with_libmodbus="no (Don't have pkg-config)"
1924 if test "x$with_libmodbus" = "xuse_pkgconfig"
1926 AC_MSG_NOTICE([Checking for modbus using $PKG_CONFIG])
1927 $PKG_CONFIG --exists 'modbus' 2>/dev/null
1930 with_libmodbus="no (pkg-config doesn't know library)"
1933 if test "x$with_libmodbus" = "xuse_pkgconfig"
1935 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'modbus'`"
1938 with_libmodbus="no ($PKG_CONFIG failed)"
1940 with_libmodbus_libs="`$PKG_CONFIG --libs 'modbus'`"
1943 with_libmodbus="no ($PKG_CONFIG failed)"
1946 if test "x$with_libmodbus" = "xuse_pkgconfig"
1948 with_libmodbus="yes"
1951 # with_libmodbus_cflags and with_libmodbus_libs are set up now, let's do
1952 # the actual checks.
1953 if test "x$with_libmodbus" = "xyes"
1955 SAVE_CPPFLAGS="$CPPFLAGS"
1956 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
1958 AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
1960 CPPFLAGS="$SAVE_CPPFLAGS"
1962 if test "x$with_libmodbus" = "xyes"
1964 SAVE_CPPFLAGS="$CPPFLAGS"
1965 SAVE_LDFLAGS="$LDFLAGS"
1967 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
1968 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
1970 AC_CHECK_LIB(modbus, modbus_init_tcp,
1971 [with_libmodbus="yes"],
1972 [with_libmodbus="no (symbol modbus_init_tcp not found)"])
1974 CPPFLAGS="$SAVE_CPPFLAGS"
1975 LDFLAGS="$SAVE_LDFLAGS"
1977 if test "x$with_libmodbus" = "xyes"
1979 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
1980 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
1981 AC_SUBST(BUILD_WITH_LIBMODBUS_CFLAGS)
1982 AC_SUBST(BUILD_WITH_LIBMODBUS_LIBS)
1986 # --with-libmysql {{{
1987 with_mysql_config="mysql_config"
1988 with_mysql_cflags=""
1990 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1992 if test "x$withval" = "xno"
1995 else if test "x$withval" = "xyes"
1999 if test -f "$withval" && test -x "$withval";
2001 with_mysql_config="$withval"
2002 else if test -x "$withval/bin/mysql_config"
2004 with_mysql_config="$withval/bin/mysql_config"
2012 if test "x$with_libmysql" = "xyes"
2014 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
2015 mysql_config_status=$?
2017 if test $mysql_config_status -ne 0
2019 with_libmysql="no ($with_mysql_config failed)"
2021 SAVE_CPPFLAGS="$CPPFLAGS"
2022 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
2025 have_mysql_mysql_h="no"
2026 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
2028 if test "x$have_mysql_h" = "xno"
2030 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
2033 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
2035 with_libmysql="no (mysql.h not found)"
2038 CPPFLAGS="$SAVE_CPPFLAGS"
2041 if test "x$with_libmysql" = "xyes"
2043 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
2044 mysql_config_status=$?
2046 if test $mysql_config_status -ne 0
2048 with_libmysql="no ($with_mysql_config failed)"
2050 AC_CHECK_LIB(mysqlclient, mysql_init,
2051 [with_libmysql="yes"],
2052 [with_libmysql="no (symbol 'mysql_init' not found)"],
2055 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
2056 [with_libmysql="yes"],
2057 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
2061 if test "x$with_libmysql" = "xyes"
2063 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
2064 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
2065 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
2066 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
2068 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
2071 # --with-libnetlink {{{
2072 with_libnetlink_cflags=""
2073 with_libnetlink_libs="-lnetlink"
2074 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
2076 echo "libnetlink: withval = $withval"
2077 if test "x$withval" = "xyes"
2079 with_libnetlink="yes"
2080 else if test "x$withval" = "xno"
2082 with_libnetlink="no"
2084 if test -d "$withval/include"
2086 with_libnetlink_cflags="-I$withval/include"
2087 with_libnetlink_libs="-L$withval/lib -lnetlink"
2088 with_libnetlink="yes"
2090 AC_MSG_ERROR("no such directory: $withval/include")
2095 if test "x$ac_system" = "xLinux"
2097 with_libnetlink="yes"
2099 with_libnetlink="no (Linux only library)"
2102 if test "x$with_libnetlink" = "xyes"
2104 SAVE_CFLAGS="$CFLAGS"
2105 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2107 with_libnetlink="no (libnetlink.h not found)"
2109 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2111 with_libnetlink="yes"
2115 #include <sys/types.h>
2116 #include <asm/types.h>
2117 #include <sys/socket.h>
2118 #include <linux/netlink.h>
2119 #include <linux/rtnetlink.h>])
2120 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2122 #include <sys/types.h>
2123 #include <asm/types.h>
2124 #include <sys/socket.h>])
2128 #include <sys/types.h>
2129 #include <asm/types.h>
2130 #include <sys/socket.h>
2131 #include <linux/netlink.h>
2132 #include <linux/rtnetlink.h>
2136 int retval = TCA_STATS2;
2139 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2144 #include <sys/types.h>
2145 #include <asm/types.h>
2146 #include <sys/socket.h>
2147 #include <linux/netlink.h>
2148 #include <linux/rtnetlink.h>
2152 int retval = TCA_STATS;
2155 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2158 CFLAGS="$SAVE_CFLAGS"
2160 if test "x$with_libnetlink" = "xyes"
2162 AC_CHECK_LIB(netlink, rtnl_open,
2163 [with_libnetlink="yes"],
2164 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2165 [$with_libnetlink_libs])
2167 if test "x$with_libnetlink" = "xyes"
2169 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2170 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2171 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2172 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2174 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2177 # --with-libnetapp {{{
2178 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2179 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2180 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2181 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2182 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2183 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2184 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2186 if test -d "$withval"
2188 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2189 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2190 with_libnetapp="yes"
2192 with_libnetapp="$withval"
2196 with_libnetapp="yes"
2199 SAVE_CPPFLAGS="$CPPFLAGS"
2200 SAVE_LDFLAGS="$LDFLAGS"
2201 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2202 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2204 if test "x$with_libnetapp" = "xyes"
2206 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2208 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2210 AC_CHECK_HEADERS(netapp_api.h,
2211 [with_libnetapp="yes"],
2212 [with_libnetapp="no (netapp_api.h not found)"])
2215 if test "x$with_libnetapp" = "xyes"
2217 if test "x$LIBNETAPP_LDFLAGS" != "x"
2219 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2222 if test "x$LIBNETAPP_LIBS" = "x"
2224 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2226 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2228 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2229 [with_libnetapp="yes"],
2230 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2232 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2235 CPPFLAGS="$SAVE_CPPFLAGS"
2236 LDFLAGS="$SAVE_LDFLAGS"
2238 if test "x$with_libnetapp" = "xyes"
2240 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2243 AC_SUBST(LIBNETAPP_CPPFLAGS)
2244 AC_SUBST(LIBNETAPP_LDFLAGS)
2245 AC_SUBST(LIBNETAPP_LIBS)
2246 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2249 # --with-libnetsnmp {{{
2250 with_snmp_config="net-snmp-config"
2253 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2255 if test "x$withval" = "xno"
2257 with_libnetsnmp="no"
2258 else if test "x$withval" = "xyes"
2260 with_libnetsnmp="yes"
2262 if test -x "$withval"
2264 with_snmp_config="$withval"
2265 with_libnetsnmp="yes"
2267 with_snmp_config="$withval/bin/net-snmp-config"
2268 with_libnetsnmp="yes"
2272 [with_libnetsnmp="yes"])
2273 if test "x$with_libnetsnmp" = "xyes"
2275 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2276 snmp_config_status=$?
2278 if test $snmp_config_status -ne 0
2280 with_libnetsnmp="no ($with_snmp_config failed)"
2282 SAVE_CPPFLAGS="$CPPFLAGS"
2283 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2285 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2287 CPPFLAGS="$SAVE_CPPFLAGS"
2290 if test "x$with_libnetsnmp" = "xyes"
2292 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2293 snmp_config_status=$?
2295 if test $snmp_config_status -ne 0
2297 with_libnetsnmp="no ($with_snmp_config failed)"
2299 AC_CHECK_LIB(netsnmp, init_snmp,
2300 [with_libnetsnmp="yes"],
2301 [with_libnetsnmp="no (libnetsnmp not found)"],
2305 if test "x$with_libnetsnmp" = "xyes"
2307 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2308 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2309 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2310 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2312 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2315 # --with-liboconfig {{{
2316 with_own_liboconfig="no"
2317 liboconfig_LDFLAGS="$LDFLAGS"
2318 liboconfig_CPPFLAGS="$CPPFLAGS"
2319 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2321 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2323 if test -d "$withval/lib"
2325 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2327 if test -d "$withval/include"
2329 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2332 if test "x$withval" = "xno"
2334 AC_MSG_ERROR("liboconfig is required")
2338 with_liboconfig="yes"
2341 save_LDFLAGS="$LDFLAGS"
2342 save_CPPFLAGS="$CPPFLAGS"
2343 LDFLAGS="$liboconfig_LDFLAGS"
2344 CPPFLAGS="$liboconfig_CPPFLAGS"
2345 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2347 with_liboconfig="yes"
2348 with_own_liboconfig="no"
2351 with_liboconfig="yes"
2352 with_own_liboconfig="yes"
2353 LDFLAGS="$save_LDFLAGS"
2354 CPPFLAGS="$save_CPPFLAGS"
2357 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2358 if test "x$with_own_liboconfig" = "xyes"
2360 with_liboconfig="yes (shipped version)"
2364 # --with-liboping {{{
2365 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2367 if test "x$withval" = "xyes"
2370 else if test "x$withval" = "xno"
2375 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2376 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2379 [with_liboping="yes"])
2381 SAVE_CPPFLAGS="$CPPFLAGS"
2382 SAVE_LDFLAGS="$LDFLAGS"
2384 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2385 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2387 if test "x$with_liboping" = "xyes"
2389 if test "x$LIBOPING_CPPFLAGS" != "x"
2391 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2393 AC_CHECK_HEADERS(oping.h,
2394 [with_liboping="yes"],
2395 [with_liboping="no ('oping.h' not found)"])
2397 if test "x$with_liboping" = "xyes"
2399 if test "x$LIBOPING_LDFLAGS" != "x"
2401 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2403 AC_CHECK_LIB(oping, ping_construct,
2404 [with_liboping="yes"],
2405 [with_liboping="no (symbol 'ping_construct' not found)"])
2408 CPPFLAGS="$SAVE_CPPFLAGS"
2409 LDFLAGS="$SAVE_LDFLAGS"
2411 if test "x$with_liboping" = "xyes"
2413 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2414 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2415 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2416 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2418 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2422 with_oracle_cppflags=""
2424 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2426 if test "x$withval" = "xyes"
2428 if test "x$ORACLE_HOME" = "x"
2430 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2433 else if test "x$withval" = "xno"
2438 ORACLE_HOME="$withval"
2442 if test "x$ORACLE_HOME" = "x"
2444 with_oracle="no (ORACLE_HOME is not set)"
2449 if test "x$ORACLE_HOME" != "x"
2451 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2453 if test -e "$ORACLE_HOME/lib/ldflags"
2455 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2457 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2458 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2460 if test "x$with_oracle" = "xyes"
2462 SAVE_CPPFLAGS="$CPPFLAGS"
2463 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2465 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2467 CPPFLAGS="$SAVE_CPPFLAGS"
2469 if test "x$with_oracle" = "xyes"
2471 SAVE_CPPFLAGS="$CPPFLAGS"
2472 SAVE_LDFLAGS="$LDFLAGS"
2473 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2474 LDFLAGS="$LDFLAGS $with_oracle_libs"
2476 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2478 CPPFLAGS="$SAVE_CPPFLAGS"
2479 LDFLAGS="$SAVE_LDFLAGS"
2481 if test "x$with_oracle" = "xyes"
2483 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2484 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2485 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2486 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2490 # --with-libowcapi {{{
2491 with_libowcapi_cppflags=""
2492 with_libowcapi_libs="-lowcapi"
2493 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2495 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2497 with_libowcapi_cppflags="-I$withval/include"
2498 with_libowcapi_libs="-L$withval/lib -lowcapi"
2499 with_libowcapi="yes"
2501 with_libowcapi="$withval"
2505 with_libowcapi="yes"
2507 if test "x$with_libowcapi" = "xyes"
2509 SAVE_CPPFLAGS="$CPPFLAGS"
2510 CPPFLAGS="$with_libowcapi_cppflags"
2512 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2514 CPPFLAGS="$SAVE_CPPFLAGS"
2516 if test "x$with_libowcapi" = "xyes"
2518 SAVE_LDFLAGS="$LDFLAGS"
2519 SAVE_CPPFLAGS="$CPPFLAGS"
2520 LDFLAGS="$with_libowcapi_libs"
2521 CPPFLAGS="$with_libowcapi_cppflags"
2523 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2525 LDFLAGS="$SAVE_LDFLAGS"
2526 CPPFLAGS="$SAVE_CPPFLAGS"
2528 if test "x$with_libowcapi" = "xyes"
2530 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2531 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2532 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2533 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2537 # --with-libpcap {{{
2538 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2540 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2542 LDFLAGS="$LDFLAGS -L$withval/lib"
2543 CPPFLAGS="$CPPFLAGS -I$withval/include"
2546 with_libpcap="$withval"
2552 if test "x$with_libpcap" = "xyes"
2554 AC_CHECK_LIB(pcap, pcap_open_live,
2556 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2557 ], [with_libpcap="no (libpcap not found)"])
2559 if test "x$with_libpcap" = "xyes"
2561 AC_CHECK_HEADERS(pcap.h,,
2562 [with_libpcap="no (pcap.h not found)"])
2564 if test "x$with_libpcap" = "xyes"
2566 AC_CHECK_HEADERS(pcap-bpf.h)
2568 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2571 # --with-libperl {{{
2572 perl_interpreter="perl"
2573 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2575 if test -x "$withval"
2577 perl_interpreter="$withval"
2579 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2581 LDFLAGS="$LDFLAGS -L$withval/lib"
2582 CPPFLAGS="$CPPFLAGS -I$withval/include"
2583 perl_interpreter="$withval/bin/perl"
2586 with_libperl="$withval"
2593 AC_MSG_CHECKING([for perl])
2594 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2595 if test -x "$perl_interpreter"
2597 AC_MSG_RESULT([yes ($perl_interpreter)])
2603 AC_SUBST(PERL, "$perl_interpreter")
2605 if test "x$with_libperl" = "xyes" \
2606 && test -n "$perl_interpreter"
2608 SAVE_CFLAGS="$CFLAGS"
2609 SAVE_LDFLAGS="$LDFLAGS"
2610 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2611 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2612 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2613 CFLAGS="$CFLAGS $PERL_CFLAGS"
2614 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2616 AC_CACHE_CHECK([for libperl],
2617 [c_cv_have_libperl],
2621 #define PERL_NO_GET_CONTEXT
2628 load_module (PERL_LOADMOD_NOIMPORT,
2629 newSVpv ("Collectd::Plugin::FooBar", 24),
2632 [c_cv_have_libperl="yes"],
2633 [c_cv_have_libperl="no"]
2637 if test "x$c_cv_have_libperl" = "xyes"
2639 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2640 AC_SUBST(PERL_CFLAGS)
2641 AC_SUBST(PERL_LDFLAGS)
2646 CFLAGS="$SAVE_CFLAGS"
2647 LDFLAGS="$SAVE_LDFLAGS"
2648 else if test -z "$perl_interpreter"; then
2649 with_libperl="no (no perl interpreter found)"
2650 c_cv_have_libperl="no"
2652 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2654 if test "x$with_libperl" = "xyes"
2656 SAVE_CFLAGS="$CFLAGS"
2657 SAVE_LDFLAGS="$LDFLAGS"
2658 CFLAGS="$CFLAGS $PERL_CFLAGS"
2659 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2661 AC_CACHE_CHECK([if perl supports ithreads],
2662 [c_cv_have_perl_ithreads],
2670 #if !defined(USE_ITHREADS)
2671 # error "Perl does not support ithreads!"
2672 #endif /* !defined(USE_ITHREADS) */
2675 [c_cv_have_perl_ithreads="yes"],
2676 [c_cv_have_perl_ithreads="no"]
2680 if test "x$c_cv_have_perl_ithreads" = "xyes"
2682 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2685 CFLAGS="$SAVE_CFLAGS"
2686 LDFLAGS="$SAVE_LDFLAGS"
2689 if test "x$with_libperl" = "xyes"
2691 SAVE_CFLAGS="$CFLAGS"
2692 SAVE_LDFLAGS="$LDFLAGS"
2693 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2694 # (see issues #41 and #42)
2695 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2696 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2698 AC_CACHE_CHECK([for broken Perl_load_module()],
2699 [c_cv_have_broken_perl_load_module],
2703 #define PERL_NO_GET_CONTEXT
2710 load_module (PERL_LOADMOD_NOIMPORT,
2711 newSVpv ("Collectd::Plugin::FooBar", 24),
2714 [c_cv_have_broken_perl_load_module="no"],
2715 [c_cv_have_broken_perl_load_module="yes"]
2719 CFLAGS="$SAVE_CFLAGS"
2720 LDFLAGS="$SAVE_LDFLAGS"
2722 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2723 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2725 if test "x$with_libperl" = "xyes"
2727 SAVE_CFLAGS="$CFLAGS"
2728 SAVE_LDFLAGS="$LDFLAGS"
2729 CFLAGS="$CFLAGS $PERL_CFLAGS"
2730 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2733 [struct mgvtbl.svt_local],
2734 [have_struct_mgvtbl_svt_local="yes"],
2735 [have_struct_mgvtbl_svt_local="no"],
2742 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2744 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2745 [Define if Perl's struct mgvtbl has member svt_local.])
2748 CFLAGS="$SAVE_CFLAGS"
2749 LDFLAGS="$SAVE_LDFLAGS"
2754 with_pg_config="pg_config"
2755 with_libpq_includedir=""
2756 with_libpq_libdir=""
2757 with_libpq_cppflags=""
2758 with_libpq_ldflags=""
2759 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2762 if test "x$withval" = "xno"
2765 else if test "x$withval" = "xyes"
2769 if test -f "$withval" && test -x "$withval";
2771 with_pg_config="$withval"
2772 else if test -x "$withval/bin/pg_config"
2774 with_pg_config="$withval/bin/pg_config"
2782 if test "x$with_libpq" = "xyes"
2784 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2787 if test $pg_config_status -eq 0
2789 if test -n "$with_libpq_includedir"; then
2790 for dir in $with_libpq_includedir; do
2791 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2795 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2798 SAVE_CPPFLAGS="$CPPFLAGS"
2799 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2801 AC_CHECK_HEADERS(libpq-fe.h, [],
2802 [with_libpq="no (libpq-fe.h not found)"], [])
2804 CPPFLAGS="$SAVE_CPPFLAGS"
2806 if test "x$with_libpq" = "xyes"
2808 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2811 if test $pg_config_status -eq 0
2813 if test -n "$with_libpq_libdir"; then
2814 for dir in $with_libpq_libdir; do
2815 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2819 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2822 SAVE_LDFLAGS="$LDFLAGS"
2823 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2825 AC_CHECK_LIB(pq, PQconnectdb,
2827 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2829 AC_CHECK_LIB(pq, PQserverVersion,
2831 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2833 LDFLAGS="$SAVE_LDFLAGS"
2835 if test "x$with_libpq" = "xyes"
2837 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2838 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2839 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2840 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2842 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2845 # --with-libpthread {{{
2846 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2847 [ if test "x$withval" != "xno" \
2848 && test "x$withval" != "xyes"
2850 LDFLAGS="$LDFLAGS -L$withval/lib"
2851 CPPFLAGS="$CPPFLAGS -I$withval/include"
2852 with_libpthread="yes"
2854 if test "x$withval" = "xno"
2856 with_libpthread="no (disabled)"
2859 ], [with_libpthread="yes"])
2860 if test "x$with_libpthread" = "xyes"
2862 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2865 if test "x$with_libpthread" = "xyes"
2867 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2869 if test "x$with_libpthread" = "xyes"
2875 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2876 [Wether or not to use pthread (POSIX threads) library])
2877 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2882 with_python_path="$PATH"
2883 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
2885 if test "x$withval" = "xyes" || test "x$withval" = "xno"
2887 with_python="$withval"
2888 else if test -x "$withval"
2890 with_python_prog="$withval"
2891 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
2893 else if test -d "$withval"
2895 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
2898 AC_MSG_WARN([Argument not recognized: $withval])
2900 ], [with_python="yes"])
2903 SAVE_CPPFLAGS="$CPPFLAGS"
2904 SAVE_LDFLAGS="$LDFLAGS"
2907 PATH="$with_python_path"
2909 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
2911 AC_MSG_CHECKING([for python])
2912 with_python_prog="`which python 2>/dev/null`"
2913 if test "x$with_python_prog" = "x"
2915 AC_MSG_RESULT([not found])
2916 with_python="no (interpreter not found)"
2918 AC_MSG_RESULT([$with_python_prog])
2922 if test "x$with_python" = "xyes"
2924 AC_MSG_CHECKING([for Python CPPFLAGS])
2925 python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
2926 python_config_status=$?
2928 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
2930 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
2933 AC_MSG_RESULT([$python_include_path])
2937 if test "x$with_python" = "xyes"
2939 CPPFLAGS="-I$python_include_path $CPPFLAGS"
2940 AC_CHECK_HEADERS(Python.h,
2941 [with_python="yes"],
2942 [with_python="no ('Python.h' not found)"])
2945 if test "x$with_python" = "xyes"
2947 AC_MSG_CHECKING([for Python LDFLAGS])
2948 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`
2949 python_config_status=$?
2951 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
2953 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
2956 AC_MSG_RESULT([$python_library_path])
2960 if test "x$with_python" = "xyes"
2962 AC_MSG_CHECKING([for Python LIBS])
2963 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`
2964 python_config_status=$?
2966 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
2968 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
2971 AC_MSG_RESULT([$python_library_flags])
2975 if test "x$with_python" = "xyes"
2977 LDFLAGS="-L$python_library_path $LDFLAGS"
2978 LIBS="$python_library_flags $LIBS"
2980 AC_CHECK_FUNC(PyObject_CallFunction,
2981 [with_python="yes"],
2982 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
2986 CPPFLAGS="$SAVE_CPPFLAGS"
2987 LDFLAGS="$SAVE_LDFLAGS"
2990 if test "x$with_python" = "xyes"
2992 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
2993 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
2994 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
2995 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
2996 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
2997 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
3001 # --with-librouteros {{{
3002 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
3004 if test "x$withval" = "xyes"
3006 with_librouteros="yes"
3007 else if test "x$withval" = "xno"
3009 with_librouteros="no"
3011 with_librouteros="yes"
3012 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
3013 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
3016 [with_librouteros="yes"])
3018 SAVE_CPPFLAGS="$CPPFLAGS"
3019 SAVE_LDFLAGS="$LDFLAGS"
3021 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
3022 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
3024 if test "x$with_librouteros" = "xyes"
3026 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
3028 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
3030 AC_CHECK_HEADERS(routeros_api.h,
3031 [with_librouteros="yes"],
3032 [with_librouteros="no ('routeros_api.h' not found)"])
3034 if test "x$with_librouteros" = "xyes"
3036 if test "x$LIBROUTEROS_LDFLAGS" != "x"
3038 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
3040 AC_CHECK_LIB(routeros, ros_interface,
3041 [with_librouteros="yes"],
3042 [with_librouteros="no (symbol 'ros_interface' not found)"])
3045 CPPFLAGS="$SAVE_CPPFLAGS"
3046 LDFLAGS="$SAVE_LDFLAGS"
3048 if test "x$with_librouteros" = "xyes"
3050 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
3051 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
3052 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
3053 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
3055 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
3059 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
3062 librrd_threadsafe="yes"
3063 librrd_rrdc_update="no"
3064 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
3065 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
3067 librrd_cflags="-I$withval/include"
3068 librrd_ldflags="-L$withval/lib"
3071 with_librrd="$withval"
3073 ], [with_librrd="yes"])
3074 if test "x$with_librrd" = "xyes"
3076 SAVE_CPPFLAGS="$CPPFLAGS"
3077 SAVE_LDFLAGS="$LDFLAGS"
3079 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3080 LDFLAGS="$LDFLAGS $librrd_ldflags"
3082 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
3084 CPPFLAGS="$SAVE_CPPFLAGS"
3085 LDFLAGS="$SAVE_LDFLAGS"
3087 if test "x$with_librrd" = "xyes"
3089 SAVE_CPPFLAGS="$CPPFLAGS"
3090 SAVE_LDFLAGS="$LDFLAGS"
3092 CPPFLAGS="$CPPFLAGS $librrd_cflags"
3093 LDFLAGS="$LDFLAGS $librrd_ldflags"
3095 AC_CHECK_LIB(rrd_th, rrd_update_r,
3097 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3099 [librrd_threadsafe="no"
3100 AC_CHECK_LIB(rrd, rrd_update,
3102 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3104 [with_librrd="no (symbol 'rrd_update' not found)"],
3109 if test "x$librrd_threadsafe" = "xyes"
3111 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3113 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3116 CPPFLAGS="$SAVE_CPPFLAGS"
3117 LDFLAGS="$SAVE_LDFLAGS"
3119 if test "x$with_librrd" = "xyes"
3121 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3122 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3123 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3124 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3126 if test "x$librrd_threadsafe" = "xyes"
3128 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3132 # --with-libsensors {{{
3133 with_sensors_cflags=""
3134 with_sensors_ldflags=""
3135 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3137 if test "x$withval" = "xno"
3139 with_libsensors="no"
3141 with_libsensors="yes"
3142 if test "x$withval" != "xyes"
3144 with_sensors_cflags="-I$withval/include"
3145 with_sensors_ldflags="-L$withval/lib"
3146 with_libsensors="yes"
3151 if test "x$ac_system" = "xLinux"
3153 with_libsensors="yes"
3155 with_libsensors="no (Linux only library)"
3158 if test "x$with_libsensors" = "xyes"
3160 SAVE_CPPFLAGS="$CPPFLAGS"
3161 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3163 # AC_CHECK_HEADERS(sensors/sensors.h,
3165 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3167 # [with_libsensors="no (sensors/sensors.h not found)"])
3168 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3170 CPPFLAGS="$SAVE_CPPFLAGS"
3172 if test "x$with_libsensors" = "xyes"
3174 SAVE_CPPFLAGS="$CPPFLAGS"
3175 SAVE_LDFLAGS="$LDFLAGS"
3176 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3177 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3179 AC_CHECK_LIB(sensors, sensors_init,
3181 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3183 [with_libsensors="no (libsensors not found)"])
3185 CPPFLAGS="$SAVE_CPPFLAGS"
3186 LDFLAGS="$SAVE_LDFLAGS"
3188 if test "x$with_libsensors" = "xyes"
3190 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3191 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3192 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3193 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3195 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3198 # --with-libstatgrab {{{
3199 with_libstatgrab_cflags=""
3200 with_libstatgrab_ldflags=""
3201 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3203 if test "x$withval" != "xno" \
3204 && test "x$withval" != "xyes"
3206 with_libstatgrab_cflags="-I$withval/include"
3207 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3208 with_libstatgrab="yes"
3209 with_libstatgrab_pkg_config="no"
3211 with_libstatgrab="$withval"
3212 with_libstatgrab_pkg_config="yes"
3216 with_libstatgrab="yes"
3217 with_libstatgrab_pkg_config="yes"
3220 if test "x$with_libstatgrab" = "xyes" \
3221 && test "x$with_libstatgrab_pkg_config" = "xyes"
3223 if test "x$PKG_CONFIG" != "x"
3225 AC_MSG_CHECKING([pkg-config for libstatgrab])
3227 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3230 with_libstatgrab_pkg_config="no"
3231 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
3232 temp_result="not found"
3234 AC_MSG_RESULT([$temp_result])
3236 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3237 with_libstatgrab_pkg_config="no"
3238 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3242 if test "x$with_libstatgrab" = "xyes" \
3243 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3244 && test "x$with_libstatgrab_cflags" = "x"
3246 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3247 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3250 with_libstatgrab_cflags="$temp_result"
3252 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3253 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3255 AC_MSG_RESULT([$temp_result])
3258 if test "x$with_libstatgrab" = "xyes" \
3259 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3260 && test "x$with_libstatgrab_ldflags" = "x"
3262 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3263 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3266 with_libstatgrab_ldflags="$temp_result"
3268 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3269 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3271 AC_MSG_RESULT([$temp_result])
3274 if test "x$with_libstatgrab" = "xyes"
3276 SAVE_CPPFLAGS="$CPPFLAGS"
3277 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3279 AC_CHECK_HEADERS(statgrab.h,
3280 [with_libstatgrab="yes"],
3281 [with_libstatgrab="no (statgrab.h not found)"])
3283 CPPFLAGS="$SAVE_CPPFLAGS"
3286 if test "x$with_libstatgrab" = "xyes"
3288 SAVE_CFLAGS="$CFLAGS"
3289 SAVE_LDFLAGS="$LDFLAGS"
3291 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3292 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3294 AC_CHECK_LIB(statgrab, sg_init,
3295 [with_libstatgrab="yes"],
3296 [with_libstatgrab="no (symbol sg_init not found)"])
3298 CFLAGS="$SAVE_CFLAGS"
3299 LDFLAGS="$SAVE_LDFLAGS"
3302 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3303 if test "x$with_libstatgrab" = "xyes"
3305 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3306 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3307 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3308 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3309 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3313 # --with-libtokyotyrant {{{
3314 with_libtokyotyrant_cppflags=""
3315 with_libtokyotyrant_ldflags=""
3316 with_libtokyotyrant_libs=""
3317 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3319 if test "x$withval" = "xno"
3321 with_libtokyotyrant="no"
3322 else if test "x$withval" = "xyes"
3324 with_libtokyotyrant="yes"
3326 with_libtokyotyrant_cppflags="-I$withval/include"
3327 with_libtokyotyrant_ldflags="-L$withval/include"
3328 with_libtokyotyrant_libs="-ltokyotyrant"
3329 with_libtokyotyrant="yes"
3333 with_libtokyotyrant="yes"
3336 if test "x$with_libtokyotyrant" = "xyes"
3338 if $PKG_CONFIG --exists tokyotyrant
3340 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3341 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3342 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3346 SAVE_CPPFLAGS="$CPPFLAGS"
3347 SAVE_LDFLAGS="$LDFLAGS"
3348 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3349 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3351 if test "x$with_libtokyotyrant" = "xyes"
3353 AC_CHECK_HEADERS(tcrdb.h,
3355 AC_DEFINE(HAVE_TCRDB_H, 1,
3356 [Define to 1 if you have the <tcrdb.h> header file.])
3357 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3360 if test "x$with_libtokyotyrant" = "xyes"
3362 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3364 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3365 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3367 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3368 [$with_libtokyotyrant_libs])
3371 CPPFLAGS="$SAVE_CPPFLAGS"
3372 LDFLAGS="$SAVE_LDFLAGS"
3374 if test "x$with_libtokyotyrant" = "xyes"
3376 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3377 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3378 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3379 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3380 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3381 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3383 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3386 # --with-libupsclient {{{
3387 with_libupsclient_config=""
3388 with_libupsclient_cflags=""
3389 with_libupsclient_libs=""
3390 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3392 if test "x$withval" = "xno"
3394 with_libupsclient="no"
3395 else if test "x$withval" = "xyes"
3397 with_libupsclient="use_pkgconfig"
3399 if test -x "$withval"
3401 with_libupsclient_config="$withval"
3402 with_libupsclient="use_libupsclient_config"
3403 else if test -x "$withval/bin/libupsclient-config"
3405 with_libupsclient_config="$withval/bin/libupsclient-config"
3406 with_libupsclient="use_libupsclient_config"
3408 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3409 with_libupsclient_cflags="-I$withval/include"
3410 with_libupsclient_libs="-L$withval/lib -lupsclient"
3411 with_libupsclient="yes"
3415 [with_libupsclient="use_pkgconfig"])
3417 # configure using libupsclient-config
3418 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3420 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3421 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3424 with_libupsclient="no ($with_libupsclient_config failed)"
3426 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3429 with_libupsclient="no ($with_libupsclient_config failed)"
3432 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3434 with_libupsclient="yes"
3437 # configure using pkg-config
3438 if test "x$with_libupsclient" = "xuse_pkgconfig"
3440 if test "x$PKG_CONFIG" = "x"
3442 with_libupsclient="no (Don't have pkg-config)"
3445 if test "x$with_libupsclient" = "xuse_pkgconfig"
3447 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3448 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3451 with_libupsclient="no (pkg-config doesn't know library)"
3454 if test "x$with_libupsclient" = "xuse_pkgconfig"
3456 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3459 with_libupsclient="no ($PKG_CONFIG failed)"
3461 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3464 with_libupsclient="no ($PKG_CONFIG failed)"
3467 if test "x$with_libupsclient" = "xuse_pkgconfig"
3469 with_libupsclient="yes"
3472 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3473 # the actual checks.
3474 if test "x$with_libupsclient" = "xyes"
3476 SAVE_CPPFLAGS="$CPPFLAGS"
3477 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3479 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3481 CPPFLAGS="$SAVE_CPPFLAGS"
3483 if test "x$with_libupsclient" = "xyes"
3485 SAVE_CPPFLAGS="$CPPFLAGS"
3486 SAVE_LDFLAGS="$LDFLAGS"
3488 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3489 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3491 AC_CHECK_LIB(upsclient, upscli_connect,
3492 [with_libupsclient="yes"],
3493 [with_libupsclient="no (symbol upscli_connect not found)"])
3495 CPPFLAGS="$SAVE_CPPFLAGS"
3496 LDFLAGS="$SAVE_LDFLAGS"
3498 if test "x$with_libupsclient" = "xyes"
3500 SAVE_CPPFLAGS="$CPPFLAGS"
3501 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3503 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3504 [#include <stdlib.h>
3506 #include <upsclient.h>])
3508 CPPFLAGS="$SAVE_CPPFLAGS"
3510 if test "x$with_libupsclient" = "xyes"
3512 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3513 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3514 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3515 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3519 # --with-libxmms {{{
3520 with_xmms_config="xmms-config"
3523 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3525 if test "x$withval" != "xno" \
3526 && test "x$withval" != "xyes"
3528 if test -f "$withval" && test -x "$withval";
3530 with_xmms_config="$withval"
3531 else if test -x "$withval/bin/xmms-config"
3533 with_xmms_config="$withval/bin/xmms-config"
3536 else if test "x$withval" = "xno"
3546 if test "x$with_libxmms" = "xyes"
3548 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3549 xmms_config_status=$?
3551 if test $xmms_config_status -ne 0
3556 if test "x$with_libxmms" = "xyes"
3558 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3559 xmms_config_status=$?
3561 if test $xmms_config_status -ne 0
3566 if test "x$with_libxmms" = "xyes"
3568 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3570 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3571 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3572 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3573 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3580 with_libxmms_numeric=0
3581 if test "x$with_libxmms" = "xyes"
3583 with_libxmms_numeric=1
3585 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3586 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3589 # --with-libyajl {{{
3590 with_libyajl_cppflags=""
3591 with_libyajl_ldflags=""
3592 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3594 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3596 with_libyajl_cppflags="-I$withval/include"
3597 with_libyajl_ldflags="-L$withval/lib"
3600 with_libyajl="$withval"
3606 if test "x$with_libyajl" = "xyes"
3608 SAVE_CPPFLAGS="$CPPFLAGS"
3609 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3611 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3612 AC_CHECK_HEADERS(yajl/yajl_version.h)
3614 CPPFLAGS="$SAVE_CPPFLAGS"
3616 if test "x$with_libyajl" = "xyes"
3618 SAVE_CPPFLAGS="$CPPFLAGS"
3619 SAVE_LDFLAGS="$LDFLAGS"
3620 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3621 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3623 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3625 CPPFLAGS="$SAVE_CPPFLAGS"
3626 LDFLAGS="$SAVE_LDFLAGS"
3628 if test "x$with_libyajl" = "xyes"
3630 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3631 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3632 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3633 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3634 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3635 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3636 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3638 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3641 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3642 with_libxml2="no (pkg-config isn't available)"
3643 with_libxml2_cflags=""
3644 with_libxml2_ldflags=""
3645 with_libvirt="no (pkg-config isn't available)"
3646 with_libvirt_cflags=""
3647 with_libvirt_ldflags=""
3648 if test "x$PKG_CONFIG" != "x"
3650 pkg-config --exists 'libxml-2.0' 2>/dev/null
3655 with_libxml2="no (pkg-config doesn't know library)"
3658 pkg-config --exists libvirt 2>/dev/null
3663 with_libvirt="no (pkg-config doesn't know library)"
3666 if test "x$with_libxml2" = "xyes"
3668 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3673 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3679 if test "x$with_libxml2" = "xyes"
3681 SAVE_CPPFLAGS="$CPPFLAGS"
3682 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3684 AC_CHECK_HEADERS(libxml/parser.h, [],
3685 [with_libxml2="no (libxml/parser.h not found)"])
3687 CPPFLAGS="$SAVE_CPPFLAGS"
3689 if test "x$with_libxml2" = "xyes"
3691 SAVE_CFLAGS="$CFLAGS"
3692 SAVE_LDFLAGS="$LDFLAGS"
3694 CFLAGS="$CFLAGS $with_libxml2_cflags"
3695 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3697 AC_CHECK_LIB(xml2, xmlXPathEval,
3698 [with_libxml2="yes"],
3699 [with_libxml2="no (symbol xmlXPathEval not found)"])
3701 CFLAGS="$SAVE_CFLAGS"
3702 LDFLAGS="$SAVE_LDFLAGS"
3704 dnl Add the right compiler flags and libraries.
3705 if test "x$with_libxml2" = "xyes"; then
3706 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3707 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3708 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3709 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3711 if test "x$with_libvirt" = "xyes"
3713 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3718 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3724 if test "x$with_libvirt" = "xyes"
3726 SAVE_CPPFLAGS="$CPPFLAGS"
3727 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3729 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3730 [with_libvirt="no (libvirt/libvirt.h not found)"])
3732 CPPFLAGS="$SAVE_CPPFLAGS"
3734 if test "x$with_libvirt" = "xyes"
3736 SAVE_CFLAGS="$CFLAGS"
3737 SAVE_LDFLAGS="$LDFLAGS"
3739 CFLAGS="$CFLAGS $with_libvirt_cflags"
3740 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3742 AC_CHECK_LIB(virt, virDomainBlockStats,
3743 [with_libvirt="yes"],
3744 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3746 CFLAGS="$SAVE_CFLAGS"
3747 LDFLAGS="$SAVE_LDFLAGS"
3749 dnl Add the right compiler flags and libraries.
3750 if test "x$with_libvirt" = "xyes"; then
3751 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3752 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3753 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3754 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3758 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3759 with_libopenipmipthread="yes"
3760 with_libopenipmipthread_cflags=""
3761 with_libopenipmipthread_libs=""
3763 AC_MSG_CHECKING([for pkg-config])
3765 if test "x$PKG_CONFIG" = "x"
3767 with_libopenipmipthread="no"
3770 temp_result="$PKG_CONFIG"
3772 AC_MSG_RESULT([$temp_result])
3774 if test "x$with_libopenipmipthread" = "xyes"
3776 AC_MSG_CHECKING([for libOpenIPMIpthread])
3777 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3780 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3782 AC_MSG_RESULT([$with_libopenipmipthread])
3785 if test "x$with_libopenipmipthread" = "xyes"
3787 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3788 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3791 with_libopenipmipthread_cflags="$temp_result"
3793 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3794 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3796 AC_MSG_RESULT([$temp_result])
3799 if test "x$with_libopenipmipthread" = "xyes"
3801 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3802 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3805 with_libopenipmipthread_ldflags="$temp_result"
3807 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3808 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3810 AC_MSG_RESULT([$temp_result])
3813 if test "x$with_libopenipmipthread" = "xyes"
3815 SAVE_CPPFLAGS="$CPPFLAGS"
3816 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3818 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3819 [with_libopenipmipthread="yes"],
3820 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3821 [#include <OpenIPMI/ipmiif.h>
3822 #include <OpenIPMI/ipmi_err.h>
3823 #include <OpenIPMI/ipmi_posix.h>
3824 #include <OpenIPMI/ipmi_conn.h>
3827 CPPFLAGS="$SAVE_CPPFLAGS"
3830 if test "x$with_libopenipmipthread" = "xyes"
3832 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3833 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3834 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3835 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3839 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3840 [with_libnotify="yes"],
3841 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3843 # Check for enabled/disabled features
3846 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3847 # ------------------------------------------------------------
3849 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3854 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3859 m4_define([EnDis],[disabled])dnl
3860 m4_define([YesNo],[no])dnl
3866 m4_define([EnDis],[enabled])dnl
3867 m4_define([YesNo],[yes])dnl
3870 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3874 m4_if([$3], [feature], [],
3878 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3884 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3886 enable_$1='[YesNo]'dnl
3888 if test "x$enable_$1" = "xno"
3892 if test "x$enable_$1" = "xyes"
3896 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3901 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3902 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3904 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3906 # AC_PLUGIN(name, default, info)
3907 # ------------------------------------------------------------
3914 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3916 if test "x$enableval" = "xyes"
3919 else if test "x$enableval" = "xforce"
3924 enable_plugin="no (disabled on command line)"
3928 if test "x$enable_all_plugins" = "xauto"
3930 if test "x$2" = "xyes"
3937 enable_plugin="$enable_all_plugins"
3940 if test "x$enable_plugin" = "xyes"
3942 if test "x$2" = "xyes" || test "x$force" = "xyes"
3944 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3945 if test "x$2" != "xyes"
3947 dependency_warning="yes"
3949 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3950 dependency_error="yes"
3951 enable_plugin="no (dependency error)"
3954 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3955 enable_$1="$enable_plugin"
3957 )# AC_PLUGIN(name, default, info)
3959 m4_divert_once([HELP_ENABLE], [
3960 collectd features:])
3961 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3962 AC_COLLECTD([debug], [enable], [feature], [debugging])
3963 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3964 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3966 dependency_warning="no"
3967 dependency_error="no"
3972 plugin_conntrack="no"
3973 plugin_contextswitch="no"
3976 plugin_curl_json="no"
3977 plugin_curl_xml="no"
3981 plugin_interface="no"
3988 plugin_multimeter="no"
3992 plugin_processes="no"
3993 plugin_protocols="no"
3997 plugin_tcpconns="no"
4004 plugin_wireless="no"
4008 if test "x$ac_system" = "xLinux"
4010 plugin_battery="yes"
4011 plugin_conntrack="yes"
4012 plugin_contextswitch="yes"
4014 plugin_cpufreq="yes"
4016 plugin_entropy="yes"
4017 plugin_interface="yes"
4022 plugin_fscache="yes"
4023 plugin_processes="yes"
4024 plugin_protocols="yes"
4027 plugin_tcpconns="yes"
4028 plugin_thermal="yes"
4031 plugin_vserver="yes"
4032 plugin_wireless="yes"
4034 if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
4040 if test "x$ac_system" = "xOpenBSD"
4042 plugin_tcpconns="yes"
4046 if test "x$with_libiokit" = "xyes"
4048 plugin_battery="yes"
4053 if test "x$with_perfstat" = "xyes"
4059 plugin_interface="yes"
4063 if test "x$with_procinfo" = "xyes"
4065 plugin_processes="yes"
4069 if test "x$with_kstat" = "xyes"
4072 plugin_zfs_arc="yes"
4075 if test "x$with_devinfo$with_kstat" = "xyesyes"
4079 plugin_interface="yes"
4084 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
4090 if test "x$with_libstatgrab" = "xyes"
4094 plugin_interface="yes"
4101 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4107 if test "x$with_libopenipmipthread" = "xyes"
4112 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4114 plugin_curl_json="yes"
4117 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4119 plugin_curl_xml="yes"
4122 if test "x$have_processor_info" = "xyes"
4126 if test "x$have_sysctl" = "xyes"
4133 if test "x$have_sysctlbyname" = "xyes"
4137 plugin_tcpconns="yes"
4140 # Df plugin: Check if we know how to determine mount points first.
4141 #if test "x$have_listmntent" = "xyes"; then
4144 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4148 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4152 #if test "x$have_getmntent" = "xseq"
4156 if test "x$c_cv_have_one_getmntent" = "xyes"
4161 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4162 if test "x$plugin_df" = "xyes"
4165 if test "x$have_statfs" = "xyes"
4169 if test "x$have_statvfs" = "xyes"
4175 if test "x$have_getifaddrs" = "xyes"
4177 plugin_interface="yes"
4180 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4182 plugin_libvirt="yes"
4185 if test "x$have_getloadavg" = "xyes"
4190 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4195 # Mac OS X memory interface
4196 if test "x$have_host_statistics" = "xyes"
4201 if test "x$have_termios_h" = "xyes"
4203 plugin_multimeter="yes"
4207 if test "x$have_thread_info" = "xyes"
4209 plugin_processes="yes"
4212 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4214 plugin_processes="yes"
4217 if test "x$with_kvm_getswapinfo" = "xyes"
4222 if test "x$have_swapctl" = "xyes"
4227 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4229 plugin_tcpconns="yes"
4232 if test "x$have_getutent" = "xyes"
4236 if test "x$have_getutxent" = "xyes"
4241 m4_divert_once([HELP_ENABLE], [
4244 AC_ARG_ENABLE([all-plugins],
4245 AC_HELP_STRING([--enable-all-plugins],
4246 [enable all plugins (auto by def)]),
4248 if test "x$enableval" = "xyes"
4250 enable_all_plugins="yes"
4251 else if test "x$enableval" = "xauto"
4253 enable_all_plugins="auto"
4255 enable_all_plugins="no"
4258 [enable_all_plugins="auto"])
4260 m4_divert_once([HELP_ENABLE], [])
4262 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4263 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4264 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4265 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4266 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4267 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4268 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4269 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4270 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4271 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4272 AC_PLUGIN([csv], [yes], [CSV output plugin])
4273 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4274 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4275 AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics])
4276 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4277 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4278 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4279 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4280 AC_PLUGIN([email], [yes], [EMail statistics])
4281 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4282 AC_PLUGIN([exec], [yes], [Execution of external programs])
4283 AC_PLUGIN([filecount], [yes], [Count files in directories])
4284 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4285 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4286 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4287 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4288 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4289 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4290 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4291 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4292 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4293 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4294 AC_PLUGIN([load], [$plugin_load], [System load])
4295 AC_PLUGIN([logfile], [yes], [File logging plugin])
4296 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4297 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4298 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4299 AC_PLUGIN([match_regex], [yes], [The regex match])
4300 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4301 AC_PLUGIN([match_value], [yes], [The value match])
4302 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4303 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4304 AC_PLUGIN([memcached], [yes], [memcached statistics])
4305 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4306 AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
4307 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4308 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4309 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4310 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4311 AC_PLUGIN([network], [yes], [Network communication plugin])
4312 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4313 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4314 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4315 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4316 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4317 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4318 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4319 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4320 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4321 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4322 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4323 # FIXME: Check for libevent, too.
4324 AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics])
4325 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4326 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4327 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4328 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4329 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4330 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4331 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4332 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4333 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4334 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4335 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4336 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4337 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4338 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4339 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4340 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4341 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4342 AC_PLUGIN([target_notification], [yes], [The notification target])
4343 AC_PLUGIN([target_replace], [yes], [The replace target])
4344 AC_PLUGIN([target_scale],[yes], [The scale target])
4345 AC_PLUGIN([target_set], [yes], [The set target])
4346 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4347 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4348 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4349 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4350 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4351 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4352 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4353 AC_PLUGIN([users], [$plugin_users], [User statistics])
4354 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4355 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4356 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4357 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4358 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4359 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4360 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4362 dnl Default configuration file
4363 # Load either syslog or logfile
4364 LOAD_PLUGIN_SYSLOG=""
4365 LOAD_PLUGIN_LOGFILE=""
4367 AC_MSG_CHECKING([which default log plugin to load])
4368 default_log_plugin="none"
4369 if test "x$enable_syslog" = "xyes"
4371 default_log_plugin="syslog"
4373 LOAD_PLUGIN_SYSLOG="##"
4376 if test "x$enable_logfile" = "xyes"
4378 if test "x$default_log_plugin" = "xnone"
4380 default_log_plugin="logfile"
4382 LOAD_PLUGIN_LOGFILE="#"
4385 LOAD_PLUGIN_LOGFILE="##"
4387 AC_MSG_RESULT([$default_log_plugin])
4389 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4390 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4392 DEFAULT_LOG_LEVEL="info"
4393 if test "x$enable_debug" = "xyes"
4395 DEFAULT_LOG_LEVEL="debug"
4397 AC_SUBST(DEFAULT_LOG_LEVEL)
4399 # Load only one of rrdtool, network, csv in the default config.
4400 LOAD_PLUGIN_RRDTOOL=""
4401 LOAD_PLUGIN_NETWORK=""
4404 AC_MSG_CHECKING([which default write plugin to load])
4405 default_write_plugin="none"
4406 if test "x$enable_rrdtool" = "xyes"
4408 default_write_plugin="rrdtool"
4410 LOAD_PLUGIN_RRDTOOL="##"
4413 if test "x$enable_network" = "xyes"
4415 if test "x$default_write_plugin" = "xnone"
4417 default_write_plugin="network"
4419 LOAD_PLUGIN_NETWORK="#"
4422 LOAD_PLUGIN_NETWORK="##"
4425 if test "x$enable_csv" = "xyes"
4427 if test "x$default_write_plugin" = "xnone"
4429 default_write_plugin="csv"
4434 LOAD_PLUGIN_CSV="##"
4436 AC_MSG_RESULT([$default_write_plugin])
4438 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4439 AC_SUBST(LOAD_PLUGIN_NETWORK)
4440 AC_SUBST(LOAD_PLUGIN_CSV)
4443 if test "x$ac_system" = "xLinux" \
4444 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4446 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4450 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4452 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4454 PERL_BINDINGS_OPTIONS="$withval"
4455 with_perl_bindings="yes"
4457 PERL_BINDINGS_OPTIONS=""
4458 with_perl_bindings="$withval"
4462 PERL_BINDINGS_OPTIONS=""
4463 if test -n "$perl_interpreter"
4465 with_perl_bindings="yes"
4467 with_perl_bindings="no (no perl interpreter found)"
4470 if test "x$with_perl_bindings" = "xyes"
4472 PERL_BINDINGS="perl"
4476 AC_SUBST(PERL_BINDINGS)
4477 AC_SUBST(PERL_BINDINGS_OPTIONS)
4479 dnl libcollectdclient
4480 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4481 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4482 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4484 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4486 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4488 AC_SUBST(LCC_VERSION_MAJOR)
4489 AC_SUBST(LCC_VERSION_MINOR)
4490 AC_SUBST(LCC_VERSION_PATCH)
4491 AC_SUBST(LCC_VERSION_EXTRA)
4492 AC_SUBST(LCC_VERSION_STRING)
4494 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4496 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)
4498 if test "x$with_librrd" = "xyes" \
4499 && test "x$librrd_threadsafe" != "xyes"
4501 with_librrd="yes (warning: librrd is not thread-safe)"
4504 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
4506 with_libiptc="yes (shipped version)"
4509 if test "x$with_libperl" = "xyes"
4511 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4513 enable_perl="no (needs libperl)"
4516 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4518 enable_perl="no (libperl doesn't support ithreads)"
4521 if test "x$with_perl_bindings" = "xyes" \
4522 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4524 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4531 libcurl . . . . . . . $with_libcurl
4532 libdbi . . . . . . . $with_libdbi
4533 libesmtp . . . . . . $with_libesmtp
4534 libganglia . . . . . $with_libganglia
4535 libgcrypt . . . . . . $with_libgcrypt
4536 libiokit . . . . . . $with_libiokit
4537 libiptc . . . . . . . $with_libiptc
4538 libjvm . . . . . . . $with_java
4539 libkstat . . . . . . $with_kstat
4540 libkvm . . . . . . . $with_libkvm
4541 libmemcached . . . . $with_libmemcached
4542 libmodbus . . . . . . $with_libmodbus
4543 libmysql . . . . . . $with_libmysql
4544 libnetapp . . . . . . $with_libnetapp
4545 libnetlink . . . . . $with_libnetlink
4546 libnetsnmp . . . . . $with_libnetsnmp
4547 libnotify . . . . . . $with_libnotify
4548 liboconfig . . . . . $with_liboconfig
4549 libopenipmi . . . . . $with_libopenipmipthread
4550 liboping . . . . . . $with_liboping
4551 libpcap . . . . . . . $with_libpcap
4552 libperfstat . . . . . $with_perfstat
4553 libperl . . . . . . . $with_libperl
4554 libpq . . . . . . . . $with_libpq
4555 libpthread . . . . . $with_libpthread
4556 librouteros . . . . . $with_librouteros
4557 librrd . . . . . . . $with_librrd
4558 libsensors . . . . . $with_libsensors
4559 libstatgrab . . . . . $with_libstatgrab
4560 libtokyotyrant . . . $with_libtokyotyrant
4561 libupsclient . . . . $with_libupsclient
4562 libvirt . . . . . . . $with_libvirt
4563 libxml2 . . . . . . . $with_libxml2
4564 libxmms . . . . . . . $with_libxmms
4565 libyajl . . . . . . . $with_libyajl
4566 libevent . . . . . . $with_libevent
4567 protobuf-c . . . . . $have_protoc_c
4568 oracle . . . . . . . $with_oracle
4569 python . . . . . . . $with_python
4572 daemon mode . . . . . $enable_daemon
4573 debug . . . . . . . . $enable_debug
4576 perl . . . . . . . . $with_perl_bindings
4579 apache . . . . . . . $enable_apache
4580 apcups . . . . . . . $enable_apcups
4581 apple_sensors . . . . $enable_apple_sensors
4582 ascent . . . . . . . $enable_ascent
4583 battery . . . . . . . $enable_battery
4584 bind . . . . . . . . $enable_bind
4585 conntrack . . . . . . $enable_conntrack
4586 contextswitch . . . . $enable_contextswitch
4587 cpu . . . . . . . . . $enable_cpu
4588 cpufreq . . . . . . . $enable_cpufreq
4589 csv . . . . . . . . . $enable_csv
4590 curl . . . . . . . . $enable_curl
4591 curl_json . . . . . . $enable_curl_json
4592 curl_xml . . . . . . $enable_curl_xml
4593 dbi . . . . . . . . . $enable_dbi
4594 df . . . . . . . . . $enable_df
4595 disk . . . . . . . . $enable_disk
4596 dns . . . . . . . . . $enable_dns
4597 email . . . . . . . . $enable_email
4598 entropy . . . . . . . $enable_entropy
4599 exec . . . . . . . . $enable_exec
4600 filecount . . . . . . $enable_filecount
4601 fscache . . . . . . . $enable_fscache
4602 gmond . . . . . . . . $enable_gmond
4603 hddtemp . . . . . . . $enable_hddtemp
4604 interface . . . . . . $enable_interface
4605 ipmi . . . . . . . . $enable_ipmi
4606 iptables . . . . . . $enable_iptables
4607 ipvs . . . . . . . . $enable_ipvs
4608 irq . . . . . . . . . $enable_irq
4609 java . . . . . . . . $enable_java
4610 libvirt . . . . . . . $enable_libvirt
4611 load . . . . . . . . $enable_load
4612 logfile . . . . . . . $enable_logfile
4613 madwifi . . . . . . . $enable_madwifi
4614 match_empty_counter . $enable_match_empty_counter
4615 match_hashed . . . . $enable_match_hashed
4616 match_regex . . . . . $enable_match_regex
4617 match_timediff . . . $enable_match_timediff
4618 match_value . . . . . $enable_match_value
4619 mbmon . . . . . . . . $enable_mbmon
4620 memcachec . . . . . . $enable_memcachec
4621 memcached . . . . . . $enable_memcached
4622 memory . . . . . . . $enable_memory
4623 modbus . . . . . . . $enable_modbus
4624 multimeter . . . . . $enable_multimeter
4625 mysql . . . . . . . . $enable_mysql
4626 netapp . . . . . . . $enable_netapp
4627 netlink . . . . . . . $enable_netlink
4628 network . . . . . . . $enable_network
4629 nfs . . . . . . . . . $enable_nfs
4630 nginx . . . . . . . . $enable_nginx
4631 notify_desktop . . . $enable_notify_desktop
4632 notify_email . . . . $enable_notify_email
4633 ntpd . . . . . . . . $enable_ntpd
4634 nut . . . . . . . . . $enable_nut
4635 olsrd . . . . . . . . $enable_olsrd
4636 onewire . . . . . . . $enable_onewire
4637 openvpn . . . . . . . $enable_openvpn
4638 oracle . . . . . . . $enable_oracle
4639 perl . . . . . . . . $enable_perl
4640 pinba . . . . . . . . $enable_pinba
4641 ping . . . . . . . . $enable_ping
4642 postgresql . . . . . $enable_postgresql
4643 powerdns . . . . . . $enable_powerdns
4644 processes . . . . . . $enable_processes
4645 protocols . . . . . . $enable_protocols
4646 python . . . . . . . $enable_python
4647 routeros . . . . . . $enable_routeros
4648 rrdcached . . . . . . $enable_rrdcached
4649 rrdtool . . . . . . . $enable_rrdtool
4650 sensors . . . . . . . $enable_sensors
4651 serial . . . . . . . $enable_serial
4652 snmp . . . . . . . . $enable_snmp
4653 swap . . . . . . . . $enable_swap
4654 syslog . . . . . . . $enable_syslog
4655 table . . . . . . . . $enable_table
4656 tail . . . . . . . . $enable_tail
4657 tape . . . . . . . . $enable_tape
4658 target_notification . $enable_target_notification
4659 target_replace . . . $enable_target_replace
4660 target_scale . . . . $enable_target_scale
4661 target_set . . . . . $enable_target_set
4662 tcpconns . . . . . . $enable_tcpconns
4663 teamspeak2 . . . . . $enable_teamspeak2
4664 ted . . . . . . . . . $enable_ted
4665 thermal . . . . . . . $enable_thermal
4666 tokyotyrant . . . . . $enable_tokyotyrant
4667 unixsock . . . . . . $enable_unixsock
4668 uptime . . . . . . . $enable_uptime
4669 users . . . . . . . . $enable_users
4670 uuid . . . . . . . . $enable_uuid
4671 vmem . . . . . . . . $enable_vmem
4672 vserver . . . . . . . $enable_vserver
4673 wireless . . . . . . $enable_wireless
4674 write_http . . . . . $enable_write_http
4675 xmms . . . . . . . . $enable_xmms
4676 zfs_arc . . . . . . . $enable_zfs_arc
4680 if test "x$dependency_error" = "xyes"; then
4681 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
4684 if test "x$dependency_warning" = "xyes"; then
4685 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
4688 # vim: set fdm=marker :