diff --git a/configure.ac b/configure.ac
index 7b3bc997942abbc029d9361f592086a5152eaf0b..5c6720c3901f3d30a71db162f8e170b405470284 100644 (file)
--- a/configure.ac
+++ b/configure.ac
#
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])
if test "x$have_protoc_c" = "xno"
then
if test "x$have_protoc_c" = "xyes"
then
- AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
- [have_protoc_c="yes"],
+ 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_version],
+ AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
[have_protoc_c="yes"],
[have_protoc_c="no (libprotobuf-c not found)"])
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
fi
AC_MSG_CHECKING([for libjvm.so])
- TMPVAR=`find -L "$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])