From 50ed57c1b80f541c64371a89d19fdde8fe33310b Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 21 Mar 2011 13:51:21 +0100 Subject: [PATCH] htools: add option to control the use of RAPI RAPI needs the curl module, which is a binding to the libcurl C library. This is more complex (can be compiled either against gnutls or openssl, etc.) and it's not of much help when the tools are used on the cluster itself, we disable it by default. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- Makefile.am | 2 +- configure.ac | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 452f5f2c7..c155895a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -409,7 +409,7 @@ bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS)) iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS)) endif -$(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) +$(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile cd htools && $(GHC) --make $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \ $(patsubst htools/%,%,$@) diff --git a/configure.ac b/configure.ac index 00198c132..546d5fc1a 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,14 @@ AC_ARG_ENABLE([htools], [], [enable_htools=check]) +# --enable-htools-rapi +HTOOLS_RAPI= +AC_ARG_ENABLE([htools-rapi], + [AS_HELP_STRING([--enable-htools-rapi], + [enable use of RAPI in htools (needs curl, default: no)])], + [], + [enable_htools_rapi=no]) + # --with-disk-separator=... AC_ARG_WITH([disk-separator], [AS_HELP_STRING([--with-disk-separator=STRING], @@ -323,15 +331,25 @@ if test -z "$GHC_PKG"; then else # check for modules AC_MSG_NOTICE([checking for required haskell modules]) - AC_MSG_CHECKING([curl]) - GHC_PKG_CURL=$($GHC_PKG latest curl) - if test -z "$GHC_PKG_CURL"; then - AC_MSG_WARN([The curl library not found, htools will be compiled - without RAPI support]) - AC_SUBST(HTOOLS_NOCURL, [-DNO_CURL]) + HTOOLS_NOCURL=-DNO_CURL + if test "$enable_htools_rapi" != "no"; then + AC_MSG_CHECKING([curl]) + GHC_PKG_CURL=$($GHC_PKG latest curl) + if test -z "$GHC_PKG_CURL"; then + if test "$enable_htools_rapi" = "check"; then + AC_MSG_WARN([The curl library not found, htools will be compiled + without RAPI support]) + else + AC_MSG_FAILURE([The curl library was not found, but it has + been requested]) + fi + else + HTOOLS_NOCURL= + fi + AC_MSG_RESULT($GHC_PKG_CURL) fi - AC_MSG_RESULT($GHC_PKG_CURL) AC_SUBST(GHC_PKG_CURL) + AC_SUBST(HTOOLS_NOCURL) AC_MSG_CHECKING([parallel]) GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-2.*') if test -z "$GHC_PKG_PARALLEL" -- GitLab