diff --git a/EHC/changelog.md.editthis b/EHC/changelog.md.editthis index 56ea776a4..0ed0ecc4f 100644 --- a/EHC/changelog.md.editthis +++ b/EHC/changelog.md.editthis @@ -1,4 +1,5 @@ -- [edit this] and this, adding new entries as needed (version nr etc is prefixed when using version bumping Makefile targets) +- [build] Strict version equality dependency on uhc-util, uulib +- [core api] Core api no longer needs ANormal patch ([#50](https://github.com/UU-ComputerScience/uhc/pull/50)). ## 1.1.8.10 - 20150327 diff --git a/EHC/configure b/EHC/configure index 5263e6128..cc356bfd3 100755 --- a/EHC/configure +++ b/EHC/configure @@ -703,6 +703,8 @@ ghcPkgCmd GHC_CMD1 GHC_GEN_OPTIONS GHC_EHC_OPTIONS +CABAL_CMD +cabalCmd GHC_VERSION GHC_CMD ghcCmd @@ -728,6 +730,7 @@ arCmd RANLIB_CMD ranlibCmd cppCmd +ENABLE_SANDBOX ENABLE_TAUPHI ENABLE_CORESYSF ENABLE_CORE_ASINPOUTP @@ -819,6 +822,7 @@ enable_tycore enable_core_asinpoutp enable_coresysf enable_tauphi +enable_sandbox with_cpp with_aspects with_build_suffix @@ -833,6 +837,7 @@ with_cabal_config_options with_ehc_unixtool_prefix with_haddock with_hc +with_cabal with_ghc_ehc_options with_uuagc with_shuffle @@ -1477,6 +1482,7 @@ Optional Features: backend and source language --enable-coresysf include System F type generation for Core --enable-tauphi include TauPhi language extension and analyses + --enable-sandbox build EHC/UHC libs with cabal sandbox Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1521,6 +1527,9 @@ Optional Packages: --with-hc= Use a command different from 'ghc' to compile with GHC. + --with-cabal= + Use a command different from 'cabal' to build + libraries with GHC. --with-ghc-ehc-options= Additional options to pass to GHC when compiling EHC. @@ -3182,6 +3191,17 @@ fi ENABLE_TAUPHI=$enableTauPhi +### enable options: use cabal sandbox for building libs, default is no +# Check whether --enable-sandbox was given. +if test "${enable_sandbox+set}" = set; then : + enableval=$enable_sandbox; enableSandbox=yes +else + enableSandbox=no +fi + +ENABLE_SANDBOX=$enableSandbox + + ### cpp # Check whether --with-cpp was given. @@ -3793,6 +3813,65 @@ GHC_CMD=$ghcCmd GHC_VERSION=$ghcVersion + +### 'with' option for cabal, by default cabal + +# Check whether --with-cabal was given. +if test "${with_cabal+set}" = set; then : + withval=$with_cabal; cabalCmd="$withval" +else + + if test "$CABAL" = ""; then + # Extract the first word of "cabal", so it can be a program name with args. +set dummy cabal; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_cabalCmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $cabalCmd in + [\\/]* | ?:[\\/]*) + ac_cv_path_cabalCmd="$cabalCmd" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_cabalCmd="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +cabalCmd=$ac_cv_path_cabalCmd +if test -n "$cabalCmd"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cabalCmd" >&5 +$as_echo "$cabalCmd" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + cabalCmd=$CABAL + fi + + +fi + +CABAL_CMD=$cabalCmd + + ### 'with' option for ghc options # Check whether --with-ghc-ehc-options was given. diff --git a/EHC/configure.ac b/EHC/configure.ac index 5d6b9cb8b..c5da5ec80 100644 --- a/EHC/configure.ac +++ b/EHC/configure.ac @@ -189,6 +189,10 @@ AC_SUBST(ENABLE_CORESYSF,$enableCoreSysF) AC_ARG_ENABLE(tauphi, AS_HELP_STRING([--enable-tauphi],[include TauPhi language extension and analyses]), [enableTauPhi=yes], [enableTauPhi=no]) AC_SUBST(ENABLE_TAUPHI,$enableTauPhi) +### enable options: use cabal sandbox for building libs, default is no +AC_ARG_ENABLE(sandbox, AS_HELP_STRING([--enable-sandbox],[build EHC/UHC libs with cabal sandbox]), [enableSandbox=yes], [enableSandbox=no]) +AC_SUBST(ENABLE_SANDBOX,$enableSandbox) + ### cpp AC_ARG_WITH(cpp, [AS_HELP_STRING([--with-cpp=],[Use a command different from 'cpp' to compile with CPP.])], @@ -424,6 +428,21 @@ fi AC_SUBST(GHC_CMD,$ghcCmd) AC_SUBST(GHC_VERSION, $ghcVersion) + +### 'with' option for cabal, by default cabal +AC_ARG_WITH(cabal, +[AS_HELP_STRING([--with-cabal=],[Use a command different from 'cabal' to build libraries with GHC.])], +[ cabalCmd="$withval" ], +[ + if test "$CABAL" = ""; then + AC_PATH_PROG(cabalCmd,cabal) + else + cabalCmd=$CABAL + fi +] +) +AC_SUBST(CABAL_CMD, $cabalCmd) + ### 'with' option for ghc options AC_ARG_WITH(ghc-ehc-options, [AS_HELP_STRING([--with-ghc-ehc-options=],[Additional options to pass to GHC when compiling EHC.])], diff --git a/EHC/mk/config.mk.in b/EHC/mk/config.mk.in index 432b42303..4c68e18cb 100644 --- a/EHC/mk/config.mk.in +++ b/EHC/mk/config.mk.in @@ -94,6 +94,11 @@ TOPLEVEL_SYSTEM_ABSPATH_PREFIX := @TOPLEVEL_SYSTEM_ABSPATH_PREFIX@ # inclusion of features ########################################################################################### +# use cabal sandbox +ifeq (@ENABLE_SANDBOX@,yes) +ENABLE_SANDBOX := yes +endif + # include java code generation ifeq (@ENABLE_JAVA@,yes) ENABLE_JAVA := yes diff --git a/EHC/mk/shared.mk.in b/EHC/mk/shared.mk.in index 80905a506..552833aec 100644 --- a/EHC/mk/shared.mk.in +++ b/EHC/mk/shared.mk.in @@ -246,6 +246,7 @@ RULER2 := @RULER_CMD@ GHC := @GHC_CMD@ GHC1 := @GHC_CMD1@ GHC_VERSION := @GHC_VERSION@ +CABAL := @CABAL_CMD@ HSC2HS := @HSC2HS_CMD@ HADDOCK := @HADDOCK_CMD@ HADDOCK_VERSION := @HADDOCK_VERSION@ diff --git a/EHC/src/ehc/files1.mk b/EHC/src/ehc/files1.mk index 30f3b2d93..5b943d2ad 100644 --- a/EHC/src/ehc/files1.mk +++ b/EHC/src/ehc/files1.mk @@ -392,6 +392,17 @@ $(LIB_EHC_SETUP_HS_DRV): $(EHC_MKF) $(LIB_EHC_SETUP2): $(LIB_EHC_SETUP_HS_DRV) $(call GHC_CABAL,$<,$@) +ifeq ($(ENABLE_SANDBOX),yes) +$(LIB_EHC_INS_FLAG): $(LIB_EHC_CABAL_DRV) $(INSABS_EHC_LIB_ALL_AG) $(EHC_MKF) + mkdir -p $(@D) + cd $(EHC_BLD_LIBEHC_VARIANT_PREFIX) && \ + $(CABAL) sandbox init && \ + $(CABAL) install --only-dependencies && \ + $(CABAL) configure $(CABAL_SETUP_OPTS) && \ + $(CABAL) build && \ + echo $@ > $@ +else +# The cabal user install version of the above, i.e. not using cabal sandbox (available with cabal 1.18) $(LIB_EHC_INS_FLAG): $(LIB_EHC_CABAL_DRV) $(LIB_EHC_SETUP2) $(INSABS_EHC_LIB_ALL_AG) $(EHC_MKF) mkdir -p $(@D) cd $(EHC_BLD_LIBEHC_VARIANT_PREFIX) && \ @@ -399,6 +410,7 @@ $(LIB_EHC_INS_FLAG): $(LIB_EHC_CABAL_DRV) $(LIB_EHC_SETUP2) $(INSABS_EHC_LIB_ALL $(LIB_EHC_SETUP) build && \ $(LIB_EHC_SETUP) install && \ echo $@ > $@ +endif $(INSABS_EHC_LIB_ALL_AG): $(INSTALLABS_VARIANT_LIB_AG_PREFIX)%: $(EHC_BLD_LIB_HS_VARIANT_PREFIX)% mkdir -p $(@D)