diff --git a/INSTALL b/INSTALL index 0087e538b4cbfa092023ec4a2d5404fb2552936a..44088b6bdf26f53f8c45ba2709425deebf4dc8dc 100644 --- a/INSTALL +++ b/INSTALL @@ -168,9 +168,9 @@ Haskell optional features Optionally, more functionality can be enabled if your build machine has a few more Haskell libraries enabled: RAPI access to remote cluster from -htools (``--enable-htools-rapi``) and enabling the ``ganeti-confd`` -daemon (``--enable-confd``). The list of extra dependencies for these -is: +htools (``--enable-htools-rapi``), the ``ganeti-confd`` +daemon (``--enable-confd``) and the monitoring agent +(``--enable-monitoring``). The list of extra dependencies for these is: - `curl `_, tested with versions 1.3.4 and above @@ -182,16 +182,19 @@ is: - `hinotify `_ - `regex-pcre `_, bindings for the ``pcre`` library +- `attoparsec `_ These libraries are available in Debian Wheezy (but not in Squeeze, with the exception of curl), so you can use either apt:: $ apt-get install libghc-hslogger-dev libghc-crypto-dev libghc-text-dev \ - libghc-hinotify-dev libghc-regex-pcre-dev libghc-curl-dev + libghc-hinotify-dev libghc-regex-pcre-dev libghc-curl-dev \ + libghc-attoparsec-dev or ``cabal``:: - $ cabal install hslogger Crypto text hinotify regex-pcre curl + $ cabal install hslogger Crypto text hinotify regex-pcre curl \ + attoparsec to install them. diff --git a/configure.ac b/configure.ac index 14554a3acfea530b2b22f42a1d31b01969bfc612..3e134a21db5b2340a8cd0d2f86442b00396246ab 100644 --- a/configure.ac +++ b/configure.ac @@ -416,6 +416,13 @@ AC_ARG_ENABLE([confd], [], [enable_confd=check]) +ENABLE_MONITORING= +AC_ARG_ENABLE([monitoring], + [AS_HELP_STRING([--enable-monitoring], + [enable the ganeti monitoring agent (default: check)])], + [], + [enable_monitoring=check]) + # Check for ghc AC_ARG_VAR(GHC, [ghc path]) AC_PATH_PROG(GHC, [ghc], []) @@ -492,12 +499,41 @@ fi AC_SUBST(ENABLE_CONFD, $has_confd) AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue]) +#extra modules for monitoring agent functionality +has_monitoring=False +if test "$enable_monitoring" != "no"; then + MONITORING_PKG= + AC_GHC_PKG_CHECK([attoparsec], [], [MONITORING_PKG="$MONITORING_PKG attoparsec"]) + if test -z "$MONITORING_PKG"; then + has_monitoring=True + else + if test "$enable_monitoring" = "check"; then + AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring + agent were not found ($MONITORING_PKG), + monitoring disabled])) + else + AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but + required libraries were not found: + $MONITORING_PKG])) + fi + fi +fi +if test "$has_monitoring" = "True"; then + AC_MSG_NOTICE([Enabling the monitoring agent usage]) +fi +AC_SUBST(ENABLE_MONITORING, $has_monitoring) +AM_CONDITIONAL([ENABLE_MONITORING], [test x$has_monitoring = xTrue]) + # development modules HTOOLS_NODEV= AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HTOOLS_NODEV=1], t) AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HTOOLS_NODEV=1], t) AC_GHC_PKG_CHECK([test-framework-hunit], [], [HTOOLS_NODEV=1]) AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HTOOLS_NODEV=1]) +# FIXME: unify checks for non-test libraries (attoparsec, hinotify, ...) +# that are needed to execute the tests, avoiding the duplication +# of the checks. +AC_GHC_PKG_CHECK([attoparsec], [], [HTOOLS_NODEV=1]) if test -n "$HTOOLS_NODEV"; then AC_MSG_WARN(m4_normalize([Required development modules were not found, you won't be able to run Haskell unittests]))