X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=configure.ac;h=95caefff584c728fdbc7268988c9203e0c1e2d8a;hp=1e31e21876c18f3502e134415864e4c6a514781e;hb=7c9d772c992647fcba64a96800c146eb9f1647f8;hpb=979b210145a48a04db82fe3d3daa3c67c51df28f diff --git a/configure.ac b/configure.ac index 1e31e218..95caefff 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,10 @@ case $host_os in AC_DEFINE([KERNEL_SOLARIS], [1], [True if program is to be compiled for a Solaris kernel]) ac_system="Solaris" ;; + *mingw32*) + AC_DEFINE([KERNEL_WIN32], [1], [True if program is to be compiled for a Windows kernel]) + ac_system="Windows" + ;; *) ac_system="unknown" ;; @@ -111,6 +115,7 @@ AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"]) AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"]) AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"]) AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"]) +AM_CONDITIONAL([BUILD_WIN32], [test "x$ac_system" = "xWindows"]) if test "x$ac_system" = "xSolaris"; then AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Define to enforce POSIX thread semantics under Solaris.]) @@ -550,6 +555,12 @@ if test "x$ac_system" = "xLinux"; then AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).]) fi + # For pcie_errors plugin + AC_CHECK_HEADERS([linux/pci_regs.h], + [have_pci_regs_h="yes"], + [have_pci_regs_h="no (linux/pci_regs.h not found)"] + ) + else have_linux_raid_md_u_h="no" have_linux_wireless_h="no" @@ -745,6 +756,7 @@ AC_CHECK_FUNCS_ONCE([ \ getaddrinfo \ getgrnam_r \ getnameinfo \ + getpwnam \ getpwnam_r \ gettimeofday \ if_indextoname \ @@ -767,6 +779,12 @@ AC_FUNC_STRERROR_R SAVE_CFLAGS="$CFLAGS" CFLAGS="-Wall -Werror" +SAVE_LDFLAGS="$LDFLAGS" +LDFLAGS="" +if test "x$ac_system" = "xWindows"; then + # This is exported from build.sh + LDFLAGS="$LDFLAGS -L${GNULIB_DIR}" +fi AC_CACHE_CHECK([for strtok_r], [c_cv_have_strtok_r_default], @@ -839,6 +857,7 @@ if test "x$c_cv_have_strtok_r_default" = "xno"; then fi CFLAGS="$SAVE_CFLAGS" +LDFLAGS="$SAVE_LDFLAGS" if test "x$c_cv_have_strtok_r_reentrant" = "xyes"; then CFLAGS="$CFLAGS -D_REENTRANT=1" fi @@ -848,11 +867,17 @@ AC_CHECK_FUNCS([socket], [ AC_CHECK_LIB([socket], [socket], [socket_needs_socket="yes"], - [AC_MSG_ERROR([cannot find socket() in libsocket])] + [ + AC_CHECK_LIB([gnu], [rpl_socket], + [socket_needs_gnulib="yes"], + [AC_MSG_ERROR([cannot find socket() in libsocket])] + ) + ] ) ] ) AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"]) +AM_CONDITIONAL([BUILD_WITH_GNULIB], [test "x$socket_needs_gnulib" = "xyes"]) clock_gettime_needs_posix4="no" AC_CHECK_FUNCS([clock_gettime], @@ -3814,7 +3839,7 @@ if test "x$with_libnetsnmp" = "xyes"; then LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags" AC_CHECK_LIB([netsnmp], [init_snmp], - [with_libnetsmp="yes"], + [with_libnetsnmp="yes"], [with_libnetsnmp="no (libnetsnmp not found)"] ) @@ -3822,6 +3847,62 @@ if test "x$with_libnetsnmp" = "xyes"; then fi if test "x$with_libnetsnmp" = "xyes"; then + SAVE_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags" + + AC_CHECK_LIB([netsnmp], [netsnmp_get_version], + [with_libnetsnmp="yes"], + [with_libnetsnmp="no (couldn't get libnetsnmp version)"] + ) + + LDFLAGS="$SAVE_LDFLAGS" +fi + +if test "x$with_libnetsnmp" = "xyes"; then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + SAVE_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $with_libnetsnmp_cppflags -Wall -Werror" + LDFLAGS="$LDFLAGS $with_libnetsnmp_ldflags" + LIBS="$LIBS -lnetsnmp" + + AC_CACHE_CHECK([whether netsnmp library has old API], + [c_cv_have_netsnmp_old_api], + [ + AC_LINK_IFELSE( + [ + AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + netsnmp_variable_list *key = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);; + int val; + u_char type = ASN_INTEGER; + snmp_set_var_value(key, &val, sizeof(val)); + snmp_set_var_typed_value(key, type, &val, sizeof(val)); + return 0; + ]] + ) + ], + [c_cv_have_netsnmp_old_api="no"], + [c_cv_have_netsnmp_old_api="yes"] + ) + ] + ) + + if test "x$c_cv_have_netsnmp_old_api" = "xyes"; then + AC_DEFINE([HAVE_NETSNMP_OLD_API], [1], + ["Define 1 if you have old netsnmp API]") + fi + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" + LIBS="$SAVE_LIBS" +fi + +if test "x$with_libnetsnmp" = "xyes"; then BUILD_WITH_LIBNETSNMP_CPPFLAGS="$with_libnetsnmp_cppflags" BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags" BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp" @@ -3832,7 +3913,7 @@ AC_SUBST([BUILD_WITH_LIBNETSNMP_LDFLAGS]) AC_SUBST([BUILD_WITH_LIBNETSNMP_LIBS]) # }}} -# --with-libnetsmpagent {{{ +# --with-libnetsnmpagent {{{ AC_ARG_WITH([libnetsnmpagent], [AS_HELP_STRING([--with-libnetsnmpagent@<:@=PREFIX@:>@], [Path to libnetsnmpagent.])], [ @@ -5839,32 +5920,41 @@ AC_SUBST([BUILD_WITH_LIBVARNISH_CFLAGS]) AC_SUBST([BUILD_WITH_LIBVARNISH_LIBS]) # }}} -# pkg-config --exists 'libxml-2.0'; pkg-config --exists libvirt {{{ -$PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null -if test $? -eq 0; then - with_libxml2="yes" -else - with_libxml2="no (pkg-config doesn't know libxml-2.0)" -fi - -$PKG_CONFIG --exists libvirt 2>/dev/null -if test $? = 0; then - with_libvirt="yes" -else - with_libvirt="no (pkg-config doesn't know libvirt)" -fi - -if test "x$with_libxml2" = "xyes"; then - with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`" - if test $? -ne 0; then - with_libxml2="no" - fi - - with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`" - if test $? -ne 0; then - with_libxml2="no" - fi -fi +# --with-libxml2 {{{ +AC_ARG_WITH(libxml2, + [AS_HELP_STRING([--with-libxml2@<:@=PREFIX@:>@], [Path to libxml2.])], + [ + if test "x$withval" = "xno"; then + with_libxml2="no" + else if test "x$withval" = "xyes"; then + $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null + if test $? -eq 0; then + with_libxml2="yes" + with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`" + with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`" + else + with_libxml2="no (pkg-config doesn't know libxml-2.0)" + fi + else + with_libxml2="yes" + with_libxml2_cflags="-I$withval/include" + with_libxml2_ldflags="-L$withval/lib" + fi; fi + ], + dnl if no argument --with-libxml2 was passed, find the library locations + dnl with pkg-config just like above, when --with-libxml2=yes. + [ + with_libxml2="yes" + $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null + if test $? -eq 0; then + with_libxml2="yes" + with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`" + with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`" + else + with_libxml2="no (pkg-config doesn't know libxml-2.0)" + fi + ] +) if test "x$with_libxml2" = "xyes"; then SAVE_CPPFLAGS="$CPPFLAGS" @@ -5897,6 +5987,15 @@ fi AC_SUBST([BUILD_WITH_LIBXML2_CFLAGS]) AC_SUBST([BUILD_WITH_LIBXML2_LIBS]) +# }}} + +# pkg-config --exists libvirt {{{ +$PKG_CONFIG --exists libvirt 2>/dev/null +if test $? = 0; then + with_libvirt="yes" +else + with_libvirt="no (pkg-config doesn't know libvirt)" +fi if test "x$with_libvirt" = "xyes"; then with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`" @@ -6229,6 +6328,7 @@ plugin_nfs="no" plugin_numa="no" plugin_ovs_events="no" plugin_ovs_stats="no" +plugin_pcie_errors="no" plugin_perl="no" plugin_pinba="no" plugin_processes="no" @@ -6307,6 +6407,10 @@ if test "x$ac_system" = "xLinux"; then plugin_ovs_events="yes" plugin_ovs_stats="yes" fi + + if test "x$have_pci_regs_h" = "xyes"; then + plugin_pcie_errors="yes" + fi fi if test "x$ac_system" = "xOpenBSD"; then @@ -6684,6 +6788,7 @@ AC_PLUGIN([openvpn], [yes], [OpenVPN client stat AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin]) AC_PLUGIN([ovs_events], [$plugin_ovs_events], [OVS events plugin]) AC_PLUGIN([ovs_stats], [$plugin_ovs_stats], [OVS statistics plugin]) +AC_PLUGIN([pcie_errors], [$plugin_pcie_errors], [PCIe errors plugin]) AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter]) AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics]) # FIXME: Check for libevent, too. @@ -7105,6 +7210,7 @@ AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn]) AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle]) AC_MSG_RESULT([ ovs_events . . . . . $enable_ovs_events]) AC_MSG_RESULT([ ovs_stats . . . . . . $enable_ovs_stats]) +AC_MSG_RESULT([ pcie_errors . . . . . $enable_pcie_errors]) AC_MSG_RESULT([ perl . . . . . . . . $enable_perl]) AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf]) AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba]) @@ -7179,3 +7285,4 @@ if test "x$dependency_warning" = "xyes"; then fi # vim: set fdm=marker sw=2 sts=2 ts=2 et : +