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.])
92 # Where to install .pc files.
93 pkgconfigdir="${libdir}/pkgconfig"
94 AC_SUBST(pkgconfigdir)
96 # Check for standards compliance mode
97 AC_ARG_ENABLE(standards,
98 AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]),
99 [enable_standards="$enableval"],
100 [enable_standards="no"])
101 if test "x$enable_standards" = "xyes"
103 AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.])
104 AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.])
105 AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.])
106 AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
108 AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes")
111 # Checks for header files.
118 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)
121 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
126 # include <sys/types.h>
129 AC_CHECK_HEADERS(netinet/in.h, [], [],
134 # include <sys/types.h>
136 #if HAVE_NETINET_IN_SYSTM_H
137 # include <netinet/in_systm.h>
140 AC_CHECK_HEADERS(netinet/ip.h, [], [],
145 # include <sys/types.h>
147 #if HAVE_NETINET_IN_SYSTM_H
148 # include <netinet/in_systm.h>
150 #if HAVE_NETINET_IN_H
151 # include <netinet/in.h>
154 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
159 # include <sys/types.h>
161 #if HAVE_NETINET_IN_SYSTM_H
162 # include <netinet/in_systm.h>
164 #if HAVE_NETINET_IN_H
165 # include <netinet/in.h>
167 #if HAVE_NETINET_IP_H
168 # include <netinet/ip.h>
171 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
176 # include <sys/types.h>
178 #if HAVE_NETINET_IN_SYSTM_H
179 # include <netinet/in_systm.h>
181 #if HAVE_NETINET_IN_H
182 # include <netinet/in.h>
184 #if HAVE_NETINET_IP_H
185 # include <netinet/ip.h>
188 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
193 # include <sys/types.h>
195 #if HAVE_NETINET_IN_SYSTM_H
196 # include <netinet/in_systm.h>
198 #if HAVE_NETINET_IN_H
199 # include <netinet/in.h>
202 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
207 # include <sys/types.h>
209 #if HAVE_NETINET_IN_SYSTM_H
210 # include <netinet/in_systm.h>
212 #if HAVE_NETINET_IN_H
213 # include <netinet/in.h>
215 #if HAVE_NETINET_IP6_H
216 # include <netinet/ip6.h>
219 AC_CHECK_HEADERS(netinet/tcp.h, [], [],
224 # include <sys/types.h>
226 #if HAVE_NETINET_IN_SYSTM_H
227 # include <netinet/in_systm.h>
229 #if HAVE_NETINET_IN_H
230 # include <netinet/in.h>
232 #if HAVE_NETINET_IP_H
233 # include <netinet/ip.h>
236 AC_CHECK_HEADERS(netinet/udp.h, [], [],
241 # include <sys/types.h>
243 #if HAVE_NETINET_IN_SYSTM_H
244 # include <netinet/in_systm.h>
246 #if HAVE_NETINET_IN_H
247 # include <netinet/in.h>
249 #if HAVE_NETINET_IP_H
250 # include <netinet/ip.h>
255 AC_CHECK_HEADERS(sys/dkstat.h)
256 if test "x$ac_system" = "xDarwin"
258 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)
259 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h IOKit/IOKitLib.h IOKit/IOTypes.h IOKit/ps/IOPSKeys.h IOKit/IOBSD.h IOKit/storage/IOBlockStorageDriver.h)
261 AC_CHECK_HEADERS(sys/sysctl.h, [], [],
264 # include <sys/types.h>
267 # include <sys/param.h>
271 AC_MSG_CHECKING([for sysctl kern.cp_times])
272 if test -x /sbin/sysctl
274 /sbin/sysctl kern.cp_times 2>/dev/null
278 AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIMES, 1,
279 [Define if sysctl supports kern.cp_times])
288 AC_CHECK_HEADERS(linux/major.h libgen.h)
290 # For the battery plugin
291 AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
293 #if HAVE_IOKIT_IOKITLIB_H
294 # include <IOKit/IOKitLib.h>
296 #if HAVE_IOKIT_IOTYPES_H
297 # include <IOKit/IOTypes.h>
301 # For the swap module
302 have_linux_wireless_h="no"
303 if test "x$ac_system" = "xLinux"
305 AC_CHECK_HEADERS(linux/wireless.h,
306 [have_linux_wireless_h="yes"],
307 [have_linux_wireless_h="no"],
310 #include <sys/ioctl.h>
311 #include <sys/socket.h>
315 # For the swap module
316 have_sys_swap_h="yes"
317 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
319 #undef _FILE_OFFSET_BITS
320 #undef _LARGEFILE64_SOURCE
322 # include <sys/types.h>
325 # include <sys/param.h>
329 if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
332 if test "x$GCC" = "xyes"
334 hint_64="CFLAGS='-m64'"
336 hint_64="CFLAGS='-xarch=v9'"
338 AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
342 # For the processes plugin
344 AC_CHECK_HEADERS(sys/loadavg.h linux/config.h utmp.h utmpx.h)
346 # For interface plugin
347 AC_CHECK_HEADERS(ifaddrs.h)
348 AC_CHECK_HEADERS(net/if.h, [], [],
351 # include <sys/types.h>
353 #if HAVE_SYS_SOCKET_H
354 # include <sys/socket.h>
357 AC_CHECK_HEADERS(linux/if.h, [], [],
360 # include <sys/types.h>
362 #if HAVE_SYS_SOCKET_H
363 # include <sys/socket.h>
366 AC_CHECK_HEADERS(linux/netdevice.h, [], [],
369 # include <sys/types.h>
371 #if HAVE_SYS_SOCKET_H
372 # include <sys/socket.h>
375 # include <linux/if.h>
380 have_net_ip_vs_h="no"
382 if test "x$ac_system" = "xLinux"
384 SAVE_CFLAGS="$CFLAGS"
385 CFLAGS="$CFLAGS $KERNEL_CFLAGS"
387 AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
388 AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
390 CFLAGS="$SAVE_CFLAGS"
394 AC_CHECK_HEADERS(sys/ucred.h, [], [],
397 # include <sys/types.h>
400 # include <sys/param.h>
404 # For mount interface
405 AC_CHECK_HEADERS(sys/mount.h, [], [],
408 # include <sys/types.h>
411 # include <sys/param.h>
415 # For the email plugin
416 AC_CHECK_HEADERS(linux/un.h, [], [],
418 #if HAVE_SYS_SOCKET_H
419 # include <sys/socket.h>
423 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)
426 AC_CHECK_HEADERS(arpa/nameser.h)
427 AC_CHECK_HEADERS(arpa/nameser_compat.h, [], [],
429 #if HAVE_ARPA_NAMESER_H
430 # include <arpa/nameser.h>
434 AC_CHECK_HEADERS(net/if_arp.h, [], [],
435 [#if HAVE_SYS_SOCKET_H
436 # include <sys/socket.h>
439 AC_CHECK_HEADERS(net/ppp_defs.h)
440 AC_CHECK_HEADERS(net/if_ppp.h, [], [],
441 [#if HAVE_NET_PPP_DEFS_H
442 # include <net/ppp_defs.h>
445 AC_CHECK_HEADERS(netinet/if_ether.h, [], [],
450 # include <sys/types.h>
452 #if HAVE_SYS_SOCKET_H
453 # include <sys/socket.h>
458 #if HAVE_NETINET_IN_H
459 # include <netinet/in.h>
463 # For the multimeter plugin
465 AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
468 # Checks for typedefs, structures, and compiler characteristics.
477 # Checks for library functions.
479 AC_PROG_GCC_TRADITIONAL
480 AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv)
484 AC_CACHE_CHECK([for strtok_r],
485 [c_cv_have_strtok_r_default],
494 char buffer[] = "foo,bar,baz";
501 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
504 printf ("token = %s;\n", token);
507 [c_cv_have_strtok_r_default="yes"],
508 [c_cv_have_strtok_r_default="no"]
512 if test "x$c_cv_have_strtok_r_default" = "xno"
514 SAVE_CFLAGS="$CFLAGS"
515 CFLAGS="$CFLAGS -D_REENTRANT=1"
517 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
518 [c_cv_have_strtok_r_reentrant],
527 char buffer[] = "foo,bar,baz";
534 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
537 printf ("token = %s;\n", token);
540 [c_cv_have_strtok_r_reentrant="yes"],
541 [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
546 AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree)
548 socket_needs_socket="no"
549 AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="yes"], AC_MSG_ERROR(cannot find socket)))
550 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
552 nanosleep_needs_rt="no"
553 nanosleep_needs_posix4="no"
554 AC_CHECK_FUNCS(nanosleep,
556 AC_CHECK_LIB(rt, nanosleep,
557 [nanosleep_needs_rt="yes"],
558 AC_CHECK_LIB(posix4, nanosleep,
559 [nanosleep_needs_posix4="yes"],
560 AC_MSG_ERROR(cannot find nanosleep))))
561 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
562 AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$nanosleep_needs_posix4" = "xyes")
564 AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"])
565 AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
566 AC_CHECK_FUNCS(host_statistics, [have_host_statistics="yes"], [have_host_statistics="no"])
567 AC_CHECK_FUNCS(processor_info, [have_processor_info="yes"], [have_processor_info="no"])
568 AC_CHECK_FUNCS(thread_info, [have_thread_info="yes"], [have_thread_info="no"])
569 AC_CHECK_FUNCS(statfs, [have_statfs="yes"], [have_statfs="no"])
570 AC_CHECK_FUNCS(statvfs, [have_statvfs="yes"], [have_statvfs="no"])
571 AC_CHECK_FUNCS(getifaddrs, [have_getifaddrs="yes"], [have_getifaddrs="no"])
572 AC_CHECK_FUNCS(syslog, [have_syslog="yes"], [have_syslog="no"])
573 AC_CHECK_FUNCS(getutent, [have_getutent="yes"], [have_getutent="no"])
574 AC_CHECK_FUNCS(getutxent, [have_getutxent="yes"], [have_getutxent="no"])
575 AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"])
578 AC_CHECK_FUNCS(getloadavg, [have_getloadavg="yes"], [have_getloadavg="no"])
581 AC_ARG_WITH(nan-emulation, [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
583 if test "x$withval" = "xno"; then
585 else if test "x$withval" = "xyes"; then
592 if test "x$nan_type" = "xnone"; then
593 AC_CACHE_CHECK([whether NAN is defined by default],
594 [c_cv_have_nan_default],
600 static float foo = NAN;
608 [c_cv_have_nan_default="yes"],
609 [c_cv_have_nan_default="no"]
612 if test "x$c_cv_have_nan_default" = "xyes"
617 if test "x$nan_type" = "xnone"; then
618 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
619 [c_cv_have_nan_isoc],
624 #define __USE_ISOC99 1
626 static float foo = NAN;
634 [c_cv_have_nan_isoc="yes"],
635 [c_cv_have_nan_isoc="no"]
638 if test "x$c_cv_have_nan_isoc" = "xyes"
643 if test "x$nan_type" = "xnone"; then
644 SAVE_LDFLAGS=$LDFLAGS
645 LDFLAGS="$LDFLAGS -lm"
646 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
647 [c_cv_have_nan_zero],
656 #define NAN (0.0 / 0.0)
658 # define isnan(f) ((f) != (f))
660 static float foo = NAN;
668 [c_cv_have_nan_zero="yes"],
669 [c_cv_have_nan_zero="no"]
672 LDFLAGS=$SAVE_LDFLAGS
673 if test "x$c_cv_have_nan_zero" = "xyes"
679 if test "x$nan_type" = "xdefault"; then
680 AC_DEFINE(NAN_STATIC_DEFAULT, 1,
681 [Define if NAN is defined by default and can initialize static variables.])
682 else if test "x$nan_type" = "xisoc99"; then
683 AC_DEFINE(NAN_STATIC_ISOC, 1,
684 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
685 else if test "x$nan_type" = "xzero"; then
686 AC_DEFINE(NAN_ZERO_ZERO, 1,
687 [Define if NAN can be defined as (0.0 / 0.0)])
689 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
692 AC_ARG_WITH(fp-layout, [AS_HELP_STRING([--with-fp-layout], [set the memory layout of doubles. For crosscompiling only.])],
694 if test "x$withval" = "xnothing"; then
695 fp_layout_type="nothing"
696 else if test "x$withval" = "xendianflip"; then
697 fp_layout_type="endianflip"
698 else if test "x$withval" = "xintswap"; then
699 fp_layout_type="intswap"
701 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
704 [fp_layout_type="unknown"])
706 if test "x$fp_layout_type" = "xunknown"; then
707 AC_CACHE_CHECK([if doubles are stored in x86 representation],
708 [c_cv_fp_layout_need_nothing],
719 # include <inttypes.h>
722 # include <stdbool.h>
732 memcpy ((void *) &i0, (void *) &d, 8);
735 memcpy ((void *) c, (void *) &i1, 8);
737 if ((c[0] == 0x2f) && (c[1] == 0x25)
738 && (c[2] == 0xc0) && (c[3] == 0xc7)
739 && (c[4] == 0x43) && (c[5] == 0x2b)
740 && (c[6] == 0x1f) && (c[7] == 0x5b))
745 [c_cv_fp_layout_need_nothing="yes"],
746 [c_cv_fp_layout_need_nothing="no"]
749 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
750 fp_layout_type="nothing"
753 if test "x$fp_layout_type" = "xunknown"; then
754 AC_CACHE_CHECK([if endianflip converts to x86 representation],
755 [c_cv_fp_layout_need_endianflip],
766 # include <inttypes.h>
769 # include <stdbool.h>
771 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
772 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
773 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
774 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
775 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
776 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
777 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
778 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
787 memcpy ((void *) &i0, (void *) &d, 8);
789 i1 = endianflip (i0);
790 memcpy ((void *) c, (void *) &i1, 8);
792 if ((c[0] == 0x2f) && (c[1] == 0x25)
793 && (c[2] == 0xc0) && (c[3] == 0xc7)
794 && (c[4] == 0x43) && (c[5] == 0x2b)
795 && (c[6] == 0x1f) && (c[7] == 0x5b))
800 [c_cv_fp_layout_need_endianflip="yes"],
801 [c_cv_fp_layout_need_endianflip="no"]
804 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
805 fp_layout_type="endianflip"
808 if test "x$fp_layout_type" = "xunknown"; then
809 AC_CACHE_CHECK([if intswap converts to x86 representation],
810 [c_cv_fp_layout_need_intswap],
821 # include <inttypes.h>
824 # include <stdbool.h>
826 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
827 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
836 memcpy ((void *) &i0, (void *) &d, 8);
839 memcpy ((void *) c, (void *) &i1, 8);
841 if ((c[0] == 0x2f) && (c[1] == 0x25)
842 && (c[2] == 0xc0) && (c[3] == 0xc7)
843 && (c[4] == 0x43) && (c[5] == 0x2b)
844 && (c[6] == 0x1f) && (c[7] == 0x5b))
849 [c_cv_fp_layout_need_intswap="yes"],
850 [c_cv_fp_layout_need_intswap="no"]
853 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
854 fp_layout_type="intswap"
858 if test "x$fp_layout_type" = "xnothing"; then
859 AC_DEFINE(FP_LAYOUT_NEED_NOTHING, 1,
860 [Define if doubles are stored in x86 representation.])
861 else if test "x$fp_layout_type" = "xendianflip"; then
862 AC_DEFINE(FP_LAYOUT_NEED_ENDIANFLIP, 1,
863 [Define if endianflip is needed to convert to x86 representation.])
864 else if test "x$fp_layout_type" = "xintswap"; then
865 AC_DEFINE(FP_LAYOUT_NEED_INTSWAP, 1,
866 [Define if intswap is needed to convert to x86 representation.])
868 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
872 AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
874 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
876 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
879 AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
880 if test "x$have_getmntent" = "xno"; then
881 AC_CHECK_LIB(sun, getmntent, [have_getmntent="sun"])
883 if test "x$have_getmntent" = "xno"; then
884 AC_CHECK_LIB(seq, getmntent, [have_getmntent="seq"])
886 if test "x$have_getmntent" = "xno"; then
887 AC_CHECK_LIB(gen, getmntent, [have_getmntent="gen"])
890 if test "x$have_getmntent" = "xc"; then
891 AC_CACHE_CHECK([whether getmntent takes one argument],
892 [c_cv_have_one_getmntent],
894 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
895 #include "$srcdir/src/utils_mount.h"]],
899 fh = setmntent ("/etc/mtab", "r");
903 [c_cv_have_one_getmntent="yes"],
904 [c_cv_have_one_getmntent="no"]
907 AC_CACHE_CHECK([whether getmntent takes two arguments],
908 [c_cv_have_two_getmntent],
910 AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
911 #include "$srcdir/src/utils_mount.h"]],
916 fh = fopen ("/etc/mnttab", "r");
917 status = getmntent (fh, &mt);
920 [c_cv_have_two_getmntent="yes"],
921 [c_cv_have_two_getmntent="no"]
926 # Check for different versions of `getmntent' here..
928 if test "x$have_getmntent" = "xc"; then
929 if test "x$c_cv_have_one_getmntent" = "xyes"; then
930 AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
931 [Define if the function getmntent exists and takes one argument.])
933 if test "x$c_cv_have_two_getmntent" = "xyes"; then
934 AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
935 [Define if the function getmntent exists and takes two arguments.])
938 if test "x$have_getmntent" = "xsun"; then
939 AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
940 [Define if the function getmntent exists. It's the version from libsun.])
942 if test "x$have_getmntent" = "xseq"; then
943 AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
944 [Define if the function getmntent exists. It's the version from libseq.])
946 if test "x$have_getmntent" = "xgen"; then
947 AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
948 [Define if the function getmntent exists. It's the version from libgen.])
952 AC_MSG_CHECKING([if have htonll defined])
957 #include <sys/types.h>
958 #include <netinet/in.h>
960 # include <inttypes.h>
967 AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
970 AC_MSG_RESULT([$have_htonll])
972 # Check for structures
973 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
974 [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])],
977 #include <sys/types.h>
978 #include <sys/socket.h>
981 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
982 [AC_DEFINE(HAVE_STRUCT_NET_DEVICE_STATS, 1, [Define if struct net_device_stats exists and is usable.])],
985 #include <sys/types.h>
986 #include <sys/socket.h>
987 #include <linux/if.h>
988 #include <linux/netdevice.h>
991 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
993 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1,
994 [Define if struct kinfo_proc exists in the FreeBSD variant.])
995 have_struct_kinfo_proc_freebsd="yes"
998 have_struct_kinfo_proc_freebsd="no"
1002 #include <sys/param.h>
1003 #include <sys/sysctl.h>
1004 #include <sys/user.h>
1007 AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
1009 AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
1010 [Define if struct kinfo_proc exists in the OpenBSD variant.])
1011 have_struct_kinfo_proc_openbsd="yes"
1014 have_struct_kinfo_proc_openbsd="no"
1017 #include <sys/param.h>
1018 #include <sys/sysctl.h>
1022 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
1023 [#define _BSD_SOURCE
1025 # include <stdint.h>
1027 #if HAVE_SYS_TYPES_H
1028 # include <sys/types.h>
1030 #if HAVE_NETINET_IN_SYSTM_H
1031 # include <netinet/in_systm.h>
1033 #if HAVE_NETINET_IN_H
1034 # include <netinet/in.h>
1036 #if HAVE_NETINET_IP_H
1037 # include <netinet/ip.h>
1039 #if HAVE_NETINET_UDP_H
1040 # include <netinet/udp.h>
1043 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
1044 [#define _BSD_SOURCE
1046 # include <stdint.h>
1048 #if HAVE_SYS_TYPES_H
1049 # include <sys/types.h>
1051 #if HAVE_NETINET_IN_SYSTM_H
1052 # include <netinet/in_systm.h>
1054 #if HAVE_NETINET_IN_H
1055 # include <netinet/in.h>
1057 #if HAVE_NETINET_IP_H
1058 # include <netinet/ip.h>
1060 #if HAVE_NETINET_UDP_H
1061 # include <netinet/udp.h>
1065 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1075 # Checks for libraries begin here
1077 with_libresolv="yes"
1078 AC_CHECK_LIB(resolv, res_search,
1080 AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).])
1082 [with_libresolv="no"])
1083 AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
1085 dnl Check for HAL (hardware abstraction library)
1087 AC_CHECK_LIB(hal,libhal_device_property_exists,
1088 [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
1090 if test "x$with_libhal" = "xyes"; then
1091 if test "x$PKG_CONFIG" != "x"; then
1092 BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
1093 BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
1094 AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
1095 AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
1099 m4_divert_once([HELP_WITH], [
1100 collectd additional packages:])
1102 AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
1104 if test "x$ac_system" = "xAIX"
1109 with_perfstat="no (AIX only)"
1110 with_procinfo="no (AIX only)"
1113 if test "x$with_perfstat" = "xyes"
1115 AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], [])
1116 # AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"])
1118 if test "x$with_perfstat" = "xyes"
1120 AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1122 AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
1124 # Processes plugin under AIX.
1125 if test "x$with_procinfo" = "xyes"
1127 AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"])
1129 if test "x$with_procinfo" = "xyes"
1131 AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h])
1134 if test "x$ac_system" = "xSolaris"
1139 with_kstat="no (Solaris only)"
1140 with_devinfo="no (Solaris only)"
1143 if test "x$with_kstat" = "xyes"
1145 AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
1147 if test "x$with_kstat" = "xyes"
1149 AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
1150 AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
1152 if test "x$with_kstat" = "xyes"
1154 AC_DEFINE(HAVE_LIBKSTAT, 1,
1155 [Define to 1 if you have the 'kstat' library (-lkstat)])
1157 AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
1158 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
1161 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
1168 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
1171 AC_CHECK_LIB(kvm, kvm_getprocs, [with_kvm_getprocs="yes"], [with_kvm_getprocs="no"])
1172 if test "x$with_kvm_getprocs" = "xyes"
1174 AC_DEFINE(HAVE_LIBKVM_GETPROCS, 1,
1175 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)])
1178 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETPROCS, test "x$with_kvm_getprocs" = "xyes")
1180 AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
1181 if test "x$with_kvm_getswapinfo" = "xyes"
1183 AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
1184 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
1187 AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
1189 AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
1190 if test "x$with_kvm_nlist" = "xyes"
1192 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1193 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
1196 AM_CONDITIONAL(BUILD_WITH_LIBKVM_NLIST, test "x$with_kvm_nlist" = "xyes")
1198 AC_CHECK_LIB(kvm, kvm_openfiles, [with_kvm_openfiles="yes"], [with_kvm_openfiles="no"])
1199 if test "x$with_kvm_openfiles" = "xyes"
1201 AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
1202 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)])
1205 AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
1207 # --with-libcurl {{{
1208 with_curl_config="curl-config"
1211 AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
1213 if test "x$withval" = "xno"
1216 else if test "x$withval" = "xyes"
1220 if test -f "$withval" && test -x "$withval"
1222 with_curl_config="$withval"
1224 else if test -x "$withval/bin/curl-config"
1226 with_curl_config="$withval/bin/curl-config"
1235 if test "x$with_libcurl" = "xyes"
1237 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
1238 curl_config_status=$?
1240 if test $curl_config_status -ne 0
1242 with_libcurl="no ($with_curl_config failed)"
1244 SAVE_CPPFLAGS="$CPPFLAGS"
1245 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
1247 AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
1249 CPPFLAGS="$SAVE_CPPFLAGS"
1252 if test "x$with_libcurl" = "xyes"
1254 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
1255 curl_config_status=$?
1257 if test $curl_config_status -ne 0
1259 with_libcurl="no ($with_curl_config failed)"
1261 AC_CHECK_LIB(curl, curl_easy_init,
1262 [with_libcurl="yes"],
1263 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
1267 if test "x$with_libcurl" = "xyes"
1269 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
1270 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
1271 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
1272 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
1274 AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
1278 with_libdbi_cppflags=""
1279 with_libdbi_ldflags=""
1280 AC_ARG_WITH(libdbi, [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
1282 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1284 with_libdbi_cppflags="-I$withval/include"
1285 with_libdbi_ldflags="-L$withval/lib"
1288 with_libdbi="$withval"
1294 if test "x$with_libdbi" = "xyes"
1296 SAVE_CPPFLAGS="$CPPFLAGS"
1297 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1299 AC_CHECK_HEADERS(dbi/dbi.h, [with_libdbi="yes"], [with_libdbi="no (dbi/dbi.h not found)"])
1301 CPPFLAGS="$SAVE_CPPFLAGS"
1303 if test "x$with_libdbi" = "xyes"
1305 SAVE_CPPFLAGS="$CPPFLAGS"
1306 SAVE_LDFLAGS="$LDFLAGS"
1307 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
1308 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
1310 AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
1312 CPPFLAGS="$SAVE_CPPFLAGS"
1313 LDFLAGS="$SAVE_LDFLAGS"
1315 if test "x$with_libdbi" = "xyes"
1317 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
1318 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
1319 BUILD_WITH_LIBDBI_LIBS="-ldbi"
1320 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
1321 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
1322 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
1324 AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
1327 # --with-libesmtp {{{
1328 AC_ARG_WITH(libesmtp, [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
1330 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1332 LDFLAGS="$LDFLAGS -L$withval/lib"
1333 CPPFLAGS="$CPPFLAGS -I$withval/include -D_THREAD_SAFE"
1336 with_libesmtp="$withval"
1342 if test "x$with_libesmtp" = "xyes"
1344 AC_CHECK_LIB(esmtp, smtp_create_session,
1346 AC_DEFINE(HAVE_LIBESMTP, 1, [Define to 1 if you have the esmtp library (-lesmtp).])
1347 ], [with_libesmtp="no (libesmtp not found)"])
1349 if test "x$with_libesmtp" = "xyes"
1351 AC_CHECK_HEADERS(libesmtp.h,
1353 AC_DEFINE(HAVE_LIBESMTP_H, 1, [Define to 1 if you have the <libesmtp.h> header file.])
1354 ], [with_libesmtp="no (libesmtp.h not found)"])
1356 if test "x$with_libesmtp" = "xyes"
1362 AC_DEFINE_UNQUOTED(COLLECT_LIBESMTP, [$collect_libesmtp],
1363 [Wether or not to use the esmtp library])
1364 AM_CONDITIONAL(BUILD_WITH_LIBESMTP, test "x$with_libesmtp" = "xyes")
1367 # --with-libganglia {{{
1368 AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
1370 if test -f "$withval" && test -x "$withval"
1372 with_libganglia_config="$withval"
1373 with_libganglia="yes"
1374 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"
1376 with_libganglia_config="$withval/bin/ganglia-config"
1377 with_libganglia="yes"
1378 else if test -d "$withval"
1380 GANGLIA_CPPFLAGS="-I$withval/include"
1381 GANGLIA_LDFLAGS="-L$withval/lib"
1382 with_libganglia="yes"
1384 with_libganglia_config="ganglia-config"
1385 with_libganglia="$withval"
1389 with_libganglia_config="ganglia-config"
1390 with_libganglia="yes"
1393 if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
1395 if test "x$GANGLIA_CPPFLAGS" = "x"
1397 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
1400 if test "x$GANGLIA_LDFLAGS" = "x"
1402 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
1405 if test "x$GANGLIA_LIBS" = "x"
1407 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
1411 SAVE_CPPFLAGS="$CPPFLAGS"
1412 SAVE_LDFLAGS="$LDFLAGS"
1413 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
1414 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
1416 if test "x$with_libganglia" = "xyes"
1418 AC_CHECK_HEADERS(gm_protocol.h,
1420 AC_DEFINE(HAVE_GM_PROTOCOL_H, 1,
1421 [Define to 1 if you have the <gm_protocol.h> header file.])
1422 ], [with_libganglia="no (gm_protocol.h not found)"])
1425 if test "x$with_libganglia" = "xyes"
1427 AC_CHECK_LIB(ganglia, xdr_Ganglia_value_msg,
1429 AC_DEFINE(HAVE_LIBGANGLIA, 1,
1430 [Define to 1 if you have the ganglia library (-lganglia).])
1431 ], [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"])
1434 CPPFLAGS="$SAVE_CPPFLAGS"
1435 LDFLAGS="$SAVE_LDFLAGS"
1437 AC_SUBST(GANGLIA_CPPFLAGS)
1438 AC_SUBST(GANGLIA_LDFLAGS)
1439 AC_SUBST(GANGLIA_LIBS)
1440 AM_CONDITIONAL(BUILD_WITH_LIBGANGLIA, test "x$with_libganglia" = "xyes")
1443 # --with-libgcrypt {{{
1444 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
1445 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
1446 GCRYPT_LIBS="$GCRYPT_LIBS"
1447 AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
1449 if test -f "$withval" && test -x "$withval"
1451 with_libgcrypt_config="$withval"
1452 with_libgcrypt="yes"
1453 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"
1455 with_libgcrypt_config="$withval/bin/gcrypt-config"
1456 with_libgcrypt="yes"
1457 else if test -d "$withval"
1459 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
1460 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
1461 with_libgcrypt="yes"
1463 with_libgcrypt_config="gcrypt-config"
1464 with_libgcrypt="$withval"
1468 with_libgcrypt_config="libgcrypt-config"
1469 with_libgcrypt="yes"
1472 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"
1474 if test "x$GCRYPT_CPPFLAGS" = "x"
1476 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
1479 if test "x$GCRYPT_LDFLAGS" = "x"
1481 gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
1482 GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
1485 if test "x$GCRYPT_LIBS" = "x"
1487 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
1491 SAVE_CPPFLAGS="$CPPFLAGS"
1492 SAVE_LDFLAGS="$LDFLAGS"
1493 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
1494 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
1496 if test "x$with_libgcrypt" = "xyes"
1498 if test "x$GCRYPT_CPPFLAGS" != "x"
1500 AC_MSG_NOTICE([gcrypt CPPFLAGS: $GCRYPT_CPPFLAGS])
1502 AC_CHECK_HEADERS(gcrypt.h,
1503 [with_libgcrypt="yes"],
1504 [with_libgcrypt="no (gcrypt.h not found)"])
1507 if test "x$with_libgcrypt" = "xyes"
1509 if test "x$GCRYPT_LDFLAGS" != "x"
1511 AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
1513 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
1514 [with_libgcrypt="yes"],
1515 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
1517 if test "$with_libgcrypt" != "no"; then
1518 AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")
1522 CPPFLAGS="$SAVE_CPPFLAGS"
1523 LDFLAGS="$SAVE_LDFLAGS"
1525 if test "x$with_libgcrypt" = "xyes"
1527 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).])
1530 AC_SUBST(GCRYPT_CPPFLAGS)
1531 AC_SUBST(GCRYPT_LDFLAGS)
1532 AC_SUBST(GCRYPT_LIBS)
1533 AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
1536 # --with-libiptc {{{
1537 with_own_libiptc="no"
1538 AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
1540 if test "x$withval" = "xshipped"
1542 with_own_libiptc="yes"
1544 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
1546 LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
1547 LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
1550 with_libiptc="$withval"
1554 if test "x$ac_system" = "xLinux"
1558 with_libiptc="no (Linux only)"
1561 SAVE_CPPFLAGS="$CPPFLAGS"
1562 SAVE_LDFLAGS="$LDFLAGS"
1563 CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
1564 LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
1565 # check whether the header file for libiptc is available.
1566 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1568 AC_CHECK_HEADERS(libiptc/libiptc.h,
1570 AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
1574 with_own_libiptc="yes"
1577 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1579 AC_CHECK_HEADERS(libiptc/libip6tc.h,
1581 AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
1585 with_own_libiptc="yes"
1588 # If the header file is available, check for the required type declaractions.
1589 # They may be missing in old versions of libiptc. In that case, they will be
1590 # declared in the iptables plugin.
1591 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1593 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
1596 # include "$srcdir/src/owniptc/libiptc.h"
1597 # include "$srcdir/src/owniptc/libip6tc.h"
1599 # include <libiptc/libiptc.h>
1600 # include <libiptc/libip6tc.h>
1604 # Check for the iptc_init symbol in the library.
1605 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
1607 AC_CHECK_LIB(iptc, iptc_init,
1609 AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
1613 with_own_libiptc="yes"
1616 # The system wide version failed for some reason. Check if we have the required
1617 # headers to build the shipped version.
1618 if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
1620 AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
1622 with_libiptc="no (Linux iptables headers not found)"
1623 with_own_libiptc="no"
1626 #include "$srcdir/src/owniptc/ipt_kernel_headers.h"
1629 AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
1630 AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
1631 if test "x$with_libiptc" = "xyes"
1633 BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
1634 BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS"
1635 AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
1636 AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
1638 if test "x$with_own_libiptc" = "xyes"
1640 AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
1642 CPPFLAGS="$SAVE_CPPFLAGS"
1643 LDFLAGS="$SAVE_LDFLAGS"
1647 with_java_home="$JAVA_HOME"
1648 with_java_vmtype="client"
1653 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
1655 if test "x$withval" = "xno"
1658 else if test "x$withval" = "xyes"
1662 with_java_home="$withval"
1667 if test "x$with_java" = "xyes"
1669 if test -d "$with_java_home"
1671 AC_MSG_CHECKING([for jni.h])
1672 TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1673 if test "x$TMPDIR" != "x"
1675 AC_MSG_RESULT([found in $TMPDIR])
1676 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1678 AC_MSG_RESULT([not found])
1681 AC_MSG_CHECKING([for jni_md.h])
1682 TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1`
1683 if test "x$TMPDIR" != "x"
1685 AC_MSG_RESULT([found in $TMPDIR])
1686 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR"
1688 AC_MSG_RESULT([not found])
1691 AC_MSG_CHECKING([for libjvm.so])
1692 TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1`
1693 if test "x$TMPDIR" != "x"
1695 AC_MSG_RESULT([found in $TMPDIR])
1696 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR -Wl,-rpath -Wl,$TMPDIR"
1698 AC_MSG_RESULT([not found])
1701 if test "x$JAVAC" = "x"
1703 AC_MSG_CHECKING([for javac])
1704 TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1`
1705 if test "x$TMPDIR" != "x"
1708 AC_MSG_RESULT([$JAVAC])
1710 AC_MSG_RESULT([not found])
1713 if test "x$JAR" = "x"
1715 AC_MSG_CHECKING([for jar])
1716 TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1`
1717 if test "x$TMPDIR" != "x"
1720 AC_MSG_RESULT([$JAR])
1722 AC_MSG_RESULT([not found])
1725 else if test "x$with_java_home" != "x"
1727 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
1731 if test "x$JAVA_CPPFLAGS" != "x"
1733 AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
1735 if test "x$JAVA_CFLAGS" != "x"
1737 AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
1739 if test "x$JAVA_LDFLAGS" != "x"
1741 AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
1743 if test "x$JAVAC" = "x"
1745 with_javac_path="$PATH"
1746 if test "x$with_java_home" != "x"
1748 with_javac_path="$with_java_home:with_javac_path"
1749 if test -d "$with_java_home/bin"
1751 with_javac_path="$with_java_home/bin:with_javac_path"
1755 AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
1757 if test "x$JAVAC" = "x"
1759 with_java="no (javac not found)"
1761 if test "x$JAR" = "x"
1763 with_jar_path="$PATH"
1764 if test "x$with_java_home" != "x"
1766 with_jar_path="$with_java_home:$with_jar_path"
1767 if test -d "$with_java_home/bin"
1769 with_jar_path="$with_java_home/bin:$with_jar_path"
1773 AC_PATH_PROG(JAR, jar, [], "$with_jar_path")
1775 if test "x$JAR" = "x"
1777 with_java="no (jar not found)"
1780 SAVE_CPPFLAGS="$CPPFLAGS"
1781 SAVE_CFLAGS="$CFLAGS"
1782 SAVE_LDFLAGS="$LDFLAGS"
1783 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
1784 CFLAGS="$CFLAGS $JAVA_CFLAGS"
1785 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
1787 if test "x$with_java" = "xyes"
1789 AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
1791 if test "x$with_java" = "xyes"
1793 AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
1795 [with_java="no (libjvm not found)"],
1798 if test "x$with_java" = "xyes"
1800 JAVA_LIBS="$JAVA_LIBS -ljvm"
1801 AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
1804 CPPFLAGS="$SAVE_CPPFLAGS"
1805 CFLAGS="$SAVE_CFLAGS"
1806 LDFLAGS="$SAVE_LDFLAGS"
1808 AC_SUBST(JAVA_CPPFLAGS)
1809 AC_SUBST(JAVA_CFLAGS)
1810 AC_SUBST(JAVA_LDFLAGS)
1812 AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
1815 # --with-libmemcached {{{
1816 with_libmemcached_cppflags=""
1817 with_libmemcached_ldflags=""
1818 AC_ARG_WITH(libmemcached, [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
1820 if test "x$withval" != "xno" && test "x$withval" != "xyes"
1822 with_libmemcached_cppflags="-I$withval/include"
1823 with_libmemcached_ldflags="-L$withval/lib"
1824 with_libmemcached="yes"
1826 with_libmemcached="$withval"
1830 with_libmemcached="yes"
1832 if test "x$with_libmemcached" = "xyes"
1834 SAVE_CPPFLAGS="$CPPFLAGS"
1835 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1837 AC_CHECK_HEADERS(libmemcached/memcached.h, [with_libmemcached="yes"], [with_libmemcached="no (libmemcached/memcached.h not found)"])
1839 CPPFLAGS="$SAVE_CPPFLAGS"
1841 if test "x$with_libmemcached" = "xyes"
1843 SAVE_CPPFLAGS="$CPPFLAGS"
1844 SAVE_LDFLAGS="$LDFLAGS"
1845 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
1846 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
1848 AC_CHECK_LIB(memcached, memcached_create, [with_libmemcached="yes"], [with_libmemcached="no (Symbol 'memcached_create' not found)"])
1850 CPPFLAGS="$SAVE_CPPFLAGS"
1851 LDFLAGS="$SAVE_LDFLAGS"
1853 if test "x$with_libmemcached" = "xyes"
1855 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
1856 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
1857 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
1858 AC_SUBST(BUILD_WITH_LIBMEMCACHED_CPPFLAGS)
1859 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LDFLAGS)
1860 AC_SUBST(BUILD_WITH_LIBMEMCACHED_LIBS)
1861 AC_DEFINE(HAVE_LIBMEMCACHED, 1, [Define if libmemcached is present and usable.])
1863 AM_CONDITIONAL(BUILD_WITH_LIBMEMCACHED, test "x$with_libmemcached" = "xyes")
1866 # --with-libmysql {{{
1867 with_mysql_config="mysql_config"
1868 with_mysql_cflags=""
1870 AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
1872 if test "x$withval" = "xno"
1875 else if test "x$withval" = "xyes"
1879 if test -f "$withval" && test -x "$withval";
1881 with_mysql_config="$withval"
1882 else if test -x "$withval/bin/mysql_config"
1884 with_mysql_config="$withval/bin/mysql_config"
1892 if test "x$with_libmysql" = "xyes"
1894 with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
1895 mysql_config_status=$?
1897 if test $mysql_config_status -ne 0
1899 with_libmysql="no ($with_mysql_config failed)"
1901 SAVE_CPPFLAGS="$CPPFLAGS"
1902 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
1905 have_mysql_mysql_h="no"
1906 AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
1908 if test "x$have_mysql_h" = "xno"
1910 AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
1913 if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
1915 with_libmysql="no (mysql.h not found)"
1918 CPPFLAGS="$SAVE_CPPFLAGS"
1921 if test "x$with_libmysql" = "xyes"
1923 with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
1924 mysql_config_status=$?
1926 if test $mysql_config_status -ne 0
1928 with_libmysql="no ($with_mysql_config failed)"
1930 AC_CHECK_LIB(mysqlclient, mysql_init,
1931 [with_libmysql="yes"],
1932 [with_libmysql="no (symbol 'mysql_init' not found)"],
1935 AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
1936 [with_libmysql="yes"],
1937 [with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
1941 if test "x$with_libmysql" = "xyes"
1943 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
1944 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
1945 AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
1946 AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
1948 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
1951 # --with-libnetlink {{{
1952 with_libnetlink_cflags=""
1953 with_libnetlink_libs="-lnetlink"
1954 AC_ARG_WITH(libnetlink, [AS_HELP_STRING([--with-libnetlink@<:@=PREFIX@:>@], [Path to libnetlink.])],
1956 echo "libnetlink: withval = $withval"
1957 if test "x$withval" = "xyes"
1959 with_libnetlink="yes"
1960 else if test "x$withval" = "xno"
1962 with_libnetlink="no"
1964 if test -d "$withval/include"
1966 with_libnetlink_cflags="-I$withval/include"
1967 with_libnetlink_libs="-L$withval/lib -lnetlink"
1968 with_libnetlink="yes"
1970 AC_MSG_ERROR("no such directory: $withval/include")
1975 if test "x$ac_system" = "xLinux"
1977 with_libnetlink="yes"
1979 with_libnetlink="no (Linux only library)"
1982 if test "x$with_libnetlink" = "xyes"
1984 SAVE_CFLAGS="$CFLAGS"
1985 CFLAGS="$CFLAGS $with_libnetlink_cflags"
1987 with_libnetlink="no (libnetlink.h not found)"
1989 AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
1991 with_libnetlink="yes"
1995 #include <sys/types.h>
1996 #include <asm/types.h>
1997 #include <sys/socket.h>
1998 #include <linux/netlink.h>
1999 #include <linux/rtnetlink.h>])
2000 AC_CHECK_HEADERS(linux/gen_stats.h linux/pkt_sched.h, [], [],
2002 #include <sys/types.h>
2003 #include <asm/types.h>
2004 #include <sys/socket.h>])
2008 #include <sys/types.h>
2009 #include <asm/types.h>
2010 #include <sys/socket.h>
2011 #include <linux/netlink.h>
2012 #include <linux/rtnetlink.h>
2016 int retval = TCA_STATS2;
2019 [AC_DEFINE([HAVE_TCA_STATS2], 1, [True if the enum-member TCA_STATS2 exists])]
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_STATS;
2035 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
2038 CFLAGS="$SAVE_CFLAGS"
2040 if test "x$with_libnetlink" = "xyes"
2042 AC_CHECK_LIB(netlink, rtnl_open,
2043 [with_libnetlink="yes"],
2044 [with_libnetlink="no (symbol 'rtnl_open' not found)"],
2045 [$with_libnetlink_libs])
2047 if test "x$with_libnetlink" = "xyes"
2049 BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
2050 BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
2051 AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
2052 AC_SUBST(BUILD_WITH_LIBNETLINK_LIBS)
2054 AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
2057 # --with-libnetapp {{{
2058 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
2059 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
2060 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
2061 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS"
2062 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS"
2063 LIBNETAPP_LIBS="$LIBNETAPP_LIBS"
2064 AC_ARG_WITH(libnetapp, [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
2066 if test -d "$withval"
2068 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
2069 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
2070 with_libnetapp="yes"
2072 with_libnetapp="$withval"
2076 with_libnetapp="yes"
2079 SAVE_CPPFLAGS="$CPPFLAGS"
2080 SAVE_LDFLAGS="$LDFLAGS"
2081 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
2082 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
2084 if test "x$with_libnetapp" = "xyes"
2086 if test "x$LIBNETAPP_CPPFLAGS" != "x"
2088 AC_MSG_NOTICE([netapp CPPFLAGS: $LIBNETAPP_CPPFLAGS])
2090 AC_CHECK_HEADERS(netapp_api.h,
2091 [with_libnetapp="yes"],
2092 [with_libnetapp="no (netapp_api.h not found)"])
2095 if test "x$with_libnetapp" = "xyes"
2097 if test "x$LIBNETAPP_LDFLAGS" != "x"
2099 AC_MSG_NOTICE([netapp LDFLAGS: $LIBNETAPP_LDFLAGS])
2102 if test "x$LIBNETAPP_LIBS" = "x"
2104 LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
2106 AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
2108 AC_CHECK_LIB(netapp, na_server_invoke_elem,
2109 [with_libnetapp="yes"],
2110 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
2112 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
2115 CPPFLAGS="$SAVE_CPPFLAGS"
2116 LDFLAGS="$SAVE_LDFLAGS"
2118 if test "x$with_libnetapp" = "xyes"
2120 AC_DEFINE(HAVE_LIBNETAPP, 1, [Define to 1 if you have the netapp library (-lnetapp).])
2123 AC_SUBST(LIBNETAPP_CPPFLAGS)
2124 AC_SUBST(LIBNETAPP_LDFLAGS)
2125 AC_SUBST(LIBNETAPP_LIBS)
2126 AM_CONDITIONAL(BUILD_WITH_LIBNETAPP, test "x$with_libnetapp" = "xyes")
2129 # --with-libnetsnmp {{{
2130 with_snmp_config="net-snmp-config"
2133 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
2135 if test "x$withval" = "xno"
2137 with_libnetsnmp="no"
2138 else if test "x$withval" = "xyes"
2140 with_libnetsnmp="yes"
2142 if test -x "$withval"
2144 with_snmp_config="$withval"
2145 with_libnetsnmp="yes"
2147 with_snmp_config="$withval/bin/net-snmp-config"
2148 with_libnetsnmp="yes"
2152 [with_libnetsnmp="yes"])
2153 if test "x$with_libnetsnmp" = "xyes"
2155 with_snmp_cflags=`$with_snmp_config --cflags 2>/dev/null`
2156 snmp_config_status=$?
2158 if test $snmp_config_status -ne 0
2160 with_libnetsnmp="no ($with_snmp_config failed)"
2162 SAVE_CPPFLAGS="$CPPFLAGS"
2163 CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
2165 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
2167 CPPFLAGS="$SAVE_CPPFLAGS"
2170 if test "x$with_libnetsnmp" = "xyes"
2172 with_snmp_libs=`$with_snmp_config --libs 2>/dev/null`
2173 snmp_config_status=$?
2175 if test $snmp_config_status -ne 0
2177 with_libnetsnmp="no ($with_snmp_config failed)"
2179 AC_CHECK_LIB(netsnmp, init_snmp,
2180 [with_libnetsnmp="yes"],
2181 [with_libnetsnmp="no (libnetsnmp not found)"],
2185 if test "x$with_libnetsnmp" = "xyes"
2187 BUILD_WITH_LIBSNMP_CFLAGS="$with_snmp_cflags"
2188 BUILD_WITH_LIBSNMP_LIBS="$with_snmp_libs"
2189 AC_SUBST(BUILD_WITH_LIBSNMP_CFLAGS)
2190 AC_SUBST(BUILD_WITH_LIBSNMP_LIBS)
2192 AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
2195 # --with-liboconfig {{{
2196 with_own_liboconfig="no"
2197 liboconfig_LDFLAGS="$LDFLAGS"
2198 liboconfig_CPPFLAGS="$CPPFLAGS"
2199 AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
2201 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2203 if test -d "$withval/lib"
2205 liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
2207 if test -d "$withval/include"
2209 liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
2212 if test "x$withval" = "xno"
2214 AC_MSG_ERROR("liboconfig is required")
2218 with_liboconfig="yes"
2221 save_LDFLAGS="$LDFLAGS"
2222 save_CPPFLAGS="$CPPFLAGS"
2223 LDFLAGS="$liboconfig_LDFLAGS"
2224 CPPFLAGS="$liboconfig_CPPFLAGS"
2225 AC_CHECK_LIB(oconfig, oconfig_parse_fh,
2227 with_liboconfig="yes"
2228 with_own_liboconfig="no"
2231 with_liboconfig="yes"
2232 with_own_liboconfig="yes"
2233 LDFLAGS="$save_LDFLAGS"
2234 CPPFLAGS="$save_CPPFLAGS"
2237 AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
2238 if test "x$with_own_liboconfig" = "xyes"
2240 with_liboconfig="yes (shipped version)"
2244 # --with-liboping {{{
2245 AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
2247 if test "x$withval" = "xyes"
2250 else if test "x$withval" = "xno"
2255 LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS -I$withval/include"
2256 LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS -L$withval/lib"
2259 [with_liboping="yes"])
2261 SAVE_CPPFLAGS="$CPPFLAGS"
2262 SAVE_LDFLAGS="$LDFLAGS"
2264 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
2265 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
2267 if test "x$with_liboping" = "xyes"
2269 if test "x$LIBOPING_CPPFLAGS" != "x"
2271 AC_MSG_NOTICE([liboping CPPFLAGS: $LIBOPING_CPPFLAGS])
2273 AC_CHECK_HEADERS(oping.h,
2274 [with_liboping="yes"],
2275 [with_liboping="no ('oping.h' not found)"])
2277 if test "x$with_liboping" = "xyes"
2279 if test "x$LIBOPING_LDFLAGS" != "x"
2281 AC_MSG_NOTICE([liboping LDFLAGS: $LIBOPING_LDFLAGS])
2283 AC_CHECK_LIB(oping, ping_construct,
2284 [with_liboping="yes"],
2285 [with_liboping="no (symbol 'ping_construct' not found)"])
2288 CPPFLAGS="$SAVE_CPPFLAGS"
2289 LDFLAGS="$SAVE_LDFLAGS"
2291 if test "x$with_liboping" = "xyes"
2293 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
2294 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
2295 AC_SUBST(BUILD_WITH_LIBOPING_CPPFLAGS)
2296 AC_SUBST(BUILD_WITH_LIBOPING_LDFLAGS)
2298 AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
2302 with_oracle_cppflags=""
2304 AC_ARG_WITH(oracle, [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
2306 if test "x$withval" = "xyes"
2308 if test "x$ORACLE_HOME" = "x"
2310 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
2313 else if test "x$withval" = "xno"
2318 ORACLE_HOME="$withval"
2322 if test "x$ORACLE_HOME" = "x"
2324 with_oracle="no (ORACLE_HOME is not set)"
2329 if test "x$ORACLE_HOME" != "x"
2331 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
2333 if test -e "$ORACLE_HOME/lib/ldflags"
2335 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
2337 #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
2338 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
2340 if test "x$with_oracle" = "xyes"
2342 SAVE_CPPFLAGS="$CPPFLAGS"
2343 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2345 AC_CHECK_HEADERS(oci.h, [with_oracle="yes"], [with_oracle="no (oci.h not found)"])
2347 CPPFLAGS="$SAVE_CPPFLAGS"
2349 if test "x$with_oracle" = "xyes"
2351 SAVE_CPPFLAGS="$CPPFLAGS"
2352 SAVE_LDFLAGS="$LDFLAGS"
2353 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
2354 LDFLAGS="$LDFLAGS $with_oracle_libs"
2356 AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
2358 CPPFLAGS="$SAVE_CPPFLAGS"
2359 LDFLAGS="$SAVE_LDFLAGS"
2361 if test "x$with_oracle" = "xyes"
2363 BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
2364 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
2365 AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
2366 AC_SUBST(BUILD_WITH_ORACLE_LIBS)
2370 # --with-libowcapi {{{
2371 with_libowcapi_cppflags=""
2372 with_libowcapi_libs="-lowcapi"
2373 AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
2375 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2377 with_libowcapi_cppflags="-I$withval/include"
2378 with_libowcapi_libs="-L$withval/lib -lowcapi"
2379 with_libowcapi="yes"
2381 with_libowcapi="$withval"
2385 with_libowcapi="yes"
2387 if test "x$with_libowcapi" = "xyes"
2389 SAVE_CPPFLAGS="$CPPFLAGS"
2390 CPPFLAGS="$with_libowcapi_cppflags"
2392 AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
2394 CPPFLAGS="$SAVE_CPPFLAGS"
2396 if test "x$with_libowcapi" = "xyes"
2398 SAVE_LDFLAGS="$LDFLAGS"
2399 SAVE_CPPFLAGS="$CPPFLAGS"
2400 LDFLAGS="$with_libowcapi_libs"
2401 CPPFLAGS="$with_libowcapi_cppflags"
2403 AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
2405 LDFLAGS="$SAVE_LDFLAGS"
2406 CPPFLAGS="$SAVE_CPPFLAGS"
2408 if test "x$with_libowcapi" = "xyes"
2410 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
2411 BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
2412 AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
2413 AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
2417 # --with-libpcap {{{
2418 AC_ARG_WITH(libpcap, [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
2420 if test "x$withval" != "xno" && test "x$withval" != "xyes"
2422 LDFLAGS="$LDFLAGS -L$withval/lib"
2423 CPPFLAGS="$CPPFLAGS -I$withval/include"
2426 with_libpcap="$withval"
2432 if test "x$with_libpcap" = "xyes"
2434 AC_CHECK_LIB(pcap, pcap_open_live,
2436 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the pcap library (-lpcap).])
2437 ], [with_libpcap="no (libpcap not found)"])
2439 if test "x$with_libpcap" = "xyes"
2441 AC_CHECK_HEADERS(pcap.h,
2443 AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
2444 ], [with_libpcap="no (pcap.h not found)"])
2446 if test "x$with_libpcap" = "xyes"
2452 AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
2453 [Wether or not to use the pcap library])
2454 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
2457 # --with-libperl {{{
2458 perl_interpreter="perl"
2459 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
2461 if test -x "$withval"
2463 perl_interpreter="$withval"
2465 else if test "x$withval" != "xno" && test "x$withval" != "xyes"
2467 LDFLAGS="$LDFLAGS -L$withval/lib"
2468 CPPFLAGS="$CPPFLAGS -I$withval/include"
2469 perl_interpreter="$withval/bin/perl"
2472 with_libperl="$withval"
2479 AC_MSG_CHECKING([for perl])
2480 perl_interpreter=`which "$perl_interpreter" 2> /dev/null`
2481 if test -x "$perl_interpreter"
2483 AC_MSG_RESULT([yes ($perl_interpreter)])
2489 AC_SUBST(PERL, "$perl_interpreter")
2491 if test "x$with_libperl" = "xyes" \
2492 && test -n "$perl_interpreter"
2494 SAVE_CFLAGS="$CFLAGS"
2495 SAVE_LDFLAGS="$LDFLAGS"
2496 dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
2497 PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
2498 PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
2499 CFLAGS="$CFLAGS $PERL_CFLAGS"
2500 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2502 AC_CACHE_CHECK([for libperl],
2503 [c_cv_have_libperl],
2507 #define PERL_NO_GET_CONTEXT
2514 load_module (PERL_LOADMOD_NOIMPORT,
2515 newSVpv ("Collectd::Plugin::FooBar", 24),
2518 [c_cv_have_libperl="yes"],
2519 [c_cv_have_libperl="no"]
2523 if test "x$c_cv_have_libperl" = "xyes"
2525 AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
2526 AC_SUBST(PERL_CFLAGS)
2527 AC_SUBST(PERL_LDFLAGS)
2532 CFLAGS="$SAVE_CFLAGS"
2533 LDFLAGS="$SAVE_LDFLAGS"
2534 else if test -z "$perl_interpreter"; then
2535 with_libperl="no (no perl interpreter found)"
2536 c_cv_have_libperl="no"
2538 AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
2540 if test "x$with_libperl" = "xyes"
2542 SAVE_CFLAGS="$CFLAGS"
2543 SAVE_LDFLAGS="$LDFLAGS"
2544 CFLAGS="$CFLAGS $PERL_CFLAGS"
2545 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2547 AC_CACHE_CHECK([if perl supports ithreads],
2548 [c_cv_have_perl_ithreads],
2556 #if !defined(USE_ITHREADS)
2557 # error "Perl does not support ithreads!"
2558 #endif /* !defined(USE_ITHREADS) */
2561 [c_cv_have_perl_ithreads="yes"],
2562 [c_cv_have_perl_ithreads="no"]
2566 if test "x$c_cv_have_perl_ithreads" = "xyes"
2568 AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
2571 CFLAGS="$SAVE_CFLAGS"
2572 LDFLAGS="$SAVE_LDFLAGS"
2575 if test "x$with_libperl" = "xyes"
2577 SAVE_CFLAGS="$CFLAGS"
2578 SAVE_LDFLAGS="$LDFLAGS"
2579 # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
2580 # (see issues #41 and #42)
2581 CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
2582 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2584 AC_CACHE_CHECK([for broken Perl_load_module()],
2585 [c_cv_have_broken_perl_load_module],
2589 #define PERL_NO_GET_CONTEXT
2596 load_module (PERL_LOADMOD_NOIMPORT,
2597 newSVpv ("Collectd::Plugin::FooBar", 24),
2600 [c_cv_have_broken_perl_load_module="no"],
2601 [c_cv_have_broken_perl_load_module="yes"]
2605 CFLAGS="$SAVE_CFLAGS"
2606 LDFLAGS="$SAVE_LDFLAGS"
2608 AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
2609 test "x$c_cv_have_broken_perl_load_module" = "xyes")
2611 if test "x$with_libperl" = "xyes"
2613 SAVE_CFLAGS="$CFLAGS"
2614 SAVE_LDFLAGS="$LDFLAGS"
2615 CFLAGS="$CFLAGS $PERL_CFLAGS"
2616 LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
2619 [struct mgvtbl.svt_local],
2620 [have_struct_mgvtbl_svt_local="yes"],
2621 [have_struct_mgvtbl_svt_local="no"],
2628 if test "x$have_struct_mgvtbl_svt_local" = "xyes"
2630 AC_DEFINE(HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL, 1,
2631 [Define if Perl's struct mgvtbl has member svt_local.])
2634 CFLAGS="$SAVE_CFLAGS"
2635 LDFLAGS="$SAVE_LDFLAGS"
2640 with_pg_config="pg_config"
2641 with_libpq_includedir=""
2642 with_libpq_libdir=""
2643 with_libpq_cppflags=""
2644 with_libpq_ldflags=""
2645 AC_ARG_WITH(libpq, [AS_HELP_STRING([--with-libpq@<:@=PREFIX@:>@],
2648 if test "x$withval" = "xno"
2651 else if test "x$withval" = "xyes"
2655 if test -f "$withval" && test -x "$withval";
2657 with_pg_config="$withval"
2658 else if test -x "$withval/bin/pg_config"
2660 with_pg_config="$withval/bin/pg_config"
2668 if test "x$with_libpq" = "xyes"
2670 with_libpq_includedir=`$with_pg_config --includedir 2> /dev/null`
2673 if test $pg_config_status -eq 0
2675 if test -n "$with_libpq_includedir"; then
2676 for dir in $with_libpq_includedir; do
2677 with_libpq_cppflags="$with_libpq_cppflags -I$dir"
2681 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2684 SAVE_CPPFLAGS="$CPPFLAGS"
2685 CPPFLAGS="$CPPFLAGS $with_libpq_cppflags"
2687 AC_CHECK_HEADERS(libpq-fe.h, [],
2688 [with_libpq="no (libpq-fe.h not found)"], [])
2690 CPPFLAGS="$SAVE_CPPFLAGS"
2692 if test "x$with_libpq" = "xyes"
2694 with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
2697 if test $pg_config_status -eq 0
2699 if test -n "$with_libpq_libdir"; then
2700 for dir in $with_libpq_libdir; do
2701 with_libpq_ldflags="$with_libpq_ldflags -L$dir"
2705 AC_MSG_WARN([$with_pg_config returned with status $pg_config_status])
2708 SAVE_LDFLAGS="$LDFLAGS"
2709 LDFLAGS="$LDFLAGS $with_libpq_ldflags"
2711 AC_CHECK_LIB(pq, PQconnectdb,
2713 [with_libpq="no (symbol 'PQconnectdb' not found)"])
2715 AC_CHECK_LIB(pq, PQserverVersion,
2717 [with_libpq="no (symbol 'PQserverVersion' not found)"])
2719 LDFLAGS="$SAVE_LDFLAGS"
2721 if test "x$with_libpq" = "xyes"
2723 BUILD_WITH_LIBPQ_CPPFLAGS="$with_libpq_cppflags"
2724 BUILD_WITH_LIBPQ_LDFLAGS="$with_libpq_ldflags"
2725 AC_SUBST(BUILD_WITH_LIBPQ_CPPFLAGS)
2726 AC_SUBST(BUILD_WITH_LIBPQ_LDFLAGS)
2728 AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
2731 # --with-libpthread {{{
2732 AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
2733 [ if test "x$withval" != "xno" \
2734 && test "x$withval" != "xyes"
2736 LDFLAGS="$LDFLAGS -L$withval/lib"
2737 CPPFLAGS="$CPPFLAGS -I$withval/include"
2738 with_libpthread="yes"
2740 if test "x$withval" = "xno"
2742 with_libpthread="no (disabled)"
2745 ], [with_libpthread="yes"])
2746 if test "x$with_libpthread" = "xyes"
2748 AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
2751 if test "x$with_libpthread" = "xyes"
2753 AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
2755 if test "x$with_libpthread" = "xyes"
2761 AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
2762 [Wether or not to use pthread (POSIX threads) library])
2763 AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
2768 with_python_path="$PATH"
2769 AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
2771 if test "x$withval" = "xyes" || test "x$withval" = "xno"
2773 with_python="$withval"
2774 else if test -x "$withval"
2776 with_python_prog="$withval"
2777 with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
2779 else if test -d "$withval"
2781 with_python_path="$withval$PATH_SEPARATOR$with_python_path"
2784 AC_MSG_WARN([Argument not recognized: $withval])
2786 ], [with_python="yes"])
2789 SAVE_CPPFLAGS="$CPPFLAGS"
2790 SAVE_LDFLAGS="$LDFLAGS"
2793 PATH="$with_python_path"
2795 if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
2797 AC_MSG_CHECKING([for python])
2798 with_python_prog="`which python 2>/dev/null`"
2799 if test "x$with_python_prog" = "x"
2801 AC_MSG_RESULT([not found])
2802 with_python="no (interpreter not found)"
2804 AC_MSG_RESULT([$with_python_prog])
2808 if test "x$with_python" = "xyes"
2810 AC_MSG_CHECKING([for Python CPPFLAGS])
2811 python_include_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_python_inc()" | "$with_python_prog" 2>&1`
2812 python_config_status=$?
2814 if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
2816 AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
2819 AC_MSG_RESULT([$python_include_path])
2823 if test "x$with_python" = "xyes"
2825 CPPFLAGS="-I$python_include_path $CPPFLAGS"
2826 AC_CHECK_HEADERS(Python.h,
2827 [with_python="yes"],
2828 [with_python="no ('Python.h' not found)"])
2831 if test "x$with_python" = "xyes"
2833 AC_MSG_CHECKING([for Python LDFLAGS])
2834 python_library_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0)" | "$with_python_prog" 2>&1`
2835 python_config_status=$?
2837 if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
2839 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
2842 AC_MSG_RESULT([$python_library_path])
2846 if test "x$with_python" = "xyes"
2848 AC_MSG_CHECKING([for Python LIBS])
2849 python_library_flags=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0)" | "$with_python_prog" 2>&1`
2850 python_config_status=$?
2852 if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
2854 AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
2857 AC_MSG_RESULT([$python_library_flags])
2861 if test "x$with_python" = "xyes"
2863 LDFLAGS="-L$python_library_path $LDFLAGS"
2864 LIBS="$python_library_flags $LIBS"
2866 AC_CHECK_FUNC(PyObject_CallFunction,
2867 [with_python="yes"],
2868 [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
2872 CPPFLAGS="$SAVE_CPPFLAGS"
2873 LDFLAGS="$SAVE_LDFLAGS"
2876 if test "x$with_python" = "xyes"
2878 BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
2879 BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
2880 BUILD_WITH_PYTHON_LIBS="$python_library_flags"
2881 AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
2882 AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
2883 AC_SUBST(BUILD_WITH_PYTHON_LIBS)
2887 # --with-librouteros {{{
2888 AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
2890 if test "x$withval" = "xyes"
2892 with_librouteros="yes"
2893 else if test "x$withval" = "xno"
2895 with_librouteros="no"
2897 with_librouteros="yes"
2898 LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS -I$withval/include"
2899 LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS -L$withval/lib"
2902 [with_librouteros="yes"])
2904 SAVE_CPPFLAGS="$CPPFLAGS"
2905 SAVE_LDFLAGS="$LDFLAGS"
2907 CPPFLAGS="$CPPFLAGS $LIBROUTEROS_CPPFLAGS"
2908 LDFLAGS="$LDFLAGS $LIBROUTEROS_LDFLAGS"
2910 if test "x$with_librouteros" = "xyes"
2912 if test "x$LIBROUTEROS_CPPFLAGS" != "x"
2914 AC_MSG_NOTICE([librouteros CPPFLAGS: $LIBROUTEROS_CPPFLAGS])
2916 AC_CHECK_HEADERS(routeros_api.h,
2917 [with_librouteros="yes"],
2918 [with_librouteros="no ('routeros_api.h' not found)"])
2920 if test "x$with_librouteros" = "xyes"
2922 if test "x$LIBROUTEROS_LDFLAGS" != "x"
2924 AC_MSG_NOTICE([librouteros LDFLAGS: $LIBROUTEROS_LDFLAGS])
2926 AC_CHECK_LIB(routeros, ros_interface,
2927 [with_librouteros="yes"],
2928 [with_librouteros="no (symbol 'ros_interface' not found)"])
2931 CPPFLAGS="$SAVE_CPPFLAGS"
2932 LDFLAGS="$SAVE_LDFLAGS"
2934 if test "x$with_librouteros" = "xyes"
2936 BUILD_WITH_LIBROUTEROS_CPPFLAGS="$LIBROUTEROS_CPPFLAGS"
2937 BUILD_WITH_LIBROUTEROS_LDFLAGS="$LIBROUTEROS_LDFLAGS"
2938 AC_SUBST(BUILD_WITH_LIBROUTEROS_CPPFLAGS)
2939 AC_SUBST(BUILD_WITH_LIBROUTEROS_LDFLAGS)
2941 AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, test "x$with_librouteros" = "xyes")
2945 # AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
2948 librrd_threadsafe="yes"
2949 librrd_rrdc_update="no"
2950 AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
2951 [ if test "x$withval" != "xno" && test "x$withval" != "xyes"
2953 librrd_cflags="-I$withval/include"
2954 librrd_ldflags="-L$withval/lib"
2957 with_librrd="$withval"
2959 ], [with_librrd="yes"])
2960 if test "x$with_librrd" = "xyes"
2962 SAVE_CPPFLAGS="$CPPFLAGS"
2963 SAVE_LDFLAGS="$LDFLAGS"
2965 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2966 LDFLAGS="$LDFLAGS $librrd_ldflags"
2968 AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
2970 CPPFLAGS="$SAVE_CPPFLAGS"
2971 LDFLAGS="$SAVE_LDFLAGS"
2973 if test "x$with_librrd" = "xyes"
2975 SAVE_CPPFLAGS="$CPPFLAGS"
2976 SAVE_LDFLAGS="$LDFLAGS"
2978 CPPFLAGS="$CPPFLAGS $librrd_cflags"
2979 LDFLAGS="$LDFLAGS $librrd_ldflags"
2981 AC_CHECK_LIB(rrd_th, rrd_update_r,
2983 librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
2985 [librrd_threadsafe="no"
2986 AC_CHECK_LIB(rrd, rrd_update,
2988 librrd_ldflags="$librrd_ldflags -lrrd -lm"
2990 [with_librrd="no (symbol 'rrd_update' not found)"],
2995 if test "x$librrd_threadsafe" = "xyes"
2997 AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
2999 AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
3002 CPPFLAGS="$SAVE_CPPFLAGS"
3003 LDFLAGS="$SAVE_LDFLAGS"
3005 if test "x$with_librrd" = "xyes"
3007 BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
3008 BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
3009 AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
3010 AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
3012 if test "x$librrd_threadsafe" = "xyes"
3014 AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
3018 # --with-libsensors {{{
3019 with_sensors_cflags=""
3020 with_sensors_ldflags=""
3021 AC_ARG_WITH(libsensors, [AS_HELP_STRING([--with-libsensors@<:@=PREFIX@:>@], [Path to lm_sensors.])],
3023 if test "x$withval" = "xno"
3025 with_libsensors="no"
3027 with_libsensors="yes"
3028 if test "x$withval" != "xyes"
3030 with_sensors_cflags="-I$withval/include"
3031 with_sensors_ldflags="-L$withval/lib"
3032 with_libsensors="yes"
3037 if test "x$ac_system" = "xLinux"
3039 with_libsensors="yes"
3041 with_libsensors="no (Linux only library)"
3044 if test "x$with_libsensors" = "xyes"
3046 SAVE_CPPFLAGS="$CPPFLAGS"
3047 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3049 # AC_CHECK_HEADERS(sensors/sensors.h,
3051 # AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
3053 # [with_libsensors="no (sensors/sensors.h not found)"])
3054 AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
3056 CPPFLAGS="$SAVE_CPPFLAGS"
3058 if test "x$with_libsensors" = "xyes"
3060 SAVE_CPPFLAGS="$CPPFLAGS"
3061 SAVE_LDFLAGS="$LDFLAGS"
3062 CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
3063 LDFLAGS="$LDFLAGS $with_sensors_ldflags"
3065 AC_CHECK_LIB(sensors, sensors_init,
3067 AC_DEFINE(HAVE_LIBSENSORS, 1, [Define to 1 if you have the sensors library (-lsensors).])
3069 [with_libsensors="no (libsensors not found)"])
3071 CPPFLAGS="$SAVE_CPPFLAGS"
3072 LDFLAGS="$SAVE_LDFLAGS"
3074 if test "x$with_libsensors" = "xyes"
3076 BUILD_WITH_LIBSENSORS_CFLAGS="$with_sensors_cflags"
3077 BUILD_WITH_LIBSENSORS_LDFLAGS="$with_sensors_ldflags"
3078 AC_SUBST(BUILD_WITH_LIBSENSORS_CFLAGS)
3079 AC_SUBST(BUILD_WITH_LIBSENSORS_LDFLAGS)
3081 AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
3084 # --with-libstatgrab {{{
3085 with_libstatgrab_cflags=""
3086 with_libstatgrab_ldflags=""
3087 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
3089 if test "x$withval" != "xno" \
3090 && test "x$withval" != "xyes"
3092 with_libstatgrab_cflags="-I$withval/include"
3093 with_libstatgrab_ldflags="-L$withval/lib -lstatgrab"
3094 with_libstatgrab="yes"
3095 with_libstatgrab_pkg_config="no"
3097 with_libstatgrab="$withval"
3098 with_libstatgrab_pkg_config="yes"
3102 with_libstatgrab="yes"
3103 with_libstatgrab_pkg_config="yes"
3106 if test "x$with_libstatgrab" = "xyes" \
3107 && test "x$with_libstatgrab_pkg_config" = "xyes"
3109 if test "x$PKG_CONFIG" != "x"
3111 AC_MSG_CHECKING([pkg-config for libstatgrab])
3113 $PKG_CONFIG --exists libstatgrab 2>/dev/null
3116 with_libstatgrab_pkg_config="no"
3117 with_libstatgrab="no ($PKG_CONFIG doesn't know libstatgrab)"
3118 temp_result="not found"
3120 AC_MSG_RESULT([$temp_result])
3122 AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
3123 with_libstatgrab_pkg_config="no"
3124 with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
3128 if test "x$with_libstatgrab" = "xyes" \
3129 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3130 && test "x$with_libstatgrab_cflags" = "x"
3132 AC_MSG_CHECKING([for libstatgrab CFLAGS])
3133 temp_result="`$PKG_CONFIG --cflags libstatgrab`"
3136 with_libstatgrab_cflags="$temp_result"
3138 with_libstatgrab="no ($PKG_CONFIG --cflags libstatgrab failed)"
3139 temp_result="$PKG_CONFIG --cflags libstatgrab failed"
3141 AC_MSG_RESULT([$temp_result])
3144 if test "x$with_libstatgrab" = "xyes" \
3145 && test "x$with_libstatgrab_pkg_config" = "xyes" \
3146 && test "x$with_libstatgrab_ldflags" = "x"
3148 AC_MSG_CHECKING([for libstatgrab LDFLAGS])
3149 temp_result="`$PKG_CONFIG --libs libstatgrab`"
3152 with_libstatgrab_ldflags="$temp_result"
3154 with_libstatgrab="no ($PKG_CONFIG --libs libstatgrab failed)"
3155 temp_result="$PKG_CONFIG --libs libstatgrab failed"
3157 AC_MSG_RESULT([$temp_result])
3160 if test "x$with_libstatgrab" = "xyes"
3162 SAVE_CPPFLAGS="$CPPFLAGS"
3163 CPPFLAGS="$CPPFLAGS $with_libstatgrab_cflags"
3165 AC_CHECK_HEADERS(statgrab.h,
3166 [with_libstatgrab="yes"],
3167 [with_libstatgrab="no (statgrab.h not found)"])
3169 CPPFLAGS="$SAVE_CPPFLAGS"
3172 if test "x$with_libstatgrab" = "xyes"
3174 SAVE_CFLAGS="$CFLAGS"
3175 SAVE_LDFLAGS="$LDFLAGS"
3177 CFLAGS="$CFLAGS $with_libstatgrab_cflags"
3178 LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags"
3180 AC_CHECK_LIB(statgrab, sg_init,
3181 [with_libstatgrab="yes"],
3182 [with_libstatgrab="no (symbol sg_init not found)"])
3184 CFLAGS="$SAVE_CFLAGS"
3185 LDFLAGS="$SAVE_LDFLAGS"
3188 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
3189 if test "x$with_libstatgrab" = "xyes"
3191 AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
3192 BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
3193 BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
3194 AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
3195 AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
3199 # --with-libtokyotyrant {{{
3200 with_libtokyotyrant_cppflags=""
3201 with_libtokyotyrant_ldflags=""
3202 with_libtokyotyrant_libs=""
3203 AC_ARG_WITH(libtokyotyrant, [AS_HELP_STRING([--with-libtokyotyrant@<:@=PREFIX@:>@], [Path to libtokyotyrant.])],
3205 if test "x$withval" = "xno"
3207 with_libtokyotyrant="no"
3208 else if test "x$withval" = "xyes"
3210 with_libtokyotyrant="yes"
3212 with_libtokyotyrant_cppflags="-I$withval/include"
3213 with_libtokyotyrant_ldflags="-L$withval/include"
3214 with_libtokyotyrant_libs="-ltokyotyrant"
3215 with_libtokyotyrant="yes"
3219 with_libtokyotyrant="yes"
3222 if test "x$with_libtokyotyrant" = "xyes"
3224 if $PKG_CONFIG --exists tokyotyrant
3226 with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
3227 with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
3228 with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
3232 SAVE_CPPFLAGS="$CPPFLAGS"
3233 SAVE_LDFLAGS="$LDFLAGS"
3234 CPPFLAGS="$CPPFLAGS $with_libtokyotyrant_cppflags"
3235 LDFLAGS="$LDFLAGS $with_libtokyotyrant_ldflags"
3237 if test "x$with_libtokyotyrant" = "xyes"
3239 AC_CHECK_HEADERS(tcrdb.h,
3241 AC_DEFINE(HAVE_TCRDB_H, 1,
3242 [Define to 1 if you have the <tcrdb.h> header file.])
3243 ], [with_libtokyotyrant="no (tcrdb.h not found)"])
3246 if test "x$with_libtokyotyrant" = "xyes"
3248 AC_CHECK_LIB(tokyotyrant, tcrdbrnum,
3250 AC_DEFINE(HAVE_LIBTOKYOTYRANT, 1,
3251 [Define to 1 if you have the tokyotyrant library (-ltokyotyrant).])
3253 [with_libtokyotyrant="no (symbol tcrdbrnum not found)"],
3254 [$with_libtokyotyrant_libs])
3257 CPPFLAGS="$SAVE_CPPFLAGS"
3258 LDFLAGS="$SAVE_LDFLAGS"
3260 if test "x$with_libtokyotyrant" = "xyes"
3262 BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
3263 BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
3264 BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
3265 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS)
3266 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS)
3267 AC_SUBST(BUILD_WITH_LIBTOKYOTYRANT_LIBS)
3269 AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
3272 # --with-libupsclient {{{
3273 with_libupsclient_config=""
3274 with_libupsclient_cflags=""
3275 with_libupsclient_libs=""
3276 AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
3278 if test "x$withval" = "xno"
3280 with_libupsclient="no"
3281 else if test "x$withval" = "xyes"
3283 with_libupsclient="use_pkgconfig"
3285 if test -x "$withval"
3287 with_libupsclient_config="$withval"
3288 with_libupsclient="use_libupsclient_config"
3289 else if test -x "$withval/bin/libupsclient-config"
3291 with_libupsclient_config="$withval/bin/libupsclient-config"
3292 with_libupsclient="use_libupsclient_config"
3294 AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
3295 with_libupsclient_cflags="-I$withval/include"
3296 with_libupsclient_libs="-L$withval/lib -lupsclient"
3297 with_libupsclient="yes"
3301 [with_libupsclient="use_pkgconfig"])
3303 # configure using libupsclient-config
3304 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3306 AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
3307 with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
3310 with_libupsclient="no ($with_libupsclient_config failed)"
3312 with_libupsclient_libs="`$with_libupsclient_config --libs`"
3315 with_libupsclient="no ($with_libupsclient_config failed)"
3318 if test "x$with_libupsclient" = "xuse_libupsclient_config"
3320 with_libupsclient="yes"
3323 # configure using pkg-config
3324 if test "x$with_libupsclient" = "xuse_pkgconfig"
3326 if test "x$PKG_CONFIG" = "x"
3328 with_libupsclient="no (Don't have pkg-config)"
3331 if test "x$with_libupsclient" = "xuse_pkgconfig"
3333 AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
3334 $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
3337 with_libupsclient="no (pkg-config doesn't know library)"
3340 if test "x$with_libupsclient" = "xuse_pkgconfig"
3342 with_libupsclient_cflags="`$PKG_CONFIG --cflags 'libupsclient'`"
3345 with_libupsclient="no ($PKG_CONFIG failed)"
3347 with_libupsclient_libs="`$PKG_CONFIG --libs 'libupsclient'`"
3350 with_libupsclient="no ($PKG_CONFIG failed)"
3353 if test "x$with_libupsclient" = "xuse_pkgconfig"
3355 with_libupsclient="yes"
3358 # with_libupsclient_cflags and with_libupsclient_libs are set up now, let's do
3359 # the actual checks.
3360 if test "x$with_libupsclient" = "xyes"
3362 SAVE_CPPFLAGS="$CPPFLAGS"
3363 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3365 AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
3367 CPPFLAGS="$SAVE_CPPFLAGS"
3369 if test "x$with_libupsclient" = "xyes"
3371 SAVE_CPPFLAGS="$CPPFLAGS"
3372 SAVE_LDFLAGS="$LDFLAGS"
3374 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3375 LDFLAGS="$LDFLAGS $with_libupsclient_libs"
3377 AC_CHECK_LIB(upsclient, upscli_connect,
3378 [with_libupsclient="yes"],
3379 [with_libupsclient="no (symbol upscli_connect not found)"])
3381 CPPFLAGS="$SAVE_CPPFLAGS"
3382 LDFLAGS="$SAVE_LDFLAGS"
3384 if test "x$with_libupsclient" = "xyes"
3386 SAVE_CPPFLAGS="$CPPFLAGS"
3387 CPPFLAGS="$CPPFLAGS $with_libupsclient_cflags"
3389 AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
3390 [#include <stdlib.h>
3392 #include <upsclient.h>])
3394 CPPFLAGS="$SAVE_CPPFLAGS"
3396 if test "x$with_libupsclient" = "xyes"
3398 BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_libupsclient_cflags"
3399 BUILD_WITH_LIBUPSCLIENT_LIBS="$with_libupsclient_libs"
3400 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
3401 AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
3405 # --with-libxmms {{{
3406 with_xmms_config="xmms-config"
3409 AC_ARG_WITH(libxmms, [AS_HELP_STRING([--with-libxmms@<:@=PREFIX@:>@], [Path to libxmms.])],
3411 if test "x$withval" != "xno" \
3412 && test "x$withval" != "xyes"
3414 if test -f "$withval" && test -x "$withval";
3416 with_xmms_config="$withval"
3417 else if test -x "$withval/bin/xmms-config"
3419 with_xmms_config="$withval/bin/xmms-config"
3422 else if test "x$withval" = "xno"
3432 if test "x$with_libxmms" = "xyes"
3434 with_xmms_cflags=`$with_xmms_config --cflags 2>/dev/null`
3435 xmms_config_status=$?
3437 if test $xmms_config_status -ne 0
3442 if test "x$with_libxmms" = "xyes"
3444 with_xmms_libs=`$with_xmms_config --libs 2>/dev/null`
3445 xmms_config_status=$?
3447 if test $xmms_config_status -ne 0
3452 if test "x$with_libxmms" = "xyes"
3454 AC_CHECK_LIB(xmms, xmms_remote_get_info,
3456 BUILD_WITH_LIBXMMS_CFLAGS="$with_xmms_cflags"
3457 BUILD_WITH_LIBXMMS_LIBS="$with_xmms_libs"
3458 AC_SUBST(BUILD_WITH_LIBXMMS_CFLAGS)
3459 AC_SUBST(BUILD_WITH_LIBXMMS_LIBS)
3466 with_libxmms_numeric=0
3467 if test "x$with_libxmms" = "xyes"
3469 with_libxmms_numeric=1
3471 AC_DEFINE_UNQUOTED(HAVE_LIBXMMS, [$with_libxmms_numeric], [Define to 1 if you have the 'xmms' library (-lxmms).])
3472 AM_CONDITIONAL(BUILD_WITH_LIBXMMS, test "x$with_libxmms" = "xyes")
3475 # --with-libyajl {{{
3476 with_libyajl_cppflags=""
3477 with_libyajl_ldflags=""
3478 AC_ARG_WITH(libyajl, [AS_HELP_STRING([--with-libyajl@<:@=PREFIX@:>@], [Path to libyajl.])],
3480 if test "x$withval" != "xno" && test "x$withval" != "xyes"
3482 with_libyajl_cppflags="-I$withval/include"
3483 with_libyajl_ldflags="-L$withval/lib"
3486 with_libyajl="$withval"
3492 if test "x$with_libyajl" = "xyes"
3494 SAVE_CPPFLAGS="$CPPFLAGS"
3495 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3497 AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"])
3499 CPPFLAGS="$SAVE_CPPFLAGS"
3501 if test "x$with_libyajl" = "xyes"
3503 SAVE_CPPFLAGS="$CPPFLAGS"
3504 SAVE_LDFLAGS="$LDFLAGS"
3505 CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags"
3506 LDFLAGS="$LDFLAGS $with_libyajl_ldflags"
3508 AC_CHECK_LIB(yajl, yajl_alloc, [with_libyajl="yes"], [with_libyajl="no (Symbol 'yajl_alloc' not found)"])
3510 CPPFLAGS="$SAVE_CPPFLAGS"
3511 LDFLAGS="$SAVE_LDFLAGS"
3513 if test "x$with_libyajl" = "xyes"
3515 BUILD_WITH_LIBYAJL_CPPFLAGS="$with_libyajl_cppflags"
3516 BUILD_WITH_LIBYAJL_LDFLAGS="$with_libyajl_ldflags"
3517 BUILD_WITH_LIBYAJL_LIBS="-lyajl"
3518 AC_SUBST(BUILD_WITH_LIBYAJL_CPPFLAGS)
3519 AC_SUBST(BUILD_WITH_LIBYAJL_LDFLAGS)
3520 AC_SUBST(BUILD_WITH_LIBYAJL_LIBS)
3521 AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is present and usable.])
3523 AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes")
3526 # pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{
3527 with_libxml2="no (pkg-config isn't available)"
3528 with_libxml2_cflags=""
3529 with_libxml2_ldflags=""
3530 with_libvirt="no (pkg-config isn't available)"
3531 with_libvirt_cflags=""
3532 with_libvirt_ldflags=""
3533 if test "x$PKG_CONFIG" != "x"
3535 pkg-config --exists 'libxml-2.0' 2>/dev/null
3540 with_libxml2="no (pkg-config doesn't know library)"
3543 pkg-config --exists libvirt 2>/dev/null
3548 with_libvirt="no (pkg-config doesn't know library)"
3551 if test "x$with_libxml2" = "xyes"
3553 with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
3558 with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
3564 if test "x$with_libxml2" = "xyes"
3566 SAVE_CPPFLAGS="$CPPFLAGS"
3567 CPPFLAGS="$CPPFLAGS $with_libxml2_cflags"
3569 AC_CHECK_HEADERS(libxml/parser.h, [],
3570 [with_libxml2="no (libxml/parser.h not found)"])
3572 CPPFLAGS="$SAVE_CPPFLAGS"
3574 if test "x$with_libxml2" = "xyes"
3576 SAVE_CFLAGS="$CFLAGS"
3577 SAVE_LDFLAGS="$LDFLAGS"
3579 CFLAGS="$CFLAGS $with_libxml2_cflags"
3580 LDFLAGS="$LDFLAGS $with_libxml2_ldflags"
3582 AC_CHECK_LIB(xml2, xmlXPathEval,
3583 [with_libxml2="yes"],
3584 [with_libxml2="no (symbol xmlXPathEval not found)"])
3586 CFLAGS="$SAVE_CFLAGS"
3587 LDFLAGS="$SAVE_LDFLAGS"
3589 dnl Add the right compiler flags and libraries.
3590 if test "x$with_libxml2" = "xyes"; then
3591 BUILD_WITH_LIBXML2_CFLAGS="$with_libxml2_cflags"
3592 BUILD_WITH_LIBXML2_LIBS="$with_libxml2_ldflags"
3593 AC_SUBST(BUILD_WITH_LIBXML2_CFLAGS)
3594 AC_SUBST(BUILD_WITH_LIBXML2_LIBS)
3596 if test "x$with_libvirt" = "xyes"
3598 with_libvirt_cflags="`pkg-config --cflags libvirt`"
3603 with_libvirt_ldflags="`pkg-config --libs libvirt`"
3609 if test "x$with_libvirt" = "xyes"
3611 SAVE_CPPFLAGS="$CPPFLAGS"
3612 CPPFLAGS="$CPPFLAGS $with_libvirt_cflags"
3614 AC_CHECK_HEADERS(libvirt/libvirt.h, [],
3615 [with_libvirt="no (libvirt/libvirt.h not found)"])
3617 CPPFLAGS="$SAVE_CPPFLAGS"
3619 if test "x$with_libvirt" = "xyes"
3621 SAVE_CFLAGS="$CFLAGS"
3622 SAVE_LDFLAGS="$LDFLAGS"
3624 CFLAGS="$CFLAGS $with_libvirt_cflags"
3625 LDFLAGS="$LDFLAGS $with_libvirt_ldflags"
3627 AC_CHECK_LIB(virt, virDomainBlockStats,
3628 [with_libvirt="yes"],
3629 [with_libvirt="no (symbol virDomainBlockStats not found)"])
3631 CFLAGS="$SAVE_CFLAGS"
3632 LDFLAGS="$SAVE_LDFLAGS"
3634 dnl Add the right compiler flags and libraries.
3635 if test "x$with_libvirt" = "xyes"; then
3636 BUILD_WITH_LIBVIRT_CFLAGS="$with_libvirt_cflags"
3637 BUILD_WITH_LIBVIRT_LIBS="$with_libvirt_ldflags"
3638 AC_SUBST(BUILD_WITH_LIBVIRT_CFLAGS)
3639 AC_SUBST(BUILD_WITH_LIBVIRT_LIBS)
3643 # $PKG_CONFIG --exists OpenIPMIpthread {{{
3644 with_libopenipmipthread="yes"
3645 with_libopenipmipthread_cflags=""
3646 with_libopenipmipthread_libs=""
3648 AC_MSG_CHECKING([for pkg-config])
3650 if test "x$PKG_CONFIG" = "x"
3652 with_libopenipmipthread="no"
3655 temp_result="$PKG_CONFIG"
3657 AC_MSG_RESULT([$temp_result])
3659 if test "x$with_libopenipmipthread" = "xyes"
3661 AC_MSG_CHECKING([for libOpenIPMIpthread])
3662 $PKG_CONFIG --exists OpenIPMIpthread 2>/dev/null
3665 with_libopenipmipthread="no ($PKG_CONFIG doesn't know OpenIPMIpthread)"
3667 AC_MSG_RESULT([$with_libopenipmipthread])
3670 if test "x$with_libopenipmipthread" = "xyes"
3672 AC_MSG_CHECKING([for libOpenIPMIpthread CFLAGS])
3673 temp_result="`$PKG_CONFIG --cflags OpenIPMIpthread`"
3676 with_libopenipmipthread_cflags="$temp_result"
3678 with_libopenipmipthread="no ($PKG_CONFIG --cflags OpenIPMIpthread failed)"
3679 temp_result="$PKG_CONFIG --cflags OpenIPMIpthread failed"
3681 AC_MSG_RESULT([$temp_result])
3684 if test "x$with_libopenipmipthread" = "xyes"
3686 AC_MSG_CHECKING([for libOpenIPMIpthread LDFLAGS])
3687 temp_result="`$PKG_CONFIG --libs OpenIPMIpthread`"
3690 with_libopenipmipthread_ldflags="$temp_result"
3692 with_libopenipmipthread="no ($PKG_CONFIG --libs OpenIPMIpthread failed)"
3693 temp_result="$PKG_CONFIG --libs OpenIPMIpthread failed"
3695 AC_MSG_RESULT([$temp_result])
3698 if test "x$with_libopenipmipthread" = "xyes"
3700 SAVE_CPPFLAGS="$CPPFLAGS"
3701 CPPFLAGS="$CPPFLAGS $with_libopenipmipthread_cflags"
3703 AC_CHECK_HEADERS(OpenIPMI/ipmi_smi.h,
3704 [with_libopenipmipthread="yes"],
3705 [with_libopenipmipthread="no (OpenIPMI/ipmi_smi.h not found)"],
3706 [#include <OpenIPMI/ipmiif.h>
3707 #include <OpenIPMI/ipmi_err.h>
3708 #include <OpenIPMI/ipmi_posix.h>
3709 #include <OpenIPMI/ipmi_conn.h>
3712 CPPFLAGS="$SAVE_CPPFLAGS"
3715 if test "x$with_libopenipmipthread" = "xyes"
3717 BUILD_WITH_OPENIPMI_CFLAGS="$with_libopenipmipthread_cflags"
3718 BUILD_WITH_OPENIPMI_LIBS="$with_libopenipmipthread_ldflags"
3719 AC_SUBST(BUILD_WITH_OPENIPMI_CFLAGS)
3720 AC_SUBST(BUILD_WITH_OPENIPMI_LIBS)
3724 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
3725 [with_libnotify="yes"],
3726 [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
3728 # Check for enabled/disabled features
3731 # AC_COLLECTD(name, enable/disable, info-text, feature/module)
3732 # ------------------------------------------------------------
3734 m4_define([my_toupper], [m4_translit([$1], m4_defn([m4_cr_letters]), m4_defn([m4_cr_LETTERS]))])
3739 m4_if([$1], [], [AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 1st argument must not be empty])])dnl
3744 m4_define([EnDis],[disabled])dnl
3745 m4_define([YesNo],[no])dnl
3751 m4_define([EnDis],[enabled])dnl
3752 m4_define([YesNo],[yes])dnl
3755 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 2nd argument must be either enable or disable])dnl
3759 m4_if([$3], [feature], [],
3763 AC_FATAL([AC_COLLECTD([$1], [$2], [$3], [$4]): 3rd argument must be either feature or disable])dnl
3769 AS_HELP_STRING([--$2-$1], [$2 $4 (EnDis by def)]),
3771 enable_$1='[YesNo]'dnl
3773 if test "x$enable_$1" = "xno"
3777 if test "x$enable_$1" = "xyes"
3781 AC_MSG_NOTICE([please specify either --enable-$1 or --disable-$1; enabling $1.])
3786 AC_DEFINE_UNQUOTED([COLLECT_]my_toupper([$1]), [$collectd_$1], [wether or not to enable $3 $4])
3787 AM_CONDITIONAL([BUILD_]my_toupper([$3])[_]my_toupper([$1]), [test "x$enable_$1" = "xyes"])dnl
3789 )# AC_COLLECTD(name, enable/disable, info-text, feature/module)
3791 # AC_PLUGIN(name, default, info)
3792 # ------------------------------------------------------------
3799 AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
3801 if test "x$enableval" = "xyes"
3804 else if test "x$enableval" = "xforce"
3813 if test "x$enable_all_plugins" = "xauto"
3815 if test "x$2" = "xyes"
3822 enable_plugin="$enable_all_plugins"
3825 if test "x$enable_plugin" = "xyes"
3827 if test "x$2" = "xyes" || test "x$force" = "xyes"
3829 AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
3830 if test "x$2" != "xyes"
3832 dependency_warning="yes"
3834 else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
3835 dependency_error="yes"
3836 enable_plugin="no (dependency error)"
3839 AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
3840 enable_$1="$enable_plugin"
3842 )# AC_PLUGIN(name, default, info)
3844 m4_divert_once([HELP_ENABLE], [
3845 collectd features:])
3846 # FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
3847 AC_COLLECTD([debug], [enable], [feature], [debugging])
3848 AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
3849 AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
3851 dependency_warning="no"
3852 dependency_error="no"
3857 plugin_conntrack="no"
3858 plugin_contextswitch="no"
3861 plugin_curl_json="no"
3865 plugin_interface="no"
3872 plugin_multimeter="no"
3876 plugin_processes="no"
3877 plugin_protocols="no"
3881 plugin_tcpconns="no"
3888 plugin_wireless="no"
3892 if test "x$ac_system" = "xLinux"
3894 plugin_battery="yes"
3895 plugin_conntrack="yes"
3896 plugin_contextswitch="yes"
3898 plugin_cpufreq="yes"
3900 plugin_entropy="yes"
3901 plugin_interface="yes"
3906 plugin_fscache="yes"
3907 plugin_processes="yes"
3908 plugin_protocols="yes"
3911 plugin_tcpconns="yes"
3912 plugin_thermal="yes"
3915 plugin_vserver="yes"
3916 plugin_wireless="yes"
3918 if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
3924 if test "x$ac_system" = "xOpenBSD"
3926 plugin_tcpconns="yes"
3930 if test "x$with_libiokit" = "xyes"
3932 plugin_battery="yes"
3937 if test "x$with_perfstat" = "xyes"
3943 plugin_interface="yes"
3947 if test "x$with_procinfo" = "xyes"
3949 plugin_processes="yes"
3953 if test "x$with_kstat" = "xyes"
3956 plugin_zfs_arc="yes"
3959 if test "x$with_devinfo$with_kstat" = "xyesyes"
3963 plugin_interface="yes"
3968 if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
3974 if test "x$with_libstatgrab" = "xyes"
3978 plugin_interface="yes"
3985 if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
3991 if test "x$with_libopenipmipthread" = "xyes"
3996 if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"
3998 plugin_curl_json="yes"
4001 if test "x$have_processor_info" = "xyes"
4005 if test "x$have_sysctl" = "xyes"
4012 if test "x$have_sysctlbyname" = "xyes"
4016 plugin_tcpconns="yes"
4019 # Df plugin: Check if we know how to determine mount points first.
4020 #if test "x$have_listmntent" = "xyes"; then
4023 if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes"
4027 if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun"
4031 #if test "x$have_getmntent" = "xseq"
4035 if test "x$c_cv_have_one_getmntent" = "xyes"
4040 # Df plugin: Check if we have either `statfs' or `statvfs' second.
4041 if test "x$plugin_df" = "xyes"
4044 if test "x$have_statfs" = "xyes"
4048 if test "x$have_statvfs" = "xyes"
4054 if test "x$have_getifaddrs" = "xyes"
4056 plugin_interface="yes"
4059 if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
4061 plugin_libvirt="yes"
4064 if test "x$have_getloadavg" = "xyes"
4069 if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
4074 # Mac OS X memory interface
4075 if test "x$have_host_statistics" = "xyes"
4080 if test "x$have_termios_h" = "xyes"
4082 plugin_multimeter="yes"
4086 if test "x$have_thread_info" = "xyes"
4088 plugin_processes="yes"
4091 if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes"
4093 plugin_processes="yes"
4096 if test "x$with_kvm_getswapinfo" = "xyes"
4101 if test "x$have_swapctl" = "xyes"
4106 if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
4108 plugin_tcpconns="yes"
4111 if test "x$have_getutent" = "xyes"
4115 if test "x$have_getutxent" = "xyes"
4120 m4_divert_once([HELP_ENABLE], [
4123 AC_ARG_ENABLE([all-plugins],
4124 AC_HELP_STRING([--enable-all-plugins],
4125 [enable all plugins (auto by def)]),
4127 if test "x$enableval" = "xyes"
4129 enable_all_plugins="yes"
4130 else if test "x$enableval" = "xauto"
4132 enable_all_plugins="auto"
4134 enable_all_plugins="no"
4137 [enable_all_plugins="auto"])
4139 m4_divert_once([HELP_ENABLE], [])
4141 AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics])
4142 AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC])
4143 AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors])
4144 AC_PLUGIN([ascent], [$plugin_ascent], [AscentEmu player statistics])
4145 AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
4146 AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
4147 AC_PLUGIN([conntrack], [$plugin_conntrack], [nf_conntrack statistics])
4148 AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
4149 AC_PLUGIN([cpufreq], [$plugin_cpufreq], [CPU frequency statistics])
4150 AC_PLUGIN([cpu], [$plugin_cpu], [CPU usage statistics])
4151 AC_PLUGIN([csv], [yes], [CSV output plugin])
4152 AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics])
4153 AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics])
4154 AC_PLUGIN([dbi], [$with_libdbi], [General database statistics])
4155 AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
4156 AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
4157 AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
4158 AC_PLUGIN([email], [yes], [EMail statistics])
4159 AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
4160 AC_PLUGIN([exec], [yes], [Execution of external programs])
4161 AC_PLUGIN([filecount], [yes], [Count files in directories])
4162 AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
4163 AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
4164 AC_PLUGIN([hddtemp], [yes], [Query hddtempd])
4165 AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics])
4166 AC_PLUGIN([ipmi], [$plugin_ipmi], [IPMI sensor statistics])
4167 AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
4168 AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
4169 AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
4170 AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
4171 AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics])
4172 AC_PLUGIN([load], [$plugin_load], [System load])
4173 AC_PLUGIN([logfile], [yes], [File logging plugin])
4174 AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
4175 AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
4176 AC_PLUGIN([match_hashed], [yes], [The hashed match])
4177 AC_PLUGIN([match_regex], [yes], [The regex match])
4178 AC_PLUGIN([match_timediff], [yes], [The timediff match])
4179 AC_PLUGIN([match_value], [yes], [The value match])
4180 AC_PLUGIN([mbmon], [yes], [Query mbmond])
4181 AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics])
4182 AC_PLUGIN([memcached], [yes], [memcached statistics])
4183 AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
4184 AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
4185 AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
4186 AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
4187 AC_PLUGIN([netlink], [$with_libnetlink], [Enhanced Linux network statistics])
4188 AC_PLUGIN([network], [yes], [Network communication plugin])
4189 AC_PLUGIN([nfs], [$plugin_nfs], [NFS statistics])
4190 AC_PLUGIN([nginx], [$with_libcurl], [nginx statistics])
4191 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
4192 AC_PLUGIN([notify_email], [$with_libesmtp], [Email notifier])
4193 AC_PLUGIN([ntpd], [yes], [NTPd statistics])
4194 AC_PLUGIN([nut], [$with_libupsclient], [Network UPS tools statistics])
4195 AC_PLUGIN([olsrd], [yes], [olsrd statistics])
4196 AC_PLUGIN([onewire], [$with_libowcapi], [OneWire sensor statistics])
4197 AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
4198 AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
4199 AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
4200 AC_PLUGIN([ping], [$with_liboping], [Network latency statistics])
4201 AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
4202 AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
4203 AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
4204 AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
4205 AC_PLUGIN([python], [$with_python], [Embed a Python interpreter])
4206 AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin])
4207 AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin])
4208 AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin])
4209 AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
4210 AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
4211 AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
4212 AC_PLUGIN([swap], [$plugin_swap], [Swap usage statistics])
4213 AC_PLUGIN([syslog], [$have_syslog], [Syslog logging plugin])
4214 AC_PLUGIN([table], [yes], [Parsing of tabular data])
4215 AC_PLUGIN([tail], [yes], [Parsing of logfiles])
4216 AC_PLUGIN([tape], [$plugin_tape], [Tape drive statistics])
4217 AC_PLUGIN([target_notification], [yes], [The notification target])
4218 AC_PLUGIN([target_replace], [yes], [The replace target])
4219 AC_PLUGIN([target_scale],[yes], [The scale target])
4220 AC_PLUGIN([target_set], [yes], [The set target])
4221 AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
4222 AC_PLUGIN([teamspeak2], [yes], [TeamSpeak2 server statistics])
4223 AC_PLUGIN([ted], [$plugin_ted], [Read The Energy Detective values])
4224 AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
4225 AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
4226 AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
4227 AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
4228 AC_PLUGIN([users], [$plugin_users], [User statistics])
4229 AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
4230 AC_PLUGIN([vmem], [$plugin_vmem], [Virtual memory statistics])
4231 AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
4232 AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
4233 AC_PLUGIN([write_http], [$with_libcurl], [HTTP output plugin])
4234 AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
4235 AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
4237 dnl Default configuration file
4238 # Load either syslog or logfile
4239 LOAD_PLUGIN_SYSLOG=""
4240 LOAD_PLUGIN_LOGFILE=""
4242 AC_MSG_CHECKING([which default log plugin to load])
4243 default_log_plugin="none"
4244 if test "x$enable_syslog" = "xyes"
4246 default_log_plugin="syslog"
4248 LOAD_PLUGIN_SYSLOG="##"
4251 if test "x$enable_logfile" = "xyes"
4253 if test "x$default_log_plugin" = "xnone"
4255 default_log_plugin="logfile"
4257 LOAD_PLUGIN_LOGFILE="#"
4260 LOAD_PLUGIN_LOGFILE="##"
4262 AC_MSG_RESULT([$default_log_plugin])
4264 AC_SUBST(LOAD_PLUGIN_SYSLOG)
4265 AC_SUBST(LOAD_PLUGIN_LOGFILE)
4267 DEFAULT_LOG_LEVEL="info"
4268 if test "x$enable_debug" = "xyes"
4270 DEFAULT_LOG_LEVEL="debug"
4272 AC_SUBST(DEFAULT_LOG_LEVEL)
4274 # Load only one of rrdtool, network, csv in the default config.
4275 LOAD_PLUGIN_RRDTOOL=""
4276 LOAD_PLUGIN_NETWORK=""
4279 AC_MSG_CHECKING([which default write plugin to load])
4280 default_write_plugin="none"
4281 if test "x$enable_rrdtool" = "xyes"
4283 default_write_plugin="rrdtool"
4285 LOAD_PLUGIN_RRDTOOL="##"
4288 if test "x$enable_network" = "xyes"
4290 if test "x$default_write_plugin" = "xnone"
4292 default_write_plugin="network"
4294 LOAD_PLUGIN_NETWORK="#"
4297 LOAD_PLUGIN_NETWORK="##"
4300 if test "x$enable_csv" = "xyes"
4302 if test "x$default_write_plugin" = "xnone"
4304 default_write_plugin="csv"
4309 LOAD_PLUGIN_CSV="##"
4311 AC_MSG_RESULT([$default_write_plugin])
4313 AC_SUBST(LOAD_PLUGIN_RRDTOOL)
4314 AC_SUBST(LOAD_PLUGIN_NETWORK)
4315 AC_SUBST(LOAD_PLUGIN_CSV)
4318 if test "x$ac_system" = "xLinux" \
4319 && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
4321 enable_ipvs="$enable_ipvs (ip_vs.h not found)"
4325 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
4327 if test "x$withval" != "xno" && test "x$withval" != "xyes"
4329 PERL_BINDINGS_OPTIONS="$withval"
4330 with_perl_bindings="yes"
4332 PERL_BINDINGS_OPTIONS=""
4333 with_perl_bindings="$withval"
4337 PERL_BINDINGS_OPTIONS=""
4338 if test -n "$perl_interpreter"
4340 with_perl_bindings="yes"
4342 with_perl_bindings="no (no perl interpreter found)"
4345 if test "x$with_perl_bindings" = "xyes"
4347 PERL_BINDINGS="perl"
4351 AC_SUBST(PERL_BINDINGS)
4352 AC_SUBST(PERL_BINDINGS_OPTIONS)
4354 dnl libcollectdclient
4355 LCC_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
4356 LCC_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
4357 LCC_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
4359 LCC_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-`
4361 LCC_VERSION_STRING="$LCC_VERSION_MAJOR.$LCC_VERSION_MINOR.$LCC_VERSION_PATCH"
4363 AC_SUBST(LCC_VERSION_MAJOR)
4364 AC_SUBST(LCC_VERSION_MINOR)
4365 AC_SUBST(LCC_VERSION_PATCH)
4366 AC_SUBST(LCC_VERSION_EXTRA)
4367 AC_SUBST(LCC_VERSION_STRING)
4369 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
4371 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)
4373 if test "x$with_librrd" = "xyes" \
4374 && test "x$librrd_threadsafe" != "xyes"
4376 with_librrd="yes (warning: librrd is not thread-safe)"
4379 if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
4381 with_libiptc="yes (shipped version)"
4384 if test "x$with_libperl" = "xyes"
4386 with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
4388 enable_perl="no (needs libperl)"
4391 if test "x$enable_perl" = "xno" && test "x$c_cv_have_perl_ithreads" = "xno"
4393 enable_perl="no (libperl doesn't support ithreads)"
4396 if test "x$with_perl_bindings" = "xyes" \
4397 && test "x$PERL_BINDINGS_OPTIONS" != "x"
4399 with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
4406 libcurl . . . . . . . $with_libcurl
4407 libdbi . . . . . . . $with_libdbi
4408 libesmtp . . . . . . $with_libesmtp
4409 libganglia . . . . . $with_libganglia
4410 libgcrypt . . . . . . $with_libgcrypt
4411 libiokit . . . . . . $with_libiokit
4412 libiptc . . . . . . . $with_libiptc
4413 libjvm . . . . . . . $with_java
4414 libkstat . . . . . . $with_kstat
4415 libkvm . . . . . . . $with_libkvm
4416 libmemcached . . . . $with_libmemcached
4417 libmysql . . . . . . $with_libmysql
4418 libnetapp . . . . . . $with_libnetapp
4419 libnetlink . . . . . $with_libnetlink
4420 libnetsnmp . . . . . $with_libnetsnmp
4421 libnotify . . . . . . $with_libnotify
4422 liboconfig . . . . . $with_liboconfig
4423 libopenipmi . . . . . $with_libopenipmipthread
4424 liboping . . . . . . $with_liboping
4425 libpcap . . . . . . . $with_libpcap
4426 libperfstat . . . . . $with_perfstat
4427 libperl . . . . . . . $with_libperl
4428 libpq . . . . . . . . $with_libpq
4429 libpthread . . . . . $with_libpthread
4430 librouteros . . . . . $with_librouteros
4431 librrd . . . . . . . $with_librrd
4432 libsensors . . . . . $with_libsensors
4433 libstatgrab . . . . . $with_libstatgrab
4434 libtokyotyrant . . . $with_libtokyotyrant
4435 libupsclient . . . . $with_libupsclient
4436 libvirt . . . . . . . $with_libvirt
4437 libxml2 . . . . . . . $with_libxml2
4438 libxmms . . . . . . . $with_libxmms
4439 libyajl . . . . . . . $with_libyajl
4440 oracle . . . . . . . $with_oracle
4441 python . . . . . . . $with_python
4444 daemon mode . . . . . $enable_daemon
4445 debug . . . . . . . . $enable_debug
4448 perl . . . . . . . . $with_perl_bindings
4451 apache . . . . . . . $enable_apache
4452 apcups . . . . . . . $enable_apcups
4453 apple_sensors . . . . $enable_apple_sensors
4454 ascent . . . . . . . $enable_ascent
4455 battery . . . . . . . $enable_battery
4456 bind . . . . . . . . $enable_bind
4457 conntrack . . . . . . $enable_conntrack
4458 contextswitch . . . . $enable_contextswitch
4459 cpu . . . . . . . . . $enable_cpu
4460 cpufreq . . . . . . . $enable_cpufreq
4461 csv . . . . . . . . . $enable_csv
4462 curl . . . . . . . . $enable_curl
4463 curl_json . . . . . . $enable_curl_json
4464 dbi . . . . . . . . . $enable_dbi
4465 df . . . . . . . . . $enable_df
4466 disk . . . . . . . . $enable_disk
4467 dns . . . . . . . . . $enable_dns
4468 email . . . . . . . . $enable_email
4469 entropy . . . . . . . $enable_entropy
4470 exec . . . . . . . . $enable_exec
4471 filecount . . . . . . $enable_filecount
4472 fscache . . . . . . . $enable_fscache
4473 gmond . . . . . . . . $enable_gmond
4474 hddtemp . . . . . . . $enable_hddtemp
4475 interface . . . . . . $enable_interface
4476 ipmi . . . . . . . . $enable_ipmi
4477 iptables . . . . . . $enable_iptables
4478 ipvs . . . . . . . . $enable_ipvs
4479 irq . . . . . . . . . $enable_irq
4480 java . . . . . . . . $enable_java
4481 libvirt . . . . . . . $enable_libvirt
4482 load . . . . . . . . $enable_load
4483 logfile . . . . . . . $enable_logfile
4484 madwifi . . . . . . . $enable_madwifi
4485 match_empty_counter . $enable_match_empty_counter
4486 match_hashed . . . . $enable_match_hashed
4487 match_regex . . . . . $enable_match_regex
4488 match_timediff . . . $enable_match_timediff
4489 match_value . . . . . $enable_match_value
4490 mbmon . . . . . . . . $enable_mbmon
4491 memcachec . . . . . . $enable_memcachec
4492 memcached . . . . . . $enable_memcached
4493 memory . . . . . . . $enable_memory
4494 multimeter . . . . . $enable_multimeter
4495 mysql . . . . . . . . $enable_mysql
4496 netapp . . . . . . . $enable_netapp
4497 netlink . . . . . . . $enable_netlink
4498 network . . . . . . . $enable_network
4499 nfs . . . . . . . . . $enable_nfs
4500 nginx . . . . . . . . $enable_nginx
4501 notify_desktop . . . $enable_notify_desktop
4502 notify_email . . . . $enable_notify_email
4503 ntpd . . . . . . . . $enable_ntpd
4504 nut . . . . . . . . . $enable_nut
4505 olsrd . . . . . . . . $enable_olsrd
4506 onewire . . . . . . . $enable_onewire
4507 openvpn . . . . . . . $enable_openvpn
4508 oracle . . . . . . . $enable_oracle
4509 perl . . . . . . . . $enable_perl
4510 ping . . . . . . . . $enable_ping
4511 postgresql . . . . . $enable_postgresql
4512 powerdns . . . . . . $enable_powerdns
4513 processes . . . . . . $enable_processes
4514 protocols . . . . . . $enable_protocols
4515 python . . . . . . . $enable_python
4516 routeros . . . . . . $enable_routeros
4517 rrdcached . . . . . . $enable_rrdcached
4518 rrdtool . . . . . . . $enable_rrdtool
4519 sensors . . . . . . . $enable_sensors
4520 serial . . . . . . . $enable_serial
4521 snmp . . . . . . . . $enable_snmp
4522 swap . . . . . . . . $enable_swap
4523 syslog . . . . . . . $enable_syslog
4524 table . . . . . . . . $enable_table
4525 tail . . . . . . . . $enable_tail
4526 tape . . . . . . . . $enable_tape
4527 target_notification . $enable_target_notification
4528 target_replace . . . $enable_target_replace
4529 target_scale . . . . $enable_target_scale
4530 target_set . . . . . $enable_target_set
4531 tcpconns . . . . . . $enable_tcpconns
4532 teamspeak2 . . . . . $enable_teamspeak2
4533 ted . . . . . . . . . $enable_ted
4534 thermal . . . . . . . $enable_thermal
4535 tokyotyrant . . . . . $enable_tokyotyrant
4536 unixsock . . . . . . $enable_unixsock
4537 uptime . . . . . . . $enable_uptime
4538 users . . . . . . . . $enable_users
4539 uuid . . . . . . . . $enable_uuid
4540 vmem . . . . . . . . $enable_vmem
4541 vserver . . . . . . . $enable_vserver
4542 wireless . . . . . . $enable_wireless
4543 write_http . . . . . $enable_write_http
4544 xmms . . . . . . . . $enable_xmms
4545 zfs_arc . . . . . . . $enable_zfs_arc
4549 if test "x$dependency_error" = "xyes"; then
4550 AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
4553 if test "x$dependency_warning" = "xyes"; then
4554 AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
4557 # vim: set fdm=marker :