diff --git a/configure.ac b/configure.ac
index a2472443f827eb2243d0917e65f1745292d0beac..8129468a1f7dc538d020c3063a13a42a24350a9d 100644 (file)
--- a/configure.ac
+++ b/configure.ac
esac
AC_MSG_RESULT([$ac_system])
-AM_CONDITIONAL([BUILD_LINUX],[test "x$x$ac_system" = "xLinux"])
-AM_CONDITIONAL([BUILD_SOLARIS],[test "x$x$ac_system" = "xSolaris"])
-AM_CONDITIONAL([BUILD_DARWIN],[test "x$x$ac_system" = "xDarwin"])
-AM_CONDITIONAL([BUILD_OPENBSD],[test "x$x$ac_system" = "xOpenBSD"])
-AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
-AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
+AM_CONDITIONAL([BUILD_LINUX],[test "x$ac_system" = "xLinux"])
+AM_CONDITIONAL([BUILD_SOLARIS],[test "x$ac_system" = "xSolaris"])
+AM_CONDITIONAL([BUILD_DARWIN],[test "x$ac_system" = "xDarwin"])
+AM_CONDITIONAL([BUILD_OPENBSD],[test "x$ac_system" = "xOpenBSD"])
+AM_CONDITIONAL([BUILD_AIX],[test "x$ac_system" = "xAIX"])
+AM_CONDITIONAL([BUILD_FREEBSD],[test "x$ac_system" = "xFreeBSD"])
if test "x$ac_system" = "xLinux"
then
then
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.])
AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.])
+
+ AC_MSG_CHECKING([whether compiler builds 64bit binaries])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ #ifndef _LP64
+ # error "Compiler not in 64bit mode."
+ #endif
+ ])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_NOTICE([Solaris detected. Please consider building a 64-bit binary.])
+ ])
fi
+
if test "x$ac_system" = "xAIX"
then
AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.])
#endif
])
+have_ip6_ext="no"
+AC_CHECK_TYPES([struct ip6_ext], [have_ip6_ext="yes"], [have_ip6_ext="no"],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+])
+
+if test "x$have_ip6_ext" = "xno"; then
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -DSOLARIS2=8"
+
+ AC_CHECK_TYPES([struct ip6_ext],
+ [have_ip6_ext="yes, with -DSOLARIS2=8"],
+ [have_ip6_ext="no"],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+])
+
+ if test "x$have_ip6_ext" = "xno"; then
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+fi
+
# For cpu modules
AC_CHECK_HEADERS(sys/dkstat.h)
if test "x$ac_system" = "xDarwin"
#endif
])
-if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
-then
- hint_64=""
- if test "x$GCC" = "xyes"
- then
- hint_64="CFLAGS='-m64'"
- else
- hint_64="CFLAGS='-xarch=v9'"
- fi
- AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).])
-fi
-
# For load module
# For the processes plugin
# For users module
have_termios_h="no"
AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
+# For the turbostat plugin
+have_asm_msrindex_h="no"
+AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
+
+if test "x$have_asm_msrindex_h" = "xyes"
+then
+ AC_CACHE_CHECK([whether asm/msr-index.h has MSR_PKG_C10_RESIDENCY],
+ [c_cv_have_usable_asm_msrindex_h],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include<asm/msr-index.h>
+]]],
+[[[
+int y = MSR_PKG_C10_RESIDENCY;
+return(y);
+]]]
+ )],
+ [c_cv_have_usable_asm_msrindex_h="yes"],
+ [c_cv_have_usable_asm_msrindex_h="no"],
+ )
+ )
+fi
+
+have_cpuid_h="no"
+AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
+
+AC_CHECK_HEADERS(sys/capability.h)
#
# Checks for typedefs, structures, and compiler characteristics.
#
AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
AC_TYPE_UID_T
+AC_TYPE_UINT32_T
AC_HEADER_TIME
#
struct mntent *me;
fh = setmntent ("/etc/mtab", "r");
me = getmntent (fh);
+return(me->mnt_passno);
]]]
)],
[c_cv_have_one_getmntent="yes"],
int status;
fh = fopen ("/etc/mnttab", "r");
status = getmntent (fh, &mt);
+ return(status);
]]]
)],
[c_cv_have_two_getmntent="yes"],
# --with-java {{{
with_java_home="$JAVA_HOME"
+if test "x$with_java_home" = "x"
+then
+ with_java_home="/usr/lib/jvm"
+fi
with_java_vmtype="client"
with_java_cflags=""
with_java_libs=""
if test -d "$with_java_home"
then
AC_MSG_CHECKING([for jni.h])
- TMPVAR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+ TMPVAR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
if test "x$TMPVAR" != "x"
then
AC_MSG_RESULT([found in $TMPVAR])
fi
AC_MSG_CHECKING([for jni_md.h])
- TMPVAR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+ TMPVAR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
if test "x$TMPVAR" != "x"
then
AC_MSG_RESULT([found in $TMPVAR])
fi
AC_MSG_CHECKING([for libjvm.so])
- TMPVAR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+ TMPVAR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
if test "x$TMPVAR" != "x"
then
AC_MSG_RESULT([found in $TMPVAR])
if test "x$JAVAC" = "x"
then
AC_MSG_CHECKING([for javac])
- TMPVAR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
+ TMPVAR=`find -L "$with_java_home" -name javac -type f 2>/dev/null | head -n 1`
if test "x$TMPVAR" != "x"
then
JAVAC="$TMPVAR"
if test "x$JAR" = "x"
then
AC_MSG_CHECKING([for jar])
- TMPVAR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
+ TMPVAR=`find -L "$with_java_home" -name jar -type f 2>/dev/null | head -n 1`
if test "x$TMPVAR" != "x"
then
JAR="$TMPVAR"
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
- AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
+ AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
CPPFLAGS="$SAVE_CPPFLAGS"
fi
AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
# }}}
+# --with-libmosquitto {{{
+with_libmosquitto_cppflags=""
+with_libmosquitto_libs="-lmosquitto"
+AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ with_libmosquitto_cppflags="-I$withval/include"
+ with_libmosquitto_libs="-L$withval/lib -lmosquitto"
+ with_libmosquitto="yes"
+ else
+ with_libmosquitto="$withval"
+ fi
+],
+[
+ with_libmosquitto="yes"
+])
+if test "x$with_libmosquitto" = "xyes"
+then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$with_libmosquitto_cppflags"
+
+ AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+if test "x$with_libmosquitto" = "xyes"
+then
+ SAVE_LDFLAGS="$LDFLAGS"
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$with_libmosquitto_libs"
+ CPPFLAGS="$with_libmosquitto_cppflags"
+
+ AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
+
+ LDFLAGS="$SAVE_LDFLAGS"
+ CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+if test "x$with_libmosquitto" = "xyes"
+then
+ BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
+ BUILD_WITH_LIBMOSQUITTO_LIBS="$with_libmosquitto_libs"
+ AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
+ AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
+fi
+# }}}
+
# --with-libmysql {{{
with_mysql_config="mysql_config"
with_mysql_cflags=""
]]],
[[[
int val = PCAP_ERROR_IFACE_NOT_UP;
+ return(val);
]]]
)],
[c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
# --with-librdkafka {{{
AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
[
- if test "x$withval" = "xno" && test "x$withval" != "xyes"
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
then
with_librdkafka_cppflags="-I$withval/include"
with_librdkafka_ldflags="-L$withval/lib"
+ with_librdkafka_rpath="$withval/lib"
with_librdkafka="yes"
else
with_librdkafka="$withval"
@@ -3733,6 +3868,9 @@ AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Pat
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
+CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
+LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
+
if test "x$with_librdkafka" = "xyes"
then
AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
then
AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
- AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
+ AC_CHECK_LIB(rdkafka, rd_kafka_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
fi
if test "x$with_librdkafka" = "xyes"
then
BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
- BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
+ if test "x$with_librdkafka_rpath" != "x"
+ then
+ BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
+ else
+ BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
+ fi
AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
- AC_CHECK_HEADERS(varnish/vapi/vsc.h,
+ AC_CHECK_HEADERS(vapi/vsc.h,
[AC_DEFINE([HAVE_VARNISH_V4], [1], [Varnish 4 API support])],
- [AC_CHECK_HEADERS(varnish/vsc.h,
+ [AC_CHECK_HEADERS(vsc.h,
[AC_DEFINE([HAVE_VARNISH_V3], [1], [Varnish 3 API support])],
- [AC_CHECK_HEADERS(varnish/varnishapi.h,
+ [AC_CHECK_HEADERS(varnishapi.h,
[AC_DEFINE([HAVE_VARNISH_V2], [1], [Varnish 2 API support])],
[with_libvarnish="no (found none of the varnish header files)"])])])
plugin_drbd="no"
plugin_entropy="no"
plugin_ethstat="no"
+plugin_fhcount="no"
plugin_fscache="no"
plugin_interface="no"
plugin_ipmi="no"
plugin_tcpconns="no"
plugin_ted="no"
plugin_thermal="no"
+plugin_turbostat="no"
plugin_uptime="no"
plugin_users="no"
plugin_virt="no"
plugin_vserver="no"
plugin_wireless="no"
plugin_zfs_arc="no"
+plugin_zone="no"
plugin_zookeeper="no"
# Linux
plugin_disk="yes"
plugin_drbd="yes"
plugin_entropy="yes"
+ plugin_fhcount="yes"
plugin_fscache="yes"
plugin_interface="yes"
plugin_ipc="yes"
then
plugin_ipvs="yes"
fi
+ if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
+ then
+ plugin_turbostat="yes"
+ fi
fi
if test "x$ac_system" = "xOpenBSD"
if test "x$ac_system" = "xAIX"
then
- plugin_tcpconns="yes"
+ plugin_tcpconns="yes"
+ plugin_ipc="yes"
fi
# FreeBSD
if test "x$ac_system" = "xFreeBSD"
then
- plugin_zfs_arc="yes"
+ plugin_zfs_arc="yes"
fi
if test "x$with_kstat" = "xyes"
then
plugin_nfs="yes"
+ plugin_processes="yes"
plugin_uptime="yes"
plugin_zfs_arc="yes"
+ plugin_zone="yes"
fi
if test "x$with_devinfo$with_kstat" = "xyesyes"
AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics])
AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver])
AC_PLUGIN([exec], [yes], [Execution of external programs])
+AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
AC_PLUGIN([filecount], [yes], [Count files in directories])
AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics])
AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin])
AC_PLUGIN([memory], [$plugin_memory], [Memory usage])
AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats])
AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin])
+AC_PLUGIN([mqtt], [$with_libmosquitto], [MQTT output plugin])
AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values])
AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics])
AC_PLUGIN([netapp], [$with_libnetapp], [NetApp plugin])
AC_PLUGIN([thermal], [$plugin_thermal], [Linux ACPI thermal zone statistics])
AC_PLUGIN([threshold], [yes], [Threshold checking plugin])
AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant], [TokyoTyrant database statistics])
+AC_PLUGIN([turbostat], [$plugin_turbostat], [Advanced statistic on Intel cpu states])
AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
AC_PLUGIN([uptime], [$plugin_uptime], [Uptime statistics])
AC_PLUGIN([users], [$plugin_users], [User statistics])
AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
AC_PLUGIN([zfs_arc], [$plugin_zfs_arc], [ZFS ARC statistics])
+AC_PLUGIN([zone], [$plugin_zone], [Solaris container statistics])
AC_PLUGIN([zookeeper], [yes], [Zookeeper statistics])
dnl Default configuration file
libmnl . . . . . . . $with_libmnl
libmodbus . . . . . . $with_libmodbus
libmongoc . . . . . . $with_libmongoc
+ libmosquitto . . . . $with_libmosquitto
libmysql . . . . . . $with_libmysql
libnetapp . . . . . . $with_libnetapp
libnetsnmp . . . . . $with_libnetsnmp
entropy . . . . . . . $enable_entropy
ethstat . . . . . . . $enable_ethstat
exec . . . . . . . . $enable_exec
+ fhcount . . . . . . . $enable_fhcount
filecount . . . . . . $enable_filecount
fscache . . . . . . . $enable_fscache
gmond . . . . . . . . $enable_gmond
memory . . . . . . . $enable_memory
mic . . . . . . . . . $enable_mic
modbus . . . . . . . $enable_modbus
+ mqtt . . . . . . . . $enable_mqtt
multimeter . . . . . $enable_multimeter
mysql . . . . . . . . $enable_mysql
netapp . . . . . . . $enable_netapp
thermal . . . . . . . $enable_thermal
threshold . . . . . . $enable_threshold
tokyotyrant . . . . . $enable_tokyotyrant
+ turbostat . . . . . . $enable_turbostat
unixsock . . . . . . $enable_unixsock
uptime . . . . . . . $enable_uptime
users . . . . . . . . $enable_users
write_tsdb . . . . . $enable_write_tsdb
xmms . . . . . . . . $enable_xmms
zfs_arc . . . . . . . $enable_zfs_arc
+ zone . . . . . . . . $enable_zone
zookeeper . . . . . . $enable_zookeeper
EOF