diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 106 |
1 files changed, 91 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 5fb493d57..d62d65233 100644 --- a/configure.ac +++ b/configure.ac @@ -57,12 +57,18 @@ AC_ARG_ENABLE( , [enable_plugin_freeipmi="detect"] ) - AC_ARG_ENABLE( +AC_ARG_ENABLE( [plugin-cups], [AS_HELP_STRING([--enable-plugin-cups], [enable cups plugin @<:@default autodetect@:>@])], , [enable_plugin_cups="detect"] - ) +) +AC_ARG_ENABLE( + [plugin-xenstat], + [AS_HELP_STRING([--enable-plugin-xenstat], [enable xenstat plugin @<:@default autodetect@:>@])], + , + [enable_plugin_xenstat="detect"] +) AC_ARG_ENABLE( [pedantic], @@ -407,10 +413,10 @@ AM_CONDITIONAL([ENABLE_PLUGIN_FREEIPMI], [test "${enable_plugin_freeipmi}" = "ye # ----------------------------------------------------------------------------- -# cups.plugin - libmnl, libnetfilter_acct +# cups.plugin - libcups # Only check most recently added method of cups - AC_CHECK_LIB([cups], [httpConnect2], +AC_CHECK_LIB([cups], [httpConnect2], [AC_CHECK_HEADER( [cups/cups.h], [have_cups=yes], @@ -463,11 +469,11 @@ PKG_CHECK_MODULES( [NFACCT], [libnetfilter_acct], [AC_CHECK_LIB( - [netfilter_acct], - [nfacct_alloc], - [have_libnetfilter_acct=yes], - [have_libnetfilter_acct=no] - )], + [netfilter_acct], + [nfacct_alloc], + [have_libnetfilter_acct=yes], + [have_libnetfilter_acct=no] + )], [have_libnetfilter_acct=no] ) @@ -475,11 +481,11 @@ PKG_CHECK_MODULES( [LIBMNL], [libmnl], [AC_CHECK_LIB( - [mnl], - [mnl_socket_open], - [have_libmnl=yes], - [have_libmnl=no] - )], + [mnl], + [mnl_socket_open], + [have_libmnl=yes], + [have_libmnl=no] + )], [have_libmnl=no] ) @@ -504,6 +510,73 @@ AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"]) # ----------------------------------------------------------------------------- +# xenstat.plugin - libxenstat + +PKG_CHECK_MODULES( + [YAJL], + [yajl], + [AC_CHECK_LIB( + [yajl], + [yajl_tree_get], + [have_libyajl=yes], + [have_libyajl=no] + )], + [have_libyajl=no] +) + +AC_CHECK_LIB( + [xenstat], + [xenstat_init], + [AC_CHECK_HEADER( + [xenstat.h], + [have_libxenstat=yes], + [have_libxenstat=no] + )], + [have_libxenstat=no], + [-lyajl] +) + +PKG_CHECK_MODULES( + [XENLIGHT], + [xenlight], + [AC_CHECK_LIB( + [xenlight], + [libxl_domain_info], + [AC_CHECK_HEADER( + [libxl.h], + [have_libxenlight=yes], + [have_libxenlight=no] + )], + [have_libxenlight=no] + )], + [have_libxenlight=no] +) + +test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenstat}" != "yes" && \ + AC_MSG_ERROR([libxenstat required but not found. try installing 'xen-dom0-libs-devel']) + +test "${enable_plugin_xenstat}" = "yes" -a "${have_libxenlight}" != "yes" && \ + AC_MSG_ERROR([libxenlight required but not found. try installing 'xen-dom0-libs-devel']) + +test "${enable_plugin_xenstat}" = "yes" -a "${have_libyajl}" != "yes" && \ + AC_MSG_ERROR([libyajl required but not found. Try installing 'yajl-devel']) + +AC_MSG_CHECKING([if xenstat.plugin should be enabled]) +if test "${enable_plugin_xenstat}" != "no" -a "${have_libxenstat}" = "yes" -a "${have_libxenlight}" = "yes" -a "${have_libyajl}" = "yes"; then + enable_plugin_xenstat="yes" + AC_DEFINE([HAVE_LIBXENSTAT], [1], [libxenstat usability]) + AC_DEFINE([HAVE_LIBXENLIGHT], [1], [libxenlight usability]) + AC_DEFINE([HAVE_LIBYAJL], [1], [libyajl usability]) + OPTIONAL_XENSTAT_CLFAGS="${XENLIGHT_CFLAGS} ${YAJL_CFLAGS}" + OPTIONAL_XENSTAT_LIBS="-lxenstat ${XENLIGHT_LIBS} ${YAJL_LIBS}" +else + enable_plugin_xenstat="no" +fi +AC_MSG_RESULT([${enable_plugin_xenstat}]) +AM_CONDITIONAL([ENABLE_PLUGIN_XENSTAT], [test "${enable_plugin_xenstat}" = "yes"]) + + +# ----------------------------------------------------------------------------- # check for setns() - cgroup-network AC_CHECK_FUNC([setns]) @@ -527,7 +600,7 @@ if test "${enable_lto}" != "no"; then fi if test "${have_lto}" = "yes"; then oCFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} -flto ${OPTIONAL_MATH_CLFAGS} ${OPTIONAL_NFACCT_CLFAGS} ${OPTIONAL_ZLIB_CLFAGS} ${OPTIONAL_UUID_CLFAGS} ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CLFAGS}" + CFLAGS="${CFLAGS} -flto ${OPTIONAL_MATH_CLFAGS} ${OPTIONAL_NFACCT_CLFAGS} ${OPTIONAL_ZLIB_CLFAGS} ${OPTIONAL_UUID_CLFAGS} ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS} ${OPTIONAL_CUPS_CLFAGS} ${OPTIONAL_XENSTAT_FLAGS}" ac_cv_c_lto_cross_compile="${enable_lto}" test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no" AC_C_LTO @@ -600,6 +673,8 @@ AC_SUBST([OPTIONAL_IPMIMONITORING_CFLAGS]) AC_SUBST([OPTIONAL_IPMIMONITORING_LIBS]) AC_SUBST([OPTIONAL_CUPS_CFLAGS]) AC_SUBST([OPTIONAL_CUPS_LIBS]) +AC_SUBST([OPTIONAL_XENSTAT_CFLAGS]) +AC_SUBST([OPTIONAL_XENSTAT_LIBS]) AC_CONFIG_FILES([ @@ -629,6 +704,7 @@ AC_CONFIG_FILES([ collectors/python.d.plugin/Makefile collectors/statsd.plugin/Makefile collectors/tc.plugin/Makefile + collectors/xenstat.plugin/Makefile daemon/Makefile database/Makefile diagrams/Makefile |