diff --git a/configure.ac b/configure.ac
index f370a86386d19eae5284f1654724a93ac8df861e..5c6720c3901f3d30a71db162f8e170b405470284 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_CONFIG_HEADERS(src/config.h)
AC_CONFIG_AUX_DIR([libltdl/config])
+dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
+dnl we don't really need the 'u' even in older toolchains. Then there is
+dnl older libtool, which spelled it AR_FLAGS
+m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
+
m4_ifdef([LT_PACKAGE_VERSION],
# libtool >= 2.2
[
]
)
+AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
+
AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LANG(C)
#
AC_PROG_CC
AC_PROG_CPP
+AC_PROG_EGREP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_LEX
AC_PROG_YACC
+
+# Warn when pkg.m4 is missing
+m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
+
PKG_PROG_PKG_CONFIG
+AC_CACHE_CHECK([if bison is the parser generator],
+ [collectd_cv_prog_bison],
+ [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
+ [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
+ )]
+)
+
+if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
+then
+ AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
+fi
+
AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
-AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
- [have_protobuf_c_h="yes"],
- [have_protobuf_c_h="no"])
-if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
+if test "x$have_protoc_c" = "xno"
+then
+ have_protoc_c="no (protoc-c compiler not found)"
+fi
+
+if test "x$have_protoc_c" = "xyes"
then
- have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
+ AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
+ [have_protoc_c="yes"; break],
+ [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
+fi
+if test "x$have_protoc_c" = "xyes"
+then
+ AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
+ [have_protoc_c="yes"],
+ [have_protoc_c="no (libprotobuf-c not found)"])
+
fi
AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
#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"
#if HAVE_NET_IF_H
# include <net/if.h>
#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
])
# For the multimeter plugin
AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
have_listmntent="no"
AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
+have_getmntent_r="no"
+AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
have_getmntent="no"
AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
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"],
@@ -1792,30 +1882,33 @@ AC_ARG_WITH(libganglia, [AS_HELP_STRING([--with-libganglia@<:@=PREFIX@:>@], [Pat
GANGLIA_LDFLAGS="-L$withval/lib"
with_libganglia="yes"
else
- with_libganglia_config="ganglia-config"
with_libganglia="$withval"
fi; fi; fi
],
[
- with_libganglia_config="ganglia-config"
with_libganglia="yes"
])
-if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
+if test "x$with_libganglia" = "xyes"
then
- if test "x$GANGLIA_CPPFLAGS" = "x"
+ if test "x$with_libganglia_config" != "x"
then
- GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
- fi
+ if test "x$GANGLIA_CPPFLAGS" = "x"
+ then
+ GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
+ fi
- if test "x$GANGLIA_LDFLAGS" = "x"
- then
- GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
- fi
+ if test "x$GANGLIA_LDFLAGS" = "x"
+ then
+ GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
+ fi
- if test "x$GANGLIA_LIBS" = "x"
- then
- GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
+ if test "x$GANGLIA_LIBS" = "x"
+ then
+ GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
+ fi
+ else
+ GANGLIA_LIBS="-lganglia"
fi
fi
GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
fi
- if test "x$GCRYPT_LDFLAGS" = "x"
- then
- gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
- GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
- fi
-
if test "x$GCRYPT_LIBS" = "x"
then
GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
+SAVE_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
+LIBS="$LIBS $GCRYPT_LIBS"
if test "x$with_libgcrypt" = "xyes"
then
if test "x$with_libgcrypt" = "xyes"
then
- if test "x$GCRYPT_LDFLAGS" != "x"
- then
- AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
- fi
AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
[with_libgcrypt="yes"],
[with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
+LIBS="$SAVE_LIBS"
if test "x$with_libgcrypt" = "xyes"
then
# --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" -type f \( -name libjvm.so -o -name libjvm.dylib \) -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
@@ -2521,7 +2611,7 @@ AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to
])
if test "x$with_libmysql" = "xyes"
then
- with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
+ with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
mysql_config_status=$?
if test $mysql_config_status -ne 0
then
with_libmysql="no ($with_mysql_config failed)"
else
- AC_CHECK_LIB(mysqlclient, mysql_init,
- [with_libmysql="yes"],
- [with_libmysql="no (symbol 'mysql_init' not found)"],
- [$with_mysql_libs])
-
- AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
+ SAVE_LIBS="$LIBS"
+ LIBS="$with_mysql_libs"
+ AC_SEARCH_LIBS([mysql_get_server_version],
+ [],
[with_libmysql="yes"],
[with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
- [$with_mysql_libs])
+ [])
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LIBS="$SAVE_LIBS"
fi
fi
if test "x$with_libmysql" = "xyes"
[with_libpcap="no (pcap.h not found)"])
fi
if test "x$with_libpcap" = "xyes"
-then
- AC_CHECK_HEADERS(pcap-bpf.h,,
- [with_libpcap="no (pcap-bpf.h not found)"])
-fi
-if test "x$with_libpcap" = "xyes"
then
AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
[c_cv_libpcap_have_pcap_error_iface_not_up],
]]],
[[[
int val = PCAP_ERROR_IFACE_NOT_UP;
+ return(val);
]]]
)],
[c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
if test "x$with_kstat" = "xyes"
then
plugin_nfs="yes"
+ plugin_processes="yes"
plugin_uptime="yes"
plugin_zfs_arc="yes"
fi
plugin_df="yes"
fi
+if test "x$c_cv_have_getmntent_r" = "xyes"
+then
+ plugin_df="yes"
+fi
+
# Df plugin: Check if we have either `statfs' or `statvfs' second.
if test "x$plugin_df" = "xyes"
then
libjvm . . . . . . . $with_java
libkstat . . . . . . $with_kstat
libkvm . . . . . . . $with_libkvm
+ liblvm2app . . . . . $with_liblvm2app
libmemcached . . . . $with_libmemcached
libmnl . . . . . . . $with_libmnl
libmodbus . . . . . . $with_libmodbus