Revision 35c6e63d configure.ac

b/configure.ac
416 416
  [],
417 417
  [enable_confd=check])
418 418

  
419
ENABLE_MONITORING=
420
AC_ARG_ENABLE([monitoring],
421
  [AS_HELP_STRING([--enable-monitoring],
422
  [enable the ganeti monitoring agent (default: check)])],
423
  [],
424
  [enable_monitoring=check])
425

  
419 426
# Check for ghc
420 427
AC_ARG_VAR(GHC, [ghc path])
421 428
AC_PATH_PROG(GHC, [ghc], [])
......
492 499
AC_SUBST(ENABLE_CONFD, $has_confd)
493 500
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
494 501

  
502
#extra modules for monitoring agent functionality
503
has_monitoring=False
504
if test "$enable_monitoring" != "no"; then
505
  MONITORING_PKG=
506
  AC_GHC_PKG_CHECK([attoparsec], [], [MONITORING_PKG="$MONITORING_PKG attoparsec"])
507
  if test -z "$MONITORING_PKG"; then
508
    has_monitoring=True
509
  else
510
    if test "$enable_monitoring" = "check"; then
511
      AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
512
                                agent were not found ($MONITORING_PKG),
513
                                monitoring disabled]))
514
    else
515
      AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
516
                                   required libraries were not found:
517
                                   $MONITORING_PKG]))
518
    fi
519
  fi
520
fi
521
if test "$has_monitoring" = "True"; then
522
  AC_MSG_NOTICE([Enabling the monitoring agent usage])
523
fi
524
AC_SUBST(ENABLE_MONITORING, $has_monitoring)
525
AM_CONDITIONAL([ENABLE_MONITORING], [test x$has_monitoring = xTrue])
526

  
495 527
# development modules
496 528
HTOOLS_NODEV=
497 529
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HTOOLS_NODEV=1], t)
498 530
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HTOOLS_NODEV=1], t)
499 531
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HTOOLS_NODEV=1])
500 532
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HTOOLS_NODEV=1])
533
# FIXME: unify checks for non-test libraries (attoparsec, hinotify, ...)
534
#        that are needed to execute the tests, avoiding the duplication
535
#        of the checks.
536
AC_GHC_PKG_CHECK([attoparsec], [], [HTOOLS_NODEV=1])
501 537
if test -n "$HTOOLS_NODEV"; then
502 538
   AC_MSG_WARN(m4_normalize([Required development modules were not found,
503 539
                             you won't be able to run Haskell unittests]))

Also available in: Unified diff