diff --git a/configure.ac b/configure.ac
index 7ffe5a9164f7c4ebad02d9f3549c0802bb26d2b8..c6710041cb5c631f50041f73f1e2f662b1dc7109 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_PREFIX_DEFAULT([/opt/sysdb])
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LANG(C)
AC_LANG_CONFTEST([int main(void){}])
$CC -c conftest.c $CFLAGS $STRICT_CFLAGS $@ > /dev/null 2> /dev/null
ret=$?
- rm -f conftest.o
+ rm -f conftest.o conftest.c
return $ret
}
test_cxx_flags() {
AC_LANG_PUSH(C++)
AC_LANG_CONFTEST([int main(void){}])
- $CXX -c conftest.c $CXXFLAGS $STRICT_CXXFLAGS $@ > /dev/null 2> /dev/null
+ $CXX -c conftest.cpp $CXXFLAGS $STRICT_CXXFLAGS $@ > /dev/null 2> /dev/null
ret=$?
- rm -f conftest.o
+ rm -f conftest.o conftest.cpp
AC_LANG_POP(C++)
return $ret
}
if test "x$enable_standards" = "xyes"; then
AC_DEFINE([_ISOC99_SOURCE], 1,
[Define to enforce ISO/IEC 9899:1999 (C99) compliance.])
- AC_DEFINE([_POSIX_C_SOURCE], 200112L,
- [Define to enforce IEEE 1003.1-2001 (POSIX:2001) compliance.])
+ AC_DEFINE([_POSIX_C_SOURCE], 200809L,
+ [Define to enforce IEEE 1003.1-2008 (POSIX:2008) compliance.])
AC_DEFINE([_XOPEN_SOURCE], 700,
[Define to enforce X/Open 7 (XSI) compliance.])
AC_DEFINE([_REENTRANT], 1,
AC_DEFINE([_THREAD_SAFE], 1,
[Define to enable reentrant interfaces.])
- dnl GNU libc defines strcasecmp() only when using _BSD_SOURCE even though
- dnl the function is conforming to POSIX.1-2001 as well. Let's weaken
- dnl strict standards compliance a bit to work around this.
- AC_DEFINE([_BSD_SOURCE], 1, [Define to enable 4.3BSD support.])
-
for flag in -std=c99; do
AC_MSG_CHECKING([whether $CC accepts $flag])
fi
AM_CONDITIONAL([BUILD_WITH_LIBDBI], test "x$with_libdbi" = "xyes")
+AC_ARG_WITH([libyajl],
+ [AS_HELP_STRING([--with-liyajl], [libyajl support (default: auto)])],
+ [with_libyajl="$withval"],
+ [with_libyajl="yes"])
+if test "x$with_libyajl" = "xyes" || test "x$with_libyajl" = "xauto"; then
+ PKG_CHECK_MODULES([YAJL], [yajl], [have_libyajl="yes"], [have_libyajl="no"])
+fi
+if test "x$with_libyajl" = "xyes"; then
+ AC_DEFINE([HAVE_LIBYAJL], 1, [Define to 1 if you have the 'yajl' library.])
+fi
+
dnl Required for mocking FILE related functions.
orig_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_GNU_SOURCE"
if test "x$have_librrd" = "xyes"; then
librrd_info="yes (version `$PKG_CONFIG --modversion librrd`)"
fi
+libyajl_info="$have_libyajl"
+if test "x$have_libyajl" = "xyes"; then
+ libyajl_info="yes (version `$PKG_CONFIG --modversion yajl`)"
+fi
AC_MSG_RESULT()
AC_MSG_RESULT([$PACKAGE_NAME has been configured successfully.])
AC_MSG_RESULT([ libopenssl: . . . . . . . . $openssl_info])
AC_MSG_RESULT([ libreadline: . . . . . . . $have_libreadline])
AC_MSG_RESULT([ librrd: . . . . . . . . . . $librrd_info])
+AC_MSG_RESULT([ libyajl: . . . . . . . . . $libyajl_info])
AC_MSG_RESULT()
AC_MSG_RESULT([ Backends:])
AC_MSG_RESULT([ collectd::unixsock: . . . . $enable_collectd_unixsock])