1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(collectd, m4_esyscmd(./version-gen.sh))
3 AC_CONFIG_SRCDIR(src/collectd.c)
4 AC_CONFIG_HEADERS(src/config.h)
6 m4_ifdef([LT_PACKAGE_VERSION],
9 LT_CONFIG_LTDL_DIR([libltdl])
11 LTDL_INIT([convenience])
12 AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.])
17 AC_LIBLTDL_CONVENIENCE
21 AC_CONFIG_SUBDIRS(libltdl)
22 AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.])
26 AM_INIT_AUTOMAKE(dist-bzip2)
29 AC_PREFIX_DEFAULT("/opt/collectd")
34 # Checks for programs.
42 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
50 AC_MSG_CHECKING([for kernel type ($host_os)])
53 AC_DEFINE([KERNEL_LINUX], 1, [True if program is to be compiled for a Linux kernel])
57 AC_DEFINE([KERNEL_SOLARIS], 1, [True if program is to be compiled for a Solaris kernel])
67 AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
73 AC_MSG_RESULT([$ac_system])
75 if test "x$ac_system" = "xLinux"
77 AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
78 if test -z "$KERNEL_DIR"
80 KERNEL_DIR="/lib/modules/`uname -r`/source"
83 KERNEL_CFLAGS="-I$KERNEL_DIR/include"
84 AC_SUBST(KERNEL_CFLAGS)
87 if test "x$ac_system" = "xSolaris"
89 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
91 if test "x$ac_system" = "xAIX"
93 AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
96 # Where to install .pc files.
97 pkgconfigdir="${libdir}/pkgconfig"
98 AC_SUBST(pkgconfigdir)
100 # Check for standards compliance mode
101 AC_ARG_ENABLE(standards,
102 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
103 [enable_standards="$enableval"],
104 [enable_standards="no"])
105 if test "x$enable_standards" = "xyes"
107 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
108 AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
109 AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
110 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
112 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
115 # Checks for header files.
122 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)
125 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
130 # include <sys/types.h>
133 AC_CHECK_HEADERS(netinet/in.h, [], [],
138 # include <sys/types.h>
140 #if HAVE_NETINET_IN_SYSTM_H
141 # include <netinet/in_systm.h>
144 AC_CHECK_HEADERS(netinet/ip.h, [], [],
149 # include <sys/types.h>
151 #if HAVE_NETINET_IN_SYSTM_H
152 # include <netinet/in_systm.h>
154 #if HAVE_NETINET_IN_H
155 # include <netinet/in.h>
158 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
163 # include <sys/types.h>
165 #if HAVE_NETINET_IN_SYSTM_H
166 # include <netinet/in_systm.h>
168 #if HAVE_NETINET_IN_H
169 # include <netinet/in.h>
171 #if HAVE_NETINET_IP_H
172 # include <netinet/ip.h>
175 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
180 # include <sys/types.h>
182 #if HAVE_NETINET_IN_SYSTM_H
183 # include <netinet/in_systm.h>
185 #if HAVE_NETINET_IN_H
186 # include <netinet/in.h>
188 #if HAVE_NETINET_IP_H
189 # include <netinet/ip.h>
192 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
197 # include <sys/types.h>
199 #if HAVE_NETINET_IN_SYSTM_H
200 # include <netinet/in_systm.h>
202 #if HAVE_NETINET_IN_H
203 # include <netinet/in.h>
206 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
211 # include <sys/types.h>
213 #if HAVE_NETINET_IN_SYSTM_H
214 # include <netinet/in_systm.h>
216 #if HAVE_NETINET_IN_H
217 # include <netinet/in.h>
219 #if HAVE_NETINET_IP6_H
220 # include <netinet/ip6.h>
223 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
228 # include <sys/types.h>
230 #if HAVE_NETINET_IN_SYSTM_H
231 # include <netinet/in_systm.h>
233 #if HAVE_NETINET_IN_H
234 # include <netinet/in.h>
236 #if HAVE_NETINET_IP_H
237 # include <netinet/ip.h>
240 AC_CHECK_HEADERS(netinet/udp.h, [], [],
245 # include <sys/types.h>
247 #if HAVE_NETINET_IN_SYSTM_H
248 # include <netinet/in_systm.h>
250 #if HAVE_NETINET_IN_H
251 # include <netinet/in.h>
253 #if HAVE_NETINET_IP_H
254 # include <netinet/ip.h>
259 AC_CHECK_HEADERS(sys/dkstat.h)
260 if test "x$ac_system" = "xDarwin"
262 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)
263 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
265 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
268 # include <sys/types.h>
271 # include <sys/param.h>
275 AC_MSG_CHECKING([for sysctl kern.cp_times])
276 if test -x /sbin/sysctl
278 /sbin/sysctl kern.cp_times 2>/dev/null
282 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
283 [Define if sysctl supports kern.cp_times])
292 AC_CHECK_HEADERS(linux/major.h libgen.h)
294 # For the battery plugin
295 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
297 #if HAVE_IOKIT_IOKITLIB_H
298 # include <IOKit/IOKitLib.h>
300 #if HAVE_IOKIT_IOTYPES_H
301 # include <IOKit/IOTypes.h>
305 # For the swap module
306 have_linux_wireless_h="no"
307 if test "x$ac_system" = "xLinux"
309 AC_CHECK_HEADERS(linux/wireless.h,
310 [have_linux_wireless_h="yes"],
311 [have_linux_wireless_h="no"],
314 #include <sys/ioctl.h>
315 #include <sys/socket.h>
319 # For the swap module
320 have_sys_swap_h="yes"
321 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
323 #undef _FILE_OFFSET_BITS
324 #undef _LARGEFILE64_SOURCE
326 # include <sys/types.h>
329 # include <sys/param.h>
333 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
336 if test "x$GCC" = "xyes"
338 hint_64="CFLAGS='-m64'"
340 hint_64="CFLAGS='-xarch=v9'"
342 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
346 # For the processes plugin
348 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
350 # For interface plugin
351 AC_CHECK_HEADERS(ifaddrs.h)
352 AC_CHECK_HEADERS(net/if.h, [], [],
355 # include <sys/types.h>
357 #if HAVE_SYS_SOCKET_H
358 # include <sys/socket.h>
361 AC_CHECK_HEADERS(linux/if.h, [], [],
364 # include <sys/types.h>
366 #if HAVE_SYS_SOCKET_H
367 # include <sys/socket.h>
370 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
373 # include <sys/types.h>
375 #if HAVE_SYS_SOCKET_H
376 # include <sys/socket.h>
379 # include <linux/if.h>
384 have_net_ip_vs_h="no"
386 if test "x$ac_system" = "xLinux"
388 SAVE_CFLAGS="$CFLAGS"
389 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
391 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
392 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
394 CFLAGS="$SAVE_CFLAGS"
398 AC_CHECK_HEADERS(sys/ucred.h, [], [],
401 # include <sys/types.h>
404 # include <sys/param.h>
408 # For mount interface
409 AC_CHECK_HEADERS(sys/mount.h, [], [],
412 # include <sys/types.h>
415 # include <sys/param.h>
419 # For the email plugin
420 AC_CHECK_HEADERS(linux/un.h, [], [],
422 #if HAVE_SYS_SOCKET_H
423 # include <sys/socket.h>
427 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)
430 AC_CHECK_HEADERS(arpa/nameser.h)
431 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
433 #if HAVE_ARPA_NAMESER_H
434 # include <arpa/nameser.h>
438 AC_CHECK_HEADERS(net/if_arp.h, [], [],
439 [#if HAVE_SYS_SOCKET_H
440 # include <sys/socket.h>
443 AC_CHECK_HEADERS(net/ppp_defs.h)
444 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
445 [#if HAVE_NET_PPP_DEFS_H
446 # include <net/ppp_defs.h>
449 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
454 # include <sys/types.h>
456 #if HAVE_SYS_SOCKET_H
457 # include <sys/socket.h>
462 #if HAVE_NETINET_IN_H
463 # include <netinet/in.h>
467 # For the multimeter plugin
469 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
472 # Checks for typedefs, structures, and compiler characteristics.
481 # Checks for library functions.
483 AC_PROG_GCC_TRADITIONAL
484 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv)
488 SAVE_CFLAGS="$CFLAGS"
489 # Emulate behavior of src/Makefile.am
490 if test "x$GCC" = "xyes"
492 CFLAGS="$CFLAGS -Wall -Werror"
495 AC_CACHE_CHECK([for strtok_r],
496 [c_cv_have_strtok_r_default],
505 char buffer[] = "foo,bar,baz";
512 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
515 printf ("token = %s;\n", token);
518 [c_cv_have_strtok_r_default="yes"],
519 [c_cv_have_strtok_r_default="no"]
523 if test "x$c_cv_have_strtok_r_default" = "xno"
525 CFLAGS="$CFLAGS -D_REENTRANT=1"
527 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
528 [c_cv_have_strtok_r_reentrant],
537 char buffer[] = "foo,bar,baz";
544 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
547 printf ("token = %s;\n", token);
550 [c_cv_have_strtok_r_reentrant="yes"],
551 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
556 CFLAGS="$SAVE_CFLAGS"
557 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"
559 CFLAGS="$CFLAGS -D_REENTRANT=1"
562 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
564 socket_needs_socket="no"
565 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
566 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
568 nanosleep_needs_rt="no"
569 nanosleep_needs_posix4="no"
570 AC_CHECK_FUNCS(nanosleep,
572 AC_CHECK_LIB(rt, nanosleep,
573 [nanosleep_needs_rt="yes"],
574 AC_CHECK_LIB(posix4, nanosleep,
575 [nanosleep_needs_posix4="yes"],
576 AC_MSG_ERROR(cannot find nanosleep))))
577 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
578 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$nanosleep_needs_posix4" = "xyes")
580 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
581 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
582 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
583 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
584 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
585 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
586 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
587 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
588 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
589 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
590 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
591 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
594 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
597 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
599 if test "x$withval" = "xno"; then
601 else if test "x$withval" = "xyes"; then
608 if test "x$nan_type" = "xnone"; then
609 AC_CACHE_CHECK([whether NAN is defined by default],
610 [c_cv_have_nan_default],
616 static float foo = NAN;
624 [c_cv_have_nan_default="yes"],
625 [c_cv_have_nan_default="no"]
628 if test "x$c_cv_have_nan_default" = "xyes"
633 if test "x$nan_type" = "xnone"; then
634 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
635 [c_cv_have_nan_isoc],
640 #define __USE_ISOC99 1
642 static float foo = NAN;
650 [c_cv_have_nan_isoc="yes"],
651 [c_cv_have_nan_isoc="no"]
654 if test "x$c_cv_have_nan_isoc" = "xyes"
659 if test "x$nan_type" = "xnone"; then
660 SAVE_LDFLAGS=$LDFLAGS
661 LDFLAGS="$LDFLAGS -lm"
662 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
663 [c_cv_have_nan_zero],
672 #define NAN (0.0 / 0.0)
674 # define isnan(f) ((f) != (f))
676 static float foo = NAN;
684 [c_cv_have_nan_zero="yes"],
685 [c_cv_have_nan_zero="no"]
688 LDFLAGS=$SAVE_LDFLAGS
689 if test "x$c_cv_have_nan_zero" = "xyes"
695 if test "x$nan_type" = "xdefault"; then
696 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
697 [Define if NAN is defined by default and can initialize static variables.])
698 else if test "x$nan_type" = "xisoc99"; then
699 AC_DEFINE(NAN_STATIC_ISOC, 1,
700 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
701 else if test "x$nan_type" = "xzero"; then
702 AC_DEFINE(NAN_ZERO_ZERO, 1,
703 [Define if NAN can be defined as (0.0 / 0.0)])
705 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
708 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
710 if test "x$withval" = "xnothing"; then
711 fp_layout_type="nothing"
712 else if test "x$withval" = "xendianflip"; then
713 fp_layout_type="endianflip"
714 else if test "x$withval" = "xintswap"; then
715 fp_layout_type="intswap"
717 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
720 [fp_layout_type="unknown"])
722 if test "x$fp_layout_type" = "xunknown"; then
723 AC_CACHE_CHECK([if doubles are stored in x86 representation],
724 [c_cv_fp_layout_need_nothing],
735 # include <inttypes.h>
738 # include <stdbool.h>
748 memcpy ((void *) &i0, (void *) &d, 8);
751 memcpy ((void *) c, (void *) &i1, 8);
753 if ((c[0] == 0x2f) && (c[1] == 0x25)
754 && (c[2] == 0xc0) && (c[3] == 0xc7)
755 && (c[4] == 0x43) && (c[5] == 0x2b)
756 && (c[6] == 0x1f) && (c[7] == 0x5b))
761 [c_cv_fp_layout_need_nothing="yes"],
762 [c_cv_fp_layout_need_nothing="no"]
765 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
766 fp_layout_type="nothing"
769 if test "x$fp_layout_type" = "xunknown"; then
770 AC_CACHE_CHECK([if endianflip converts to x86 representation],
771 [c_cv_fp_layout_need_endianflip],
782 # include <inttypes.h>
785 # include <stdbool.h>
787 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
788 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
789 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
790 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
791 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
792 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
793 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
794 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
803 memcpy ((void *) &i0, (void *) &d, 8);
805 i1 = endianflip (i0);
806 memcpy ((void *) c, (void *) &i1, 8);
808 if ((c[0] == 0x2f) && (c[1] == 0x25)
809 && (c[2] == 0xc0) && (c[3] == 0xc7)
810 && (c[4] == 0x43) && (c[5] == 0x2b)
811 && (c[6] == 0x1f) && (c[7] == 0x5b))
816 [c_cv_fp_layout_need_endianflip="yes"],
817 [c_cv_fp_layout_need_endianflip="no"]
820 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
821 fp_layout_type="endianflip"
824 if test "x$fp_layout_type" = "xunknown"; then
825 AC_CACHE_CHECK([if intswap converts to x86 representation],
826 [c_cv_fp_layout_need_intswap],
837 # include <inttypes.h>
840 # include <stdbool.h>
842 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
843 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
852 memcpy ((void *) &i0, (void *) &d, 8);
855 memcpy ((void *) c, (void *) &i1, 8);
857 if ((c[0] == 0x2f) && (c[1] == 0x25)
858 && (c[2] == 0xc0) && (c[3] == 0xc7)
859 && (c[4] == 0x43) && (c[5] == 0x2b)
860 && (c[6] == 0x1f) && (c[7] == 0x5b))
865 [c_cv_fp_layout_need_intswap="yes"],
866 [c_cv_fp_layout_need_intswap="no"]
869 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
870 fp_layout_type="intswap"
874 if test "x$fp_layout_type" = "xnothing"; then
875 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
876 [Define if doubles are stored in x86 representation.])
877 else if test "x$fp_layout_type" = "xendianflip"; then
878 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
879 [Define if endianflip is needed to convert to x86 representation.])
880 else if test "x$fp_layout_type" = "xintswap"; then
881 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
882 [Define if intswap is needed to convert to x86 representation.])
884 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
888 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
890 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
892 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
895 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
896 if test "x$have_getmntent" = "xno"; then
897 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
899 if test "x$have_getmntent" = "xno"; then
900 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
902 if test "x$have_getmntent" = "xno"; then
903 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
906 if test "x$have_getmntent" = "xc"; then
907 AC_CACHE_CHECK([whether getmntent takes one argument],
908 [c_cv_have_one_getmntent],
910 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
911 #include "$srcdir/src/utils_mount.h"]],
915 fh = setmntent ("/etc/mtab", "r");
919 [c_cv_have_one_getmntent="yes"],
920 [c_cv_have_one_getmntent="no"]
923 AC_CACHE_CHECK([whether getmntent takes two arguments],
924 [c_cv_have_two_getmntent],
926 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
927 #include "$srcdir/src/utils_mount.h"]],
932 fh = fopen ("/etc/mnttab", "r");
933 status = getmntent (fh, &mt);
936 [c_cv_have_two_getmntent="yes"],
937 [c_cv_have_two_getmntent="no"]
942 # Check for different versions of `getmntent' here..
944 if test "x$have_getmntent" = "xc"; then
945 if test "x$c_cv_have_one_getmntent" = "xyes"; then
946 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
947 [Define if the function getmntent exists and takes one argument.])
949 if test "x$c_cv_have_two_getmntent" = "xyes"; then
950 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
951 [Define if the function getmntent exists and takes two arguments.])
954 if test "x$have_getmntent" = "xsun"; then
955 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
956 [Define if the function getmntent exists. It's the version from libsun.])
958 if test "x$have_getmntent" = "xseq"; then
959 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
960 [Define if the function getmntent exists. It's the version from libseq.])
962 if test "x$have_getmntent" = "xgen"; then
963 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
964 [Define if the function getmntent exists. It's the version from libgen.])
968 AC_MSG_CHECKING([if have htonll defined])
973 #include <sys/types.h>
974 #include <netinet/in.h>
976 # include <inttypes.h>
983 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
986 AC_MSG_RESULT([$have_htonll])
988 # Check for structures
989 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
990 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
993 #include <sys/types.h>
994 #include <sys/socket.h>
997 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
998 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
1001 #include <sys/types.h>
1002 #include <sys/socket.h>
1003 #include <linux/if.h>
1004 #include <linux/netdevice.h>
1007 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1009 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
1010 [Define if struct kinfo_proc exists in the FreeBSD variant.])
1011 have_struct_kinfo_proc_freebsd="yes"
1014 have_struct_kinfo_proc_freebsd="no"
1018 #include <sys/param.h>
1019 #include <sys/sysctl.h>
1020 #include <sys/user.h>
1023 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1025 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1026 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1027 have_struct_kinfo_proc_openbsd="yes"
1030 have_struct_kinfo_proc_openbsd="no"
1033 #include <sys/param.h>
1034 #include <sys/sysctl.h>
1038 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1039 [#define _BSD_SOURCE
1041 # include <stdint.h>
1043 #if HAVE_SYS_TYPES_H
1044 # include <sys/types.h>
1046 #if HAVE_NETINET_IN_SYSTM_H
1047 # include <netinet/in_systm.h>
1049 #if HAVE_NETINET_IN_H
1050 # include <netinet/in.h>
1052 #if HAVE_NETINET_IP_H
1053 # include <netinet/ip.h>
1055 #if HAVE_NETINET_UDP_H
1056 # include <netinet/udp.h>
1059 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1060 [#define _BSD_SOURCE
1062 # include <stdint.h>
1064 #if HAVE_SYS_TYPES_H
1065 # include <sys/types.h>
1067 #if HAVE_NETINET_IN_SYSTM_H
1068 # include <netinet/in_systm.h>
1070 #if HAVE_NETINET_IN_H
1071 # include <netinet/in.h>
1073 #if HAVE_NETINET_IP_H
1074 # include <netinet/ip.h>
1076 #if HAVE_NETINET_UDP_H
1077 # include <netinet/udp.h>
1081 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1091 # Checks for libraries begin here
1093 with_libresolv="yes"
1094 AC_CHECK_LIB(resolv, res_search,
1096 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1098 [with_libresolv="no"])
1099 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1101 dnl Check for HAL (hardware abstraction library)
1103 AC_CHECK_LIB(hal,libhal_device_property_exists,
1104 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1106 if test "x$with_libhal" = "xyes"; then
1107 if test "x$PKG_CONFIG" != "x"; then
1108 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1109 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1110 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1111 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1115 m4_divert_once([HELP_WITH], [
1116 collectd additional packages:])
1118 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1120 if test "x$ac_system" = "xAIX"
1125 with_perfstat="no (AIX only)"
1126 with_procinfo="no (AIX only)"
1129 if test "x$with_perfstat" = "xyes"
1131 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1132 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1134 if test "x$with_perfstat" = "xyes"
1136 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1138 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1140 # Processes plugin under AIX.
1141 if test "x$with_procinfo" = "xyes"
1143 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1145 if test "x$with_procinfo" = "xyes"
1147 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1150 if test "x$ac_system" = "xSolaris"
1155 with_kstat="no (Solaris only)"
1156 with_devinfo="no (Solaris only)"
1159 if test "x$with_kstat" = "xyes"
1161 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1163 if test "x$with_kstat" = "xyes"
1165 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1166 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1168 if test "x$with_kstat" = "xyes"
1170 AC_DEFINE(HAVE_LIBKSTAT, 1,
1171 [Define to 1 if you have the 'kstat' library (-lkstat)])
1173 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1174 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1177 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1184 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1187 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1188 if test "x$with_kvm_getprocs" = "xyes"
1190 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1191 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1194 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1196 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1197 if test "x$with_kvm_getswapinfo" = "xyes"
1199 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1200 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1203 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1205 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1206 if test "x$with_kvm_nlist" = "xyes"
1208 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1209 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1212 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1214 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1215 if test "x$with_kvm_openfiles" = "xyes"
1217 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1218 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1221 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1223 # --with-libcurl {{{
1224 with_curl_config="curl-config"
1227 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1229 if test "x$withval" = "xno"
1232 else if test "x$withval" = "xyes"
1236 if test -f "$withval" && test -x "$withval"
1238 with_curl_config="$withval"
1240 else if test -x "$withval/bin/curl-config"
1242 with_curl_config="$withval/bin/curl-config"
1251 if test "x$with_libcurl" = "xyes"
1253 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1254 curl_config_status=$?
1256 if test $curl_config_status -ne 0
1258 with_libcurl="no ($with_curl_config failed)"
1260 SAVE_CPPFLAGS="$CPPFLAGS"
1261 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1263 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1265 CPPFLAGS="$SAVE_CPPFLAGS"
1268 if test "x$with_libcurl" = "xyes"
1270 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1271 curl_config_status=$?
1273 if test $curl_config_status -ne 0
1275 with_libcurl="no ($with_curl_config failed)"
1277 AC_CHECK_LIB(curl, curl_easy_init,
1278 [with_libcurl="yes"],
1279 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1283 if test "x$with_libcurl" = "xyes"
1285 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1286 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1287 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1288 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1290 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1294 with_libdbi_cppflags=""
1295 with_libdbi_ldflags=""
1296 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1298 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1300 with_libdbi_cppflags="-I$withval/include"
1301 with_libdbi_ldflags="-L$withval/lib"
1304 with_libdbi="$withval"
1310 if test "x$with_libdbi" = "xyes"
1312 SAVE_CPPFLAGS="$CPPFLAGS"
1313 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1315 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1317 CPPFLAGS="$SAVE_CPPFLAGS"
1319 if test "x$with_libdbi" = "xyes"
1321 SAVE_CPPFLAGS="$CPPFLAGS"
1322 SAVE_LDFLAGS="$LDFLAGS"
1323 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1324 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1326 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1328 CPPFLAGS="$SAVE_CPPFLAGS"
1329 LDFLAGS="$SAVE_LDFLAGS"
1331 if test "x$with_libdbi" = "xyes"
1333 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1334 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1335 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1336 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1337 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1338 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1340 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1343 # --with-libesmtp {{{
1344 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1346 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1348 LDFLAGS="$LDFLAGS -L$withval/lib"
1349 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1352 with_libesmtp="$withval"
1358 if test "x$with_libesmtp" = "xyes"
1360 AC_CHECK_LIB(esmtp, smtp_create_session,
1362 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1363 ], [with_libesmtp="no (libesmtp not found)"])
1365 if test "x$with_libesmtp" = "xyes"
1367 AC_CHECK_HEADERS(libesmtp.h,
1369 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1370 ], [with_libesmtp="no (libesmtp.h not found)"])
1372 if test "x$with_libesmtp" = "xyes"
1378 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1379 [Wether or not to use the esmtp library])
1380 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1383 # --with-libganglia {{{
1384 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1386 if test -f "$withval" && test -x "$withval"
1388 with_libganglia_config="$withval"
1389 with_libganglia="yes"
1390 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1392 with_libganglia_config="$withval/bin/ganglia-config"
1393 with_libganglia="yes"
1394 else if test -d "$withval"
1396 GANGLIA_CPPFLAGS="-I$withval/include"
1397 GANGLIA_LDFLAGS="-L$withval/lib"
1398 with_libganglia="yes"
1400 with_libganglia_config="ganglia-config"
1401 with_libganglia="$withval"
1405 with_libganglia_config="ganglia-config"
1406 with_libganglia="yes"
1409 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1411 if test "x$GANGLIA_CPPFLAGS" = "x"
1413 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1416 if test "x$GANGLIA_LDFLAGS" = "x"
1418 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1421 if test "x$GANGLIA_LIBS" = "x"
1423 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1427 SAVE_CPPFLAGS="$CPPFLAGS"
1428 SAVE_LDFLAGS="$LDFLAGS"
1429 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1430 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1432 if test "x$with_libganglia" = "xyes"
1434 AC_CHECK_HEADERS(gm_protocol.h,
1436 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1437 [Define to 1 if you have the <gm_protocol.h> header file.])
1438 ], [with_libganglia="no (gm_protocol.h not found)"])
1441 if test "x$with_libganglia" = "xyes"
1443 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1445 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1446 [Define to 1 if you have the ganglia library (-lganglia).])
1447 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1450 CPPFLAGS="$SAVE_CPPFLAGS"
1451 LDFLAGS="$SAVE_LDFLAGS"
1453 AC_SUBST(GANGLIA_CPPFLAGS)
1454 AC_SUBST(GANGLIA_LDFLAGS)
1455 AC_SUBST(GANGLIA_LIBS)
1456 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1459 # --with-libgcrypt {{{
1460 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1461 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1462 GCRYPT_LIBS="$GCRYPT_LIBS"
1463 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1465 if test -f "$withval" && test -x "$withval"
1467 with_libgcrypt_config="$withval"
1468 with_libgcrypt="yes"
1469 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1471 with_libgcrypt_config="$withval/bin/gcrypt-config"
1472 with_libgcrypt="yes"
1473 else if test -d "$withval"
1475 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1476 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1477 with_libgcrypt="yes"
1479 with_libgcrypt_config="gcrypt-config"
1480 with_libgcrypt="$withval"
1484 with_libgcrypt_config="libgcrypt-config"
1485 with_libgcrypt="yes"
1488 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1490 if test "x$GCRYPT_CPPFLAGS" = "x"
1492 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1495 if test "x$GCRYPT_LDFLAGS" = "x"
1497 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1498 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1501 if test "x$GCRYPT_LIBS" = "x"
1503 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1507 SAVE_CPPFLAGS="$CPPFLAGS"
1508 SAVE_LDFLAGS="$LDFLAGS"
1509 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1510 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1512 if test "x$with_libgcrypt" = "xyes"
1514 if test "x$GCRYPT_CPPFLAGS" != "x"
1516 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1518 AC_CHECK_HEADERS(gcrypt.h,
1519 [with_libgcrypt="yes"],
1520 [with_libgcrypt="no (gcrypt.h not found)"])
1523 if test "x$with_libgcrypt" = "xyes"
1525 if test "x$GCRYPT_LDFLAGS" != "x"
1527 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1529 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1530 [with_libgcrypt="yes"],
1531 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1533 if test "$with_libgcrypt" != "no"; then
1534 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1538 CPPFLAGS="$SAVE_CPPFLAGS"
1539 LDFLAGS="$SAVE_LDFLAGS"
1541 if test "x$with_libgcrypt" = "xyes"
1543 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1546 AC_SUBST(GCRYPT_CPPFLAGS)
1547 AC_SUBST(GCRYPT_LDFLAGS)
1548 AC_SUBST(GCRYPT_LIBS)
1549 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1552 # --with-libiptc {{{
1553 with_own_libiptc="no"
1554 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1556 if test "x$withval" = "xshipped"
1558 with_own_libiptc="yes"
1560 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1562 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1563 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1566 with_libiptc="$withval"
1570 if test "x$ac_system" = "xLinux"
1574 with_libiptc="no (Linux only)"
1577 SAVE_CPPFLAGS="$CPPFLAGS"
1578 SAVE_LDFLAGS="$LDFLAGS"
1579 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1580 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1581 # check whether the header file for libiptc is available.
1582 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1584 AC_CHECK_HEADERS(libiptc/libiptc.h,
1586 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1590 with_own_libiptc="yes"
1593 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1595 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1597 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1601 with_own_libiptc="yes"
1604 # If the header file is available, check for the required type declaractions.
1605 # They may be missing in old versions of libiptc. In that case, they will be
1606 # declared in the iptables plugin.
1607 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1609 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1612 # include "$srcdir/src/owniptc/libiptc.h"
1613 # include "$srcdir/src/owniptc/libip6tc.h"
1615 # include <libiptc/libiptc.h>
1616 # include <libiptc/libip6tc.h>
1620 # Check for the iptc_init symbol in the library.
1621 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1623 AC_CHECK_LIB(iptc, iptc_init,
1625 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1629 with_own_libiptc="yes"
1632 # The system wide version failed for some reason. Check if we have the required
1633 # headers to build the shipped version.
1634 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1636 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1638 with_libiptc="no (Linux iptables headers not found)"
1639 with_own_libiptc="no"
1642 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1645 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1646 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1647 if test "x$with_libiptc" = "xyes"
1649 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1650 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1651 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1652 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1654 if test "x$with_own_libiptc" = "xyes"
1656 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1658 CPPFLAGS="$SAVE_CPPFLAGS"
1659 LDFLAGS="$SAVE_LDFLAGS"
1663 with_java_home="$JAVA_HOME"
1664 with_java_vmtype="client"
1669 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1671 if test "x$withval" = "xno"
1674 else if test "x$withval" = "xyes"
1678 with_java_home="$withval"
1683 if test "x$with_java" = "xyes"
1685 if test -d "$with_java_home"
1687 AC_MSG_CHECKING([for jni.h])
1688 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1689 if test "x$TMPDIR" != "x"
1691 AC_MSG_RESULT([found in $TMPDIR])
1692 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1694 AC_MSG_RESULT([not found])
1697 AC_MSG_CHECKING([for jni_md.h])
1698 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1699 if test "x$TMPDIR" != "x"
1701 AC_MSG_RESULT([found in $TMPDIR])
1702 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1704 AC_MSG_RESULT([not found])
1707 AC_MSG_CHECKING([for libjvm.so])
1708 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1709 if test "x$TMPDIR" != "x"
1711 AC_MSG_RESULT([found in $TMPDIR])
1712 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1714 AC_MSG_RESULT([not found])
1717 if test "x$JAVAC" = "x"
1719 AC_MSG_CHECKING([for javac])
1720 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1721 if test "x$TMPDIR" != "x"
1724 AC_MSG_RESULT([$JAVAC])
1726 AC_MSG_RESULT([not found])
1729 if test "x$JAR" = "x"
1731 AC_MSG_CHECKING([for jar])
1732 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1733 if test "x$TMPDIR" != "x"
1736 AC_MSG_RESULT([$JAR])
1738 AC_MSG_RESULT([not found])
1741 else if test "x$with_java_home" != "x"
1743 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1747 if test "x$JAVA_CPPFLAGS" != "x"
1749 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1751 if test "x$JAVA_CFLAGS" != "x"
1753 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1755 if test "x$JAVA_LDFLAGS" != "x"
1757 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1759 if test "x$JAVAC" = "x"
1761 with_javac_path="$PATH"
1762 if test "x$with_java_home" != "x"
1764 with_javac_path="$with_java_home:with_javac_path"
1765 if test -d "$with_java_home/bin"
1767 with_javac_path="$with_java_home/bin:with_javac_path"
1771 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1773 if test "x$JAVAC" = "x"
1775 with_java="no (javac not found)"
1777 if test "x$JAR" = "x"
1779 with_jar_path="$PATH"
1780 if test "x$with_java_home" != "x"
1782 with_jar_path="$with_java_home:$with_jar_path"
1783 if test -d "$with_java_home/bin"
1785 with_jar_path="$with_java_home/bin:$with_jar_path"
1789 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
1791 if test "x$JAR" = "x"
1793 with_java="no (jar not found)"
1796 SAVE_CPPFLAGS="$CPPFLAGS"
1797 SAVE_CFLAGS="$CFLAGS"
1798 SAVE_LDFLAGS="$LDFLAGS"
1799 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1800 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1801 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1803 if test "x$with_java" = "xyes"
1805 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1807 if test "x$with_java" = "xyes"
1809 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1811 [with_java="no (libjvm not found)"],
1814 if test "x$with_java" = "xyes"
1816 JAVA_LIBS="$JAVA_LIBS -ljvm"
1817 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1820 CPPFLAGS="$SAVE_CPPFLAGS"
1821 CFLAGS="$SAVE_CFLAGS"
1822 LDFLAGS="$SAVE_LDFLAGS"
1824 AC_SUBST(JAVA_CPPFLAGS)
1825 AC_SUBST(JAVA_CFLAGS)
1826 AC_SUBST(JAVA_LDFLAGS)
1828 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1831 # --with-libmemcached {{{
1832 with_libmemcached_cppflags=""
1833 with_libmemcached_ldflags=""
1834 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
1836 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1838 with_libmemcached_cppflags="-I$withval/include"
1839 with_libmemcached_ldflags="-L$withval/lib"
1840 with_libmemcached="yes"
1842 with_libmemcached="$withval"
1846 with_libmemcached="yes"
1848 if test "x$with_libmemcached" = "xyes"
1850 SAVE_CPPFLAGS="$CPPFLAGS"
1851 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1853 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
1855 CPPFLAGS="$SAVE_CPPFLAGS"
1857 if test "x$with_libmemcached" = "xyes"
1859 SAVE_CPPFLAGS="$CPPFLAGS"
1860 SAVE_LDFLAGS="$LDFLAGS"
1861 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1862 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
1864 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
1866 CPPFLAGS="$SAVE_CPPFLAGS"
1867 LDFLAGS="$SAVE_LDFLAGS"
1869 if test "x$with_libmemcached" = "xyes"
1871 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
1872 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
1873 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
1874 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1875 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1876 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
1877 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
1879 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
1882 # --with-libmysql {{{
1883 with_mysql_config="mysql_config"
1884 with_mysql_cflags=""
1886 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1888 if test "x$withval" = "xno"
1891 else if test "x$withval" = "xyes"
1895 if test -f "$withval" && test -x "$withval";
1897 with_mysql_config="$withval"
1898 else if test -x "$withval/bin/mysql_config"
1900 with_mysql_config="$withval/bin/mysql_config"
1908 if test "x$with_libmysql" = "xyes"
1910 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1911 mysql_config_status=$?
1913 if test $mysql_config_status -ne 0
1915 with_libmysql="no ($with_mysql_config failed)"
1917 SAVE_CPPFLAGS="$CPPFLAGS"
1918 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1921 have_mysql_mysql_h="no"
1922 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1924 if test "x$have_mysql_h" = "xno"
1926 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1929 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1931 with_libmysql="no (mysql.h not found)"
1934 CPPFLAGS="$SAVE_CPPFLAGS"
1937 if test "x$with_libmysql" = "xyes"
1939 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1940 mysql_config_status=$?
1942 if test $mysql_config_status -ne 0
1944 with_libmysql="no ($with_mysql_config failed)"
1946 AC_CHECK_LIB(mysqlclient, mysql_init,
1947 [with_libmysql="yes"],
1948 [with_libmysql="no (symbol 'mysql_init' not found)"],
1951 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1952 [with_libmysql="yes"],
1953 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1957 if test "x$with_libmysql" = "xyes"
1959 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1960 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1961 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1962 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1964 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1967 # --with-libnetlink {{{
1968 with_libnetlink_cflags=""
1969 with_libnetlink_libs="-lnetlink"
1970 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1972 echo "libnetlink: withval = $withval"
1973 if test "x$withval" = "xyes"
1975 with_libnetlink="yes"
1976 else if test "x$withval" = "xno"
1978 with_libnetlink="no"
1980 if test -d "$withval/include"
1982 with_libnetlink_cflags="-I$withval/include"
1983 with_libnetlink_libs="-L$withval/lib -lnetlink"
1984 with_libnetlink="yes"
1986 AC_MSG_ERROR("no such directory: $withval/include")
1991 if test "x$ac_system" = "xLinux"
1993 with_libnetlink="yes"
1995 with_libnetlink="no (Linux only library)"
1998 if test "x$with_libnetlink" = "xyes"
2000 SAVE_CFLAGS="$CFLAGS"
2001 CFLAGS="$CFLAGS $with_libnetlink_cflags"
2003 with_libnetlink="no (libnetlink.h not found)"
2005 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
2007 with_libnetlink="yes"
2011 #include <sys/types.h>
2012 #include <asm/types.h>
2013 #include <sys/socket.h>
2014 #include <linux/netlink.h>
2015 #include <linux/rtnetlink.h>])
2016 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2018 #include <sys/types.h>
2019 #include <asm/types.h>
2020 #include <sys/socket.h>])
2024 #include <sys/types.h>
2025 #include <asm/types.h>
2026 #include <sys/socket.h>
2027 #include <linux/netlink.h>
2028 #include <linux/rtnetlink.h>
2032 int retval = TCA_STATS2;
2035 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
2040 #include <sys/types.h>
2041 #include <asm/types.h>
2042 #include <sys/socket.h>
2043 #include <linux/netlink.h>
2044 #include <linux/rtnetlink.h>
2048 int retval = TCA_STATS;
2051 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2054 CFLAGS="$SAVE_CFLAGS"
2056 if test "x$with_libnetlink" = "xyes"
2058 AC_CHECK_LIB(netlink, rtnl_open,
2059 [with_libnetlink="yes"],
2060 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2061 [$with_libnetlink_libs])
2063 if test "x$with_libnetlink" = "xyes"
2065 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2066 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2067 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2068 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2070 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2073 # --with-libnetapp {{{
2074 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2075 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2076 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2077 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2078 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2079 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2080 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2082 if test -d "$withval"
2084 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2085 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2086 with_libnetapp="yes"
2088 with_libnetapp="$withval"
2092 with_libnetapp="yes"
2095 SAVE_CPPFLAGS="$CPPFLAGS"
2096 SAVE_LDFLAGS="$LDFLAGS"
2097 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2098 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2100 if test "x$with_libnetapp" = "xyes"
2102 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2104 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2106 AC_CHECK_HEADERS(netapp_api.h,
2107 [with_libnetapp="yes"],
2108 [with_libnetapp="no (netapp_api.h not found)"])
2111 if test "x$with_libnetapp" = "xyes"
2113 if test "x$LIBNETAPP_LDFLAGS" != "x"
2115 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2118 if test "x$LIBNETAPP_LIBS" = "x"
2120 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2122 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2124 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2125 [with_libnetapp="yes"],
2126 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2128 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2131 CPPFLAGS="$SAVE_CPPFLAGS"
2132 LDFLAGS="$SAVE_LDFLAGS"
2134 if test "x$with_libnetapp" = "xyes"
2136 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2139 AC_SUBST(LIBNETAPP_CPPFLAGS)
2140 AC_SUBST(LIBNETAPP_LDFLAGS)
2141 AC_SUBST(LIBNETAPP_LIBS)
2142 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2145 # --with-libnetsnmp {{{
2146 with_snmp_config="net-snmp-config"
2149 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2151 if test "x$withval" = "xno"
2153 with_libnetsnmp="no"
2154 else if test "x$withval" = "xyes"
2156 with_libnetsnmp="yes"
2158 if test -x "$withval"
2160 with_snmp_config="$withval"
2161 with_libnetsnmp="yes"
2163 with_snmp_config="$withval/bin/net-snmp-config"
2164 with_libnetsnmp="yes"
2168 [with_libnetsnmp="yes"])
2169 if test "x$with_libnetsnmp" = "xyes"
2171 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2172 snmp_config_status=$?
2174 if test $snmp_config_status -ne 0
2176 with_libnetsnmp="no ($with_snmp_config failed)"
2178 SAVE_CPPFLAGS="$CPPFLAGS"
2179 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2181 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2183 CPPFLAGS="$SAVE_CPPFLAGS"
2186 if test "x$with_libnetsnmp" = "xyes"
2188 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2189 snmp_config_status=$?
2191 if test $snmp_config_status -ne 0
2193 with_libnetsnmp="no ($with_snmp_config failed)"
2195 AC_CHECK_LIB(netsnmp, init_snmp,
2196 [with_libnetsnmp="yes"],
2197 [with_libnetsnmp="no (libnetsnmp not found)"],
2201 if test "x$with_libnetsnmp" = "xyes"
2203 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2204 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2205 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2206 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2208 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2211 # --with-liboconfig {{{
2212 with_own_liboconfig="no"
2213 liboconfig_LDFLAGS="$LDFLAGS"
2214 liboconfig_CPPFLAGS="$CPPFLAGS"
2215 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2217 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2219 if test -d "$withval/lib"
2221 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2223 if test -d "$withval/include"
2225 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2228 if test "x$withval" = "xno"
2230 AC_MSG_ERROR("liboconfig is required")
2234 with_liboconfig="yes"
2237 save_LDFLAGS="$LDFLAGS"
2238 save_CPPFLAGS="$CPPFLAGS"
2239 LDFLAGS="$liboconfig_LDFLAGS"
2240 CPPFLAGS="$liboconfig_CPPFLAGS"
2241 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2243 with_liboconfig="yes"
2244 with_own_liboconfig="no"
2247 with_liboconfig="yes"
2248 with_own_liboconfig="yes"
2249 LDFLAGS="$save_LDFLAGS"
2250 CPPFLAGS="$save_CPPFLAGS"
2253 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2254 if test "x$with_own_liboconfig" = "xyes"
2256 with_liboconfig="yes (shipped version)"
2260 # --with-liboping {{{
2261 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2263 if test "x$withval" = "xyes"
2266 else if test "x$withval" = "xno"
2271 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2272 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2275 [with_liboping="yes"])
2277 SAVE_CPPFLAGS="$CPPFLAGS"
2278 SAVE_LDFLAGS="$LDFLAGS"
2280 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2281 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2283 if test "x$with_liboping" = "xyes"
2285 if test "x$LIBOPING_CPPFLAGS" != "x"
2287 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2289 AC_CHECK_HEADERS(oping.h,
2290 [with_liboping="yes"],
2291 [with_liboping="no ('oping.h' not found)"])
2293 if test "x$with_liboping" = "xyes"
2295 if test "x$LIBOPING_LDFLAGS" != "x"
2297 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2299 AC_CHECK_LIB(oping, ping_construct,
2300 [with_liboping="yes"],
2301 [with_liboping="no (symbol 'ping_construct' not found)"])
2304 CPPFLAGS="$SAVE_CPPFLAGS"
2305 LDFLAGS="$SAVE_LDFLAGS"
2307 if test "x$with_liboping" = "xyes"
2309 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2310 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2311 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2312 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2314 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2318 with_oracle_cppflags=""
2320 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2322 if test "x$withval" = "xyes"
2324 if test "x$ORACLE_HOME" = "x"
2326 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2329 else if test "x$withval" = "xno"
2334 ORACLE_HOME="$withval"
2338 if test "x$ORACLE_HOME" = "x"
2340 with_oracle="no (ORACLE_HOME is not set)"
2345 if test "x$ORACLE_HOME" != "x"
2347 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2349 if test -e "$ORACLE_HOME/lib/ldflags"
2351 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2353 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2354 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2356 if test "x$with_oracle" = "xyes"
2358 SAVE_CPPFLAGS="$CPPFLAGS"
2359 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2361 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2363 CPPFLAGS="$SAVE_CPPFLAGS"
2365 if test "x$with_oracle" = "xyes"
2367 SAVE_CPPFLAGS="$CPPFLAGS"
2368 SAVE_LDFLAGS="$LDFLAGS"
2369 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2370 LDFLAGS="$LDFLAGS $with_oracle_libs"
2372 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2374 CPPFLAGS="$SAVE_CPPFLAGS"
2375 LDFLAGS="$SAVE_LDFLAGS"
2377 if test "x$with_oracle" = "xyes"
2379 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2380 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2381 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2382 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2386 # --with-libowcapi {{{
2387 with_libowcapi_cppflags=""
2388 with_libowcapi_libs="-lowcapi"
2389 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2391 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2393 with_libowcapi_cppflags="-I$withval/include"
2394 with_libowcapi_libs="-L$withval/lib -lowcapi"
2395 with_libowcapi="yes"
2397 with_libowcapi="$withval"
2401 with_libowcapi="yes"
2403 if test "x$with_libowcapi" = "xyes"
2405 SAVE_CPPFLAGS="$CPPFLAGS"
2406 CPPFLAGS="$with_libowcapi_cppflags"
2408 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2410 CPPFLAGS="$SAVE_CPPFLAGS"
2412 if test "x$with_libowcapi" = "xyes"
2414 SAVE_LDFLAGS="$LDFLAGS"
2415 SAVE_CPPFLAGS="$CPPFLAGS"
2416 LDFLAGS="$with_libowcapi_libs"
2417 CPPFLAGS="$with_libowcapi_cppflags"
2419 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2421 LDFLAGS="$SAVE_LDFLAGS"
2422 CPPFLAGS="$SAVE_CPPFLAGS"
2424 if test "x$with_libowcapi" = "xyes"
2426 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2427 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2428 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2429 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2433 # --with-libpcap {{{
2434 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2436 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2438 LDFLAGS="$LDFLAGS -L$withval/lib"
2439 CPPFLAGS="$CPPFLAGS -I$withval/include"
2442 with_libpcap="$withval"
2448 if test "x$with_libpcap" = "xyes"
2450 AC_CHECK_LIB(pcap, pcap_open_live,
2452 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2453 ], [with_libpcap="no (libpcap not found)"])
2455 if test "x$with_libpcap" = "xyes"
2457 AC_CHECK_HEADERS(pcap.h,
2459 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
2460 ], [with_libpcap="no (pcap.h not found)"])
2462 if test "x$with_libpcap" = "xyes"
2468 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
2469 [Wether or not to use the pcap library])
2470 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2473 # --with-libperl {{{
2474 perl_interpreter="perl"
2475 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2477 if test -x "$withval"
2479 perl_interpreter="$withval"
2481 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2483 LDFLAGS="$LDFLAGS -L$withval/lib"
2484 CPPFLAGS="$CPPFLAGS -I$withval/include"
2485 perl_interpreter="$withval/bin/perl"
2488 with_libperl="$withval"
2495 AC_MSG_CHECKING([for perl])
2496 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2497 if test -x "$perl_interpreter"
2499 AC_MSG_RESULT([yes ($perl_interpreter)])
2505 AC_SUBST(PERL, "$perl_interpreter")
2507 if test "x$with_libperl" = "xyes" \
2508 && test -n "$perl_interpreter"
2510 SAVE_CFLAGS="$CFLAGS"
2511 SAVE_LDFLAGS="$LDFLAGS"
2512 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2513 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2514 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2515 CFLAGS="$CFLAGS $PERL_CFLAGS"
2516 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2518 AC_CACHE_CHECK([for libperl],
2519 [c_cv_have_libperl],
2523 #define PERL_NO_GET_CONTEXT
2530 load_module (PERL_LOADMOD_NOIMPORT,
2531 newSVpv ("Collectd::Plugin::FooBar", 24),
2534 [c_cv_have_libperl="yes"],
2535 [c_cv_have_libperl="no"]
2539 if test "x$c_cv_have_libperl" = "xyes"
2541 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2542 AC_SUBST(PERL_CFLAGS)
2543 AC_SUBST(PERL_LDFLAGS)
2548 CFLAGS="$SAVE_CFLAGS"
2549 LDFLAGS="$SAVE_LDFLAGS"
2550 else if test -z "$perl_interpreter"; then
2551 with_libperl="no (no perl interpreter found)"
2552 c_cv_have_libperl="no"
2554 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2556 if test "x$with_libperl" = "xyes"
2558 SAVE_CFLAGS="$CFLAGS"
2559 SAVE_LDFLAGS="$LDFLAGS"
2560 CFLAGS="$CFLAGS $PERL_CFLAGS"
2561 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2563 AC_CACHE_CHECK([if perl supports ithreads],
2564 [c_cv_have_perl_ithreads],
2572 #if !defined(USE_ITHREADS)
2573 # error "Perl does not support ithreads!"
2574 #endif /* !defined(USE_ITHREADS) */
2577 [c_cv_have_perl_ithreads="yes"],
2578 [c_cv_have_perl_ithreads="no"]
2582 if test "x$c_cv_have_perl_ithreads" = "xyes"
2584 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2587 CFLAGS="$SAVE_CFLAGS"
2588 LDFLAGS="$SAVE_LDFLAGS"
2591 if test "x$with_libperl" = "xyes"
2593 SAVE_CFLAGS="$CFLAGS"
2594 SAVE_LDFLAGS="$LDFLAGS"
2595 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2596 # (see issues #41 and #42)
2597 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2598 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2600 AC_CACHE_CHECK([for broken Perl_load_module()],
2601 [c_cv_have_broken_perl_load_module],
2605 #define PERL_NO_GET_CONTEXT
2612 load_module (PERL_LOADMOD_NOIMPORT,
2613 newSVpv ("Collectd::Plugin::FooBar", 24),
2616 [c_cv_have_broken_perl_load_module="no"],
2617 [c_cv_have_broken_perl_load_module="yes"]
2621 CFLAGS="$SAVE_CFLAGS"
2622 LDFLAGS="$SAVE_LDFLAGS"
2624 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2625 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2627 if test "x$with_libperl" = "xyes"
2629 SAVE_CFLAGS="$CFLAGS"
2630 SAVE_LDFLAGS="$LDFLAGS"
2631 CFLAGS="$CFLAGS $PERL_CFLAGS"
2632 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2635 [struct mgvtbl.svt_local],
2636 [have_struct_mgvtbl_svt_local="yes"],
2637 [have_struct_mgvtbl_svt_local="no"],
2644 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2646 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2647 [Define if Perl's struct mgvtbl has member svt_local.])
2650 CFLAGS="$SAVE_CFLAGS"
2651 LDFLAGS="$SAVE_LDFLAGS"
2656 with_pg_config="pg_config"
2657 with_libpq_includedir=""
2658 with_libpq_libdir=""
2659 with_libpq_cppflags=""
2660 with_libpq_ldflags=""
2661 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2664 if test "x$withval" = "xno"
2667 else if test "x$withval" = "xyes"
2671 if test -f "$withval" && test -x "$withval";
2673 with_pg_config="$withval"
2674 else if test -x "$withval/bin/pg_config"
2676 with_pg_config="$withval/bin/pg_config"
2684 if test "x$with_libpq" = "xyes"
2686 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2689 if test $pg_config_status -eq 0
2691 if test -n "$with_libpq_includedir"; then
2692 for dir in $with_libpq_includedir; do
2693 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2697 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2700 SAVE_CPPFLAGS="$CPPFLAGS"
2701 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2703 AC_CHECK_HEADERS(libpq-fe.h, [],
2704 [with_libpq="no (libpq-fe.h not found)"], [])
2706 CPPFLAGS="$SAVE_CPPFLAGS"
2708 if test "x$with_libpq" = "xyes"
2710 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2713 if test $pg_config_status -eq 0
2715 if test -n "$with_libpq_libdir"; then
2716 for dir in $with_libpq_libdir; do
2717 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2721 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2724 SAVE_LDFLAGS="$LDFLAGS"
2725 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2727 AC_CHECK_LIB(pq, PQconnectdb,
2729 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2731 AC_CHECK_LIB(pq, PQserverVersion,
2733 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2735 LDFLAGS="$SAVE_LDFLAGS"
2737 if test "x$with_libpq" = "xyes"
2739 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2740 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2741 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2742 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2744 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2747 # --with-libpthread {{{
2748 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2749 [ if test "x$withval" != "xno" \
2750 && test "x$withval" != "xyes"
2752 LDFLAGS="$LDFLAGS -L$withval/lib"
2753 CPPFLAGS="$CPPFLAGS -I$withval/include"
2754 with_libpthread="yes"
2756 if test "x$withval" = "xno"
2758 with_libpthread="no (disabled)"
2761 ], [with_libpthread="yes"])
2762 if test "x$with_libpthread" = "xyes"
2764 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2767 if test "x$with_libpthread" = "xyes"
2769 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2771 if test "x$with_libpthread" = "xyes"
2777 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2778 [Wether or not to use pthread (POSIX threads) library])
2779 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2784 with_python_path="$PATH"
2785 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
2787 if test "x$withval" = "xyes" || test "x$withval" = "xno"
2789 with_python="$withval"
2790 else if test -x "$withval"
2792 with_python_prog="$withval"
2793 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
2795 else if test -d "$withval"
2797 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
2800 AC_MSG_WARN([Argument not recognized: $withval])
2802 ], [with_python="yes"])
2805 SAVE_CPPFLAGS="$CPPFLAGS"
2806 SAVE_LDFLAGS="$LDFLAGS"
2809 PATH="$with_python_path"
2811 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
2813 AC_MSG_CHECKING([for python])
2814 with_python_prog="`which python 2>/dev/null`"
2815 if test "x$with_python_prog" = "x"
2817 AC_MSG_RESULT([not found])
2818 with_python="no (interpreter not found)"
2820 AC_MSG_RESULT([$with_python_prog])
2824 if test "x$with_python" = "xyes"
2826 AC_MSG_CHECKING([for Python CPPFLAGS])
2827 python_include_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_python_inc()" | "$with_python_prog" 2>&1`
2828 python_config_status=$?
2830 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
2832 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
2835 AC_MSG_RESULT([$python_include_path])
2839 if test "x$with_python" = "xyes"
2841 CPPFLAGS="-I$python_include_path $CPPFLAGS"
2842 AC_CHECK_HEADERS(Python.h,
2843 [with_python="yes"],
2844 [with_python="no ('Python.h' not found)"])
2847 if test "x$with_python" = "xyes"
2849 AC_MSG_CHECKING([for Python LDFLAGS])
2850 python_library_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0)" | "$with_python_prog" 2>&1`
2851 python_config_status=$?
2853 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
2855 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
2858 AC_MSG_RESULT([$python_library_path])
2862 if test "x$with_python" = "xyes"
2864 AC_MSG_CHECKING([for Python LIBS])
2865 python_library_flags=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0)" | "$with_python_prog" 2>&1`
2866 python_config_status=$?
2868 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
2870 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
2873 AC_MSG_RESULT([$python_library_flags])
2877 if test "x$with_python" = "xyes"
2879 LDFLAGS="-L$python_library_path $LDFLAGS"
2880 LIBS="$python_library_flags $LIBS"
2882 AC_CHECK_FUNC(PyObject_CallFunction,
2883 [with_python="yes"],
2884 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
2888 CPPFLAGS="$SAVE_CPPFLAGS"
2889 LDFLAGS="$SAVE_LDFLAGS"
2892 if test "x$with_python" = "xyes"
2894 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
2895 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
2896 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
2897 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
2898 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
2899 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
2903 # --with-librouteros {{{
2904 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
2906 if test "x$withval" = "xyes"
2908 with_librouteros="yes"
2909 else if test "x$withval" = "xno"
2911 with_librouteros="no"
2913 with_librouteros="yes"
2914 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
2915 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
2918 [with_librouteros="yes"])
2920 SAVE_CPPFLAGS="$CPPFLAGS"
2921 SAVE_LDFLAGS="$LDFLAGS"
2923 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
2924 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
2926 if test "x$with_librouteros" = "xyes"
2928 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
2930 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
2932 AC_CHECK_HEADERS(routeros_api.h,
2933 [with_librouteros="yes"],
2934 [with_librouteros="no ('routeros_api.h' not found)"])
2936 if test "x$with_librouteros" = "xyes"
2938 if test "x$LIBROUTEROS_LDFLAGS" != "x"
2940 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
2942 AC_CHECK_LIB(routeros, ros_interface,
2943 [with_librouteros="yes"],
2944 [with_librouteros="no (symbol 'ros_interface' not found)"])
2947 CPPFLAGS="$SAVE_CPPFLAGS"
2948 LDFLAGS="$SAVE_LDFLAGS"
2950 if test "x$with_librouteros" = "xyes"
2952 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
2953 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
2954 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
2955 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
2957 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
2961 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2964 librrd_threadsafe="yes"
2965 librrd_rrdc_update="no"
2966 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2967 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2969 librrd_cflags="-I$withval/include"
2970 librrd_ldflags="-L$withval/lib"
2973 with_librrd="$withval"
2975 ], [with_librrd="yes"])
2976 if test "x$with_librrd" = "xyes"
2978 SAVE_CPPFLAGS="$CPPFLAGS"
2979 SAVE_LDFLAGS="$LDFLAGS"
2981 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2982 LDFLAGS="$LDFLAGS $librrd_ldflags"
2984 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2986 CPPFLAGS="$SAVE_CPPFLAGS"
2987 LDFLAGS="$SAVE_LDFLAGS"
2989 if test "x$with_librrd" = "xyes"
2991 SAVE_CPPFLAGS="$CPPFLAGS"
2992 SAVE_LDFLAGS="$LDFLAGS"
2994 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2995 LDFLAGS="$LDFLAGS $librrd_ldflags"
2997 AC_CHECK_LIB(rrd_th, rrd_update_r,
2999 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
3001 [librrd_threadsafe="no"
3002 AC_CHECK_LIB(rrd, rrd_update,
3004 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3006 [with_librrd="no (symbol 'rrd_update' not found)"],
3011 if test "x$librrd_threadsafe" = "xyes"
3013 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3015 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3018 CPPFLAGS="$SAVE_CPPFLAGS"
3019 LDFLAGS="$SAVE_LDFLAGS"
3021 if test "x$with_librrd" = "xyes"
3023 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3024 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3025 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3026 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3028 if test "x$librrd_threadsafe" = "xyes"
3030 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3034 # --with-libsensors {{{
3035 with_sensors_cflags=""
3036 with_sensors_ldflags=""
3037 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3039 if test "x$withval" = "xno"
3041 with_libsensors="no"
3043 with_libsensors="yes"
3044 if test "x$withval" != "xyes"
3046 with_sensors_cflags="-I$withval/include"
3047 with_sensors_ldflags="-L$withval/lib"
3048 with_libsensors="yes"
3053 if test "x$ac_system" = "xLinux"
3055 with_libsensors="yes"
3057 with_libsensors="no (Linux only library)"
3060 if test "x$with_libsensors" = "xyes"
3062 SAVE_CPPFLAGS="$CPPFLAGS"
3063 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3065 # AC_CHECK_HEADERS(sensors/sensors.h,
3067 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3069 # [with_libsensors="no (sensors/sensors.h not found)"])
3070 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3072 CPPFLAGS="$SAVE_CPPFLAGS"
3074 if test "x$with_libsensors" = "xyes"
3076 SAVE_CPPFLAGS="$CPPFLAGS"
3077 SAVE_LDFLAGS="$LDFLAGS"
3078 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3079 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3081 AC_CHECK_LIB(sensors, sensors_init,
3083 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3085 [with_libsensors="no (libsensors not found)"])
3087 CPPFLAGS="$SAVE_CPPFLAGS"
3088 LDFLAGS="$SAVE_LDFLAGS"
3090 if test "x$with_libsensors" = "xyes"
3092 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3093 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3094 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3095 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3097 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3100 # --with-libstatgrab {{{
3101 with_libstatgrab_cflags=""
3102 with_libstatgrab_ldflags=""
3103 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3105 if test "x$withval" != "xno" \
3106 && test "x$withval" != "xyes"
3108 with_libstatgrab_cflags="-I$withval/include"
3109 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3110 with_libstatgrab="yes"
3111 with_libstatgrab_pkg_config="no"
3113 with_libstatgrab="$withval"
3114 with_libstatgrab_pkg_config="yes"
3118 with_libstatgrab="yes"
3119 with_libstatgrab_pkg_config="yes"
3122 if test "x$with_libstatgrab" = "xyes" \
3123 && test "x$with_libstatgrab_pkg_config" = "xyes"
3125 if test "x$PKG_CONFIG" != "x"
3127 AC_MSG_CHECKING([pkg-config for libstatgrab])
3129 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3132 with_libstatgrab_pkg_config="no"
3133 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
3134 temp_result="not found"
3136 AC_MSG_RESULT([$temp_result])
3138 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3139 with_libstatgrab_pkg_config="no"
3140 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3144 if test "x$with_libstatgrab" = "xyes" \
3145 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3146 && test "x$with_libstatgrab_cflags" = "x"
3148 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3149 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3152 with_libstatgrab_cflags="$temp_result"
3154 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3155 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3157 AC_MSG_RESULT([$temp_result])
3160 if test "x$with_libstatgrab" = "xyes" \
3161 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3162 && test "x$with_libstatgrab_ldflags" = "x"
3164 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3165 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3168 with_libstatgrab_ldflags="$temp_result"
3170 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3171 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3173 AC_MSG_RESULT([$temp_result])
3176 if test "x$with_libstatgrab" = "xyes"
3178 SAVE_CPPFLAGS="$CPPFLAGS"
3179 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3181 AC_CHECK_HEADERS(statgrab.h,
3182 [with_libstatgrab="yes"],
3183 [with_libstatgrab="no (statgrab.h not found)"])
3185 CPPFLAGS="$SAVE_CPPFLAGS"
3188 if test "x$with_libstatgrab" = "xyes"
3190 SAVE_CFLAGS="$CFLAGS"
3191 SAVE_LDFLAGS="$LDFLAGS"
3193 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3194 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3196 AC_CHECK_LIB(statgrab, sg_init,
3197 [with_libstatgrab="yes"],
3198 [with_libstatgrab="no (symbol sg_init not found)"])
3200 CFLAGS="$SAVE_CFLAGS"
3201 LDFLAGS="$SAVE_LDFLAGS"
3204 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3205 if test "x$with_libstatgrab" = "xyes"
3207 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3208 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3209 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3210 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3211 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3215 # --with-libtokyotyrant {{{
3216 with_libtokyotyrant_cppflags=""
3217 with_libtokyotyrant_ldflags=""
3218 with_libtokyotyrant_libs=""
3219 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3221 if test "x$withval" = "xno"
3223 with_libtokyotyrant="no"
3224 else if test "x$withval" = "xyes"
3226 with_libtokyotyrant="yes"
3228 with_libtokyotyrant_cppflags="-I$withval/include"
3229 with_libtokyotyrant_ldflags="-L$withval/include"
3230 with_libtokyotyrant_libs="-ltokyotyrant"
3231 with_libtokyotyrant="yes"
3235 with_libtokyotyrant="yes"
3238 if test "x$with_libtokyotyrant" = "xyes"
3240 if $PKG_CONFIG --exists tokyotyrant
3242 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3243 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3244 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3248 SAVE_CPPFLAGS="$CPPFLAGS"
3249 SAVE_LDFLAGS="$LDFLAGS"
3250 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3251 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3253 if test "x$with_libtokyotyrant" = "xyes"
3255 AC_CHECK_HEADERS(tcrdb.h,
3257 AC_DEFINE(HAVE_TCRDB_H, 1,
3258 [Define to 1 if you have the <tcrdb.h> header file.])
3259 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3262 if test "x$with_libtokyotyrant" = "xyes"
3264 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3266 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3267 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3269 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3270 [$with_libtokyotyrant_libs])
3273 CPPFLAGS="$SAVE_CPPFLAGS"
3274 LDFLAGS="$SAVE_LDFLAGS"
3276 if test "x$with_libtokyotyrant" = "xyes"
3278 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3279 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3280 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3281 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3282 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3283 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3285 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3288 # --with-libupsclient {{{
3289 with_libupsclient_config=""
3290 with_libupsclient_cflags=""
3291 with_libupsclient_libs=""
3292 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3294 if test "x$withval" = "xno"
3296 with_libupsclient="no"
3297 else if test "x$withval" = "xyes"
3299 with_libupsclient="use_pkgconfig"
3301 if test -x "$withval"
3303 with_libupsclient_config="$withval"
3304 with_libupsclient="use_libupsclient_config"
3305 else if test -x "$withval/bin/libupsclient-config"
3307 with_libupsclient_config="$withval/bin/libupsclient-config"
3308 with_libupsclient="use_libupsclient_config"
3310 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3311 with_libupsclient_cflags="-I$withval/include"
3312 with_libupsclient_libs="-L$withval/lib -lupsclient"
3313 with_libupsclient="yes"
3317 [with_libupsclient="use_pkgconfig"])
3319 # configure using libupsclient-config
3320 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3322 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3323 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3326 with_libupsclient="no ($with_libupsclient_config failed)"
3328 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3331 with_libupsclient="no ($with_libupsclient_config failed)"
3334 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3336 with_libupsclient="yes"
3339 # configure using pkg-config
3340 if test "x$with_libupsclient" = "xuse_pkgconfig"
3342 if test "x$PKG_CONFIG" = "x"
3344 with_libupsclient="no (Don't have pkg-config)"
3347 if test "x$with_libupsclient" = "xuse_pkgconfig"
3349 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3350 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3353 with_libupsclient="no (pkg-config doesn't know library)"
3356 if test "x$with_libupsclient" = "xuse_pkgconfig"
3358 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3361 with_libupsclient="no ($PKG_CONFIG failed)"
3363 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3366 with_libupsclient="no ($PKG_CONFIG failed)"
3369 if test "x$with_libupsclient" = "xuse_pkgconfig"
3371 with_libupsclient="yes"
3374 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3375 # the actual checks.
3376 if test "x$with_libupsclient" = "xyes"
3378 SAVE_CPPFLAGS="$CPPFLAGS"
3379 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3381 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3383 CPPFLAGS="$SAVE_CPPFLAGS"
3385 if test "x$with_libupsclient" = "xyes"
3387 SAVE_CPPFLAGS="$CPPFLAGS"
3388 SAVE_LDFLAGS="$LDFLAGS"
3390 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3391 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3393 AC_CHECK_LIB(upsclient, upscli_connect,
3394 [with_libupsclient="yes"],
3395 [with_libupsclient="no (symbol upscli_connect not found)"])
3397 CPPFLAGS="$SAVE_CPPFLAGS"
3398 LDFLAGS="$SAVE_LDFLAGS"
3400 if test "x$with_libupsclient" = "xyes"
3402 SAVE_CPPFLAGS="$CPPFLAGS"
3403 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3405 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3406 [#include <stdlib.h>
3408 #include <upsclient.h>])
3410 CPPFLAGS="$SAVE_CPPFLAGS"
3412 if test "x$with_libupsclient" = "xyes"
3414 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3415 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3416 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3417 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3421 # --with-libxmms {{{
3422 with_xmms_config="xmms-config"
3425 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3427 if test "x$withval" != "xno" \
3428 && test "x$withval" != "xyes"
3430 if test -f "$withval" && test -x "$withval";
3432 with_xmms_config="$withval"
3433 else if test -x "$withval/bin/xmms-config"
3435 with_xmms_config="$withval/bin/xmms-config"
3438 else if test "x$withval" = "xno"
3448 if test "x$with_libxmms" = "xyes"
3450 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3451 xmms_config_status=$?
3453 if test $xmms_config_status -ne 0
3458 if test "x$with_libxmms" = "xyes"
3460 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3461 xmms_config_status=$?
3463 if test $xmms_config_status -ne 0
3468 if test "x$with_libxmms" = "xyes"
3470 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3472 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3473 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3474 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3475 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3482 with_libxmms_numeric=0
3483 if test "x$with_libxmms" = "xyes"
3485 with_libxmms_numeric=1
3487 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3488 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3491 # --with-libyajl {{{
3492 with_libyajl_cppflags=""
3493 with_libyajl_ldflags=""
3494 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3496 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3498 with_libyajl_cppflags="-I$withval/include"
3499 with_libyajl_ldflags="-L$withval/lib"
3502 with_libyajl="$withval"
3508 if test "x$with_libyajl" = "xyes"
3510 SAVE_CPPFLAGS="$CPPFLAGS"
3511 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3513 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3515 CPPFLAGS="$SAVE_CPPFLAGS"
3517 if test "x$with_libyajl" = "xyes"
3519 SAVE_CPPFLAGS="$CPPFLAGS"
3520 SAVE_LDFLAGS="$LDFLAGS"
3521 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3522 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3524 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3526 CPPFLAGS="$SAVE_CPPFLAGS"
3527 LDFLAGS="$SAVE_LDFLAGS"
3529 if test "x$with_libyajl" = "xyes"
3531 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3532 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3533 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3534 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3535 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3536 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3537 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3539 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3542 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3543 with_libxml2="no (pkg-config isn't available)"
3544 with_libxml2_cflags=""
3545 with_libxml2_ldflags=""
3546 with_libvirt="no (pkg-config isn't available)"
3547 with_libvirt_cflags=""
3548 with_libvirt_ldflags=""
3549 if test "x$PKG_CONFIG" != "x"
3551 pkg-config --exists 'libxml-2.0' 2>/dev/null
3556 with_libxml2="no (pkg-config doesn't know library)"
3559 pkg-config --exists libvirt 2>/dev/null
3564 with_libvirt="no (pkg-config doesn't know library)"
3567 if test "x$with_libxml2" = "xyes"
3569 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3574 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3580 if test "x$with_libxml2" = "xyes"
3582 SAVE_CPPFLAGS="$CPPFLAGS"
3583 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3585 AC_CHECK_HEADERS(libxml/parser.h, [],
3586 [with_libxml2="no (libxml/parser.h not found)"])
3588 CPPFLAGS="$SAVE_CPPFLAGS"
3590 if test "x$with_libxml2" = "xyes"
3592 SAVE_CFLAGS="$CFLAGS"
3593 SAVE_LDFLAGS="$LDFLAGS"
3595 CFLAGS="$CFLAGS $with_libxml2_cflags"
3596 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3598 AC_CHECK_LIB(xml2, xmlXPathEval,
3599 [with_libxml2="yes"],
3600 [with_libxml2="no (symbol xmlXPathEval not found)"])
3602 CFLAGS="$SAVE_CFLAGS"
3603 LDFLAGS="$SAVE_LDFLAGS"
3605 dnl Add the right compiler flags and libraries.
3606 if test "x$with_libxml2" = "xyes"; then
3607 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3608 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3609 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3610 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3612 if test "x$with_libvirt" = "xyes"
3614 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3619 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3625 if test "x$with_libvirt" = "xyes"
3627 SAVE_CPPFLAGS="$CPPFLAGS"
3628 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3630 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3631 [with_libvirt="no (libvirt/libvirt.h not found)"])
3633 CPPFLAGS="$SAVE_CPPFLAGS"
3635 if test "x$with_libvirt" = "xyes"
3637 SAVE_CFLAGS="$CFLAGS"
3638 SAVE_LDFLAGS="$LDFLAGS"
3640 CFLAGS="$CFLAGS $with_libvirt_cflags"
3641 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3643 AC_CHECK_LIB(virt, virDomainBlockStats,
3644 [with_libvirt="yes"],
3645 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3647 CFLAGS="$SAVE_CFLAGS"
3648 LDFLAGS="$SAVE_LDFLAGS"
3650 dnl Add the right compiler flags and libraries.
3651 if test "x$with_libvirt" = "xyes"; then
3652 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3653 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3654 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3655 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3659 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3660 with_libopenipmipthread="yes"
3661 with_libopenipmipthread_cflags=""
3662 with_libopenipmipthread_libs=""
3664 AC_MSG_CHECKING([for pkg-config])
3666 if test "x$PKG_CONFIG" = "x"
3668 with_libopenipmipthread="no"
3671 temp_result="$PKG_CONFIG"
3673 AC_MSG_RESULT([$temp_result])
3675 if test "x$with_libopenipmipthread" = "xyes"
3677 AC_MSG_CHECKING([for libOpenIPMIpthread])
3678 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3681 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3683 AC_MSG_RESULT([$with_libopenipmipthread])
3686 if test "x$with_libopenipmipthread" = "xyes"
3688 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3689 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3692 with_libopenipmipthread_cflags="$temp_result"
3694 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3695 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3697 AC_MSG_RESULT([$temp_result])
3700 if test "x$with_libopenipmipthread" = "xyes"
3702 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3703 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3706 with_libopenipmipthread_ldflags="$temp_result"
3708 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3709 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3711 AC_MSG_RESULT([$temp_result])
3714 if test "x$with_libopenipmipthread" = "xyes"
3716 SAVE_CPPFLAGS="$CPPFLAGS"
3717 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3719 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3720 [with_libopenipmipthread="yes"],
3721 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3722 [#include <OpenIPMI/ipmiif.h>
3723 #include <OpenIPMI/ipmi_err.h>
3724 #include <OpenIPMI/ipmi_posix.h>
3725 #include <OpenIPMI/ipmi_conn.h>
3728 CPPFLAGS="$SAVE_CPPFLAGS"
3731 if test "x$with_libopenipmipthread" = "xyes"
3733 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3734 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3735 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3736 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3740 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3741 [with_libnotify="yes"],
3742 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3744 # Check for enabled/disabled features
3747 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3748 # ------------------------------------------------------------
3750 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3755 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3760 m4_define([EnDis],[disabled])dnl
3761 m4_define([YesNo],[no])dnl
3767 m4_define([EnDis],[enabled])dnl
3768 m4_define([YesNo],[yes])dnl
3771 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3775 m4_if([$3], [feature], [],
3779 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3785 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3787 enable_$1='[YesNo]'dnl
3789 if test "x$enable_$1" = "xno"
3793 if test "x$enable_$1" = "xyes"
3797 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3802 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3803 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3805 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3807 # AC_PLUGIN(name, default, info)
3808 # ------------------------------------------------------------
3815 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3817 if test "x$enableval" = "xyes"
3820 else if test "x$enableval" = "xforce"
3829 if test "x$enable_all_plugins" = "xauto"
3831 if test "x$2" = "xyes"
3838 enable_plugin="$enable_all_plugins"
3841 if test "x$enable_plugin" = "xyes"
3843 if test "x$2" = "xyes" || test "x$force" = "xyes"
3845 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3846 if test "x$2" != "xyes"
3848 dependency_warning="yes"
3850 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3851 dependency_error="yes"
3852 enable_plugin="no (dependency error)"
3855 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3856 enable_$1="$enable_plugin"
3858 )# AC_PLUGIN(name, default, info)
3860 m4_divert_once([HELP_ENABLE], [
3861 collectd features:])
3862 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3863 AC_COLLECTD([debug], [enable], [feature], [debugging])
3864 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3865 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3867 dependency_warning="no"
3868 dependency_error="no"
3873 plugin_conntrack="no"
3874 plugin_contextswitch="no"
3877 plugin_curl_json="no"
3881 plugin_interface="no"
3888 plugin_multimeter="no"
3892 plugin_processes="no"
3893 plugin_protocols="no"
3897 plugin_tcpconns="no"
3904 plugin_wireless="no"
3908 if test "x$ac_system" = "xLinux"
3910 plugin_battery="yes"
3911 plugin_conntrack="yes"
3912 plugin_contextswitch="yes"
3914 plugin_cpufreq="yes"
3916 plugin_entropy="yes"
3917 plugin_interface="yes"
3922 plugin_fscache="yes"
3923 plugin_processes="yes"
3924 plugin_protocols="yes"
3927 plugin_tcpconns="yes"
3928 plugin_thermal="yes"
3931 plugin_vserver="yes"
3932 plugin_wireless="yes"
3934 if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
3940 if test "x$ac_system" = "xOpenBSD"
3942 plugin_tcpconns="yes"
3946 if test "x$with_libiokit" = "xyes"
3948 plugin_battery="yes"
3953 if test "x$with_perfstat" = "xyes"
3959 plugin_interface="yes"
3963 if test "x$with_procinfo" = "xyes"
3965 plugin_processes="yes"
3969 if test "x$with_kstat" = "xyes"
3972 plugin_zfs_arc="yes"
3975 if test "x$with_devinfo$with_kstat" = "xyesyes"
3979 plugin_interface="yes"
3984 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
3990 if test "x$with_libstatgrab" = "xyes"
3994 plugin_interface="yes"
4001 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4007 if test "x$with_libopenipmipthread" = "xyes"
4012 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4014 plugin_curl_json="yes"
4017 if test "x$have_processor_info" = "xyes"
4021 if test "x$have_sysctl" = "xyes"
4028 if test "x$have_sysctlbyname" = "xyes"
4032 plugin_tcpconns="yes"
4035 # Df plugin: Check if we know how to determine mount points first.
4036 #if test "x$have_listmntent" = "xyes"; then
4039 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4043 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4047 #if test "x$have_getmntent" = "xseq"
4051 if test "x$c_cv_have_one_getmntent" = "xyes"
4056 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4057 if test "x$plugin_df" = "xyes"
4060 if test "x$have_statfs" = "xyes"
4064 if test "x$have_statvfs" = "xyes"
4070 if test "x$have_getifaddrs" = "xyes"
4072 plugin_interface="yes"
4075 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4077 plugin_libvirt="yes"
4080 if test "x$have_getloadavg" = "xyes"
4085 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4090 # Mac OS X memory interface
4091 if test "x$have_host_statistics" = "xyes"
4096 if test "x$have_termios_h" = "xyes"
4098 plugin_multimeter="yes"
4102 if test "x$have_thread_info" = "xyes"
4104 plugin_processes="yes"
4107 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4109 plugin_processes="yes"
4112 if test "x$with_kvm_getswapinfo" = "xyes"
4117 if test "x$have_swapctl" = "xyes"
4122 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4124 plugin_tcpconns="yes"
4127 if test "x$have_getutent" = "xyes"
4131 if test "x$have_getutxent" = "xyes"
4136 m4_divert_once([HELP_ENABLE], [
4139 AC_ARG_ENABLE([all-plugins],
4140 AC_HELP_STRING([--enable-all-plugins],
4141 [enable all plugins (auto by def)]),
4143 if test "x$enableval" = "xyes"
4145 enable_all_plugins="yes"
4146 else if test "x$enableval" = "xauto"
4148 enable_all_plugins="auto"
4150 enable_all_plugins="no"
4153 [enable_all_plugins="auto"])
4155 m4_divert_once([HELP_ENABLE], [])
4157 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4158 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4159 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4160 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4161 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4162 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4163 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4164 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4165 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4166 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4167 AC_PLUGIN([csv], [yes], [CSV output plugin])
4168 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4169 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4170 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4171 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4172 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4173 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4174 AC_PLUGIN([email], [yes], [EMail statistics])
4175 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4176 AC_PLUGIN([exec], [yes], [Execution of external programs])
4177 AC_PLUGIN([filecount], [yes], [Count files in directories])
4178 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4179 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4180 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4181 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4182 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4183 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4184 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4185 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4186 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4187 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4188 AC_PLUGIN([load], [$plugin_load], [System load])
4189 AC_PLUGIN([logfile], [yes], [File logging plugin])
4190 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4191 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4192 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4193 AC_PLUGIN([match_regex], [yes], [The regex match])
4194 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4195 AC_PLUGIN([match_value], [yes], [The value match])
4196 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4197 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4198 AC_PLUGIN([memcached], [yes], [memcached statistics])
4199 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4200 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4201 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4202 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4203 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4204 AC_PLUGIN([network], [yes], [Network communication plugin])
4205 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4206 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4207 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4208 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4209 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4210 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4211 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4212 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4213 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4214 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4215 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4216 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4217 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4218 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4219 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4220 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4221 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4222 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4223 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4224 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4225 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4226 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4227 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4228 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4229 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4230 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4231 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4232 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4233 AC_PLUGIN([target_notification], [yes], [The notification target])
4234 AC_PLUGIN([target_replace], [yes], [The replace target])
4235 AC_PLUGIN([target_scale],[yes], [The scale target])
4236 AC_PLUGIN([target_set], [yes], [The set target])
4237 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4238 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4239 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4240 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4241 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4242 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4243 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4244 AC_PLUGIN([users], [$plugin_users], [User statistics])
4245 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4246 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4247 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4248 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4249 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4250 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4251 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4253 dnl Default configuration file
4254 # Load either syslog or logfile
4255 LOAD_PLUGIN_SYSLOG=""
4256 LOAD_PLUGIN_LOGFILE=""
4258 AC_MSG_CHECKING([which default log plugin to load])
4259 default_log_plugin="none"
4260 if test "x$enable_syslog" = "xyes"
4262 default_log_plugin="syslog"
4264 LOAD_PLUGIN_SYSLOG="##"
4267 if test "x$enable_logfile" = "xyes"
4269 if test "x$default_log_plugin" = "xnone"
4271 default_log_plugin="logfile"
4273 LOAD_PLUGIN_LOGFILE="#"
4276 LOAD_PLUGIN_LOGFILE="##"
4278 AC_MSG_RESULT([$default_log_plugin])
4280 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4281 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4283 DEFAULT_LOG_LEVEL="info"
4284 if test "x$enable_debug" = "xyes"
4286 DEFAULT_LOG_LEVEL="debug"
4288 AC_SUBST(DEFAULT_LOG_LEVEL)
4290 # Load only one of rrdtool, network, csv in the default config.
4291 LOAD_PLUGIN_RRDTOOL=""
4292 LOAD_PLUGIN_NETWORK=""
4295 AC_MSG_CHECKING([which default write plugin to load])
4296 default_write_plugin="none"
4297 if test "x$enable_rrdtool" = "xyes"
4299 default_write_plugin="rrdtool"
4301 LOAD_PLUGIN_RRDTOOL="##"
4304 if test "x$enable_network" = "xyes"
4306 if test "x$default_write_plugin" = "xnone"
4308 default_write_plugin="network"
4310 LOAD_PLUGIN_NETWORK="#"
4313 LOAD_PLUGIN_NETWORK="##"
4316 if test "x$enable_csv" = "xyes"
4318 if test "x$default_write_plugin" = "xnone"
4320 default_write_plugin="csv"
4325 LOAD_PLUGIN_CSV="##"
4327 AC_MSG_RESULT([$default_write_plugin])
4329 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4330 AC_SUBST(LOAD_PLUGIN_NETWORK)
4331 AC_SUBST(LOAD_PLUGIN_CSV)
4334 if test "x$ac_system" = "xLinux" \
4335 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4337 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4341 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4343 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4345 PERL_BINDINGS_OPTIONS="$withval"
4346 with_perl_bindings="yes"
4348 PERL_BINDINGS_OPTIONS=""
4349 with_perl_bindings="$withval"
4353 PERL_BINDINGS_OPTIONS=""
4354 if test -n "$perl_interpreter"
4356 with_perl_bindings="yes"
4358 with_perl_bindings="no (no perl interpreter found)"
4361 if test "x$with_perl_bindings" = "xyes"
4363 PERL_BINDINGS="perl"
4367 AC_SUBST(PERL_BINDINGS)
4368 AC_SUBST(PERL_BINDINGS_OPTIONS)
4370 dnl libcollectdclient
4371 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4372 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4373 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4375 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4377 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4379 AC_SUBST(LCC_VERSION_MAJOR)
4380 AC_SUBST(LCC_VERSION_MINOR)
4381 AC_SUBST(LCC_VERSION_PATCH)
4382 AC_SUBST(LCC_VERSION_EXTRA)
4383 AC_SUBST(LCC_VERSION_STRING)
4385 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4387 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)
4389 if test "x$with_librrd" = "xyes" \
4390 && test "x$librrd_threadsafe" != "xyes"
4392 with_librrd="yes (warning: librrd is not thread-safe)"
4395 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
4397 with_libiptc="yes (shipped version)"
4400 if test "x$with_libperl" = "xyes"
4402 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4404 enable_perl="no (needs libperl)"
4407 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4409 enable_perl="no (libperl doesn't support ithreads)"
4412 if test "x$with_perl_bindings" = "xyes" \
4413 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4415 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4422 libcurl . . . . . . . $with_libcurl
4423 libdbi . . . . . . . $with_libdbi
4424 libesmtp . . . . . . $with_libesmtp
4425 libganglia . . . . . $with_libganglia
4426 libgcrypt . . . . . . $with_libgcrypt
4427 libiokit . . . . . . $with_libiokit
4428 libiptc . . . . . . . $with_libiptc
4429 libjvm . . . . . . . $with_java
4430 libkstat . . . . . . $with_kstat
4431 libkvm . . . . . . . $with_libkvm
4432 libmemcached . . . . $with_libmemcached
4433 libmysql . . . . . . $with_libmysql
4434 libnetapp . . . . . . $with_libnetapp
4435 libnetlink . . . . . $with_libnetlink
4436 libnetsnmp . . . . . $with_libnetsnmp
4437 libnotify . . . . . . $with_libnotify
4438 liboconfig . . . . . $with_liboconfig
4439 libopenipmi . . . . . $with_libopenipmipthread
4440 liboping . . . . . . $with_liboping
4441 libpcap . . . . . . . $with_libpcap
4442 libperfstat . . . . . $with_perfstat
4443 libperl . . . . . . . $with_libperl
4444 libpq . . . . . . . . $with_libpq
4445 libpthread . . . . . $with_libpthread
4446 librouteros . . . . . $with_librouteros
4447 librrd . . . . . . . $with_librrd
4448 libsensors . . . . . $with_libsensors
4449 libstatgrab . . . . . $with_libstatgrab
4450 libtokyotyrant . . . $with_libtokyotyrant
4451 libupsclient . . . . $with_libupsclient
4452 libvirt . . . . . . . $with_libvirt
4453 libxml2 . . . . . . . $with_libxml2
4454 libxmms . . . . . . . $with_libxmms
4455 libyajl . . . . . . . $with_libyajl
4456 oracle . . . . . . . $with_oracle
4457 python . . . . . . . $with_python
4460 daemon mode . . . . . $enable_daemon
4461 debug . . . . . . . . $enable_debug
4464 perl . . . . . . . . $with_perl_bindings
4467 apache . . . . . . . $enable_apache
4468 apcups . . . . . . . $enable_apcups
4469 apple_sensors . . . . $enable_apple_sensors
4470 ascent . . . . . . . $enable_ascent
4471 battery . . . . . . . $enable_battery
4472 bind . . . . . . . . $enable_bind
4473 conntrack . . . . . . $enable_conntrack
4474 contextswitch . . . . $enable_contextswitch
4475 cpu . . . . . . . . . $enable_cpu
4476 cpufreq . . . . . . . $enable_cpufreq
4477 csv . . . . . . . . . $enable_csv
4478 curl . . . . . . . . $enable_curl
4479 curl_json . . . . . . $enable_curl_json
4480 dbi . . . . . . . . . $enable_dbi
4481 df . . . . . . . . . $enable_df
4482 disk . . . . . . . . $enable_disk
4483 dns . . . . . . . . . $enable_dns
4484 email . . . . . . . . $enable_email
4485 entropy . . . . . . . $enable_entropy
4486 exec . . . . . . . . $enable_exec
4487 filecount . . . . . . $enable_filecount
4488 fscache . . . . . . . $enable_fscache
4489 gmond . . . . . . . . $enable_gmond
4490 hddtemp . . . . . . . $enable_hddtemp
4491 interface . . . . . . $enable_interface
4492 ipmi . . . . . . . . $enable_ipmi
4493 iptables . . . . . . $enable_iptables
4494 ipvs . . . . . . . . $enable_ipvs
4495 irq . . . . . . . . . $enable_irq
4496 java . . . . . . . . $enable_java
4497 libvirt . . . . . . . $enable_libvirt
4498 load . . . . . . . . $enable_load
4499 logfile . . . . . . . $enable_logfile
4500 madwifi . . . . . . . $enable_madwifi
4501 match_empty_counter . $enable_match_empty_counter
4502 match_hashed . . . . $enable_match_hashed
4503 match_regex . . . . . $enable_match_regex
4504 match_timediff . . . $enable_match_timediff
4505 match_value . . . . . $enable_match_value
4506 mbmon . . . . . . . . $enable_mbmon
4507 memcachec . . . . . . $enable_memcachec
4508 memcached . . . . . . $enable_memcached
4509 memory . . . . . . . $enable_memory
4510 multimeter . . . . . $enable_multimeter
4511 mysql . . . . . . . . $enable_mysql
4512 netapp . . . . . . . $enable_netapp
4513 netlink . . . . . . . $enable_netlink
4514 network . . . . . . . $enable_network
4515 nfs . . . . . . . . . $enable_nfs
4516 nginx . . . . . . . . $enable_nginx
4517 notify_desktop . . . $enable_notify_desktop
4518 notify_email . . . . $enable_notify_email
4519 ntpd . . . . . . . . $enable_ntpd
4520 nut . . . . . . . . . $enable_nut
4521 olsrd . . . . . . . . $enable_olsrd
4522 onewire . . . . . . . $enable_onewire
4523 openvpn . . . . . . . $enable_openvpn
4524 oracle . . . . . . . $enable_oracle
4525 perl . . . . . . . . $enable_perl
4526 ping . . . . . . . . $enable_ping
4527 postgresql . . . . . $enable_postgresql
4528 powerdns . . . . . . $enable_powerdns
4529 processes . . . . . . $enable_processes
4530 protocols . . . . . . $enable_protocols
4531 python . . . . . . . $enable_python
4532 routeros . . . . . . $enable_routeros
4533 rrdcached . . . . . . $enable_rrdcached
4534 rrdtool . . . . . . . $enable_rrdtool
4535 sensors . . . . . . . $enable_sensors
4536 serial . . . . . . . $enable_serial
4537 snmp . . . . . . . . $enable_snmp
4538 swap . . . . . . . . $enable_swap
4539 syslog . . . . . . . $enable_syslog
4540 table . . . . . . . . $enable_table
4541 tail . . . . . . . . $enable_tail
4542 tape . . . . . . . . $enable_tape
4543 target_notification . $enable_target_notification
4544 target_replace . . . $enable_target_replace
4545 target_scale . . . . $enable_target_scale
4546 target_set . . . . . $enable_target_set
4547 tcpconns . . . . . . $enable_tcpconns
4548 teamspeak2 . . . . . $enable_teamspeak2
4549 ted . . . . . . . . . $enable_ted
4550 thermal . . . . . . . $enable_thermal
4551 tokyotyrant . . . . . $enable_tokyotyrant
4552 unixsock . . . . . . $enable_unixsock
4553 uptime . . . . . . . $enable_uptime
4554 users . . . . . . . . $enable_users
4555 uuid . . . . . . . . $enable_uuid
4556 vmem . . . . . . . . $enable_vmem
4557 vserver . . . . . . . $enable_vserver
4558 wireless . . . . . . $enable_wireless
4559 write_http . . . . . $enable_write_http
4560 xmms . . . . . . . . $enable_xmms
4561 zfs_arc . . . . . . . $enable_zfs_arc
4565 if test "x$dependency_error" = "xyes"; then
4566 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
4569 if test "x$dependency_warning" = "xyes"; then
4570 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
4573 # vim: set fdm=marker :