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,,
2458 [with_libpcap="no (pcap.h not found)"])
2460 if test "x$with_libpcap" = "xyes"
2462 AC_CHECK_HEADERS(pcap-bpf.h)
2464 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2467 # --with-libperl {{{
2468 perl_interpreter="perl"
2469 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2471 if test -x "$withval"
2473 perl_interpreter="$withval"
2475 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2477 LDFLAGS="$LDFLAGS -L$withval/lib"
2478 CPPFLAGS="$CPPFLAGS -I$withval/include"
2479 perl_interpreter="$withval/bin/perl"
2482 with_libperl="$withval"
2489 AC_MSG_CHECKING([for perl])
2490 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2491 if test -x "$perl_interpreter"
2493 AC_MSG_RESULT([yes ($perl_interpreter)])
2499 AC_SUBST(PERL, "$perl_interpreter")
2501 if test "x$with_libperl" = "xyes" \
2502 && test -n "$perl_interpreter"
2504 SAVE_CFLAGS="$CFLAGS"
2505 SAVE_LDFLAGS="$LDFLAGS"
2506 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2507 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2508 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2509 CFLAGS="$CFLAGS $PERL_CFLAGS"
2510 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2512 AC_CACHE_CHECK([for libperl],
2513 [c_cv_have_libperl],
2517 #define PERL_NO_GET_CONTEXT
2524 load_module (PERL_LOADMOD_NOIMPORT,
2525 newSVpv ("Collectd::Plugin::FooBar", 24),
2528 [c_cv_have_libperl="yes"],
2529 [c_cv_have_libperl="no"]
2533 if test "x$c_cv_have_libperl" = "xyes"
2535 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2536 AC_SUBST(PERL_CFLAGS)
2537 AC_SUBST(PERL_LDFLAGS)
2542 CFLAGS="$SAVE_CFLAGS"
2543 LDFLAGS="$SAVE_LDFLAGS"
2544 else if test -z "$perl_interpreter"; then
2545 with_libperl="no (no perl interpreter found)"
2546 c_cv_have_libperl="no"
2548 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2550 if test "x$with_libperl" = "xyes"
2552 SAVE_CFLAGS="$CFLAGS"
2553 SAVE_LDFLAGS="$LDFLAGS"
2554 CFLAGS="$CFLAGS $PERL_CFLAGS"
2555 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2557 AC_CACHE_CHECK([if perl supports ithreads],
2558 [c_cv_have_perl_ithreads],
2566 #if !defined(USE_ITHREADS)
2567 # error "Perl does not support ithreads!"
2568 #endif /* !defined(USE_ITHREADS) */
2571 [c_cv_have_perl_ithreads="yes"],
2572 [c_cv_have_perl_ithreads="no"]
2576 if test "x$c_cv_have_perl_ithreads" = "xyes"
2578 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2581 CFLAGS="$SAVE_CFLAGS"
2582 LDFLAGS="$SAVE_LDFLAGS"
2585 if test "x$with_libperl" = "xyes"
2587 SAVE_CFLAGS="$CFLAGS"
2588 SAVE_LDFLAGS="$LDFLAGS"
2589 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2590 # (see issues #41 and #42)
2591 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2592 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2594 AC_CACHE_CHECK([for broken Perl_load_module()],
2595 [c_cv_have_broken_perl_load_module],
2599 #define PERL_NO_GET_CONTEXT
2606 load_module (PERL_LOADMOD_NOIMPORT,
2607 newSVpv ("Collectd::Plugin::FooBar", 24),
2610 [c_cv_have_broken_perl_load_module="no"],
2611 [c_cv_have_broken_perl_load_module="yes"]
2615 CFLAGS="$SAVE_CFLAGS"
2616 LDFLAGS="$SAVE_LDFLAGS"
2618 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2619 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2621 if test "x$with_libperl" = "xyes"
2623 SAVE_CFLAGS="$CFLAGS"
2624 SAVE_LDFLAGS="$LDFLAGS"
2625 CFLAGS="$CFLAGS $PERL_CFLAGS"
2626 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2629 [struct mgvtbl.svt_local],
2630 [have_struct_mgvtbl_svt_local="yes"],
2631 [have_struct_mgvtbl_svt_local="no"],
2638 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2640 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2641 [Define if Perl's struct mgvtbl has member svt_local.])
2644 CFLAGS="$SAVE_CFLAGS"
2645 LDFLAGS="$SAVE_LDFLAGS"
2650 with_pg_config="pg_config"
2651 with_libpq_includedir=""
2652 with_libpq_libdir=""
2653 with_libpq_cppflags=""
2654 with_libpq_ldflags=""
2655 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2658 if test "x$withval" = "xno"
2661 else if test "x$withval" = "xyes"
2665 if test -f "$withval" && test -x "$withval";
2667 with_pg_config="$withval"
2668 else if test -x "$withval/bin/pg_config"
2670 with_pg_config="$withval/bin/pg_config"
2678 if test "x$with_libpq" = "xyes"
2680 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2683 if test $pg_config_status -eq 0
2685 if test -n "$with_libpq_includedir"; then
2686 for dir in $with_libpq_includedir; do
2687 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2691 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2694 SAVE_CPPFLAGS="$CPPFLAGS"
2695 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2697 AC_CHECK_HEADERS(libpq-fe.h, [],
2698 [with_libpq="no (libpq-fe.h not found)"], [])
2700 CPPFLAGS="$SAVE_CPPFLAGS"
2702 if test "x$with_libpq" = "xyes"
2704 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2707 if test $pg_config_status -eq 0
2709 if test -n "$with_libpq_libdir"; then
2710 for dir in $with_libpq_libdir; do
2711 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2715 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2718 SAVE_LDFLAGS="$LDFLAGS"
2719 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2721 AC_CHECK_LIB(pq, PQconnectdb,
2723 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2725 AC_CHECK_LIB(pq, PQserverVersion,
2727 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2729 LDFLAGS="$SAVE_LDFLAGS"
2731 if test "x$with_libpq" = "xyes"
2733 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2734 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2735 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2736 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2738 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2741 # --with-libpthread {{{
2742 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2743 [ if test "x$withval" != "xno" \
2744 && test "x$withval" != "xyes"
2746 LDFLAGS="$LDFLAGS -L$withval/lib"
2747 CPPFLAGS="$CPPFLAGS -I$withval/include"
2748 with_libpthread="yes"
2750 if test "x$withval" = "xno"
2752 with_libpthread="no (disabled)"
2755 ], [with_libpthread="yes"])
2756 if test "x$with_libpthread" = "xyes"
2758 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2761 if test "x$with_libpthread" = "xyes"
2763 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2765 if test "x$with_libpthread" = "xyes"
2771 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2772 [Wether or not to use pthread (POSIX threads) library])
2773 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2778 with_python_path="$PATH"
2779 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
2781 if test "x$withval" = "xyes" || test "x$withval" = "xno"
2783 with_python="$withval"
2784 else if test -x "$withval"
2786 with_python_prog="$withval"
2787 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
2789 else if test -d "$withval"
2791 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
2794 AC_MSG_WARN([Argument not recognized: $withval])
2796 ], [with_python="yes"])
2799 SAVE_CPPFLAGS="$CPPFLAGS"
2800 SAVE_LDFLAGS="$LDFLAGS"
2803 PATH="$with_python_path"
2805 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
2807 AC_MSG_CHECKING([for python])
2808 with_python_prog="`which python 2>/dev/null`"
2809 if test "x$with_python_prog" = "x"
2811 AC_MSG_RESULT([not found])
2812 with_python="no (interpreter not found)"
2814 AC_MSG_RESULT([$with_python_prog])
2818 if test "x$with_python" = "xyes"
2820 AC_MSG_CHECKING([for Python CPPFLAGS])
2821 python_include_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_python_inc()" | "$with_python_prog" 2>&1`
2822 python_config_status=$?
2824 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
2826 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
2829 AC_MSG_RESULT([$python_include_path])
2833 if test "x$with_python" = "xyes"
2835 CPPFLAGS="-I$python_include_path $CPPFLAGS"
2836 AC_CHECK_HEADERS(Python.h,
2837 [with_python="yes"],
2838 [with_python="no ('Python.h' not found)"])
2841 if test "x$with_python" = "xyes"
2843 AC_MSG_CHECKING([for Python LDFLAGS])
2844 python_library_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0)" | "$with_python_prog" 2>&1`
2845 python_config_status=$?
2847 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
2849 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
2852 AC_MSG_RESULT([$python_library_path])
2856 if test "x$with_python" = "xyes"
2858 AC_MSG_CHECKING([for Python LIBS])
2859 python_library_flags=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0)" | "$with_python_prog" 2>&1`
2860 python_config_status=$?
2862 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
2864 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
2867 AC_MSG_RESULT([$python_library_flags])
2871 if test "x$with_python" = "xyes"
2873 LDFLAGS="-L$python_library_path $LDFLAGS"
2874 LIBS="$python_library_flags $LIBS"
2876 AC_CHECK_FUNC(PyObject_CallFunction,
2877 [with_python="yes"],
2878 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
2882 CPPFLAGS="$SAVE_CPPFLAGS"
2883 LDFLAGS="$SAVE_LDFLAGS"
2886 if test "x$with_python" = "xyes"
2888 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
2889 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
2890 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
2891 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
2892 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
2893 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
2897 # --with-librouteros {{{
2898 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
2900 if test "x$withval" = "xyes"
2902 with_librouteros="yes"
2903 else if test "x$withval" = "xno"
2905 with_librouteros="no"
2907 with_librouteros="yes"
2908 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
2909 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
2912 [with_librouteros="yes"])
2914 SAVE_CPPFLAGS="$CPPFLAGS"
2915 SAVE_LDFLAGS="$LDFLAGS"
2917 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
2918 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
2920 if test "x$with_librouteros" = "xyes"
2922 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
2924 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
2926 AC_CHECK_HEADERS(routeros_api.h,
2927 [with_librouteros="yes"],
2928 [with_librouteros="no ('routeros_api.h' not found)"])
2930 if test "x$with_librouteros" = "xyes"
2932 if test "x$LIBROUTEROS_LDFLAGS" != "x"
2934 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
2936 AC_CHECK_LIB(routeros, ros_interface,
2937 [with_librouteros="yes"],
2938 [with_librouteros="no (symbol 'ros_interface' not found)"])
2941 CPPFLAGS="$SAVE_CPPFLAGS"
2942 LDFLAGS="$SAVE_LDFLAGS"
2944 if test "x$with_librouteros" = "xyes"
2946 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
2947 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
2948 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
2949 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
2951 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
2955 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2958 librrd_threadsafe="yes"
2959 librrd_rrdc_update="no"
2960 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2961 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2963 librrd_cflags="-I$withval/include"
2964 librrd_ldflags="-L$withval/lib"
2967 with_librrd="$withval"
2969 ], [with_librrd="yes"])
2970 if test "x$with_librrd" = "xyes"
2972 SAVE_CPPFLAGS="$CPPFLAGS"
2973 SAVE_LDFLAGS="$LDFLAGS"
2975 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2976 LDFLAGS="$LDFLAGS $librrd_ldflags"
2978 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2980 CPPFLAGS="$SAVE_CPPFLAGS"
2981 LDFLAGS="$SAVE_LDFLAGS"
2983 if test "x$with_librrd" = "xyes"
2985 SAVE_CPPFLAGS="$CPPFLAGS"
2986 SAVE_LDFLAGS="$LDFLAGS"
2988 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2989 LDFLAGS="$LDFLAGS $librrd_ldflags"
2991 AC_CHECK_LIB(rrd_th, rrd_update_r,
2993 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2995 [librrd_threadsafe="no"
2996 AC_CHECK_LIB(rrd, rrd_update,
2998 librrd_ldflags="$librrd_ldflags -lrrd -lm"
3000 [with_librrd="no (symbol 'rrd_update' not found)"],
3005 if test "x$librrd_threadsafe" = "xyes"
3007 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3009 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3012 CPPFLAGS="$SAVE_CPPFLAGS"
3013 LDFLAGS="$SAVE_LDFLAGS"
3015 if test "x$with_librrd" = "xyes"
3017 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3018 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3019 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3020 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3022 if test "x$librrd_threadsafe" = "xyes"
3024 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3028 # --with-libsensors {{{
3029 with_sensors_cflags=""
3030 with_sensors_ldflags=""
3031 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3033 if test "x$withval" = "xno"
3035 with_libsensors="no"
3037 with_libsensors="yes"
3038 if test "x$withval" != "xyes"
3040 with_sensors_cflags="-I$withval/include"
3041 with_sensors_ldflags="-L$withval/lib"
3042 with_libsensors="yes"
3047 if test "x$ac_system" = "xLinux"
3049 with_libsensors="yes"
3051 with_libsensors="no (Linux only library)"
3054 if test "x$with_libsensors" = "xyes"
3056 SAVE_CPPFLAGS="$CPPFLAGS"
3057 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3059 # AC_CHECK_HEADERS(sensors/sensors.h,
3061 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3063 # [with_libsensors="no (sensors/sensors.h not found)"])
3064 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3066 CPPFLAGS="$SAVE_CPPFLAGS"
3068 if test "x$with_libsensors" = "xyes"
3070 SAVE_CPPFLAGS="$CPPFLAGS"
3071 SAVE_LDFLAGS="$LDFLAGS"
3072 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3073 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3075 AC_CHECK_LIB(sensors, sensors_init,
3077 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3079 [with_libsensors="no (libsensors not found)"])
3081 CPPFLAGS="$SAVE_CPPFLAGS"
3082 LDFLAGS="$SAVE_LDFLAGS"
3084 if test "x$with_libsensors" = "xyes"
3086 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3087 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3088 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3089 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3091 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3094 # --with-libstatgrab {{{
3095 with_libstatgrab_cflags=""
3096 with_libstatgrab_ldflags=""
3097 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3099 if test "x$withval" != "xno" \
3100 && test "x$withval" != "xyes"
3102 with_libstatgrab_cflags="-I$withval/include"
3103 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3104 with_libstatgrab="yes"
3105 with_libstatgrab_pkg_config="no"
3107 with_libstatgrab="$withval"
3108 with_libstatgrab_pkg_config="yes"
3112 with_libstatgrab="yes"
3113 with_libstatgrab_pkg_config="yes"
3116 if test "x$with_libstatgrab" = "xyes" \
3117 && test "x$with_libstatgrab_pkg_config" = "xyes"
3119 if test "x$PKG_CONFIG" != "x"
3121 AC_MSG_CHECKING([pkg-config for libstatgrab])
3123 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3126 with_libstatgrab_pkg_config="no"
3127 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
3128 temp_result="not found"
3130 AC_MSG_RESULT([$temp_result])
3132 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3133 with_libstatgrab_pkg_config="no"
3134 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3138 if test "x$with_libstatgrab" = "xyes" \
3139 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3140 && test "x$with_libstatgrab_cflags" = "x"
3142 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3143 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3146 with_libstatgrab_cflags="$temp_result"
3148 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3149 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3151 AC_MSG_RESULT([$temp_result])
3154 if test "x$with_libstatgrab" = "xyes" \
3155 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3156 && test "x$with_libstatgrab_ldflags" = "x"
3158 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3159 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3162 with_libstatgrab_ldflags="$temp_result"
3164 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3165 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3167 AC_MSG_RESULT([$temp_result])
3170 if test "x$with_libstatgrab" = "xyes"
3172 SAVE_CPPFLAGS="$CPPFLAGS"
3173 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3175 AC_CHECK_HEADERS(statgrab.h,
3176 [with_libstatgrab="yes"],
3177 [with_libstatgrab="no (statgrab.h not found)"])
3179 CPPFLAGS="$SAVE_CPPFLAGS"
3182 if test "x$with_libstatgrab" = "xyes"
3184 SAVE_CFLAGS="$CFLAGS"
3185 SAVE_LDFLAGS="$LDFLAGS"
3187 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3188 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3190 AC_CHECK_LIB(statgrab, sg_init,
3191 [with_libstatgrab="yes"],
3192 [with_libstatgrab="no (symbol sg_init not found)"])
3194 CFLAGS="$SAVE_CFLAGS"
3195 LDFLAGS="$SAVE_LDFLAGS"
3198 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3199 if test "x$with_libstatgrab" = "xyes"
3201 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3202 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3203 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3204 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3205 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3209 # --with-libtokyotyrant {{{
3210 with_libtokyotyrant_cppflags=""
3211 with_libtokyotyrant_ldflags=""
3212 with_libtokyotyrant_libs=""
3213 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3215 if test "x$withval" = "xno"
3217 with_libtokyotyrant="no"
3218 else if test "x$withval" = "xyes"
3220 with_libtokyotyrant="yes"
3222 with_libtokyotyrant_cppflags="-I$withval/include"
3223 with_libtokyotyrant_ldflags="-L$withval/include"
3224 with_libtokyotyrant_libs="-ltokyotyrant"
3225 with_libtokyotyrant="yes"
3229 with_libtokyotyrant="yes"
3232 if test "x$with_libtokyotyrant" = "xyes"
3234 if $PKG_CONFIG --exists tokyotyrant
3236 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3237 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3238 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3242 SAVE_CPPFLAGS="$CPPFLAGS"
3243 SAVE_LDFLAGS="$LDFLAGS"
3244 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3245 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3247 if test "x$with_libtokyotyrant" = "xyes"
3249 AC_CHECK_HEADERS(tcrdb.h,
3251 AC_DEFINE(HAVE_TCRDB_H, 1,
3252 [Define to 1 if you have the <tcrdb.h> header file.])
3253 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3256 if test "x$with_libtokyotyrant" = "xyes"
3258 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3260 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3261 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3263 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3264 [$with_libtokyotyrant_libs])
3267 CPPFLAGS="$SAVE_CPPFLAGS"
3268 LDFLAGS="$SAVE_LDFLAGS"
3270 if test "x$with_libtokyotyrant" = "xyes"
3272 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3273 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3274 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3275 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3276 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3277 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3279 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3282 # --with-libupsclient {{{
3283 with_libupsclient_config=""
3284 with_libupsclient_cflags=""
3285 with_libupsclient_libs=""
3286 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the upsclient library.])],
3288 if test "x$withval" = "xno"
3290 with_libupsclient="no"
3291 else if test "x$withval" = "xyes"
3293 with_libupsclient="use_pkgconfig"
3295 if test -x "$withval"
3297 with_libupsclient_config="$withval"
3298 with_libupsclient="use_libupsclient_config"
3299 else if test -x "$withval/bin/libupsclient-config"
3301 with_libupsclient_config="$withval/bin/libupsclient-config"
3302 with_libupsclient="use_libupsclient_config"
3304 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3305 with_libupsclient_cflags="-I$withval/include"
3306 with_libupsclient_libs="-L$withval/lib -lupsclient"
3307 with_libupsclient="yes"
3311 [with_libupsclient="use_pkgconfig"])
3313 # configure using libupsclient-config
3314 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3316 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3317 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3320 with_libupsclient="no ($with_libupsclient_config failed)"
3322 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3325 with_libupsclient="no ($with_libupsclient_config failed)"
3328 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3330 with_libupsclient="yes"
3333 # configure using pkg-config
3334 if test "x$with_libupsclient" = "xuse_pkgconfig"
3336 if test "x$PKG_CONFIG" = "x"
3338 with_libupsclient="no (Don't have pkg-config)"
3341 if test "x$with_libupsclient" = "xuse_pkgconfig"
3343 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3344 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3347 with_libupsclient="no (pkg-config doesn't know library)"
3350 if test "x$with_libupsclient" = "xuse_pkgconfig"
3352 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3355 with_libupsclient="no ($PKG_CONFIG failed)"
3357 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3360 with_libupsclient="no ($PKG_CONFIG failed)"
3363 if test "x$with_libupsclient" = "xuse_pkgconfig"
3365 with_libupsclient="yes"
3368 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3369 # the actual checks.
3370 if test "x$with_libupsclient" = "xyes"
3372 SAVE_CPPFLAGS="$CPPFLAGS"
3373 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3375 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3377 CPPFLAGS="$SAVE_CPPFLAGS"
3379 if test "x$with_libupsclient" = "xyes"
3381 SAVE_CPPFLAGS="$CPPFLAGS"
3382 SAVE_LDFLAGS="$LDFLAGS"
3384 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3385 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3387 AC_CHECK_LIB(upsclient, upscli_connect,
3388 [with_libupsclient="yes"],
3389 [with_libupsclient="no (symbol upscli_connect not found)"])
3391 CPPFLAGS="$SAVE_CPPFLAGS"
3392 LDFLAGS="$SAVE_LDFLAGS"
3394 if test "x$with_libupsclient" = "xyes"
3396 SAVE_CPPFLAGS="$CPPFLAGS"
3397 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3399 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3400 [#include <stdlib.h>
3402 #include <upsclient.h>])
3404 CPPFLAGS="$SAVE_CPPFLAGS"
3406 if test "x$with_libupsclient" = "xyes"
3408 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3409 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3410 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3411 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3415 # --with-libxmms {{{
3416 with_xmms_config="xmms-config"
3419 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3421 if test "x$withval" != "xno" \
3422 && test "x$withval" != "xyes"
3424 if test -f "$withval" && test -x "$withval";
3426 with_xmms_config="$withval"
3427 else if test -x "$withval/bin/xmms-config"
3429 with_xmms_config="$withval/bin/xmms-config"
3432 else if test "x$withval" = "xno"
3442 if test "x$with_libxmms" = "xyes"
3444 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3445 xmms_config_status=$?
3447 if test $xmms_config_status -ne 0
3452 if test "x$with_libxmms" = "xyes"
3454 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3455 xmms_config_status=$?
3457 if test $xmms_config_status -ne 0
3462 if test "x$with_libxmms" = "xyes"
3464 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3466 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3467 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3468 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3469 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3476 with_libxmms_numeric=0
3477 if test "x$with_libxmms" = "xyes"
3479 with_libxmms_numeric=1
3481 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3482 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3485 # --with-libyajl {{{
3486 with_libyajl_cppflags=""
3487 with_libyajl_ldflags=""
3488 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3490 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3492 with_libyajl_cppflags="-I$withval/include"
3493 with_libyajl_ldflags="-L$withval/lib"
3496 with_libyajl="$withval"
3502 if test "x$with_libyajl" = "xyes"
3504 SAVE_CPPFLAGS="$CPPFLAGS"
3505 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3507 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3509 CPPFLAGS="$SAVE_CPPFLAGS"
3511 if test "x$with_libyajl" = "xyes"
3513 SAVE_CPPFLAGS="$CPPFLAGS"
3514 SAVE_LDFLAGS="$LDFLAGS"
3515 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3516 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3518 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3520 CPPFLAGS="$SAVE_CPPFLAGS"
3521 LDFLAGS="$SAVE_LDFLAGS"
3523 if test "x$with_libyajl" = "xyes"
3525 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3526 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3527 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3528 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3529 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3530 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3531 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3533 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3536 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3537 with_libxml2="no (pkg-config isn't available)"
3538 with_libxml2_cflags=""
3539 with_libxml2_ldflags=""
3540 with_libvirt="no (pkg-config isn't available)"
3541 with_libvirt_cflags=""
3542 with_libvirt_ldflags=""
3543 if test "x$PKG_CONFIG" != "x"
3545 pkg-config --exists 'libxml-2.0' 2>/dev/null
3550 with_libxml2="no (pkg-config doesn't know library)"
3553 pkg-config --exists libvirt 2>/dev/null
3558 with_libvirt="no (pkg-config doesn't know library)"
3561 if test "x$with_libxml2" = "xyes"
3563 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3568 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3574 if test "x$with_libxml2" = "xyes"
3576 SAVE_CPPFLAGS="$CPPFLAGS"
3577 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3579 AC_CHECK_HEADERS(libxml/parser.h, [],
3580 [with_libxml2="no (libxml/parser.h not found)"])
3582 CPPFLAGS="$SAVE_CPPFLAGS"
3584 if test "x$with_libxml2" = "xyes"
3586 SAVE_CFLAGS="$CFLAGS"
3587 SAVE_LDFLAGS="$LDFLAGS"
3589 CFLAGS="$CFLAGS $with_libxml2_cflags"
3590 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3592 AC_CHECK_LIB(xml2, xmlXPathEval,
3593 [with_libxml2="yes"],
3594 [with_libxml2="no (symbol xmlXPathEval not found)"])
3596 CFLAGS="$SAVE_CFLAGS"
3597 LDFLAGS="$SAVE_LDFLAGS"
3599 dnl Add the right compiler flags and libraries.
3600 if test "x$with_libxml2" = "xyes"; then
3601 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3602 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3603 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3604 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3606 if test "x$with_libvirt" = "xyes"
3608 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3613 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3619 if test "x$with_libvirt" = "xyes"
3621 SAVE_CPPFLAGS="$CPPFLAGS"
3622 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3624 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3625 [with_libvirt="no (libvirt/libvirt.h not found)"])
3627 CPPFLAGS="$SAVE_CPPFLAGS"
3629 if test "x$with_libvirt" = "xyes"
3631 SAVE_CFLAGS="$CFLAGS"
3632 SAVE_LDFLAGS="$LDFLAGS"
3634 CFLAGS="$CFLAGS $with_libvirt_cflags"
3635 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3637 AC_CHECK_LIB(virt, virDomainBlockStats,
3638 [with_libvirt="yes"],
3639 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3641 CFLAGS="$SAVE_CFLAGS"
3642 LDFLAGS="$SAVE_LDFLAGS"
3644 dnl Add the right compiler flags and libraries.
3645 if test "x$with_libvirt" = "xyes"; then
3646 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3647 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3648 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3649 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3653 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3654 with_libopenipmipthread="yes"
3655 with_libopenipmipthread_cflags=""
3656 with_libopenipmipthread_libs=""
3658 AC_MSG_CHECKING([for pkg-config])
3660 if test "x$PKG_CONFIG" = "x"
3662 with_libopenipmipthread="no"
3665 temp_result="$PKG_CONFIG"
3667 AC_MSG_RESULT([$temp_result])
3669 if test "x$with_libopenipmipthread" = "xyes"
3671 AC_MSG_CHECKING([for libOpenIPMIpthread])
3672 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3675 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3677 AC_MSG_RESULT([$with_libopenipmipthread])
3680 if test "x$with_libopenipmipthread" = "xyes"
3682 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3683 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3686 with_libopenipmipthread_cflags="$temp_result"
3688 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3689 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3691 AC_MSG_RESULT([$temp_result])
3694 if test "x$with_libopenipmipthread" = "xyes"
3696 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3697 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3700 with_libopenipmipthread_ldflags="$temp_result"
3702 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3703 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3705 AC_MSG_RESULT([$temp_result])
3708 if test "x$with_libopenipmipthread" = "xyes"
3710 SAVE_CPPFLAGS="$CPPFLAGS"
3711 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3713 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3714 [with_libopenipmipthread="yes"],
3715 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3716 [#include <OpenIPMI/ipmiif.h>
3717 #include <OpenIPMI/ipmi_err.h>
3718 #include <OpenIPMI/ipmi_posix.h>
3719 #include <OpenIPMI/ipmi_conn.h>
3722 CPPFLAGS="$SAVE_CPPFLAGS"
3725 if test "x$with_libopenipmipthread" = "xyes"
3727 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3728 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3729 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3730 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3734 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3735 [with_libnotify="yes"],
3736 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3738 # Check for enabled/disabled features
3741 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3742 # ------------------------------------------------------------
3744 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3749 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3754 m4_define([EnDis],[disabled])dnl
3755 m4_define([YesNo],[no])dnl
3761 m4_define([EnDis],[enabled])dnl
3762 m4_define([YesNo],[yes])dnl
3765 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3769 m4_if([$3], [feature], [],
3773 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3779 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3781 enable_$1='[YesNo]'dnl
3783 if test "x$enable_$1" = "xno"
3787 if test "x$enable_$1" = "xyes"
3791 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3796 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3797 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3799 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3801 # AC_PLUGIN(name, default, info)
3802 # ------------------------------------------------------------
3809 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3811 if test "x$enableval" = "xyes"
3814 else if test "x$enableval" = "xforce"
3823 if test "x$enable_all_plugins" = "xauto"
3825 if test "x$2" = "xyes"
3832 enable_plugin="$enable_all_plugins"
3835 if test "x$enable_plugin" = "xyes"
3837 if test "x$2" = "xyes" || test "x$force" = "xyes"
3839 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3840 if test "x$2" != "xyes"
3842 dependency_warning="yes"
3844 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3845 dependency_error="yes"
3846 enable_plugin="no (dependency error)"
3849 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3850 enable_$1="$enable_plugin"
3852 )# AC_PLUGIN(name, default, info)
3854 m4_divert_once([HELP_ENABLE], [
3855 collectd features:])
3856 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3857 AC_COLLECTD([debug], [enable], [feature], [debugging])
3858 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3859 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3861 dependency_warning="no"
3862 dependency_error="no"
3867 plugin_conntrack="no"
3868 plugin_contextswitch="no"
3871 plugin_curl_json="no"
3875 plugin_interface="no"
3882 plugin_multimeter="no"
3886 plugin_processes="no"
3887 plugin_protocols="no"
3891 plugin_tcpconns="no"
3898 plugin_wireless="no"
3902 if test "x$ac_system" = "xLinux"
3904 plugin_battery="yes"
3905 plugin_conntrack="yes"
3906 plugin_contextswitch="yes"
3908 plugin_cpufreq="yes"
3910 plugin_entropy="yes"
3911 plugin_interface="yes"
3916 plugin_fscache="yes"
3917 plugin_processes="yes"
3918 plugin_protocols="yes"
3921 plugin_tcpconns="yes"
3922 plugin_thermal="yes"
3925 plugin_vserver="yes"
3926 plugin_wireless="yes"
3928 if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
3934 if test "x$ac_system" = "xOpenBSD"
3936 plugin_tcpconns="yes"
3940 if test "x$with_libiokit" = "xyes"
3942 plugin_battery="yes"
3947 if test "x$with_perfstat" = "xyes"
3953 plugin_interface="yes"
3957 if test "x$with_procinfo" = "xyes"
3959 plugin_processes="yes"
3963 if test "x$with_kstat" = "xyes"
3966 plugin_zfs_arc="yes"
3969 if test "x$with_devinfo$with_kstat" = "xyesyes"
3973 plugin_interface="yes"
3978 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
3984 if test "x$with_libstatgrab" = "xyes"
3988 plugin_interface="yes"
3995 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
4001 if test "x$with_libopenipmipthread" = "xyes"
4006 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
4008 plugin_curl_json="yes"
4011 if test "x$have_processor_info" = "xyes"
4015 if test "x$have_sysctl" = "xyes"
4022 if test "x$have_sysctlbyname" = "xyes"
4026 plugin_tcpconns="yes"
4029 # Df plugin: Check if we know how to determine mount points first.
4030 #if test "x$have_listmntent" = "xyes"; then
4033 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4037 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4041 #if test "x$have_getmntent" = "xseq"
4045 if test "x$c_cv_have_one_getmntent" = "xyes"
4050 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4051 if test "x$plugin_df" = "xyes"
4054 if test "x$have_statfs" = "xyes"
4058 if test "x$have_statvfs" = "xyes"
4064 if test "x$have_getifaddrs" = "xyes"
4066 plugin_interface="yes"
4069 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4071 plugin_libvirt="yes"
4074 if test "x$have_getloadavg" = "xyes"
4079 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4084 # Mac OS X memory interface
4085 if test "x$have_host_statistics" = "xyes"
4090 if test "x$have_termios_h" = "xyes"
4092 plugin_multimeter="yes"
4096 if test "x$have_thread_info" = "xyes"
4098 plugin_processes="yes"
4101 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4103 plugin_processes="yes"
4106 if test "x$with_kvm_getswapinfo" = "xyes"
4111 if test "x$have_swapctl" = "xyes"
4116 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4118 plugin_tcpconns="yes"
4121 if test "x$have_getutent" = "xyes"
4125 if test "x$have_getutxent" = "xyes"
4130 m4_divert_once([HELP_ENABLE], [
4133 AC_ARG_ENABLE([all-plugins],
4134 AC_HELP_STRING([--enable-all-plugins],
4135 [enable all plugins (auto by def)]),
4137 if test "x$enableval" = "xyes"
4139 enable_all_plugins="yes"
4140 else if test "x$enableval" = "xauto"
4142 enable_all_plugins="auto"
4144 enable_all_plugins="no"
4147 [enable_all_plugins="auto"])
4149 m4_divert_once([HELP_ENABLE], [])
4151 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4152 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4153 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4154 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4155 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4156 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4157 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4158 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4159 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4160 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4161 AC_PLUGIN([csv], [yes], [CSV output plugin])
4162 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4163 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4164 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4165 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4166 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4167 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4168 AC_PLUGIN([email], [yes], [EMail statistics])
4169 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4170 AC_PLUGIN([exec], [yes], [Execution of external programs])
4171 AC_PLUGIN([filecount], [yes], [Count files in directories])
4172 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4173 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4174 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4175 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4176 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4177 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4178 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4179 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4180 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4181 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4182 AC_PLUGIN([load], [$plugin_load], [System load])
4183 AC_PLUGIN([logfile], [yes], [File logging plugin])
4184 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4185 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4186 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4187 AC_PLUGIN([match_regex], [yes], [The regex match])
4188 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4189 AC_PLUGIN([match_value], [yes], [The value match])
4190 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4191 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4192 AC_PLUGIN([memcached], [yes], [memcached statistics])
4193 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4194 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4195 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4196 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4197 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4198 AC_PLUGIN([network], [yes], [Network communication plugin])
4199 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4200 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4201 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4202 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4203 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4204 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4205 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4206 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4207 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4208 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4209 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4210 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4211 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4212 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4213 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4214 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4215 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4216 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4217 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4218 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4219 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4220 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4221 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4222 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4223 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4224 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4225 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4226 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4227 AC_PLUGIN([target_notification], [yes], [The notification target])
4228 AC_PLUGIN([target_replace], [yes], [The replace target])
4229 AC_PLUGIN([target_scale],[yes], [The scale target])
4230 AC_PLUGIN([target_set], [yes], [The set target])
4231 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4232 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4233 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4234 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4235 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4236 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4237 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4238 AC_PLUGIN([users], [$plugin_users], [User statistics])
4239 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4240 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4241 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4242 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4243 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4244 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4245 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4247 dnl Default configuration file
4248 # Load either syslog or logfile
4249 LOAD_PLUGIN_SYSLOG=""
4250 LOAD_PLUGIN_LOGFILE=""
4252 AC_MSG_CHECKING([which default log plugin to load])
4253 default_log_plugin="none"
4254 if test "x$enable_syslog" = "xyes"
4256 default_log_plugin="syslog"
4258 LOAD_PLUGIN_SYSLOG="##"
4261 if test "x$enable_logfile" = "xyes"
4263 if test "x$default_log_plugin" = "xnone"
4265 default_log_plugin="logfile"
4267 LOAD_PLUGIN_LOGFILE="#"
4270 LOAD_PLUGIN_LOGFILE="##"
4272 AC_MSG_RESULT([$default_log_plugin])
4274 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4275 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4277 DEFAULT_LOG_LEVEL="info"
4278 if test "x$enable_debug" = "xyes"
4280 DEFAULT_LOG_LEVEL="debug"
4282 AC_SUBST(DEFAULT_LOG_LEVEL)
4284 # Load only one of rrdtool, network, csv in the default config.
4285 LOAD_PLUGIN_RRDTOOL=""
4286 LOAD_PLUGIN_NETWORK=""
4289 AC_MSG_CHECKING([which default write plugin to load])
4290 default_write_plugin="none"
4291 if test "x$enable_rrdtool" = "xyes"
4293 default_write_plugin="rrdtool"
4295 LOAD_PLUGIN_RRDTOOL="##"
4298 if test "x$enable_network" = "xyes"
4300 if test "x$default_write_plugin" = "xnone"
4302 default_write_plugin="network"
4304 LOAD_PLUGIN_NETWORK="#"
4307 LOAD_PLUGIN_NETWORK="##"
4310 if test "x$enable_csv" = "xyes"
4312 if test "x$default_write_plugin" = "xnone"
4314 default_write_plugin="csv"
4319 LOAD_PLUGIN_CSV="##"
4321 AC_MSG_RESULT([$default_write_plugin])
4323 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4324 AC_SUBST(LOAD_PLUGIN_NETWORK)
4325 AC_SUBST(LOAD_PLUGIN_CSV)
4328 if test "x$ac_system" = "xLinux" \
4329 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4331 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4335 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4337 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4339 PERL_BINDINGS_OPTIONS="$withval"
4340 with_perl_bindings="yes"
4342 PERL_BINDINGS_OPTIONS=""
4343 with_perl_bindings="$withval"
4347 PERL_BINDINGS_OPTIONS=""
4348 if test -n "$perl_interpreter"
4350 with_perl_bindings="yes"
4352 with_perl_bindings="no (no perl interpreter found)"
4355 if test "x$with_perl_bindings" = "xyes"
4357 PERL_BINDINGS="perl"
4361 AC_SUBST(PERL_BINDINGS)
4362 AC_SUBST(PERL_BINDINGS_OPTIONS)
4364 dnl libcollectdclient
4365 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4366 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4367 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4369 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4371 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4373 AC_SUBST(LCC_VERSION_MAJOR)
4374 AC_SUBST(LCC_VERSION_MINOR)
4375 AC_SUBST(LCC_VERSION_PATCH)
4376 AC_SUBST(LCC_VERSION_EXTRA)
4377 AC_SUBST(LCC_VERSION_STRING)
4379 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4381 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)
4383 if test "x$with_librrd" = "xyes" \
4384 && test "x$librrd_threadsafe" != "xyes"
4386 with_librrd="yes (warning: librrd is not thread-safe)"
4389 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
4391 with_libiptc="yes (shipped version)"
4394 if test "x$with_libperl" = "xyes"
4396 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4398 enable_perl="no (needs libperl)"
4401 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4403 enable_perl="no (libperl doesn't support ithreads)"
4406 if test "x$with_perl_bindings" = "xyes" \
4407 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4409 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4416 libcurl . . . . . . . $with_libcurl
4417 libdbi . . . . . . . $with_libdbi
4418 libesmtp . . . . . . $with_libesmtp
4419 libganglia . . . . . $with_libganglia
4420 libgcrypt . . . . . . $with_libgcrypt
4421 libiokit . . . . . . $with_libiokit
4422 libiptc . . . . . . . $with_libiptc
4423 libjvm . . . . . . . $with_java
4424 libkstat . . . . . . $with_kstat
4425 libkvm . . . . . . . $with_libkvm
4426 libmemcached . . . . $with_libmemcached
4427 libmysql . . . . . . $with_libmysql
4428 libnetapp . . . . . . $with_libnetapp
4429 libnetlink . . . . . $with_libnetlink
4430 libnetsnmp . . . . . $with_libnetsnmp
4431 libnotify . . . . . . $with_libnotify
4432 liboconfig . . . . . $with_liboconfig
4433 libopenipmi . . . . . $with_libopenipmipthread
4434 liboping . . . . . . $with_liboping
4435 libpcap . . . . . . . $with_libpcap
4436 libperfstat . . . . . $with_perfstat
4437 libperl . . . . . . . $with_libperl
4438 libpq . . . . . . . . $with_libpq
4439 libpthread . . . . . $with_libpthread
4440 librouteros . . . . . $with_librouteros
4441 librrd . . . . . . . $with_librrd
4442 libsensors . . . . . $with_libsensors
4443 libstatgrab . . . . . $with_libstatgrab
4444 libtokyotyrant . . . $with_libtokyotyrant
4445 libupsclient . . . . $with_libupsclient
4446 libvirt . . . . . . . $with_libvirt
4447 libxml2 . . . . . . . $with_libxml2
4448 libxmms . . . . . . . $with_libxmms
4449 libyajl . . . . . . . $with_libyajl
4450 oracle . . . . . . . $with_oracle
4451 python . . . . . . . $with_python
4454 daemon mode . . . . . $enable_daemon
4455 debug . . . . . . . . $enable_debug
4458 perl . . . . . . . . $with_perl_bindings
4461 apache . . . . . . . $enable_apache
4462 apcups . . . . . . . $enable_apcups
4463 apple_sensors . . . . $enable_apple_sensors
4464 ascent . . . . . . . $enable_ascent
4465 battery . . . . . . . $enable_battery
4466 bind . . . . . . . . $enable_bind
4467 conntrack . . . . . . $enable_conntrack
4468 contextswitch . . . . $enable_contextswitch
4469 cpu . . . . . . . . . $enable_cpu
4470 cpufreq . . . . . . . $enable_cpufreq
4471 csv . . . . . . . . . $enable_csv
4472 curl . . . . . . . . $enable_curl
4473 curl_json . . . . . . $enable_curl_json
4474 dbi . . . . . . . . . $enable_dbi
4475 df . . . . . . . . . $enable_df
4476 disk . . . . . . . . $enable_disk
4477 dns . . . . . . . . . $enable_dns
4478 email . . . . . . . . $enable_email
4479 entropy . . . . . . . $enable_entropy
4480 exec . . . . . . . . $enable_exec
4481 filecount . . . . . . $enable_filecount
4482 fscache . . . . . . . $enable_fscache
4483 gmond . . . . . . . . $enable_gmond
4484 hddtemp . . . . . . . $enable_hddtemp
4485 interface . . . . . . $enable_interface
4486 ipmi . . . . . . . . $enable_ipmi
4487 iptables . . . . . . $enable_iptables
4488 ipvs . . . . . . . . $enable_ipvs
4489 irq . . . . . . . . . $enable_irq
4490 java . . . . . . . . $enable_java
4491 libvirt . . . . . . . $enable_libvirt
4492 load . . . . . . . . $enable_load
4493 logfile . . . . . . . $enable_logfile
4494 madwifi . . . . . . . $enable_madwifi
4495 match_empty_counter . $enable_match_empty_counter
4496 match_hashed . . . . $enable_match_hashed
4497 match_regex . . . . . $enable_match_regex
4498 match_timediff . . . $enable_match_timediff
4499 match_value . . . . . $enable_match_value
4500 mbmon . . . . . . . . $enable_mbmon
4501 memcachec . . . . . . $enable_memcachec
4502 memcached . . . . . . $enable_memcached
4503 memory . . . . . . . $enable_memory
4504 multimeter . . . . . $enable_multimeter
4505 mysql . . . . . . . . $enable_mysql
4506 netapp . . . . . . . $enable_netapp
4507 netlink . . . . . . . $enable_netlink
4508 network . . . . . . . $enable_network
4509 nfs . . . . . . . . . $enable_nfs
4510 nginx . . . . . . . . $enable_nginx
4511 notify_desktop . . . $enable_notify_desktop
4512 notify_email . . . . $enable_notify_email
4513 ntpd . . . . . . . . $enable_ntpd
4514 nut . . . . . . . . . $enable_nut
4515 olsrd . . . . . . . . $enable_olsrd
4516 onewire . . . . . . . $enable_onewire
4517 openvpn . . . . . . . $enable_openvpn
4518 oracle . . . . . . . $enable_oracle
4519 perl . . . . . . . . $enable_perl
4520 ping . . . . . . . . $enable_ping
4521 postgresql . . . . . $enable_postgresql
4522 powerdns . . . . . . $enable_powerdns
4523 processes . . . . . . $enable_processes
4524 protocols . . . . . . $enable_protocols
4525 python . . . . . . . $enable_python
4526 routeros . . . . . . $enable_routeros
4527 rrdcached . . . . . . $enable_rrdcached
4528 rrdtool . . . . . . . $enable_rrdtool
4529 sensors . . . . . . . $enable_sensors
4530 serial . . . . . . . $enable_serial
4531 snmp . . . . . . . . $enable_snmp
4532 swap . . . . . . . . $enable_swap
4533 syslog . . . . . . . $enable_syslog
4534 table . . . . . . . . $enable_table
4535 tail . . . . . . . . $enable_tail
4536 tape . . . . . . . . $enable_tape
4537 target_notification . $enable_target_notification
4538 target_replace . . . $enable_target_replace
4539 target_scale . . . . $enable_target_scale
4540 target_set . . . . . $enable_target_set
4541 tcpconns . . . . . . $enable_tcpconns
4542 teamspeak2 . . . . . $enable_teamspeak2
4543 ted . . . . . . . . . $enable_ted
4544 thermal . . . . . . . $enable_thermal
4545 tokyotyrant . . . . . $enable_tokyotyrant
4546 unixsock . . . . . . $enable_unixsock
4547 uptime . . . . . . . $enable_uptime
4548 users . . . . . . . . $enable_users
4549 uuid . . . . . . . . $enable_uuid
4550 vmem . . . . . . . . $enable_vmem
4551 vserver . . . . . . . $enable_vserver
4552 wireless . . . . . . $enable_wireless
4553 write_http . . . . . $enable_write_http
4554 xmms . . . . . . . . $enable_xmms
4555 zfs_arc . . . . . . . $enable_zfs_arc
4559 if test "x$dependency_error" = "xyes"; then
4560 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
4563 if test "x$dependency_warning" = "xyes"; then
4564 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
4567 # vim: set fdm=marker :