X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.ac;h=98f0a9072197272bcaaf787ed4635a74f0ace02f;hb=7d6d77abad82af9b9c7df77948af345e3b7755fc;hp=e27b046edc02dbccb0926d1d6b060ecc1d07ece3;hpb=d061c270fabc5dba961cf2b94ebe968e9a89b899;p=collectd.git diff --git a/configure.ac b/configure.ac index e27b046e..98f0a907 100644 --- a/configure.ac +++ b/configure.ac @@ -808,7 +808,26 @@ fi have_cpuid_h="no" AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"]) -AC_CHECK_HEADERS(sys/capability.h) +have_capability="yes" +AC_CHECK_HEADERS(sys/capability.h, + [have_capability="yes"], + [have_capability="no ( not found)"]) +if test "x$have_capability" = "xyes"; then +AC_CHECK_LIB(cap, cap_get_proc, + [have_capability="yes"], + [have_capability="no (cap_get_proc() not found)"]) +fi +if test "x$have_capability" = "xyes"; then +AC_CHECK_DECL([CAP_IS_SUPPORTED], + [have_capability="yes"], + [have_capability="no (CAP_IS_SUPPORTED not found)"], + [[#include ]]) +fi +if test "x$have_capability" = "xyes"; then + AC_DEFINE(HAVE_CAPABILITY, 1, [Define to 1 if you have cap_get_proc() (-lcap).]) +fi +AM_CONDITIONAL(BUILD_WITH_CAPABILITY, test "x$have_capability" = "xyes") + # # Checks for typedefs, structures, and compiler characteristics. # @@ -1027,6 +1046,92 @@ then fi # }}} Check for strptime +# Check for timegm {{{ + +# These checks need -Werror because implicit function declarations are only a +# warning ... +SAVE_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" + +AC_CACHE_CHECK([for timegm], + [c_cv_have_timegm], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( +[[[ +#if STRPTIME_NEEDS_STANDARDS +# ifndef _ISOC99_SOURCE +# define _ISOC99_SOURCE 1 +# endif +# ifndef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200112L +# endif +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 500 +# endif +#endif +#include +]]], +[[[ + time_t t = timegm(&(struct tm){0}); + if (t == ((time_t) -1)) { + return 1; + } +]]] + )], + [c_cv_have_timegm="yes"], + [c_cv_have_timegm="no"] + ) +) + +if test "x$c_cv_have_timegm" != "xyes" +then + AC_CACHE_CHECK([for timegm with _BSD_SOURCE], + [c_cv_have_timegm_bsd], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( +[[[ +#if STRPTIME_NEEDS_STANDARDS +# ifndef _ISOC99_SOURCE +# define _ISOC99_SOURCE 1 +# endif +# ifndef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200112L +# endif +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 500 +# endif +#endif +#ifndef _BSD_SOURCE +# define _BSD_SOURCE 1 +#endif +#include +]]], +[[[ + time_t t = timegm(&(struct tm){0}); + if (t == ((time_t) -1)) { + return 1; + } +]]] + )], + [c_cv_have_timegm_bsd="yes" + c_cv_have_timegm="yes"], + [c_cv_have_timegm_bsd="no"] + ) + ) +fi + +if test "x$c_cv_have_timegm" = "xyes" +then + AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.]) + if test "x$c_cv_have_timegm_bsd" = "xyes" + then + AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.]) + fi +fi + +CFLAGS="$SAVE_CFLAGS" +# }}} Check for timegm + AC_CHECK_FUNCS(swapctl, [have_swapctl="yes"], [have_swapctl="no"]) if test "x$have_swapctl" = "xyes"; then AC_CACHE_CHECK([whether swapctl takes two arguments], @@ -2558,7 +2663,7 @@ then if test -d "$with_java_home" then AC_MSG_CHECKING([for jni.h]) - TMPVAR=`find -L "$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 | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then AC_MSG_RESULT([found in $TMPVAR]) @@ -2568,7 +2673,7 @@ then fi AC_MSG_CHECKING([for jni_md.h]) - TMPVAR=`find -L "$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 | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then AC_MSG_RESULT([found in $TMPVAR]) @@ -2578,7 +2683,7 @@ then fi AC_MSG_CHECKING([for libjvm.so]) - TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -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 | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then AC_MSG_RESULT([found in $TMPVAR]) @@ -2590,7 +2695,7 @@ then if test "x$JAVAC" = "x" then AC_MSG_CHECKING([for javac]) - TMPVAR=`find -L "$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 | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then JAVAC="$TMPVAR" @@ -2602,7 +2707,7 @@ then if test "x$JAR" = "x" then AC_MSG_CHECKING([for jar]) - TMPVAR=`find -L "$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 | LC_ALL=C sort | head -n 1` if test "x$TMPVAR" != "x" then JAR="$TMPVAR" @@ -2767,63 +2872,82 @@ AM_CONDITIONAL(BUILD_WITH_LIBLDAP, test "x$with_libldap" = "xyes") # }}} # --with-liblua {{{ -with_liblua_cppflags="" -with_liblua_ldflags="" -with_liblua_libs="" -with_liblua="yes" - AC_ARG_VAR([LIBLUA_PKG_CONFIG_NAME], [Name of liblua used by pkg-config]) -if test "x$LIBLUA_PKG_CONFIG_NAME" = "x" +if test "x$LIBLUA_PKG_CONFIG_NAME" != "x" then - LIBLUA_PKG_CONFIG_NAME="lua" + PKG_CHECK_MODULES([LUA], [$LIBLUA_PKG_CONFIG_NAME], + [with_liblua="yes"], + [with_liblua="no"] + ) +else + PKG_CHECK_MODULES([LUA], [lua], + [with_liblua="yes"], + [ + PKG_CHECK_MODULES([LUA], [lua-5.3], + [with_liblua="yes"], + [ + PKG_CHECK_MODULES([LUA], [lua5.3], + [with_liblua="yes"], + [ + PKG_CHECK_MODULES([LUA], [lua-5.2], + [with_liblua="yes"], + [ + PKG_CHECK_MODULES([LUA], [lua5.2], + [with_liblua="yes"], + [ + PKG_CHECK_MODULES([LUA], [lua-5.1], + [with_liblua="yes"], + [ + PKG_CHECK_MODULES([LUA], [lua5.1], + [with_liblua="yes"], + [with_liblua="no (pkg-config cannot find liblua)"] + ) + ] + ) + ] + ) + ] + ) + ] + ) + ] + ) + ] + ) fi if test "x$with_liblua" = "xyes" then - $PKG_CONFIG --exists $LIBLUA_PKG_CONFIG_NAME 2>/dev/null - lua_config_status=$? + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $LUA_CFLAGS" - if test 0 -ne $lua_config_status - then - with_liblua="no" - fi -fi + AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h], + [with_liblua="yes"], + [with_liblua="no (header not found)"] + ) -if test "x$with_liblua" = "xyes" -then - with_liblua_cppflags=`$PKG_CONFIG --cflags-only-I $LIBLUA_PKG_CONFIG_NAME` || with_liblua="no" - with_liblua_ldflags=`$PKG_CONFIG --libs-only-L $LIBLUA_PKG_CONFIG_NAME` || with_liblua="no" - with_liblua_libs=`$PKG_CONFIG --libs-only-l $LIBLUA_PKG_CONFIG_NAME` || with_liblua="no" + CPPFLAGS="$SAVE_CPPFLAGS" fi -if test "x$with_liblua" = "xyes" -then - SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $with_liblua_cppflags" - AC_CHECK_HEADERS(lua.h lauxlib.h lualib.h, [], [with_liblua="no (header not found)"], []) - - CPPFLAGS="$SAVE_CPPFLAGS" -fi if test "x$with_liblua" = "xyes" then - SAVE_LDFLAGS="$LDFLAGS" - SAVE_LIBS="$LIBS" - LDFLAGS="$SAVE_LDFLAGS $with_liblua_ldflags" - LIBS="$LIBS $with_liblua_libs" + SAVE_LIBS="$LIBS" + LIBS="$LIBS $LUA_LIBS" - AC_CHECK_FUNC(lua_settop, [with_liblua="yes"], [with_liblua="no (symbol 'lua_settop' not found)"]) + AC_CHECK_FUNC([lua_settop], + [with_liblua="yes"], + [with_liblua="no (symbol 'lua_settop' not found)"] + ) - LDFLAGS="$SAVE_LDFLAGS" - LIBS="$SAVE_LIBS" + LIBS="$SAVE_LIBS" fi + if test "x$with_liblua" = "xyes" then - BUILD_WITH_LIBLUA_CPPFLAGS="$with_liblua_cppflags" - BUILD_WITH_LIBLUA_LDFLAGS="$with_liblua_ldflags" - BUILD_WITH_LIBLUA_LIBS="$with_liblua_libs" + BUILD_WITH_LIBLUA_CFLAGS="$LUA_CFLAGS" + BUILD_WITH_LIBLUA_LIBS="$LUA_LIBS" fi -AC_SUBST(BUILD_WITH_LIBLUA_CPPFLAGS) -AC_SUBST(BUILD_WITH_LIBLUA_LDFLAGS) +AC_SUBST(BUILD_WITH_LIBLUA_CFLAGS) AC_SUBST(BUILD_WITH_LIBLUA_LIBS) # }}} @@ -4347,11 +4471,10 @@ then if test "x$with_librdkafka_log_cb" = "xyes" then AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.]) - fi - if test "x$with_librdkafka_logger" = "xyes" + else if test "x$with_librdkafka_logger" = "xyes" then AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.]) - fi + fi; fi fi CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" @@ -5537,7 +5660,7 @@ PKG_CHECK_MODULES([LIBNOTIFY], [libnotify], [with_libnotify="no (pkg-config doesn't know libnotify)"] ) -PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.8.0], +PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0], [with_libriemann_client="yes"], [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])