1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
4 AC_CONFIG_SRCDIR(src/target_set.c)
5 AC_CONFIG_HEADERS(src/config.h)
6 AC_CONFIG_AUX_DIR([build-aux])
7 AC_CONFIG_MACRO_DIR([m4])
9 dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
10 dnl we don't really need the 'u' even in older toolchains. Then there is
11 dnl older libtool, which spelled it AR_FLAGS
12 m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
14 LT_INIT([dlopen disable-static])
16 AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
17 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20 AC_PREFIX_DEFAULT("/opt/collectd")
25 # Checks for programs.
28 [AC_MSG_ERROR([No compiler found that supports C99])]
44 AC_PATH_PROG([VALGRIND], [valgrind])
46 # Warn when pkg.m4 is missing
47 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
51 AC_CACHE_CHECK([if Bison is the parser generator],
52 [collectd_cv_prog_bison],
54 AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
55 [collectd_cv_prog_bison=yes],
56 [collectd_cv_prog_bison=no]
61 if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"; then
62 AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
65 if test "x$lt_cv_dlopen" = "xno"; then
66 AC_MSG_ERROR([Your system does not support dlopen])
69 AC_SUBST([DLOPEN_LIBS], [$lt_cv_dlopen_libs])
72 AC_MSG_CHECKING([for kernel type ($host_os)])
75 AC_DEFINE([KERNEL_AIX], [1], [True if program is to be compiled for a AIX kernel])
79 AC_DEFINE([KERNEL_DARWIN], [1], [True if program is to be compiled for a Darwin kernel])
83 AC_DEFINE([KERNEL_FREEBSD], [1], [True if program is to be compiled for a FreeBSD kernel])
87 AC_DEFINE([KERNEL_LINUX], [1], [True if program is to be compiled for a Linux kernel])
91 AC_DEFINE([KERNEL_NETBSD], [1], [True if program is to be compiled for a NetBSD kernel])
95 AC_DEFINE([KERNEL_OPENBSD], [1], [True if program is to be compiled for an OpenBSD kernel])
99 AC_DEFINE([KERNEL_SOLARIS], [1], [True if program is to be compiled for a Solaris kernel])
103 AC_DEFINE([KERNEL_WIN32], [1], [True if program is to be compiled for a Windows kernel])
110 AC_MSG_RESULT([$ac_system])
112 AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
113 AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
114 AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
115 AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
116 AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
117 AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
118 AM_CONDITIONAL([BUILD_WIN32], [test "x$ac_system" = "xWindows"])
120 if test "x$ac_system" = "xSolaris"; then
121 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Define to enforce POSIX thread semantics under Solaris.])
122 AC_DEFINE([_REENTRANT], [1], [Define to enable reentrancy interfaces.])
124 AC_MSG_CHECKING([whether compiler builds 64bit binaries])
130 # error "Compiler not in 64bit mode."
135 [AC_MSG_RESULT([yes])],
138 AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
143 if test "x$ac_system" = "xAIX"; then
144 AC_DEFINE([_THREAD_SAFE_ERRNO], [1], [Define to use the thread-safe version of errno under AIX.])
147 # Where to install .pc files.
148 pkgconfigdir="${libdir}/pkgconfig"
149 AC_SUBST([pkgconfigdir])
152 # Checks for header files.
157 AC_CHECK_HEADERS_ONCE([ \
199 if test "x$ac_system" = "xNetBSD"; then
200 # For entropy plugin on newer NetBSD
201 AC_CHECK_HEADERS([sys/rndio.h], [], [],
204 # include <sys/types.h>
207 # include <sys/ioctl.h>
210 # include <sys/param.h>
217 AC_CHECK_HEADERS([netinet/in_systm.h], [], [],
221 # include <sys/types.h>
226 AC_CHECK_HEADERS([netinet/in.h], [], [],
230 # include <sys/types.h>
232 #if HAVE_NETINET_IN_SYSTM_H
233 # include <netinet/in_systm.h>
238 AC_CHECK_HEADERS([netinet/ip.h], [], [],
242 # include <sys/types.h>
244 #if HAVE_NETINET_IN_SYSTM_H
245 # include <netinet/in_systm.h>
247 #if HAVE_NETINET_IN_H
248 # include <netinet/in.h>
253 AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [],
257 # include <sys/types.h>
259 #if HAVE_NETINET_IN_SYSTM_H
260 # include <netinet/in_systm.h>
262 #if HAVE_NETINET_IN_H
263 # include <netinet/in.h>
265 #if HAVE_NETINET_IP_H
266 # include <netinet/ip.h>
271 AC_CHECK_HEADERS([netinet/ip_var.h], [], [],
275 # include <sys/types.h>
277 #if HAVE_NETINET_IN_SYSTM_H
278 # include <netinet/in_systm.h>
280 #if HAVE_NETINET_IN_H
281 # include <netinet/in.h>
283 #if HAVE_NETINET_IP_H
284 # include <netinet/ip.h>
289 AC_CHECK_HEADERS([netinet/ip6.h], [], [],
293 # include <sys/types.h>
295 #if HAVE_NETINET_IN_SYSTM_H
296 # include <netinet/in_systm.h>
298 #if HAVE_NETINET_IN_H
299 # include <netinet/in.h>
304 AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
308 # include <sys/types.h>
310 #if HAVE_NETINET_IN_SYSTM_H
311 # include <netinet/in_systm.h>
313 #if HAVE_NETINET_IN_H
314 # include <netinet/in.h>
316 #if HAVE_NETINET_IP6_H
317 # include <netinet/ip6.h>
322 AC_CHECK_HEADERS([netinet/tcp.h], [], [],
326 # include <sys/types.h>
328 #if HAVE_NETINET_IN_SYSTM_H
329 # include <netinet/in_systm.h>
331 #if HAVE_NETINET_IN_H
332 # include <netinet/in.h>
334 #if HAVE_NETINET_IP_H
335 # include <netinet/ip.h>
340 AC_CHECK_HEADERS([netinet/udp.h], [], [],
344 # include <sys/types.h>
346 #if HAVE_NETINET_IN_SYSTM_H
347 # include <netinet/in_systm.h>
349 #if HAVE_NETINET_IN_H
350 # include <netinet/in.h>
352 #if HAVE_NETINET_IP_H
353 # include <netinet/ip.h>
359 AC_CHECK_HEADERS([sys/dkstat.h])
360 if test "x$ac_system" = "xDarwin"; then
370 mach/processor_set.h \
372 mach/processor_info.h \
378 mach/vm_statistics.h \
380 CoreFoundation/CoreFoundation.h \
383 IOKit/ps/IOPSKeys.h \
385 IOKit/storage/IOBlockStorageDriver.h
389 # For the battery plugin
390 AC_CHECK_HEADERS([IOKit/ps/IOPowerSources.h], [], [],
392 #if HAVE_IOKIT_IOKITLIB_H
393 # include <IOKit/IOKitLib.h>
395 #if HAVE_IOKIT_IOTYPES_H
396 # include <IOKit/IOTypes.h>
402 AC_CHECK_HEADERS([sys/sysctl.h], [], [],
405 # include <sys/types.h>
408 # include <sys/param.h>
413 # For interface plugin
414 AC_CHECK_HEADERS([ifaddrs.h])
415 AC_CHECK_HEADERS([net/if.h], [], [],
418 # include <sys/types.h>
420 #if HAVE_SYS_SOCKET_H
421 # include <sys/socket.h>
426 if test "x$ac_system" = "xLinux"; then
428 AC_CHECK_HEADERS([linux/major.h])
430 # For md module (Linux only)
431 AC_CHECK_HEADERS([linux/raid/md_u.h],
432 [have_linux_raid_md_u_h="yes"],
433 [have_linux_raid_md_u_h="no"],
435 #include <sys/ioctl.h>
436 #include <linux/major.h>
437 #include <linux/types.h>
440 AC_CHECK_HEADERS([sys/sysmacros.h])
442 AC_CHECK_HEADERS([linux/wireless.h],
443 [have_linux_wireless_h="yes"],
444 [have_linux_wireless_h="no"],
447 #include <sys/ioctl.h>
448 #include <sys/socket.h>
452 AC_CHECK_HEADERS([linux/if.h], [], [],
455 # include <sys/types.h>
457 #if HAVE_SYS_SOCKET_H
458 # include <sys/socket.h>
463 AC_CHECK_HEADERS([linux/inet_diag.h], [], [],
466 # include <sys/types.h>
468 #if HAVE_SYS_SOCKET_H
469 # include <sys/socket.h>
474 AC_CHECK_HEADERS([linux/netdevice.h], [], [],
477 # include <sys/types.h>
479 #if HAVE_SYS_SOCKET_H
480 # include <sys/socket.h>
483 # include <linux/if.h>
489 AC_CHECK_HEADERS([linux/sockios.h],
490 [have_linux_sockios_h="yes"],
491 [have_linux_sockios_h="no"],
494 # include <sys/ioctl.h>
502 AC_CHECK_HEADERS([linux/ethtool.h],
503 [have_linux_ethtool_h="yes"],
504 [have_linux_ethtool_h="no"],
507 # include <sys/ioctl.h>
512 #if HAVE_LINUX_SOCKIOS_H
513 # include <linux/sockios.h>
519 AC_CHECK_HEADERS_ONCE([linux/ip_vs.h])
521 # For the email plugin
522 AC_CHECK_HEADERS([linux/un.h], [], [],
524 #if HAVE_SYS_SOCKET_H
525 # include <sys/socket.h>
529 # For the turbostat plugin
530 AC_CHECK_HEADERS([cpuid.h],
531 [have_cpuid_h="yes"],
532 [have_cpuid_h="no (cpuid.h not found)"]
535 AC_CHECK_HEADERS([sys/capability.h],
536 [have_capability="yes"],
537 [have_capability="no (<sys/capability.h> not found)"]
540 if test "x$have_capability" = "xyes"; then
541 AC_CHECK_LIB([cap], [cap_get_proc],
542 [have_capability="yes"],
543 [have_capability="no (cap_get_proc() not found)"]
547 if test "x$have_capability" = "xyes"; then
548 AC_CHECK_DECL([CAP_IS_SUPPORTED],
549 [have_capability="yes"],
550 [have_capability="no (CAP_IS_SUPPORTED not found)"],
551 [[#include <sys/capability.h>]]
555 if test "x$have_capability" = "xyes"; then
556 AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
559 # For pcie_errors plugin
560 AC_CHECK_HEADERS([linux/pci_regs.h],
561 [have_pci_regs_h="yes"],
562 [have_pci_regs_h="no (linux/pci_regs.h not found)"]
566 have_linux_raid_md_u_h="no"
567 have_linux_wireless_h="no"
570 AM_CONDITIONAL([BUILD_WITH_CAPABILITY], [test "x$have_capability" = "xyes"])
572 # For the swap module
573 have_sys_swap_h="yes"
574 AC_CHECK_HEADERS([sys/swap.h vm/anon.h],
576 [have_sys_swap_h="no"],
578 #undef _FILE_OFFSET_BITS
579 #undef _LARGEFILE64_SOURCE
581 # include <sys/types.h>
584 # include <sys/param.h>
590 # For the processes plugin
592 AC_CHECK_HEADERS([sys/loadavg.h linux/config.h utmp.h utmpx.h])
595 AC_CHECK_HEADERS([sys/ucred.h], [], [],
598 # include <sys/types.h>
601 # include <sys/param.h>
606 # For mount interface
607 AC_CHECK_HEADERS([sys/mount.h], [], [],
610 # include <sys/types.h>
613 # include <sys/param.h>
620 [AS_HELP_STRING([--enable-xfs], [xfs support in df plugin @<:@default=yes@:>@])],
625 if test "x$enable_xfs" != "xno"; then
626 AC_CHECK_HEADERS([xfs/xqm.h],
629 if test "x$enable_xfs" = "xyes"; then
630 AC_MSG_ERROR([xfs/xqm.h not found])
633 [[#define _GNU_SOURCE]]
639 AC_CHECK_HEADERS([net/if_arp.h], [], [],
641 #if HAVE_SYS_SOCKET_H
642 # include <sys/socket.h>
647 AC_CHECK_HEADERS([net/ppp_defs.h])
648 AC_CHECK_HEADERS([net/if_ppp.h], [], [],
650 #if HAVE_NET_PPP_DEFS_H
651 # include <net/ppp_defs.h>
656 AC_CHECK_HEADERS([netinet/if_ether.h], [], [],
660 # include <sys/types.h>
662 #if HAVE_SYS_SOCKET_H
663 # include <sys/socket.h>
668 #if HAVE_NETINET_IN_H
669 # include <netinet/in.h>
674 AC_CHECK_HEADERS([net/pfvar.h],
675 [have_net_pfvar_h="yes"],
676 [have_net_pfvar_h="no"],
679 # include <sys/ioctl.h>
681 #if HAVE_SYS_SOCKET_H
682 # include <sys/socket.h>
687 #if HAVE_NETINET_IN_H
688 # include <netinet/in.h>
693 # For the multimeter plugin
694 AC_CHECK_HEADERS([termios.h],
695 [have_termios_h="yes"],
696 [have_termios_h="no"]
699 # For cpusleep plugin
700 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
701 [c_cv_have_clock_boottime_monotonic],
705 [[#include <time.h>]],
707 struct timespec b, m;
708 clock_gettime(CLOCK_BOOTTIME, &b );
709 clock_gettime(CLOCK_MONOTONIC, &m );
713 [c_cv_have_clock_boottime_monotonic="yes"],
714 [c_cv_have_clock_boottime_monotonic="no"]
721 # Checks for typedefs, structures, and compiler characteristics.
732 [AC_LANG_SOURCE([[int main(void){}]]) ]
734 $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
742 # Checks for library functions.
744 AC_CHECK_FUNCS_ONCE([ \
757 if test "x$GCC" = "xyes"; then
758 SAVE_CFLAGS="$CFLAGS"
759 CFLAGS="$CFLAGS -Wall -Werror"
761 SAVE_LDFLAGS="$LDFLAGS"
763 if test "x$ac_system" = "xWindows"; then
764 # This is exported from build.sh
765 LDFLAGS="$LDFLAGS -L${GNULIB_DIR}"
768 AC_CACHE_CHECK([for strtok_r],
769 [c_cv_have_strtok_r_default],
780 char buffer[] = "foo,bar,baz";
787 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
790 printf ("token = %s;\n", token);
795 [c_cv_have_strtok_r_default="yes"],
796 [c_cv_have_strtok_r_default="no"]
801 if test "x$c_cv_have_strtok_r_default" = "xno"; then
802 CFLAGS="$CFLAGS -D_REENTRANT=1"
804 AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
805 [c_cv_have_strtok_r_reentrant],
816 char buffer[] = "foo,bar,baz";
823 while ((token = strtok_r (dummy, ",", &saveptr)) != NULL)
826 printf ("token = %s;\n", token);
831 [c_cv_have_strtok_r_reentrant="yes"],
832 [AC_MSG_FAILURE([strtok_r is not available. Please file a bugreport!])]
838 CFLAGS="$SAVE_CFLAGS"
839 LDFLAGS="$SAVE_LDFLAGS"
840 if test "x$c_cv_have_strtok_r_reentrant" = "xyes"; then
841 CFLAGS="$CFLAGS -D_REENTRANT=1"
844 AC_CHECK_FUNCS([socket],
847 AC_CHECK_LIB([socket], [socket],
848 [socket_needs_socket="yes"],
850 AC_CHECK_LIB([gnu], [rpl_socket],
851 [socket_needs_gnulib="yes"],
852 [AC_MSG_ERROR([cannot find socket() in libsocket])]
858 AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
859 AM_CONDITIONAL([BUILD_WITH_GNULIB], [test "x$socket_needs_gnulib" = "xyes"])
861 AC_CHECK_FUNCS([inet_ntop],
864 AC_CHECK_LIB([nsl], [inet_ntop],
865 [inet_ntop_needs_nsl="yes"],
866 [AC_MSG_ERROR([cannot find inet_ntop() in libnsl])]
870 AM_CONDITIONAL([BUILD_WITH_LIBNSL], [test "x$inet_ntop_needs_nsl" = "xyes"])
872 clock_gettime_needs_posix4="no"
873 AC_CHECK_FUNCS([clock_gettime],
874 [have_clock_gettime="yes"],
875 [have_clock_gettime="no"]
878 if test "x$have_clock_gettime" = "xno"; then
879 AC_CHECK_LIB([rt], [clock_gettime],
881 clock_gettime_needs_rt="yes"
882 have_clock_gettime="yes"
887 if test "x$have_clock_gettime" = "xno"; then
888 AC_CHECK_LIB([posix4], [clock_gettime],
890 clock_gettime_needs_posix4="yes"
891 have_clock_gettime="yes"
896 if test "x$have_clock_gettime" = "xyes"; then
897 AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if the clock_gettime(2) function is available.])
900 AC_CHECK_FUNCS([nanosleep], [],
901 AC_CHECK_LIB([rt], [nanosleep],
902 [nanosleep_needs_rt="yes"],
904 AC_CHECK_LIB([posix4], [nanosleep],
905 [nanosleep_needs_posix4="yes"],
906 [AC_MSG_ERROR([cannot find nanosleep])]
912 AM_CONDITIONAL([BUILD_WITH_LIBRT], [test "x$clock_gettime_needs_rt" = "xyes" || test "x$nanosleep_needs_rt" = "xyes"])
913 AM_CONDITIONAL([BUILD_WITH_LIBPOSIX4], [test "x$clock_gettime_needs_posix4" = "xyes" || test "x$nanosleep_needs_posix4" = "xyes"])
915 AC_CHECK_FUNCS([getifaddrs], [have_getifaddrs="yes"], [have_getifaddrs="no"])
916 AC_CHECK_FUNCS([getloadavg], [have_getloadavg="yes"], [have_getloadavg="no"])
917 AC_CHECK_FUNCS([getutent], [have_getutent="yes"], [have_getutent="no"])
918 AC_CHECK_FUNCS([getutxent], [have_getutxent="yes"], [have_getutxent="no"])
919 AC_CHECK_FUNCS([host_statistics], [have_host_statistics="yes"], [have_host_statistics="no"])
920 AC_CHECK_FUNCS([processor_info], [have_processor_info="yes"], [have_processor_info="no"])
921 AC_CHECK_FUNCS([statfs], [have_statfs="yes"], [have_statfs="no"])
922 AC_CHECK_FUNCS([statvfs], [have_statvfs="yes"], [have_statvfs="no"])
923 AC_CHECK_FUNCS([sysctl], [have_sysctl="yes"], [have_sysctl="no"])
924 AC_CHECK_FUNCS([sysctlbyname], [have_sysctlbyname="yes"], [have_sysctlbyname="no"])
925 AC_CHECK_FUNCS([syslog], [have_syslog="yes"], [have_syslog="no"])
926 AC_CHECK_FUNCS([thread_info], [have_thread_info="yes"], [have_thread_info="no"])
928 # Check for strptime {{{
929 if test "x$GCC" = "xyes"; then
930 SAVE_CFLAGS="$CFLAGS"
931 CFLAGS="$CFLAGS -Wall -Wextra -Werror"
934 AC_CHECK_FUNCS([strptime], [have_strptime="yes"], [have_strptime="no"])
935 if test "x$have_strptime" = "xyes"; then
936 AC_CACHE_CHECK([whether strptime is exported by default],
937 [c_cv_have_strptime_default],
942 [[#include <time.h>]],
945 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
949 [c_cv_have_strptime_default="yes"],
950 [c_cv_have_strptime_default="no"])
955 if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"; then
956 AC_CACHE_CHECK([whether strptime needs standards mode],
957 [c_cv_have_strptime_standards],
963 #ifndef _ISOC99_SOURCE
964 # define _ISOC99_SOURCE 1
966 #ifndef _POSIX_C_SOURCE
967 # define _POSIX_C_SOURCE 200112L
969 #ifndef _XOPEN_SOURCE
970 # define _XOPEN_SOURCE 500
976 (void)strptime ("2010-12-30%13:42:42", "%Y-%m-%dT%T", &stm);
980 [c_cv_have_strptime_standards="yes"],
981 [c_cv_have_strptime_standards="no"]
986 if test "x$c_cv_have_strptime_standards" = "xyes"; then
987 AC_DEFINE([STRPTIME_NEEDS_STANDARDS], [1],
988 [Set to true if strptime is only exported in X/Open mode (GNU libc).]
995 if test "x$GCC" = "xyes"; then
996 CFLAGS="$SAVE_CFLAGS"
998 # }}} Check for strptime
1000 # Check for timegm {{{
1002 # These checks need -Werror because implicit function declarations are only a
1004 SAVE_CFLAGS="$CFLAGS"
1005 CFLAGS="$CFLAGS -Werror"
1007 AC_CACHE_CHECK([for timegm],
1012 #if STRPTIME_NEEDS_STANDARDS
1013 # ifndef _ISOC99_SOURCE
1014 # define _ISOC99_SOURCE 1
1016 # ifndef _POSIX_C_SOURCE
1017 # define _POSIX_C_SOURCE 200112L
1019 # ifndef _XOPEN_SOURCE
1020 # define _XOPEN_SOURCE 500
1026 time_t t = timegm(&(struct tm){0});
1027 if (t == ((time_t) -1)) {
1032 [c_cv_have_timegm="yes"],
1033 [c_cv_have_timegm="no"]
1037 if test "x$c_cv_have_timegm" != "xyes"
1039 AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
1040 [c_cv_have_timegm_bsd],
1044 #if STRPTIME_NEEDS_STANDARDS
1045 # ifndef _ISOC99_SOURCE
1046 # define _ISOC99_SOURCE 1
1048 # ifndef _POSIX_C_SOURCE
1049 # define _POSIX_C_SOURCE 200112L
1051 # ifndef _XOPEN_SOURCE
1052 # define _XOPEN_SOURCE 500
1056 # define _BSD_SOURCE 1
1061 time_t t = timegm(&(struct tm){0});
1062 if (t == ((time_t) -1)) {
1067 [c_cv_have_timegm_bsd="yes"
1068 c_cv_have_timegm="yes"],
1069 [c_cv_have_timegm_bsd="no"]
1074 if test "x$c_cv_have_timegm" = "xyes"
1076 AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
1077 if test "x$c_cv_have_timegm_bsd" = "xyes"
1079 AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
1083 CFLAGS="$SAVE_CFLAGS"
1084 # }}} Check for timegm
1086 AC_MSG_CHECKING([for sysctl kern.cp_times])
1087 if test -x /sbin/sysctl; then
1088 /sbin/sysctl kern.cp_times >/dev/null 2>&1
1089 if test $? -eq 0; then
1090 AC_MSG_RESULT([yes])
1091 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIMES], [1], [Define if sysctl supports kern.cp_times])
1099 AC_MSG_CHECKING([for sysctl kern.cp_time])
1100 if test -x /sbin/sysctl; then
1101 /sbin/sysctl kern.cp_time >/dev/null 2>&1
1104 AC_MSG_RESULT([yes])
1105 AC_DEFINE([HAVE_SYSCTL_KERN_CP_TIME], [1], [Define if sysctl supports kern.cp_time])
1113 AC_CHECK_FUNCS([swapctl], [have_swapctl="yes"], [have_swapctl="no"])
1114 if test "x$have_swapctl" = "xyes"; then
1115 AC_CACHE_CHECK([whether swapctl takes two arguments],
1116 [c_cv_have_swapctl_two_args],
1122 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1123 # undef _FILE_OFFSET_BITS
1124 # undef _LARGEFILE64_SOURCE
1126 #include <sys/stat.h>
1127 #include <sys/param.h>
1128 #include <sys/swap.h>
1131 [[int num = swapctl(0, NULL);]]
1134 [c_cv_have_swapctl_two_args="yes"],
1135 [c_cv_have_swapctl_two_args="no"]
1140 AC_CACHE_CHECK([whether swapctl takes three arguments],
1141 [c_cv_have_swapctl_three_args],
1147 #if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
1148 # undef _FILE_OFFSET_BITS
1149 # undef _LARGEFILE64_SOURCE
1151 #include <sys/stat.h>
1152 #include <sys/param.h>
1153 #include <sys/swap.h>
1156 [[int num = swapctl(0, NULL, 0);]]
1159 [c_cv_have_swapctl_three_args="yes"],
1160 [c_cv_have_swapctl_three_args="no"]
1166 # Check for different versions of `swapctl' here..
1167 if test "x$have_swapctl" = "xyes"; then
1168 if test "x$c_cv_have_swapctl_two_args" = "xyes"; then
1169 AC_DEFINE([HAVE_SWAPCTL_TWO_ARGS], [1], [Define if the function swapctl exists and takes two arguments.])
1172 if test "x$c_cv_have_swapctl_three_args" = "xyes"; then
1173 AC_DEFINE([HAVE_SWAPCTL_THREE_ARGS], [1], [Define if the function swapctl exists and takes three arguments.])
1178 AC_ARG_WITH([nan-emulation],
1179 [AS_HELP_STRING([--with-nan-emulation], [use emulated NAN. For crosscompiling only.])],
1181 if test "x$withval" = "xno"; then
1183 else if test "x$withval" = "xyes"; then
1192 if test "x$nan_type" = "xnone"; then
1193 AC_CACHE_CHECK([whether NAN is defined by default],
1194 [c_cv_have_nan_default],
1202 static double foo = NAN;
1211 [c_cv_have_nan_default="yes"],
1212 [c_cv_have_nan_default="no"]
1218 if test "x$c_cv_have_nan_default" = "xyes"; then
1222 if test "x$nan_type" = "xnone"; then
1223 AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
1224 [c_cv_have_nan_isoc],
1231 #define __USE_ISOC99 1
1233 static double foo = NAN;
1242 [c_cv_have_nan_isoc="yes"],
1243 [c_cv_have_nan_isoc="no"]
1249 if test "x$c_cv_have_nan_isoc" = "xyes"; then
1253 if test "x$nan_type" = "xnone"; then
1254 SAVE_LDFLAGS="$LDFLAGS"
1255 LDFLAGS="$LDFLAGS -lm"
1256 AC_CACHE_CHECK([whether NAN can be defined by 0/0],
1257 [c_cv_have_nan_zero],
1268 #define NAN (0.0 / 0.0)
1270 # define isnan(f) ((f) != (f))
1272 static double foo = NAN;
1281 [c_cv_have_nan_zero="yes"],
1282 [c_cv_have_nan_zero="no"]
1286 LDFLAGS=$SAVE_LDFLAGS
1289 if test "x$c_cv_have_nan_zero" = "xyes"; then
1293 if test "x$nan_type" = "xdefault"; then
1294 AC_DEFINE([NAN_STATIC_DEFAULT], [1],
1295 [Define if NAN is defined by default and can initialize static variables.]
1297 else if test "x$nan_type" = "xisoc99"; then
1298 AC_DEFINE([NAN_STATIC_ISOC], [1],
1299 [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.]
1301 else if test "x$nan_type" = "xzero"; then
1302 AC_DEFINE([NAN_ZERO_ZERO], [1],
1303 [Define if NAN can be defined as (0.0 / 0.0)]
1306 AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
1309 AC_ARG_WITH([fp-layout],
1311 AS_HELP_STRING([--with-fp-layout],
1312 [set the memory layout of doubles. For crosscompiling only.]
1316 if test "x$withval" = "xnothing"; then
1317 fp_layout_type="nothing"
1318 else if test "x$withval" = "xendianflip"; then
1319 fp_layout_type="endianflip"
1320 else if test "x$withval" = "xintswap"; then
1321 fp_layout_type="intswap"
1323 AC_MSG_ERROR([Invalid argument for --with-fp-layout. Valid arguments are: nothing, endianflip, intswap]);
1326 [fp_layout_type="unknown"]
1329 if test "x$fp_layout_type" = "xunknown"; then
1330 AC_CACHE_CHECK([if doubles are stored in x86 representation],
1331 [c_cv_fp_layout_need_nothing],
1341 #include <inttypes.h>
1342 #include <stdbool.h>
1351 memcpy ((void *) &i0, (void *) &d, 8);
1354 memcpy ((void *) c, (void *) &i1, 8);
1356 if ((c[0] == 0x2f) && (c[1] == 0x25)
1357 && (c[2] == 0xc0) && (c[3] == 0xc7)
1358 && (c[4] == 0x43) && (c[5] == 0x2b)
1359 && (c[6] == 0x1f) && (c[7] == 0x5b))
1365 [c_cv_fp_layout_need_nothing="yes"],
1366 [c_cv_fp_layout_need_nothing="no"]
1372 if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
1373 fp_layout_type="nothing"
1376 if test "x$fp_layout_type" = "xunknown"; then
1377 AC_CACHE_CHECK([if endianflip converts to x86 representation],
1378 [c_cv_fp_layout_need_endianflip],
1388 #include <inttypes.h>
1389 #include <stdbool.h>
1390 #define endianflip(A) ((((uint64_t)(A) & 0xff00000000000000LL) >> 56) | \
1391 (((uint64_t)(A) & 0x00ff000000000000LL) >> 40) | \
1392 (((uint64_t)(A) & 0x0000ff0000000000LL) >> 24) | \
1393 (((uint64_t)(A) & 0x000000ff00000000LL) >> 8) | \
1394 (((uint64_t)(A) & 0x00000000ff000000LL) << 8) | \
1395 (((uint64_t)(A) & 0x0000000000ff0000LL) << 24) | \
1396 (((uint64_t)(A) & 0x000000000000ff00LL) << 40) | \
1397 (((uint64_t)(A) & 0x00000000000000ffLL) << 56))
1406 memcpy ((void *) &i0, (void *) &d, 8);
1408 i1 = endianflip (i0);
1409 memcpy ((void *) c, (void *) &i1, 8);
1411 if ((c[0] == 0x2f) && (c[1] == 0x25)
1412 && (c[2] == 0xc0) && (c[3] == 0xc7)
1413 && (c[4] == 0x43) && (c[5] == 0x2b)
1414 && (c[6] == 0x1f) && (c[7] == 0x5b))
1420 [c_cv_fp_layout_need_endianflip="yes"],
1421 [c_cv_fp_layout_need_endianflip="no"]
1427 if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
1428 fp_layout_type="endianflip"
1431 if test "x$fp_layout_type" = "xunknown"; then
1432 AC_CACHE_CHECK([if intswap converts to x86 representation],
1433 [c_cv_fp_layout_need_intswap],
1443 #include <inttypes.h>
1444 #include <stdbool.h>
1445 #define intswap(A) ((((uint64_t)(A) & 0xffffffff00000000LL) >> 32) | \
1446 (((uint64_t)(A) & 0x00000000ffffffffLL) << 32))
1455 memcpy ((void *) &i0, (void *) &d, 8);
1458 memcpy ((void *) c, (void *) &i1, 8);
1460 if ((c[0] == 0x2f) && (c[1] == 0x25)
1461 && (c[2] == 0xc0) && (c[3] == 0xc7)
1462 && (c[4] == 0x43) && (c[5] == 0x2b)
1463 && (c[6] == 0x1f) && (c[7] == 0x5b))
1469 [c_cv_fp_layout_need_intswap="yes"],
1470 [c_cv_fp_layout_need_intswap="no"]
1476 if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
1477 fp_layout_type="intswap"
1480 if test "x$fp_layout_type" = "xnothing"; then
1481 AC_DEFINE([FP_LAYOUT_NEED_NOTHING], [1],
1482 [Define if doubles are stored in x86 representation.]
1484 else if test "x$fp_layout_type" = "xendianflip"; then
1485 AC_DEFINE([FP_LAYOUT_NEED_ENDIANFLIP], [1],
1486 [Define if endianflip is needed to convert to x86 representation.]
1488 else if test "x$fp_layout_type" = "xintswap"; then
1489 AC_DEFINE([FP_LAYOUT_NEED_INTSWAP], [1],
1490 [Define if intswap is needed to convert to x86 representation.]
1493 AC_MSG_ERROR([Didn't find out how doubles are stored in memory. Sorry.])
1496 # For cpusleep plugin
1497 AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
1498 [c_cv_have_clock_boottime_monotonic],
1502 [[#include <time.h>]],
1504 struct timespec b, m;
1505 clock_gettime(CLOCK_BOOTTIME, &b );
1506 clock_gettime(CLOCK_MONOTONIC, &m );
1510 [c_cv_have_clock_boottime_monotonic="yes"],
1511 [c_cv_have_clock_boottime_monotonic="no"]
1516 # --with-useragent {{{
1517 AC_ARG_WITH([useragent],
1518 [AS_HELP_STRING([--with-useragent@<:@=AGENT@:>@], [User agent to use on http requests])],
1520 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
1521 AC_DEFINE_UNQUOTED([COLLECTD_USERAGENT], ["$withval"], [User agent for http requests])
1528 # --with-data-max-name-len {{{
1529 AC_ARG_WITH([data-max-name-len],
1530 [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
1532 if test "x$withval" != "x" && test $withval -gt 0; then
1533 AC_DEFINE_UNQUOTED([DATA_MAX_NAME_LEN], [$withval], [Maximum length of data buffers])
1535 AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
1538 [AC_DEFINE([DATA_MAX_NAME_LEN], [128], [Maximum length of data buffers])]
1542 AC_CHECK_FUNCS([getfsstat], [have_getfsstat="yes"], [have_getfsstat="no"])
1543 AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"], [have_getvfsstat="no"])
1544 AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"], [have_listmntent="no"])
1545 AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"], [have_getmntent_r="no"])
1547 AC_CHECK_FUNCS(getmntent, [have_getmntent="libc"], [have_getmntent="no"])
1548 if test "x$have_getmntent" = "xno"; then
1549 AC_CHECK_LIB([sun], [getmntent],
1550 [have_getmntent="sun"],
1551 [have_gemntent="no"]
1555 if test "x$have_getmntent" = "xno"; then
1556 AC_CHECK_LIB([seq], [getmntent],
1557 [have_getmntent="seq"],
1558 [have_getmntent="no"]
1562 if test "x$have_getmntent" = "xno"; then
1563 AC_CHECK_LIB([gen], [getmntent],
1564 [have_getmntent="gen"],
1565 [have_getmntent="no"]
1569 if test "x$have_getmntent" = "xlibc"; then
1570 AC_CACHE_CHECK([whether getmntent takes one argument],
1571 [c_cv_have_one_getmntent],
1576 [[#include "$srcdir/src/utils/mount/mount.h"]],
1580 fh = setmntent ("/etc/mtab", "r");
1581 me = getmntent (fh);
1582 return me->mnt_passno;
1586 [c_cv_have_one_getmntent="yes"],
1587 [c_cv_have_one_getmntent="no"]
1592 AC_CACHE_CHECK([whether getmntent takes two arguments],
1593 [c_cv_have_two_getmntent],
1598 [[#include "$srcdir/src/utils/mount/mount.h"]],
1603 fh = fopen ("/etc/mnttab", "r");
1604 status = getmntent (fh, &mt);
1609 [c_cv_have_two_getmntent="yes"],
1610 [c_cv_have_two_getmntent="no"]
1616 # Check for different versions of `getmntent' here..
1618 if test "x$have_getmntent" = "xlibc"; then
1619 if test "x$c_cv_have_one_getmntent" = "xyes"; then
1620 AC_DEFINE([HAVE_ONE_GETMNTENT], [1],
1621 [Define if the function getmntent exists and takes one argument.]
1625 if test "x$c_cv_have_two_getmntent" = "xyes"; then
1626 AC_DEFINE([HAVE_TWO_GETMNTENT], [1],
1627 [Define if the function getmntent exists and takes two arguments.]
1632 if test "x$have_getmntent" = "xsun"; then
1633 AC_DEFINE([HAVE_SUN_GETMNTENT], [1],
1634 [Define if the function getmntent exists. It is the version from libsun.]
1638 if test "x$have_getmntent" = "xgen"; then
1639 AC_DEFINE([HAVE_GEN_GETMNTENT], [1],
1640 [Define if the function getmntent exists. It is the version from libgen.]
1645 AC_CACHE_CHECK([whether htonll is defined],
1652 #include <inttypes.h>
1653 #include <sys/types.h>
1654 #include <netinet/in.h>
1656 [[return htonll(0);]]
1659 [c_cv_have_htonll="yes"],
1660 [c_cv_have_htonll="no"]
1665 if test "x$c_cv_have_htonll" = "xyes"; then
1666 AC_DEFINE([HAVE_HTONLL], [1], [Define if the function htonll exists.])
1669 # Check for structures
1670 AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
1671 [AC_DEFINE([HAVE_STRUCT_IF_DATA], [1], [Define if struct if_data exists and is usable.])],
1674 #include <sys/types.h>
1675 #include <sys/socket.h>
1680 AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_packets, struct net_device_stats.rx_errors],
1681 [AC_DEFINE([HAVE_STRUCT_NET_DEVICE_STATS], [1], [Define if struct net_device_stats exists and is usable.])],
1684 #include <sys/types.h>
1685 #include <sys/socket.h>
1686 #include <linux/if.h>
1687 #include <linux/netdevice.h>
1691 AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
1692 [AC_DEFINE([HAVE_STRUCT_LINUX_INET_DIAG_REQ], [1], [Define if struct inet_diag_req exists and is usable.])],
1694 [[#include <linux/inet_diag.h>]]
1697 AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
1700 #include <netinet/in.h>
1705 AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage],
1707 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_FREEBSD], [1], [Define if struct kinfo_proc exists in the FreeBSD variant.])
1708 have_struct_kinfo_proc_freebsd="yes"
1713 #include <sys/param.h>
1714 #include <sys/sysctl.h>
1715 #include <sys/user.h>
1719 AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
1721 AC_DEFINE([HAVE_STRUCT_KINFO_PROC_OPENBSD], [1], [Define if struct kinfo_proc exists in the OpenBSD variant.])
1722 have_struct_kinfo_proc_openbsd="yes"
1726 #include <sys/param.h>
1727 #include <sys/sysctl.h>
1732 AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
1734 AC_DEFINE([HAVE_STRUCT_KINFO_PROC2_NETBSD], [1], [Define if struct kinfo_proc2 exists in the NetBSD variant.])
1735 have_struct_kinfo_proc2_netbsd="yes"
1739 #include <sys/param.h>
1740 #include <sys/sysctl.h>
1745 AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport],
1750 #define _DEFAULT_SOURCE
1752 #if HAVE_SYS_TYPES_H
1753 # include <sys/types.h>
1755 #if HAVE_NETINET_IN_SYSTM_H
1756 # include <netinet/in_systm.h>
1758 #if HAVE_NETINET_IN_H
1759 # include <netinet/in.h>
1761 #if HAVE_NETINET_IP_H
1762 # include <netinet/ip.h>
1764 #if HAVE_NETINET_UDP_H
1765 # include <netinet/udp.h>
1770 AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source],
1775 #define _DEFAULT_SOURCE
1777 #if HAVE_SYS_TYPES_H
1778 # include <sys/types.h>
1780 #if HAVE_NETINET_IN_SYSTM_H
1781 # include <netinet/in_systm.h>
1783 #if HAVE_NETINET_IN_H
1784 # include <netinet/in.h>
1786 #if HAVE_NETINET_IP_H
1787 # include <netinet/ip.h>
1789 #if HAVE_NETINET_UDP_H
1790 # include <netinet/udp.h>
1795 AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, kstat_io_t.wtime],
1798 [[# include <kstat.h>]]
1801 # check for pthread_setname_np
1802 SAVE_LDFLAGS="$LDFLAGS"
1803 LDFLAGS="$LDFLAGS -lpthread"
1805 AC_MSG_CHECKING([for pthread_setname_np])
1806 have_pthread_setname_np="no"
1812 #include <pthread.h>
1814 [[pthread_setname_np((pthread_t) {0}, "conftest");]]
1818 have_pthread_setname_np="yes"
1819 AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
1823 AC_MSG_RESULT([$have_pthread_setname_np])
1825 # check for pthread_set_name_np(3) (FreeBSD)
1826 AC_MSG_CHECKING([for pthread_set_name_np])
1827 have_pthread_set_name_np="no"
1831 [[#include <pthread_np.h>]],
1832 [[pthread_set_name_np((pthread_t) {0}, "conftest");]]
1836 have_pthread_set_name_np="yes"
1837 AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
1840 AC_MSG_RESULT([$have_pthread_set_name_np])
1842 LDFLAGS="$SAVE_LDFLAGS"
1844 AC_CHECK_TYPES([struct ip6_ext],
1845 [have_ip6_ext="yes"],
1846 [have_ip6_ext="no"],
1849 #if HAVE_SYS_TYPES_H
1850 # include <sys/types.h>
1852 #if HAVE_NETINET_IN_SYSTM_H
1853 # include <netinet/in_systm.h>
1855 #if HAVE_NETINET_IN_H
1856 # include <netinet/in.h>
1858 #if HAVE_NETINET_IP6_H
1859 # include <netinet/ip6.h>
1864 if test "x$have_ip6_ext" = "xno"; then
1865 SAVE_CFLAGS="$CFLAGS"
1866 CFLAGS="$CFLAGS -DSOLARIS2=8"
1867 AC_CHECK_TYPES([struct ip6_ext],
1868 [have_ip6_ext="yes, with -DSOLARIS2=8"],
1869 [have_ip6_ext="no"],
1872 #if HAVE_SYS_TYPES_H
1873 # include <sys/types.h>
1875 #if HAVE_NETINET_IN_SYSTM_H
1876 # include <netinet/in_systm.h>
1878 #if HAVE_NETINET_IN_H
1879 # include <netinet/in.h>
1881 #if HAVE_NETINET_IP6_H
1882 # include <netinet/ip6.h>
1886 if test "x$have_ip6_ext" = "xno"; then
1887 CFLAGS="$SAVE_CFLAGS"
1892 if test "x$ac_system" = "xLinux"; then
1894 AC_CHECK_HEADERS([i2c/smbus.h],
1895 [with_libi2c_libs="-li2c"]
1897 AC_CHECK_DECL([i2c_smbus_read_i2c_block_data],
1898 [with_libi2c="yes"],
1899 [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
1902 #include <linux/i2c-dev.h>
1903 #if HAVE_I2C_SMBUS_H
1904 # include <i2c/smbus.h>
1908 BUILD_WITH_LIBI2C_LIBS="$with_libi2c_libs"
1909 AC_SUBST([BUILD_WITH_LIBI2C_LIBS])
1911 with_libi2c="no (Linux only)"
1915 # Checks for libraries begin here
1918 # Check for libpthread
1920 AC_CHECK_LIB([pthread],
1923 [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread])],
1926 PTHREAD_LIBS="$LIBS"
1928 AC_SUBST([PTHREAD_LIBS])
1930 AC_CHECK_HEADERS([pthread.h],
1932 [AC_MSG_ERROR([pthread.h not found])]
1935 m4_divert_once([HELP_WITH], [
1936 Collectd additional packages:])
1938 if test "x$ac_system" = "xAIX"; then
1942 with_perfstat="no (AIX only)"
1943 with_procinfo="no (AIX only)"
1946 if test "x$with_perfstat" = "xyes"; then
1947 AC_CHECK_LIB([perfstat], [perfstat_reset],
1948 [with_perfstat="yes"],
1949 [with_perfstat="no (perfstat not found)"]
1953 if test "x$with_perfstat" = "xyes"; then
1954 AC_DEFINE([HAVE_PERFSTAT], [1], [Define to 1 if you have the 'perfstat' library (-lperfstat)])
1955 # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
1956 AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled],
1959 [[#include <libperfstat.h]]
1961 if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"; then
1962 AC_DEFINE([PERFSTAT_SUPPORTS_DONATION], [1], [Define to 1 if your version of the 'perfstat' library supports donation])
1965 AM_CONDITIONAL([BUILD_WITH_PERFSTAT], [test "x$with_perfstat" = "xyes"])
1967 # Processes plugin under AIX.
1968 if test "x$with_procinfo" = "xyes"; then
1969 AC_CHECK_HEADERS([procinfo.h],
1970 [AC_DEFINE([HAVE_PROCINFO_H], [1], [Define to 1 if you have the procinfo.h])],
1971 [with_procinfo="no (procinfo.h not found)"]
1975 if test "x$ac_system" = "xSolaris"; then
1979 with_kstat="no (Solaris only)"
1980 with_devinfo="no (Solaris only)"
1983 if test "x$with_kstat" = "xyes"; then
1984 AC_CHECK_LIB([kstat], [kstat_open],
1986 [with_kstat="no (libkstat not found)"]
1990 if test "x$with_kstat" = "xyes"; then
1991 AC_CHECK_LIB([devinfo], [di_init],
1992 [with_devinfo="yes"],
1993 [with_devinfo="no (not found)"]
1995 AC_CHECK_HEADERS([kstat.h],
1996 [AC_DEFINE(HAVE_LIBKSTAT, [1], [Define to 1 if you have the 'kstat' library (-lkstat)])],
1997 [with_kstat="no (kstat.h not found)"]
2001 AM_CONDITIONAL([BUILD_WITH_LIBDEVINFO], [test "x$with_devinfo" = "xyes"])
2002 AM_CONDITIONAL([BUILD_WITH_LIBKSTAT], [test "x$with_kstat" = "xyes"])
2004 if test "x$ac_system" = "xDarwin"; then
2009 AM_CONDITIONAL([BUILD_WITH_LIBIOKIT], [test "x$with_libiokit" = "xyes"])
2012 AC_CHECK_LIB([kvm], [kvm_getprocs],
2013 [with_kvm_getprocs="yes"],
2014 [with_kvm_getprocs="no"]
2017 if test "x$with_kvm_getprocs" = "xyes"; then
2018 AC_DEFINE([HAVE_LIBKVM_GETPROCS], [1],
2019 [Define to 1 if you have the 'kvm' library with the 'kvm_getprocs' symbol (-lkvm)]
2024 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETPROCS], [test "x$with_kvm_getprocs" = "xyes"])
2026 AC_CHECK_LIB([kvm], [kvm_getswapinfo],
2027 [with_kvm_getswapinfo="yes"],
2028 [with_kvm_getswapinfo="no"]
2031 if test "x$with_kvm_getswapinfo" = "xyes"; then
2032 AC_DEFINE([HAVE_LIBKVM_GETSWAPINFO], [1],
2033 [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)]
2038 AM_CONDITIONAL([BUILD_WITH_LIBKVM_GETSWAPINFO], [test "x$with_kvm_getswapinfo" = "xyes"])
2040 AC_CHECK_LIB([kvm], [kvm_nlist],
2041 [with_kvm_nlist="yes"],
2042 [with_kvm_nlist="no"]
2045 if test "x$with_kvm_nlist" = "xyes"; then
2046 AC_CHECK_HEADERS([bsd/nlist.h nlist.h])
2047 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2048 [Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)]
2053 AM_CONDITIONAL([BUILD_WITH_LIBKVM_NLIST], [test "x$with_kvm_nlist" = "xyes"])
2055 AC_CHECK_LIB([kvm], [kvm_openfiles],
2056 [with_kvm_openfiles="yes"],
2057 [with_kvm_openfiles="no"]
2060 if test "x$with_kvm_openfiles" = "xyes"; then
2061 AC_DEFINE([HAVE_LIBKVM_NLIST], [1],
2062 [Define to 1 if you have the 'kvm' library with the 'kvm_openfiles' symbol (-lkvm)]
2069 [AS_HELP_STRING([--with-cuda@<:@=PREFIX@:>@], [Path to cuda.])],
2071 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2072 with_cuda_cppflags="-I$withval/include"
2073 with_cuda_ldflags="-I$withval/lib"
2076 with_cuda="$withval"
2082 if test "x$with_cuda" = "xyes"; then
2083 SAVE_CPPFLAGS="$CPPFLAGS"
2084 CPPFLAGS="$CPPFLAGS $with_cuda_cppflags"
2086 AC_CHECK_HEADERS([nvml.h],
2088 [with_cuda="no (nvml.h not found)"]
2091 CPPFLAGS="$SAVE_CPPFLAGS"
2094 if test "x$with_cuda" = "xyes"; then
2095 BUILD_WITH_CUDA_CPPFLAGS="$CUDA_CPPFLAGS"
2096 BUILD_WITH_CUDA_LDFLAGS="$CUDA_LDFLAGS"
2097 BUILD_WITH_CUDA_LIBS="-lnvidia-ml"
2100 AC_SUBST([BUILD_WITH_CUDA_CPPFLAGS])
2101 AC_SUBST([BUILD_WITH_CUDA_LDFLAGS])
2102 AC_SUBST([BUILD_WITH_CUDA_LIBS])
2106 # --with-libaquaero5 {{{
2107 AC_ARG_WITH([libaquaero5],
2108 [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])],
2110 if test "x$withval" = "xyes"; then
2111 with_libaquaero5="yes"
2112 else if test "x$withval" = "xno"; then
2113 with_libaquaero5="no"
2115 with_libaquaero5="yes"
2116 LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS -I$withval/src"
2117 LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS -L$withval/obj"
2120 [with_libaquaero5="yes"]
2123 SAVE_CPPFLAGS="$CPPFLAGS"
2124 SAVE_LDFLAGS="$LDFLAGS"
2125 CPPFLAGS="$CPPFLAGS $LIBAQUAERO5_CFLAGS"
2126 LDFLAGS="$LDFLAGS $LIBAQUAERO5_LDFLAGS"
2128 if test "x$with_libaquaero5" = "xyes"; then
2129 AC_CHECK_HEADERS([libaquaero5.h],
2130 [with_libaquaero5="yes"],
2131 [with_libaquaero5="no (libaquaero5.h not found)"]
2135 if test "x$with_libaquaero5" = "xyes"; then
2136 AC_CHECK_LIB([aquaero5], libaquaero5_poll,
2137 [with_libaquaero5="yes"],
2138 [with_libaquaero5="no (symbol 'libaquaero5_poll' not found)"]
2142 CPPFLAGS="$SAVE_CPPFLAGS"
2143 LDFLAGS="$SAVE_LDFLAGS"
2145 if test "x$with_libaquaero5" = "xyes"; then
2146 BUILD_WITH_LIBAQUAERO5_CFLAGS="$LIBAQUAERO5_CFLAGS"
2147 BUILD_WITH_LIBAQUAERO5_LDFLAGS="$LIBAQUAERO5_LDFLAGS"
2149 AC_SUBST([BUILD_WITH_LIBAQUAERO5_CFLAGS])
2150 AC_SUBST([BUILD_WITH_LIBAQUAERO5_LDFLAGS])
2153 # --with-libhiredis {{{
2154 AC_ARG_WITH([libhiredis],
2155 [AS_HELP_STRING([--with-libhiredis@<:@=PREFIX@:>@], [Path to libhiredis.])],
2157 if test "x$withval" = "xyes"; then
2158 with_libhiredis="yes"
2159 else if test "x$withval" = "xno"; then
2160 with_libhiredis="no"
2162 with_libhiredis="yes"
2163 LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS -I$withval/include"
2164 LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS -L$withval/lib"
2167 [with_libhiredis="yes"]
2170 SAVE_CPPFLAGS="$CPPFLAGS"
2171 SAVE_LDFLAGS="$LDFLAGS"
2172 CPPFLAGS="$CPPFLAGS $LIBHIREDIS_CPPFLAGS"
2173 LDFLAGS="$LDFLAGS $LIBHIREDIS_LDFLAGS"
2175 if test "x$with_libhiredis" = "xyes"; then
2176 AC_CHECK_HEADERS([hiredis/hiredis.h],
2177 [with_libhiredis="yes"],
2178 [with_libhiredis="no (hiredis.h not found)"]
2182 if test "x$with_libhiredis" = "xyes"; then
2183 AC_CHECK_LIB([hiredis], [redisCommand],
2184 [with_libhiredis="yes"],
2185 [with_libhiredis="no (symbol 'redisCommand' not found)"]
2189 CPPFLAGS="$SAVE_CPPFLAGS"
2190 LDFLAGS="$SAVE_LDFLAGS"
2192 if test "x$with_libhiredis" = "xyes"; then
2193 BUILD_WITH_LIBHIREDIS_CPPFLAGS="$LIBHIREDIS_CPPFLAGS"
2194 BUILD_WITH_LIBHIREDIS_LDFLAGS="$LIBHIREDIS_LDFLAGS"
2197 AC_SUBST([BUILD_WITH_LIBHIREDIS_CPPFLAGS])
2198 AC_SUBST([BUILD_WITH_LIBHIREDIS_LDFLAGS])
2201 # --with-libcurl {{{
2202 with_curl_config="curl-config"
2205 AC_ARG_WITH(libcurl,
2206 [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
2208 if test "x$withval" = "xno"; then
2210 else if test "x$withval" = "xyes"; then
2213 if test -f "$withval" && test -x "$withval"; then
2214 with_curl_config="$withval"
2216 else if test -x "$withval/bin/curl-config"; then
2217 with_curl_config="$withval/bin/curl-config"
2223 [with_libcurl="yes"]
2226 if test "x$with_libcurl" = "xyes"; then
2227 with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
2228 curl_config_status=$?
2230 if test $curl_config_status -ne 0; then
2231 with_libcurl="no ($with_curl_config failed)"
2233 SAVE_CPPFLAGS="$CPPFLAGS"
2234 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2236 AC_CHECK_HEADERS([curl/curl.h],
2237 [with_libcurl="yes"],
2238 [with_libcurl="no (curl/curl.h not found)"]
2241 CPPFLAGS="$SAVE_CPPFLAGS"
2245 if test "x$with_libcurl" = "xyes"; then
2246 with_curl_libs=`$with_curl_config --libs 2>/dev/null`
2247 curl_config_status=$?
2249 if test $curl_config_status -ne 0; then
2250 with_libcurl="no ($with_curl_config failed)"
2252 AC_CHECK_LIB([curl], [curl_easy_init],
2253 [with_libcurl="yes"],
2254 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
2258 AC_CHECK_DECL([CURLOPT_USERNAME],
2259 [have_curlopt_username="yes"],
2260 [have_curlopt_username="no"],
2261 [[#include <curl/curl.h>]]
2264 AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
2265 [have_curlopt_timeout="yes"],
2266 [have_curlopt_timeout="no"],
2267 [[#include <curl/curl.h>]]
2272 if test "x$with_libcurl" = "xyes"; then
2273 SAVE_CPPFLAGS="$CPPFLAGS"
2274 SAVE_LDFLAGS="$LDFLAGS"
2275 CPPFLAGS="$CPPFLAGS $with_curl_cflags"
2276 LDFLAGS="$LDFLAGS $with_curl_libs"
2277 AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
2278 [c_cv_have_curlinfo_appconnect_time],
2283 [[#include <curl/curl.h>]],
2285 int val = CURLINFO_APPCONNECT_TIME;
2290 [c_cv_have_curlinfo_appconnect_time="yes"],
2291 [c_cv_have_curlinfo_appconnect_time="no"]
2295 CPPFLAGS="$SAVE_CPPFLAGS"
2296 LDFLAGS="$SAVE_LDFLAGS"
2299 if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"; then
2300 AC_DEFINE([HAVE_CURLINFO_APPCONNECT_TIME], [1],
2301 [Define if curl.h defines CURLINFO_APPCONNECT_TIME.]
2305 if test "x$with_libcurl" = "xyes"; then
2306 BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
2307 BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
2309 if test "x$have_curlopt_username" = "xyes"; then
2310 AC_DEFINE([HAVE_CURLOPT_USERNAME], [1],
2311 [Define if libcurl supports CURLOPT_USERNAME option.]
2315 if test "x$have_curlopt_timeout" = "xyes"; then
2316 AC_DEFINE([HAVE_CURLOPT_TIMEOUT_MS], [1],
2317 [Define if libcurl supports CURLOPT_TIMEOUT_MS option.]
2322 AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
2323 AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
2325 AM_CONDITIONAL([BUILD_WITH_LIBCURL], [test "x$with_libcurl" = "xyes"])
2329 AC_ARG_WITH([libdbi],
2330 [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
2332 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2333 with_libdbi_cppflags="-I$withval/include"
2334 with_libdbi_ldflags="-L$withval/lib"
2337 with_libdbi="$withval"
2343 if test "x$with_libdbi" = "xyes"; then
2344 SAVE_CPPFLAGS="$CPPFLAGS"
2345 CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
2347 AC_CHECK_HEADERS([dbi/dbi.h],
2348 [with_libdbi="yes"],
2349 [with_libdbi="no (dbi/dbi.h not found)"]
2352 CPPFLAGS="$SAVE_CPPFLAGS"
2355 if test "x$with_libdbi" = "xyes"; then
2356 SAVE_LDFLAGS="$LDFLAGS"
2357 LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
2359 AC_CHECK_LIB([dbi], [dbi_initialize],
2360 [with_libdbi="yes"],
2361 [with_libdbi="no (Symbol 'dbi_initialize' not found)"]
2364 LDFLAGS="$SAVE_LDFLAGS"
2367 BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
2368 BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
2369 BUILD_WITH_LIBDBI_LIBS="-ldbi"
2370 AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
2371 AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
2372 AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
2375 # --with-libdpdk {{{
2376 AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
2377 AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
2378 AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
2379 AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
2381 AC_ARG_WITH([libdpdk],
2382 [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
2383 [with_libdpdk="$withval"],
2384 [with_libdpdk="yes"]
2387 if test "x$with_libdpdk" != "xno"; then
2388 PKG_CHECK_MODULES([DPDK], [libdpdk], [],
2389 [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
2390 if test "x$LIBDPDK_CPPFLAGS" = "x"; then
2391 LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
2393 if test "x$LIBDPDK_CFLAGS" = "x"; then
2394 LIBDPDK_CFLAGS="$DPDK_CFLAGS"
2395 LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
2397 if test "x$LIBDPDK_LIBS" = "x"; then
2398 if test "x$DPDK_LIBS" != "x"; then
2399 LIBDPDK_LIBS="$DPDK_LIBS"
2401 LIBDPDK_LIBS="-ldpdk"
2404 SAVE_CPPFLAGS="$CPPFLAGS"
2405 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2406 SAVE_CFLAGS="$CFLAGS"
2407 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2408 AC_CHECK_HEADERS([rte_config.h],
2415 #include <rte_version.h>
2416 #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
2417 #error "required DPDK >= 16.07"
2422 [dpdk_keepalive="yes"],
2423 [dpdk_keepalive="no (DPDK version < 16.07)"]
2426 [with_libdpdk="no (rte_config.h not found)"]
2428 CPPFLAGS="$SAVE_CPPFLAGS"
2429 CFLAGS="$SAVE_CFLAGS"
2432 if test "x$with_libdpdk" = "xyes"; then
2434 LIBS="$LIBDPDK_LIBS $LIBS"
2435 SAVE_LDFLAGS="$LDFLAGS"
2436 LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
2437 SAVE_CPPFLAGS="$CPPFLAGS"
2438 CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
2439 SAVE_CFLAGS="$CFLAGS"
2440 CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
2445 #include <rte_eal.h>
2447 [[return rte_eal_init(0, NULL);]]
2450 [with_libdpdk="yes"],
2451 [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
2454 LDFLAGS="$SAVE_LDFLAGS"
2455 CPPFLAGS="$SAVE_CPPFLAGS"
2456 CFLAGS="$SAVE_CFLAGS"
2461 # --with-libesmtp {{{
2462 AC_ARG_WITH([libesmtp],
2463 [AS_HELP_STRING([--with-libesmtp@<:@=PREFIX@:>@], [Path to libesmtp.])],
2465 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2466 with_libesmtp_cppflags="-I$withval/include"
2467 with_libesmtp_ldflags="-L$withval/lib"
2470 with_libesmtp="$withval"
2473 [with_libesmtp="yes"]
2476 if test "x$with_libesmtp" = "xyes"; then
2477 SAVE_CPPFLAGS="$CPPFLAGS"
2478 CPPFLAGS="$CPPFLAGS $with_libesmtp_cppflags"
2480 AC_CHECK_HEADERS([libesmtp.h],
2481 [with_libesmtp="yes"],
2482 [with_libesmtp="no (libesmtp.h not found)"]
2485 CPPFLAGS="$SAVE_CPPFLAGS"
2488 if test "x$with_libesmtp" = "xyes"; then
2489 SAVE_LDFLAGS="$LDFLAGS"
2490 LDFLAGS="$LDFLAGS $with_esmtp_ldflags"
2492 AC_CHECK_LIB([esmtp], [smtp_create_session],
2493 [with_libesmtp="yes"],
2494 [with_libesmtp="no (Symbol 'smtp_create_session' not found)"]
2497 LDFLAGS="$SAVE_LDFLAGS"
2500 BUILD_WITH_LIBESMTP_CPPFLAGS="$with_libesmtp_cppflags"
2501 BUILD_WITH_LIBESMTP_LDFLAGS="$with_libesmtp_ldflags"
2502 BUILD_WITH_LIBESMTP_LIBS="-lesmtp"
2503 AC_SUBST(BUILD_WITH_LIBESMTP_CPPFLAGS)
2504 AC_SUBST(BUILD_WITH_LIBESMTP_LDFLAGS)
2505 AC_SUBST(BUILD_WITH_LIBESMTP_LIBS)
2508 # --with-libganglia {{{
2509 AC_ARG_WITH([libganglia],
2510 [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Path to libganglia.])],
2512 if test -f "$withval" && test -x "$withval"; then
2513 with_libganglia_config="$withval"
2514 with_libganglia="yes"
2515 else if test -f "$withval/bin/ganglia-config" && test -x "$withval/bin/ganglia-config"; then
2516 with_libganglia_config="$withval/bin/ganglia-config"
2517 with_libganglia="yes"
2518 else if test -d "$withval"; then
2519 GANGLIA_CPPFLAGS="-I$withval/include"
2520 GANGLIA_LDFLAGS="-L$withval/lib"
2521 with_libganglia="yes"
2523 with_libganglia="$withval"
2526 [with_libganglia="yes"]
2529 if test "x$with_libganglia" = "xyes"; then
2530 if test "x$with_libganglia_config" != "x"; then
2531 if test "x$GANGLIA_CPPFLAGS" = "x"; then
2532 GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
2535 if test "x$GANGLIA_LDFLAGS" = "x"; then
2536 GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
2539 if test "x$GANGLIA_LIBS" = "x"; then
2540 GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
2543 GANGLIA_LIBS="-lganglia"
2547 SAVE_CPPFLAGS="$CPPFLAGS"
2548 SAVE_LDFLAGS="$LDFLAGS"
2549 CPPFLAGS="$CPPFLAGS $GANGLIA_CPPFLAGS"
2550 LDFLAGS="$LDFLAGS $GANGLIA_LDFLAGS"
2552 if test "x$with_libganglia" = "xyes"; then
2553 AC_CHECK_HEADERS([gm_protocol.h],
2554 [with_libganglia="yes"],
2555 [with_libganglia="no (gm_protocol.h not found)"]
2559 if test "x$with_libganglia" = "xyes"; then
2560 AC_CHECK_LIB([ganglia], [xdr_Ganglia_value_msg],
2561 [with_libganglia="yes"],
2562 [with_libganglia="no (symbol xdr_Ganglia_value_msg not found)"]
2566 CPPFLAGS="$SAVE_CPPFLAGS"
2567 LDFLAGS="$SAVE_LDFLAGS"
2569 AC_SUBST(GANGLIA_CPPFLAGS)
2570 AC_SUBST(GANGLIA_LDFLAGS)
2571 AC_SUBST(GANGLIA_LIBS)
2574 # --with-libgcrypt {{{
2575 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS"
2576 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS"
2577 GCRYPT_LIBS="$GCRYPT_LIBS"
2578 AC_ARG_WITH([libgcrypt],
2579 [AS_HELP_STRING([--with-libgcrypt@<:@=PREFIX@:>@], [Path to libgcrypt.])],
2581 if test -f "$withval" && test -x "$withval"; then
2582 with_libgcrypt_config="$withval"
2583 with_libgcrypt="yes"
2584 else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"; then
2585 with_libgcrypt_config="$withval/bin/gcrypt-config"
2586 with_libgcrypt="yes"
2587 else if test -d "$withval"; then
2588 GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
2589 GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
2590 with_libgcrypt="yes"
2592 with_libgcrypt_config="gcrypt-config"
2593 with_libgcrypt="$withval"
2597 with_libgcrypt_config="libgcrypt-config"
2598 with_libgcrypt="yes"
2602 if test "x$with_libgcrypt" = "xyes" && test "x$with_libgcrypt_config" != "x"; then
2603 if test "x$GCRYPT_CPPFLAGS" = "x"; then
2604 GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
2607 if test "x$GCRYPT_LIBS" = "x"; then
2608 GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
2612 SAVE_CPPFLAGS="$CPPFLAGS"
2613 SAVE_LDFLAGS="$LDFLAGS"
2615 CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
2616 LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
2617 LIBS="$LIBS $GCRYPT_LIBS"
2619 if test "x$with_libgcrypt" = "xyes"; then
2620 AC_CHECK_HEADERS([gcrypt.h],
2621 [with_libgcrypt="yes"],
2622 [with_libgcrypt="no (gcrypt.h not found)"]
2626 if test "x$with_libgcrypt" = "xyes"; then
2627 AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
2628 [with_libgcrypt="yes"],
2629 [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"]
2633 CPPFLAGS="$SAVE_CPPFLAGS"
2634 LDFLAGS="$SAVE_LDFLAGS"
2637 AC_SUBST([GCRYPT_CPPFLAGS])
2638 AC_SUBST([GCRYPT_LDFLAGS])
2639 AC_SUBST([GCRYPT_LIBS])
2640 AM_CONDITIONAL([BUILD_WITH_LIBGCRYPT], [test "x$with_libgcrypt" = "xyes"])
2644 AC_ARG_WITH([libgps],
2645 [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
2647 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2648 with_libgps_cflags="-I$withval/include"
2649 with_libgps_ldflags="-L$withval/lib"
2652 with_libgps="$withval"
2658 if test "x$with_libgps" = "xyes"; then
2659 SAVE_CFLAGS="$CFLAGS"
2660 CFLAGS="$CFLAGS $with_libgps_cflags"
2662 AC_CHECK_HEADERS([gps.h],
2663 [with_libgps="yes"],
2664 [with_libgps="no (gps.h not found)"]
2667 CFLAGS="$SAVE_CFLAGS"
2670 if test "x$with_libgps" = "xyes"; then
2671 SAVE_LDFLAGS="$LDFLAGS"
2672 LDFLAGS="$LDFLAGS $with_libgps_ldflags"
2674 AC_CHECK_LIB([gps], [gps_open],
2675 [with_libgps="yes"],
2676 [with_libgps="no (symbol gps_open not found)"]
2679 LDFLAGS="$SAVE_LDFLAGS"
2682 if test "x$with_libgps" = "xyes"; then
2683 BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
2684 BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
2685 BUILD_WITH_LIBGPS_LIBS="-lgps"
2688 AC_SUBST([BUILD_WITH_LIBGPS_CFLAGS])
2689 AC_SUBST([BUILD_WITH_LIBGPS_LDFLAGS])
2690 AC_SUBST([BUILD_WITH_LIBGPS_LIBS])
2694 # --with-libgrpc++ {{{
2695 AC_ARG_WITH([libgrpc++],
2696 [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
2698 with_grpcpp="$withval"
2699 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
2700 with_libgrpcpp_cppflags="-I$withval/include"
2701 with_libgrpcpp_ldflags="-L$withval/lib"
2702 with_libgrpcpp_bin="$withval/bin"
2703 with_libgrpcpp="yes"
2705 if test "x$withval" = "xno"; then
2706 with_libgrpcpp="no (disabled on command line)"
2711 if test "x$withval" = "xyes"; then
2712 PKG_CHECK_MODULES([GRPCPP], [grpc++],
2713 [with_libgrpcpp="yes"],
2714 [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
2718 if test "x$withval" != "xno"; then
2719 AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
2720 if test_cxx_flags -std=c++11; then
2721 AC_MSG_RESULT([yes])
2724 with_libgrpcpp="no (requires C++11 support)"
2725 with_libprotobuf="no (<google/protobuf/util/time_util.h> requires C++11 support)"
2729 if test "x$with_libgrpcpp" = "xyes"; then
2731 SAVE_CPPFLAGS="$CPPFLAGS"
2732 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2733 AC_CHECK_HEADERS([grpc++/grpc++.h],
2734 [with_libgrpcpp="yes"],
2735 [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
2737 CPPFLAGS="$SAVE_CPPFLAGS"
2741 if test "x$with_libgrpcpp" = "xyes"; then
2743 SAVE_CPPFLAGS="$CPPFLAGS"
2744 SAVE_LDFLAGS="$LDFLAGS"
2746 CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
2747 LDFLAGS="$with_libgrpcpp_ldflags"
2748 if test "x$GRPCPP_LIBS" = "x"; then
2756 [[#include <grpc++/grpc++.h>]],
2757 [[grpc::ServerBuilder sb;]]
2761 with_libgrpcpp="yes"
2762 if test "x$GRPCPP_LIBS" = "x"; then
2763 GRPCPP_LIBS="-lgrpc++"
2766 [with_libgrpcpp="no (libgrpc++ not found)"]
2768 CPPFLAGS="$SAVE_CPPFLAGS"
2769 LDFLAGS="$SAVE_LDFLAGS"
2774 BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
2775 BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
2776 BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
2777 AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
2778 AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
2779 AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
2782 AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
2783 if test "x$with_libgrpcpp_bin" = "x"; then
2784 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
2786 AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin], [], "$with_libgrpcpp_bin:$PATH")
2788 AM_CONDITIONAL([HAVE_GRPC_CPP], [test "x$GRPC_CPP_PLUGIN" != "x"])
2790 # --with-libiptc {{{
2791 AC_ARG_WITH([libiptc],
2792 [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
2794 if test "x$withval" = "xyes"; then
2795 with_libiptc="pkgconfig"
2796 else if test "x$withval" = "xno"; then
2800 with_libiptc_cflags="-I$withval/include"
2801 with_libiptc_libs="-L$withval/lib"
2805 if test "x$ac_system" = "xLinux"; then
2806 with_libiptc="pkgconfig"
2808 with_libiptc="no (Linux only)"
2813 if test "x$with_libiptc" = "xpkgconfig"; then
2814 $PKG_CONFIG --exists 'libiptc' 2>/dev/null
2815 if test $? -ne 0; then
2816 with_libiptc="no (pkg-config doesn't know libiptc)"
2820 if test "x$with_libiptc" = "xpkgconfig"; then
2821 with_libiptc_cflags="`$PKG_CONFIG --cflags 'libiptc'`"
2822 if test $? -ne 0; then
2823 with_libiptc="no ($PKG_CONFIG failed)"
2826 with_libiptc_libs="`$PKG_CONFIG --libs 'libiptc'`"
2827 if test $? -ne 0; then
2828 with_libiptc="no ($PKG_CONFIG failed)"
2832 SAVE_CPPFLAGS="$CPPFLAGS"
2833 CPPFLAGS="$CPPFLAGS $with_libiptc_cflags"
2835 # check whether the header file for libiptc is available.
2836 if test "x$with_libiptc" = "xpkgconfig"; then
2837 AC_CHECK_HEADERS([libiptc/libiptc.h libiptc/libip6tc.h],
2839 [with_libiptc="no (header file missing)"]
2843 # If the header file is available, check for the required type declaractions.
2844 # They may be missing in old versions of libiptc. In that case, they will be
2845 # declared in the iptables plugin.
2846 if test "x$with_libiptc" = "xpkgconfig"; then
2847 AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
2850 # Check for the iptc_init symbol in the library.
2851 # This could be in iptc or ip4tc
2852 if test "x$with_libiptc" = "xpkgconfig"; then
2854 AC_SEARCH_LIBS([iptc_init], [iptc ip4tc],
2855 [with_libiptc="pkgconfig"],
2856 [with_libiptc="no"],
2857 [$with_libiptc_libs]
2862 if test "x$with_libiptc" = "xpkgconfig"; then
2866 CPPFLAGS="$SAVE_CPPFLAGS"
2868 if test "x$with_libiptc" = "xyes"; then
2869 BUILD_WITH_LIBIPTC_CPPFLAGS="$with_libiptc_cflags"
2870 BUILD_WITH_LIBIPTC_LDFLAGS="$with_libiptc_libs"
2872 AC_SUBST([BUILD_WITH_LIBIPTC_CPPFLAGS])
2873 AC_SUBST([BUILD_WITH_LIBIPTC_LDFLAGS])
2877 with_java_home="$JAVA_HOME"
2878 if test "x$with_java_home" = "x"; then
2879 with_java_home="/usr/lib/jvm"
2885 [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
2887 if test "x$withval" = "xno"; then
2889 else if test "x$withval" = "xyes"; then
2892 with_java_home="$withval"
2899 AX_COMPARE_VERSION([$am__api_version],[lt],[1.12],
2900 [JAVA_TIMESTAMP_FILE="classdist_noinst.stamp"],
2901 [JAVA_TIMESTAMP_FILE="classnoinst.stamp"])
2902 if test "x$with_java" = "xyes"; then
2903 if test -d "$with_java_home"; then
2904 AC_MSG_CHECKING([for jni.h])
2905 TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2906 if test "x$TMPVAR" != "x"; then
2907 AC_MSG_RESULT([found in $TMPVAR])
2908 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2910 AC_MSG_RESULT([not found])
2913 AC_MSG_CHECKING([for jni_md.h])
2914 TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2915 if test "x$TMPVAR" != "x"; then
2916 AC_MSG_RESULT([found in $TMPVAR])
2917 JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPVAR"
2919 AC_MSG_RESULT([not found])
2922 AC_MSG_CHECKING([for libjvm.so])
2923 TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1`
2924 if test "x$TMPVAR" != "x"; then
2925 AC_MSG_RESULT([found in $TMPVAR])
2926 JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPVAR -Wl,-rpath -Wl,$TMPVAR"
2928 AC_MSG_RESULT([not found])
2931 if test "x$JAVAC" = "x"; then
2932 AC_MSG_CHECKING([for javac])
2933 TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2934 if test "x$TMPVAR" != "x"; then
2936 AC_MSG_RESULT([$JAVAC])
2938 AC_MSG_RESULT([not found])
2942 if test "x$JAR" = "x"; then
2943 AC_MSG_CHECKING([for jar])
2944 TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | LC_ALL=C sort | head -n 1`
2945 if test "x$TMPVAR" != "x"; then
2947 AC_MSG_RESULT([$JAR])
2949 AC_MSG_RESULT([not found])
2952 else if test "x$with_java_home" != "x"; then
2953 AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
2957 if test "x$JAVAC" = "x"; then
2958 with_javac_path="$PATH"
2959 if test "x$with_java_home" != "x"; then
2960 with_javac_path="$with_java_home:with_javac_path"
2961 if test -d "$with_java_home/bin"; then
2962 with_javac_path="$with_java_home/bin:with_javac_path"
2966 AC_PATH_PROG([JAVAC], [javac], [], "$with_javac_path")
2969 if test "x$JAVAC" = "x"; then
2970 with_java="no (javac not found)"
2973 if test "x$JAR" = "x"; then
2974 with_jar_path="$PATH"
2975 if test "x$with_java_home" != "x"; then
2976 with_jar_path="$with_java_home:$with_jar_path"
2977 if test -d "$with_java_home/bin"; then
2978 with_jar_path="$with_java_home/bin:$with_jar_path"
2982 AC_PATH_PROG([JAR], [jar], [], "$with_jar_path")
2985 if test "x$JAR" = "x"; then
2986 with_java="no (jar not found)"
2989 SAVE_CPPFLAGS="$CPPFLAGS"
2990 SAVE_CFLAGS="$CFLAGS"
2991 SAVE_LDFLAGS="$LDFLAGS"
2993 CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
2994 CFLAGS="$CFLAGS $JAVA_CFLAGS"
2995 LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
2996 LIBS="$LIBS $JAVA_LIBS"
2998 if test "x$with_java" = "xyes"; then
2999 AC_CHECK_HEADERS([jni.h],
3001 [with_java="no (jni.h not found)"])
3004 if test "x$with_java" = "xyes"; then
3005 AC_CHECK_LIB([jvm], [JNI_CreateJavaVM],
3007 [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
3008 [$JAVA_LIBS $PTHREAD_LIBS]
3012 if test "x$with_java" = "xyes"; then
3013 JAVA_LIBS="$JAVA_LIBS -ljvm"
3016 CPPFLAGS="$SAVE_CPPFLAGS"
3017 CFLAGS="$SAVE_CFLAGS"
3018 LDFLAGS="$SAVE_LDFLAGS"
3021 AC_SUBST([JAVA_CPPFLAGS])
3022 AC_SUBST([JAVA_CFLAGS])
3023 AC_SUBST([JAVA_LDFLAGS])
3024 AC_SUBST([JAVA_LIBS])
3025 AC_SUBST([JAVA_TIMESTAMP_FILE])
3026 AM_CONDITIONAL([BUILD_WITH_JAVA], [test "x$with_java" = "xyes"])
3029 # --with-libldap {{{
3030 AC_ARG_WITH([libldap],
3031 [AS_HELP_STRING([--with-libldap@<:@=PREFIX@:>@], [Path to libldap.])],
3033 if test "x$withval" = "xyes"; then
3035 else if test "x$withval" = "xno"; then
3039 LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS -I$withval/include"
3040 LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS -L$withval/lib"
3043 [with_libldap="yes"]
3046 SAVE_CPPFLAGS="$CPPFLAGS"
3047 SAVE_LDFLAGS="$LDFLAGS"
3049 CPPFLAGS="$CPPFLAGS $LIBLDAP_CPPFLAGS"
3050 LDFLAGS="$LDFLAGS $LIBLDAP_LDFLAGS"
3052 if test "x$with_libldap" = "xyes"; then
3053 AC_CHECK_HEADERS([ldap.h],
3054 [with_libldap="yes"],
3055 [with_libldap="no ('ldap.h' not found)"]
3059 if test "x$with_libldap" = "xyes"; then
3060 AC_CHECK_LIB([ldap], [ldap_initialize],
3061 [with_libldap="yes"],
3062 [with_libldap="no (symbol 'ldap_initialize' not found)"]
3066 CPPFLAGS="$SAVE_CPPFLAGS"
3067 LDFLAGS="$SAVE_LDFLAGS"
3069 if test "x$with_libldap" = "xyes"
3071 BUILD_WITH_LIBLDAP_CPPFLAGS="$LIBLDAP_CPPFLAGS"
3072 BUILD_WITH_LIBLDAP_LDFLAGS="$LIBLDAP_LDFLAGS"
3074 AC_SUBST([BUILD_WITH_LIBLDAP_CPPFLAGS])
3075 AC_SUBST([BUILD_WITH_LIBLDAP_LDFLAGS])
3079 AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config])
3080 if test "x$LIBLUA_PKG_CONFIG_NAME" != "x"
3082 PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME],
3083 [with_liblua="yes"],
3087 PKG_CHECK_MODULES([LUA], [lua],
3088 [with_liblua="yes"],
3090 PKG_CHECK_MODULES([LUA], [lua-5.3],
3091 [with_liblua="yes"],
3093 PKG_CHECK_MODULES([LUA], [lua5.3],
3094 [with_liblua="yes"],
3096 PKG_CHECK_MODULES([LUA], [lua53],
3097 [with_liblua="yes"],
3099 PKG_CHECK_MODULES([LUA], [lua-5.2],
3100 [with_liblua="yes"],
3102 PKG_CHECK_MODULES([LUA], [lua5.2],
3103 [with_liblua="yes"],
3105 PKG_CHECK_MODULES([LUA], [lua52],
3106 [with_liblua="yes"],
3108 PKG_CHECK_MODULES([LUA], [lua-5.1],
3109 [with_liblua="yes"],
3111 PKG_CHECK_MODULES([LUA], [lua5.1],
3112 [with_liblua="yes"],
3114 PKG_CHECK_MODULES([LUA], [lua51],
3115 [with_liblua="yes"],
3116 [with_liblua="no (pkg-config cannot find liblua)"]
3138 if test "x$with_liblua" = "xyes"
3140 SAVE_CPPFLAGS="$CPPFLAGS"
3141 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
3143 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
3144 [with_liblua="yes"],
3145 [with_liblua="no (header not found)"]
3148 CPPFLAGS="$SAVE_CPPFLAGS"
3151 if test "x$with_liblua" = "xyes"
3154 LIBS="$LIBS $LUA_LIBS"
3156 AC_CHECK_FUNC([lua_settop],
3157 [with_liblua="yes"],
3158 [with_liblua="no (symbol 'lua_settop' not found)"]
3164 if test "x$with_liblua" = "xyes"
3166 BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS"
3167 BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS"
3169 AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS)
3170 AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
3173 # --with-libmemcached {{{
3174 AC_ARG_WITH([libmemcached],
3175 [AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
3177 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3178 with_libmemcached_cppflags="-I$withval/include"
3179 with_libmemcached_ldflags="-L$withval/lib"
3180 with_libmemcached="yes"
3182 with_libmemcached="$withval"
3185 [with_libmemcached="yes"]
3188 if test "x$with_libmemcached" = "xyes"; then
3189 SAVE_CPPFLAGS="$CPPFLAGS"
3190 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3192 AC_CHECK_HEADERS([libmemcached/memcached.h],
3193 [with_libmemcached="yes"],
3194 [with_libmemcached="no (libmemcached/memcached.h not found)"]
3197 CPPFLAGS="$SAVE_CPPFLAGS"
3200 if test "x$with_libmemcached" = "xyes"; then
3201 SAVE_CPPFLAGS="$CPPFLAGS"
3202 SAVE_LDFLAGS="$LDFLAGS"
3203 CPPFLAGS="$CPPFLAGS $with_libmemcached_cppflags"
3204 LDFLAGS="$LDFLAGS $with_libmemcached_ldflags"
3206 AC_CHECK_LIB([memcached], [memcached_create],
3207 [with_libmemcached="yes"],
3208 [with_libmemcached="no (Symbol 'memcached_create' not found)"]
3211 CPPFLAGS="$SAVE_CPPFLAGS"
3212 LDFLAGS="$SAVE_LDFLAGS"
3215 if test "x$with_libmemcached" = "xyes"; then
3216 BUILD_WITH_LIBMEMCACHED_CPPFLAGS="$with_libmemcached_cppflags"
3217 BUILD_WITH_LIBMEMCACHED_LDFLAGS="$with_libmemcached_ldflags"
3218 BUILD_WITH_LIBMEMCACHED_LIBS="-lmemcached"
3221 AC_SUBST([BUILD_WITH_LIBMEMCACHED_CPPFLAGS])
3222 AC_SUBST([BUILD_WITH_LIBMEMCACHED_LDFLAGS])
3223 AC_SUBST([BUILD_WITH_LIBMEMCACHED_LIBS])
3226 # --with-libmicrohttpd {{{
3227 with_libmicrohttpd_cppflags=""
3228 with_libmicrohttpd_ldflags=""
3229 AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
3231 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3232 with_libmicrohttpd_cppflags="-I$withval/include"
3233 with_libmicrohttpd_ldflags="-L$withval/lib"
3234 with_libmicrohttpd="yes"
3236 if test "x$withval" = "xno"; then
3237 with_libmicrohttpd="no (disabled on command line)"
3242 if test "x$withval" = "xyes"; then
3243 PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
3244 [with_libmicrohttpd="yes"],
3245 [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
3249 if test "x$MICROHTTPD_LIBS" = "x"; then
3250 MICROHTTPD_LIBS="-lmicrohttpd"
3253 SAVE_CPPFLAGS="$CPPFLAGS"
3254 SAVE_LDFLAGS="$LDFLAGS"
3256 CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3257 LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
3258 LIBS="$LIBS $MICROHTTPD_LIBS"
3260 if test "x$with_libmicrohttpd" = "xyes"; then
3261 AC_CHECK_HEADERS([microhttpd.h],
3262 [with_libmicrohttpd="yes"],
3263 [with_libmicrohttpd="no (<microhttpd.h> not found)"]
3267 if test "x$with_libmicrohttpd" = "xyes"; then
3268 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
3269 [with_libmicrohttpd="yes"],
3270 [with_libmicrohttpd="no (libmicrohttpd not found)"]
3274 CPPFLAGS="$SAVE_CPPFLAGS"
3275 LDFLAGS="$SAVE_LDFLAGS"
3278 BUILD_WITH_LIBMICROHTTPD_CPPFLAGS="$with_libmicrohttpd_cppflags $MICROHTTPD_CFLAGS"
3279 BUILD_WITH_LIBMICROHTTPD_LDFLAGS="$with_libmicrohttpd_ldflags"
3280 BUILD_WITH_LIBMICROHTTPD_LIBS="$MICROHTTPD_LIBS"
3281 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_CPPFLAGS])
3282 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LDFLAGS])
3283 AC_SUBST([BUILD_WITH_LIBMICROHTTPD_LIBS])
3286 # --with-libmodbus {{{
3287 AC_ARG_WITH([libmodbus],
3288 [AS_HELP_STRING([--with-libmodbus@<:@=PREFIX@:>@], [Path to the modbus library.])],
3290 if test "x$withval" = "xno"; then
3292 else if test "x$withval" = "xyes"; then
3293 with_libmodbus="use_pkgconfig"
3294 else if test -d "$with_libmodbus/lib"; then
3295 AC_MSG_NOTICE([Not checking for libmodbus: Manually configured])
3296 with_libmodbus_cflags="-I$withval/include"
3297 with_libmodbus_libs="-L$withval/lib -lmodbus"
3298 with_libmodbus="yes"
3301 [with_libmodbus="use_pkgconfig"]
3304 # configure using pkg-config
3305 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3306 $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
3307 if test $? -ne 0; then
3308 with_libmodbus="no (pkg-config doesn't know libmodbus)"
3312 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3313 with_libmodbus_cflags="`$PKG_CONFIG --cflags 'libmodbus'`"
3314 if test $? -ne 0; then
3315 with_libmodbus="no ($PKG_CONFIG failed)"
3318 with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
3319 if test $? -ne 0; then
3320 with_libmodbus="no ($PKG_CONFIG failed)"
3324 if test "x$with_libmodbus" = "xuse_pkgconfig"; then
3325 with_libmodbus="yes"
3328 if test "x$with_libmodbus" = "xyes"; then
3329 SAVE_CPPFLAGS="$CPPFLAGS"
3330 CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
3332 AC_CHECK_HEADERS([modbus.h],
3333 [with_libmodbus="yes"],
3334 [with_libmodbus="no (modbus.h not found)"]
3337 CPPFLAGS="$SAVE_CPPFLAGS"
3340 if test "x$with_libmodbus" = "xyes"; then
3341 SAVE_LDFLAGS="$LDFLAGS"
3342 LDFLAGS="$LDFLAGS $with_libmodbus_libs"
3344 AC_CHECK_LIB([modbus], [modbus_connect],
3345 [with_libmodbus="yes"],
3346 [with_libmodbus="no (symbol modbus_connect not found)"]
3349 LDFLAGS="$SAVE_LDFLAGS"
3352 if test "x$with_libmodbus" = "xyes"; then
3353 BUILD_WITH_LIBMODBUS_CFLAGS="$with_libmodbus_cflags"
3354 BUILD_WITH_LIBMODBUS_LIBS="$with_libmodbus_libs"
3357 AC_SUBST([BUILD_WITH_LIBMODBUS_CFLAGS])
3358 AC_SUBST([BUILD_WITH_LIBMODBUS_LIBS])
3361 # --with-libmongoc {{{
3362 AC_ARG_WITH([libmongoc],
3363 [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
3365 if test "x$withval" = "xyes"; then
3366 with_libmongoc="yes"
3367 else if test "x$withval" = "xno"; then
3373 [with_libmongoc="yes"]
3376 if test "x$with_libmongoc" = "xyes"; then
3377 PKG_CHECK_MODULES([LIBMONGOC], [libmongoc-1.0],
3378 [with_libmongoc="yes"],
3379 [with_libmongoc="no (pkg-config could not find libmongoc)"]
3383 if test "x$with_libmongoc" = "xyes"; then
3384 SAVE_CPPFLAGS="$CPPFLAGS"
3386 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS"
3388 AC_CHECK_HEADERS([mongoc.h],
3389 [with_libmongoc="yes"],
3390 [with_libmongoc="no ('mongoc.h' not found)"]
3393 CPPFLAGS="$SAVE_CPPFLAGS"
3396 if test "x$with_libmongoc" = "xyes"; then
3397 SAVE_CPPFLAGS="$CPPFLAGS"
3398 SAVE_LDFLAGS="$LDFLAGS"
3400 CPPFLAGS="$CPPFLAGS $LIBMONGOC_CFLAGS"
3401 LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
3403 AC_CHECK_LIB([mongoc-1.0], [mongoc_init],
3404 [with_libmongoc="yes"],
3405 [with_libmongoc="no (symbol 'mongoc_init' not found)"]
3408 CPPFLAGS="$SAVE_CPPFLAGS"
3409 LDFLAGS="$SAVE_LDFLAGS"
3412 if test "x$with_libmongoc" = "xyes"; then
3413 BUILD_WITH_LIBMONGOC_CFLAGS="$LIBMONGOC_CFLAGS"
3414 BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
3415 BUILD_WITH_LIBMONGOC_LIBS="$LIBMONGOC_LIBS"
3418 AC_SUBST([BUILD_WITH_LIBMONGOC_CFLAGS])
3419 AC_SUBST([BUILD_WITH_LIBMONGOC_LDFLAGS])
3420 AC_SUBST([BUILD_WITH_LIBMONGOC_LIBS])
3423 # --with-libmosquitto {{{
3424 AC_ARG_WITH([libmosquitto],
3425 [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
3427 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
3428 with_libmosquitto_cppflags="-I$withval/include"
3429 with_libmosquitto_ldflags="-L$withval/lib"
3430 with_libmosquitto="yes"
3432 with_libmosquitto="$withval"
3435 [with_libmosquitto="yes"]
3438 if test "x$with_libmosquitto" = "xyes"; then
3439 SAVE_CPPFLAGS="$CPPFLAGS"
3440 CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
3442 AC_CHECK_HEADERS([mosquitto.h],
3443 [with_libmosquitto="yes"],
3444 [with_libmosquitto="no (mosquitto.h not found)"]
3447 CPPFLAGS="$SAVE_CPPFLAGS"
3450 if test "x$with_libmosquitto" = "xyes"; then
3451 SAVE_LDFLAGS="$LDFLAGS"
3452 LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
3454 AC_CHECK_LIB([mosquitto], [mosquitto_connect],
3455 [with_libmosquitto="yes"],
3456 [with_libmosquitto="no (libmosquitto not found)"]
3459 LDFLAGS="$SAVE_LDFLAGS"
3462 if test "x$with_libmosquitto" = "xyes"; then
3463 BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
3464 BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
3465 BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
3468 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_CPPFLAGS])
3469 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_LDFLAGS])
3470 AC_SUBST([BUILD_WITH_LIBMOSQUITTO_LIBS])
3473 # --with-libmysql {{{
3474 with_mysql_config="mysql_config"
3475 AC_ARG_WITH([libmysql],
3476 [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
3478 if test "x$withval" = "xno"; then
3480 else if test "x$withval" = "xyes"; then
3483 if test -f "$withval" && test -x "$withval"; then
3484 with_mysql_config="$withval"
3485 else if test -x "$withval/bin/mysql_config"; then
3486 with_mysql_config="$withval/bin/mysql_config"
3491 [with_libmysql="yes"]
3494 if test "x$with_libmysql" = "xyes"; then
3495 with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
3496 if test $? -ne 0; then
3497 with_libmysql="no ($with_mysql_config failed)"
3499 SAVE_CPPFLAGS="$CPPFLAGS"
3500 CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
3502 AC_CHECK_HEADERS([mysql.h],
3503 [have_mysql_h="yes"],
3507 if test "x$have_mysql_h" != "xyes"; then
3508 AC_CHECK_HEADERS([mysql/mysql.h],
3509 [have_mysql_mysql_h="yes"],
3514 if test "x$have_mysql_h" != "xyes" && test "x$have_mysql_mysql_h" != "xyes"; then
3515 with_libmysql="no (mysql.h not found)"
3518 CPPFLAGS="$SAVE_CPPFLAGS"
3522 if test "x$with_libmysql" = "xyes"; then
3523 with_mysql_libs=`$with_mysql_config --libs_r 2>/dev/null`
3524 if test $? -ne 0; then
3525 with_libmysql="no ($with_mysql_config failed)"
3528 LIBS="$with_mysql_libs"
3530 AC_SEARCH_LIBS([mysql_get_server_version],
3532 [with_libmysql="yes"],
3533 [with_libmysql="no (symbol 'mysql_get_server_version' not found in ${LIBS})"],
3540 if test "x$with_libmysql" = "xyes"; then
3541 BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
3542 BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
3545 AC_SUBST([BUILD_WITH_LIBMYSQL_CFLAGS])
3546 AC_SUBST([BUILD_WITH_LIBMYSQL_LIBS])
3550 AC_ARG_WITH([libmnl],
3551 [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])],
3553 if test "x$withval" = "xyes"; then
3555 else if test "x$withval" = "xno"; then
3558 if test -d "$withval/include"; then
3559 with_libmnl_cflags="-I$withval/include"
3560 with_libmnl_libs="-L$withval/lib -lmnl"
3563 AC_MSG_ERROR("no such directory: $withval/include")
3568 if test "x$ac_system" = "xLinux"; then
3571 with_libmnl="no (Linux only library)"
3576 if test "x$with_libmnl" = "xyes"; then
3577 if $PKG_CONFIG --exists libmnl 2>/dev/null; then
3578 with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`"
3579 with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`"
3582 AC_CHECK_HEADERS([libmnl.h libmnl/libmnl.h],
3590 #include <sys/types.h>
3591 #include <asm/types.h>
3592 #include <sys/socket.h>
3593 #include <linux/netlink.h>
3594 #include <linux/rtnetlink.h>]]
3597 AC_CHECK_HEADERS([linux/gen_stats.h linux/pkt_sched.h],
3602 #include <sys/types.h>
3603 #include <asm/types.h>
3604 #include <sys/socket.h>
3613 #include <sys/types.h>
3614 #include <asm/types.h>
3615 #include <sys/socket.h>
3616 #include <linux/netlink.h>
3617 #include <linux/rtnetlink.h>
3620 int retval = TCA_STATS2;
3625 [AC_DEFINE([HAVE_TCA_STATS2], [1], [True if the enum-member TCA_STATS2 exists])]
3633 #include <sys/types.h>
3634 #include <asm/types.h>
3635 #include <sys/socket.h>
3636 #include <linux/netlink.h>
3637 #include <linux/rtnetlink.h>
3640 int retval = TCA_STATS;
3645 [AC_DEFINE([HAVE_TCA_STATS], 1, [True if the enum-member TCA_STATS exists])]
3648 AC_CHECK_MEMBERS([struct rtnl_link_stats64.tx_window_errors],
3649 [AC_DEFINE(HAVE_RTNL_LINK_STATS64, 1, [Define if struct rtnl_link_stats64 exists and is usable.])],
3651 [[#include <linux/if_link.h>]]
3654 AC_CHECK_MEMBERS([struct rtnl_link_stats.rx_nohandler],
3657 [[#include <linux/if_link.h>]]
3660 AC_CHECK_MEMBERS([struct rtnl_link_stats64.rx_nohandler],
3663 [[#include <linux/if_link.h>]]
3666 AC_CHECK_LIB([mnl], [mnl_nlmsg_get_payload],
3667 [with_libmnl="yes"],
3668 [with_libmnl="no (symbol 'mnl_nlmsg_get_payload' not found)"],
3673 if test "x$with_libmnl" = "xyes"; then
3674 BUILD_WITH_LIBMNL_CFLAGS="$with_libmnl_cflags"
3675 BUILD_WITH_LIBMNL_LIBS="$with_libmnl_libs"
3677 AC_SUBST([BUILD_WITH_LIBMNL_CFLAGS])
3678 AC_SUBST([BUILD_WITH_LIBMNL_LIBS])
3679 AM_CONDITIONAL([HAVE_LIBMNL], [test "x$with_libmnl" = "xyes"])
3682 # --with-libnetapp {{{
3683 AC_ARG_VAR([LIBNETAPP_CPPFLAGS], [C preprocessor flags required to build with libnetapp])
3684 AC_ARG_VAR([LIBNETAPP_LDFLAGS], [Linker flags required to build with libnetapp])
3685 AC_ARG_VAR([LIBNETAPP_LIBS], [Other libraries required to link against libnetapp])
3686 AC_ARG_WITH([libnetapp],
3687 [AS_HELP_STRING([--with-libnetapp@<:@=PREFIX@:>@], [Path to libnetapp.])],
3689 if test -d "$withval"; then
3690 LIBNETAPP_CPPFLAGS="$LIBNETAPP_CPPFLAGS -I$withval/include"
3691 LIBNETAPP_LDFLAGS="$LIBNETAPP_LDFLAGS -L$withval/lib"
3692 with_libnetapp="yes"
3694 with_libnetapp="$withval"
3697 [with_libnetapp="yes"]
3700 SAVE_CPPFLAGS="$CPPFLAGS"
3701 SAVE_LDFLAGS="$LDFLAGS"
3702 CPPFLAGS="$CPPFLAGS $LIBNETAPP_CPPFLAGS"
3703 LDFLAGS="$LDFLAGS $LIBNETAPP_LDFLAGS"
3705 if test "x$with_libnetapp" = "xyes"; then
3706 AC_CHECK_HEADERS([netapp_api.h],
3707 [with_libnetapp="yes"],
3708 [with_libnetapp="no (netapp_api.h not found)"]
3712 if test "x$with_libnetapp" = "xyes"; then
3713 if test "x$LIBNETAPP_LIBS" = "x"; then
3714 LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
3717 AC_CHECK_LIB([netapp], [na_server_invoke_elem],
3718 [with_libnetapp="yes"],
3719 [with_libnetapp="no (symbol na_server_invoke_elem not found)"],
3723 LIBNETAPP_LIBS="-lnetapp $LIBNETAPP_LIBS"
3726 CPPFLAGS="$SAVE_CPPFLAGS"
3727 LDFLAGS="$SAVE_LDFLAGS"
3729 AC_SUBST([LIBNETAPP_CPPFLAGS])
3730 AC_SUBST([LIBNETAPP_LDFLAGS])
3731 AC_SUBST([LIBNETAPP_LIBS])
3734 # --with-libnetsnmp {{{
3735 AC_ARG_WITH([libnetsnmp],
3736 [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to libnetsnmp.])],
3738 if test "x$withval" = "xno"; then
3739 with_libnetsnmp="no"
3740 else if test "x$withval" = "xyes"; then
3741 with_libnetsnmp="yes"
3743 with_libnetsnmp_cppflags="-I$withval/include"
3744 with_libnetsnmp_ldflags="-I$withval/lib"
3745 with_libnetsnmp="yes"
3748 [with_libnetsnmp="yes"]
3751 if test "x$with_libnetsnmp" = "xyes"; then
3752 SAVE_CPPFLAGS="$CPPFLAGS"
3753 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3755 AC_CHECK_HEADERS([net-snmp/net-snmp-config.h],
3756 [with_libnetsnmp="yes"],
3757 [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]
3760 AC_CHECK_HEADERS([net-snmp/net-snmp-includes.h],
3761 [with_libnetsnmp="yes"],
3762 [with_libnetsnmp="no (net-snmp/net-snmp-includes.h not found)"],
3764 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3765 # include <net-snmp/net-snmp-config.h>
3770 CPPFLAGS="$SAVE_CPPFLAGS"
3773 if test "x$with_libnetsnmp" = "xyes"; then
3774 SAVE_LDFLAGS="$LDFLAGS"
3775 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3777 AC_CHECK_LIB([netsnmp], [init_snmp],
3778 [with_libnetsnmp="yes"],
3779 [with_libnetsnmp="no (libnetsnmp not found)"]
3782 LDFLAGS="$SAVE_LDFLAGS"
3785 if test "x$with_libnetsnmp" = "xyes"; then
3786 SAVE_LDFLAGS="$LDFLAGS"
3787 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3789 AC_CHECK_LIB([netsnmp], [netsnmp_get_version],
3790 [with_libnetsnmp="yes"],
3791 [with_libnetsnmp="no (couldn't get libnetsnmp version)"]
3794 LDFLAGS="$SAVE_LDFLAGS"
3797 if test "x$with_libnetsnmp" = "xyes"; then
3798 SAVE_CPPFLAGS="$CPPFLAGS"
3799 SAVE_LDFLAGS="$LDFLAGS"
3801 CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags"
3802 if test "x$GCC" = "xyes"; then
3803 CPPFLAGS="$CPPFLAGS -Wall -Werror"
3805 LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags"
3806 LIBS="$LIBS -lnetsnmp"
3808 AC_CACHE_CHECK([whether netsnmp library has old API],
3809 [c_cv_have_netsnmp_old_api],
3815 #include <net-snmp/net-snmp-config.h>
3816 #include <net-snmp/net-snmp-includes.h>
3819 netsnmp_variable_list *key = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);;
3821 u_char type = ASN_INTEGER;
3822 snmp_set_var_value(key, &val, sizeof(val));
3823 snmp_set_var_typed_value(key, type, &val, sizeof(val));
3828 [c_cv_have_netsnmp_old_api="no"],
3829 [c_cv_have_netsnmp_old_api="yes"]
3834 if test "x$c_cv_have_netsnmp_old_api" = "xyes"; then
3835 AC_DEFINE([HAVE_NETSNMP_OLD_API], [1],
3836 ["Define 1 if you have old netsnmp API]")
3839 CPPFLAGS="$SAVE_CPPFLAGS"
3840 LDFLAGS="$SAVE_LDFLAGS"
3844 if test "x$with_libnetsnmp" = "xyes"; then
3845 BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags"
3846 BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
3847 BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
3850 AC_SUBST([BUILD_WITH_LIBNETSNMP_CPPFLAGS])
3851 AC_SUBST([BUILD_WITH_LIBNETSNMP_LDFLAGS])
3852 AC_SUBST([BUILD_WITH_LIBNETSNMP_LIBS])
3855 # --with-libnetsnmpagent {{{
3856 AC_ARG_WITH([libnetsnmpagent],
3857 [AS_HELP_STRING([--with-libnetsnmpagent@<:@=PREFIX@:>@], [Path to libnetsnmpagent.])],
3859 if test "x$withval" = "xno"; then
3860 with_libnetsnmpagent="no"
3861 else if test "x$withval" = "xyes"; then
3862 with_libnetsnmpagent="yes"
3864 with_libnetsnmpagent_cppflags="-I$withval/include"
3865 with_libnetsnmpagent_ldflags="-I$withval/lib"
3866 with_libnetsnmpagent="yes"
3869 [with_libnetsnmpagent="yes"]
3872 if test "x$with_libnetsnmpagent" = "xyes"; then
3873 SAVE_CPPFLAGS="$CPPFLAGS"
3874 CPPFLAGS="$CPPFLAGS $with_libnetsnmpagent_cppflags"
3876 AC_CHECK_HEADERS([net-snmp/agent/net-snmp-agent-includes.h],
3878 [with_libnetsnmpagent="no (net-snmp/agent/net-snmp-agent-includes.h not found)"],
3880 #if HAVE_NET_SNMP_NET_SNMP_CONFIG_H
3881 # include <net-snmp/net-snmp-config.h>
3883 #if HAVE_NET_SNMP_NET_SNMP_INCLUDES_H
3884 # include <net-snmp/net-snmp-includes.h>
3889 CPPFLAGS="$SAVE_CPPFLAGS"
3892 if test "x$with_libnetsnmpagent" = "xyes"; then
3893 SAVE_LDFLAGS="$LDFLAGS"
3894 LDFLAGS="$LDFLAGS $with_libnetsnmpagent_ldflags"
3896 # older versions of libnetsnmpagent fail to link
3897 # against the helpers library, so do that explicitly
3898 AC_CHECK_LIB([netsnmphelpers], [netsnmp_init_helpers],
3899 [libnetsnmphelpers="-lnetsnmphelpers"],
3900 [libnetsnmphelpers=""]
3903 AC_CHECK_LIB([netsnmpagent], [init_agent],
3905 # libnetsnmp can be built without mib loading support
3906 AC_CHECK_LIB([netsnmp], [get_tree],
3907 [with_libnetsnmpagent="yes"],
3908 [with_libnetsnmpagent="no (libnetsnmp doesn't support mib loading)"]
3911 [with_libnetsnmpagent="no (libnetsnmpagent not found)"],
3912 [$libnetsnmphelpers]
3915 LDFLAGS="$SAVE_LDFLAGS"
3918 if test "x$with_libnetsnmpagent" = "xyes"; then
3919 BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS="$with_libnetsnmpagent_cppflags"
3920 BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS="$with_libnetsnmpagent_ldflags"
3921 BUILD_WITH_LIBNETSNMPAGENT_LIBS="-lnetsnmpagent $libnetsnmphelpers"
3924 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_CPPFLAGS])
3925 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LDFLAGS])
3926 AC_SUBST([BUILD_WITH_LIBNETSNMPAGENT_LIBS])
3929 # --with-liboping {{{
3930 AC_ARG_WITH([liboping],
3931 [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
3933 if test "x$withval" = "xyes"; then
3935 else if test "x$withval" = "xno"; then
3939 LIBOPING_CPPFLAGS="-I$withval/include"
3940 LIBOPING_LDFLAGS="-L$withval/lib"
3943 [with_liboping="yes"]
3946 SAVE_CPPFLAGS="$CPPFLAGS"
3947 SAVE_LDFLAGS="$LDFLAGS"
3948 CPPFLAGS="$CPPFLAGS $LIBOPING_CPPFLAGS"
3949 LDFLAGS="$LDFLAGS $LIBOPING_LDFLAGS"
3951 if test "x$with_liboping" = "xyes"; then
3952 AC_CHECK_HEADERS([oping.h],
3953 [with_liboping="yes"],
3954 [with_liboping="no (oping.h not found)"]
3958 if test "x$with_liboping" = "xyes"; then
3959 AC_CHECK_LIB([oping], [ping_construct],
3960 [with_liboping="yes"],
3961 [with_liboping="no (symbol 'ping_construct' not found)"]
3965 CPPFLAGS="$SAVE_CPPFLAGS"
3966 LDFLAGS="$SAVE_LDFLAGS"
3968 if test "x$with_liboping" = "xyes"; then
3969 BUILD_WITH_LIBOPING_CPPFLAGS="$LIBOPING_CPPFLAGS"
3970 BUILD_WITH_LIBOPING_LDFLAGS="$LIBOPING_LDFLAGS"
3973 AC_SUBST([BUILD_WITH_LIBOPING_CPPFLAGS])
3974 AC_SUBST([BUILD_WITH_LIBOPING_LDFLAGS])
3978 AC_ARG_WITH([oracle],
3979 [AS_HELP_STRING([--with-oracle@<:@=ORACLE_HOME@:>@], [Path to Oracle.])],
3981 if test "x$withval" = "xyes"; then
3982 if test "x$ORACLE_HOME" = "x"; then
3983 AC_MSG_WARN([Use of the Oracle library has been forced, but the environment variable ORACLE_HOME is not set.])
3986 else if test "x$withval" = "xno"; then
3990 ORACLE_HOME="$withval"
3994 if test "x$ORACLE_HOME" = "x"; then
3995 with_oracle="no (ORACLE_HOME is not set)"
4002 if test "x$ORACLE_HOME" != "x"; then
4003 with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
4004 if test -e "$ORACLE_HOME/lib/ldflags"; then
4005 with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
4007 with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
4010 if test "x$with_oracle" = "xyes"; then
4011 SAVE_CPPFLAGS="$CPPFLAGS"
4012 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
4014 AC_CHECK_HEADERS([oci.h],
4015 [with_oracle="yes"],
4016 [with_oracle="no (oci.h not found)"]
4019 CPPFLAGS="$SAVE_CPPFLAGS"
4022 if test "x$with_oracle" = "xyes"; then
4023 SAVE_CPPFLAGS="$CPPFLAGS"
4025 CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
4026 LIBS="$LIBS $with_oracle_libs"
4028 AC_CHECK_FUNC([OCIEnvCreate],
4029 [with_oracle="yes"],
4030 [with_oracle="no (Symbol 'OCIEnvCreate' not found)"]
4033 CPPFLAGS="$SAVE_CPPFLAGS"
4037 if test "x$with_oracle" = "xyes"; then
4038 BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
4039 BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
4042 AC_SUBST([BUILD_WITH_ORACLE_CPPFLAGS])
4043 AC_SUBST([BUILD_WITH_ORACLE_LIBS])
4046 # --with-libowcapi {{{
4047 AC_ARG_WITH([libowcapi],
4048 [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
4050 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4051 with_libowcapi_cppflags="-I$withval/include"
4052 with_libowcapi_ldflags="-L$withval/lib"
4053 with_libowcapi="yes"
4055 with_libowcapi="$withval"
4058 [with_libowcapi="yes"]
4061 if test "x$with_libowcapi" = "xyes"; then
4062 SAVE_CPPFLAGS="$CPPFLAGS"
4063 CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
4065 AC_CHECK_HEADERS([owcapi.h],
4066 [with_libowcapi="yes"],
4067 [with_libowcapi="no (owcapi.h not found)"]
4070 CPPFLAGS="$SAVE_CPPFLAGS"
4073 if test "x$with_libowcapi" = "xyes"; then
4074 SAVE_LDFLAGS="$LDFLAGS"
4075 LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
4077 AC_CHECK_LIB([owcapi], [OW_get],
4078 [with_libowcapi="yes"],
4079 [with_libowcapi="no (libowcapi not found)"]
4082 LDFLAGS="$SAVE_LDFLAGS"
4085 if test "x$with_libowcapi" = "xyes"; then
4086 BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
4087 BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
4088 BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
4091 AC_SUBST([BUILD_WITH_LIBOWCAPI_CPPFLAGS])
4092 AC_SUBST([BUILD_WITH_LIBOWCAPI_LDFLAGS])
4093 AC_SUBST([BUILD_WITH_LIBOWCAPI_LIBS])
4096 # --with-libpcap {{{
4097 AC_ARG_WITH([libpcap],
4098 [AS_HELP_STRING([--with-libpcap@<:@=PREFIX@:>@], [Path to libpcap.])],
4100 if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
4101 with_libpcap_cppflags="-I$withval/include"
4102 with_libpcap_ldflags="$LDFLAGS -L$withval/lib"
4105 with_libpcap="$withval"
4108 [with_libpcap="yes"]
4111 if test "x$with_libpcap" = "xyes"; then
4112 SAVE_CPPFLAGS="$CPPFLAGS"
4113 CPPFLAGS="$CPPFLAGS $with_libpcap_cppflags"
4115 AC_CHECK_HEADERS([pcap.h],
4116 [with_libpcap="yes"],
4117 [with_libpcap="no (pcap.h not found)"]
4120 CPPFLAGS="$SAVE_CPPFLAGS"
4123 if test "x$with_libpcap" = "xyes"; then
4124 SAVE_LDFLAGS="$LDFLAGS"
4125 LDFLAGS="$LDFLAGS $with_libpcap_ldflags"
4127 AC_CHECK_LIB([pcap], [pcap_open_live],
4128 [with_libpcap="yes"],
4129 [with_libpcap="no (libpcap not found)"]
4132 LDFLAGS="$SAVE_LDFLAGS"
4135 if test "x$with_libpcap" = "xyes"; then
4136 AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
4137 [c_cv_libpcap_have_pcap_error_iface_not_up],
4142 [[#include <pcap.h>]],
4144 int val = PCAP_ERROR_IFACE_NOT_UP;