Revision d9a900dc

b/Makefile.am
54 54
# Delete output file if an error occurred while building it
55 55
.DELETE_ON_ERROR:
56 56

  
57
HTOOLS_DIRS = \
57
HS_DIRS = \
58 58
	src \
59 59
	src/Ganeti \
60 60
	src/Ganeti/Block \
......
76 76
	htest/Test/Ganeti/Query
77 77

  
78 78
DIRS = \
79
	$(HTOOLS_DIRS) \
79
	$(HS_DIRS) \
80 80
	autotools \
81 81
	daemons \
82 82
	devel \
......
161 161

  
162 162
CLEANFILES = \
163 163
	$(addsuffix /*.py[co],$(DIRS)) \
164
	$(addsuffix /*.hi,$(HTOOLS_DIRS)) \
165
	$(addsuffix /*.o,$(HTOOLS_DIRS)) \
164
	$(addsuffix /*.hi,$(HS_DIRS)) \
165
	$(addsuffix /*.o,$(HS_DIRS)) \
166 166
	$(PYTHON_BOOTSTRAP) \
167 167
	epydoc.conf \
168 168
	$(REPLACE_VARS_SED) \
......
191 191
	$(BUILT_PYTHON_SOURCES) \
192 192
	$(PYTHON_BOOTSTRAP)
193 193

  
194
HTOOLS_GENERATED_FILES =
194
HS_GENERATED_FILES =
195 195
if WANT_HTOOLS
196
HTOOLS_GENERATED_FILES += $(HS_PROGS)
196
HS_GENERATED_FILES += $(HS_PROGS)
197 197
if ENABLE_CONFD
198
HTOOLS_GENERATED_FILES += src/hconfd src/ganeti-confd
198
HS_GENERATED_FILES += src/hconfd src/ganeti-confd
199 199
endif
200 200
endif
201 201

  
......
670 670
endif
671 671

  
672 672
$(HS_ALL_PROGS): %: %.hs $(HS_LIBTEST_SRCS) $(HS_BUILT_SRCS) Makefile
673
	@if [ "$(notdir $@)" = "test" ] && [ "$(HTOOLS_NODEV)" ]; then \
673
	@if [ "$(notdir $@)" = "test" ] && [ "$(HS_NODEV)" ]; then \
674 674
	  echo "Error: cannot run unittests without the development" \
675 675
	       " libraries (see devnotes.rst)" 1>&2; \
676 676
	  exit 1; \
......
678 678
	@rm -f $(notdir $@).tix
679 679
	$(GHC) --make \
680 680
	  $(HFLAGS) \
681
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
681
	  $(HS_NOCURL) $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
682 682
	  -osuf $(notdir $@).o -hisuf $(notdir $@).hi \
683 683
	  $(HEXTRA) $(HEXTRA_INT) $@
684 684
	@touch "$@"
......
1053 1053
nodist_TESTS =
1054 1054
check_SCRIPTS =
1055 1055

  
1056
if WANT_HTOOLSTESTS
1056
if WANT_HSTESTS
1057 1057
nodist_TESTS += $(haskell_tests)
1058 1058
dist_TESTS += htest/offline-test.sh
1059 1059
check_SCRIPTS += \
......
1173 1173
	$(BUILD_BASH_COMPLETION) $(RUN_IN_TEMPDIR) \
1174 1174
	lib/cli.py $(gnt_scripts) $(client_PYTHON) tools/burnin \
1175 1175
	daemons/ganeti-cleaner \
1176
	$(GENERATED_FILES) $(HTOOLS_GENERATED_FILES)
1176
	$(GENERATED_FILES) $(HS_GENERATED_FILES)
1177 1177
	PYTHONPATH=. $(RUN_IN_TEMPDIR) \
1178 1178
	  $(CURDIR)/$(BUILD_BASH_COMPLETION) $(BC_ARGS) > $@
1179 1179

  
......
1685 1685
	  "$(DESTDIR)${localstatedir}/run/ganeti"
1686 1686

  
1687 1687
.PHONY: apidoc
1688
if WANT_HTOOLSAPIDOC
1688
if WANT_HSAPIDOC
1689 1689
apidoc: py-apidoc hs-apidoc
1690 1690
else
1691 1691
apidoc: py-apidoc
......
1713 1713
	$(LN_S) ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/Confd/hscolour.css
1714 1714
	set -e ; \
1715 1715
	cd src; \
1716
	if [ "$(HTOOLS_NOCURL)" ]; \
1717
	then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
1716
	if [ "$(HS_NOCURL)" ]; \
1717
	then OPTGHC="--optghc=$(HS_NOCURL)"; \
1718 1718
	else OPTGHC=""; \
1719 1719
	fi; \
1720
	if [ "$(HTOOLS_PARALLEL3)" ]; \
1721
	then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_PARALLEL3)"; \
1720
	if [ "$(HS_PARALLEL3)" ]; \
1721
	then OPTGHC="$$OPTGHC --optghc=$(HS_PARALLEL3)"; \
1722 1722
	fi; \
1723
	if [ "$(HTOOLS_REGEX_PCRE)" ]; \
1724
	then OPTGHC="$$OPTGHC --optghc=$(HTOOLS_REGEX_PCRE)"; \
1723
	if [ "$(HS_REGEX_PCRE)" ]; \
1724
	then OPTGHC="$$OPTGHC --optghc=$(HS_REGEX_PCRE)"; \
1725 1725
	fi; \
1726 1726
	RELSRCS="$(HS_LIB_SRCS:src/%=%) $(patsubst src/%,%,$(filter src/%,$(HS_BUILT_SRCS)))"; \
1727 1727
	for file in $$RELSRCS; do \
......
1740 1740
	rm -f TAGS
1741 1741
	$(GHC) -e ":etags" -v0 \
1742 1742
	  $(filter-out -O -Werror,$(HFLAGS)) \
1743
	  $(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) $(HTOOLS_REGEX_PCRE) \
1743
	  $(HS_NOCURL) $(HS_PARALLEL3) $(HS_REGEX_PCRE) \
1744 1744
	  $(HS_LIBTEST_SRCS)
1745 1745
	find . -path './lib/*.py' -o -path './scripts/gnt-*' -o \
1746 1746
	  -path './daemons/ganeti-*' -o -path './tools/*' -o \
b/configure.ac
476 476

  
477 477
# check for modules, first custom/special checks
478 478
AC_MSG_NOTICE([checking for required haskell modules])
479
HTOOLS_NOCURL=-DNO_CURL
479
HS_NOCURL=-DNO_CURL
480 480
if test "$enable_htools_rapi" != no; then
481
  AC_GHC_PKG_CHECK([curl], [HTOOLS_NOCURL=], [])
482
  if test -n "$HTOOLS_NOCURL"; then
481
  AC_GHC_PKG_CHECK([curl], [HS_NOCURL=], [])
482
  if test -n "$HS_NOCURL"; then
483 483
    if test "$enable_htools_rapi" = check; then
484 484
      AC_MSG_WARN(m4_normalize([The curl library was not found, Haskell
485 485
                                code will be compiled without RAPI support]))
......
491 491
    AC_MSG_NOTICE([Enabling curl/RAPI/RPC usage in Haskell code])
492 492
  fi
493 493
fi
494
AC_SUBST(HTOOLS_NOCURL)
494
AC_SUBST(HS_NOCURL)
495 495

  
496
HTOOLS_PARALLEL3=
497
AC_GHC_PKG_CHECK([parallel-3.*], [HTOOLS_PARALLEL3=-DPARALLEL3],
496
HS_PARALLEL3=
497
AC_GHC_PKG_CHECK([parallel-3.*], [HS_PARALLEL3=-DPARALLEL3],
498 498
                 [AC_GHC_PKG_REQUIRE(parallel)], t)
499
AC_SUBST(HTOOLS_PARALLEL3)
499
AC_SUBST(HS_PARALLEL3)
500 500

  
501 501
# and now standard modules
502 502
AC_GHC_PKG_REQUIRE(json)
......
506 506
AC_GHC_PKG_REQUIRE(utf8-string)
507 507

  
508 508
# extra modules for confd functionality
509
HTOOLS_REGEX_PCRE=-DNO_REGEX_PCRE
509
HS_REGEX_PCRE=-DNO_REGEX_PCRE
510 510
has_confd=False
511 511
if test "$enable_confd" != no; then
512 512
  CONFD_PKG=
513
  AC_GHC_PKG_CHECK([regex-pcre], [HTOOLS_REGEX_PCRE=],
513
  AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
514 514
                   [CONFD_PKG="$CONFD_PKG regex-pcre"])
515 515
  AC_GHC_PKG_CHECK([hslogger], [], [CONFD_PKG="$CONFD_PKG hslogger"])
516 516
  AC_GHC_PKG_CHECK([Crypto], [], [CONFD_PKG="$CONFD_PKG Crypto"])
......
528 528
                                 $CONFD_PKG]))
529 529
  fi
530 530
fi
531
AC_SUBST(HTOOLS_REGEX_PCRE)
531
AC_SUBST(HS_REGEX_PCRE)
532 532
if test "$has_confd" = True; then
533 533
  AC_MSG_NOTICE([Enabling confd usage])
534 534
fi
......
560 560
AM_CONDITIONAL([ENABLE_MONITORING], [test "$has_monitoring" = True])
561 561

  
562 562
# development modules
563
HTOOLS_NODEV=
564
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HTOOLS_NODEV=1], t)
565
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HTOOLS_NODEV=1], t)
566
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HTOOLS_NODEV=1])
567
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HTOOLS_NODEV=1])
568
AC_GHC_PKG_CHECK([temporary], [], [HTOOLS_NODEV=1])
563
HS_NODEV=
564
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t)
565
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HS_NODEV=1], t)
566
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HS_NODEV=1])
567
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HS_NODEV=1])
568
AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1])
569 569
# FIXME: unify checks for non-test libraries (attoparsec, hinotify, ...)
570 570
#        that are needed to execute the tests, avoiding the duplication
571 571
#        of the checks.
572
AC_GHC_PKG_CHECK([attoparsec], [], [HTOOLS_NODEV=1])
573
AC_GHC_PKG_CHECK([vector], [], [HTOOLS_NODEV=1])
574
if test -n "$HTOOLS_NODEV"; then
572
AC_GHC_PKG_CHECK([attoparsec], [], [HS_NODEV=1])
573
AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1])
574
if test -n "$HS_NODEV"; then
575 575
   AC_MSG_WARN(m4_normalize([Required development modules were not found,
576 576
                             you won't be able to run Haskell unittests]))
577 577
else
578 578
   AC_MSG_NOTICE([Haskell development modules found, unittests enabled])
579 579
fi
580
AC_SUBST(HTOOLS_NODEV)
580
AC_SUBST(HS_NODEV)
581 581

  
582 582
HTOOLS=yes
583 583
AC_SUBST(HTOOLS)
......
600 600
        ;;
601 601
    esac
602 602
  ]],
603
  [[case "x${has_confd}x${HTOOLS_NOCURL}x" in
603
  [[case "x${has_confd}x${HS_NOCURL}x" in
604 604
     xTruexx)
605 605
       enable_split_query=True
606 606
       ;;
......
614 614
  AC_MSG_ERROR([Split queries require the confd daemon])
615 615
fi
616 616

  
617
if test x$enable_split_query = xTrue -a x$HTOOLS_NOCURL != x; then
617
if test x$enable_split_query = xTrue -a x$HS_NOCURL != x; then
618 618
  AC_MSG_ERROR([Split queries require the htools-rapi feature (curl library)])
619 619
fi
620 620

  
......
623 623
fi
624 624

  
625 625
# Check for HsColour
626
HTOOLS_APIDOC=no
626
HS_APIDOC=no
627 627
AC_ARG_VAR(HSCOLOUR, [HsColour path])
628 628
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
629 629
if test -z "$HSCOLOUR"; then
......
639 639
                            not be generated]))
640 640
fi
641 641
if test -n "$HADDOCK" && test -n "$HSCOLOUR"; then
642
  HTOOLS_APIDOC=yes
642
  HS_APIDOC=yes
643 643
fi
644
AC_SUBST(HTOOLS_APIDOC)
644
AC_SUBST(HS_APIDOC)
645 645

  
646 646
# Check for hlint
647 647
AC_ARG_VAR(HLINT, [hlint path])
......
656 656
fi
657 657

  
658 658
AM_CONDITIONAL([WANT_HTOOLS], [test "$HTOOLS" = yes])
659
AM_CONDITIONAL([WANT_HTOOLSTESTS], [test "x$HTOOLS_NODEV" = x])
660
AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test "$HTOOLS_APIDOC" = yes])
659
AM_CONDITIONAL([WANT_HSTESTS], [test "x$HS_NODEV" = x])
660
AM_CONDITIONAL([WANT_HSAPIDOC], [test "$HS_APIDOC" = yes])
661 661
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
662 662

  
663 663
# Check for fakeroot

Also available in: Unified diff