Skip to content

Commit

Permalink
initial work for sandbox, but a .o file cannot be found during build...
Browse files Browse the repository at this point in the history
  • Loading branch information
atzedijkstra committed Apr 16, 2015
1 parent de0877a commit 6d100c1
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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

Expand Down
79 changes: 79 additions & 0 deletions EHC/configure
Expand Up @@ -703,6 +703,8 @@ ghcPkgCmd
GHC_CMD1
GHC_GEN_OPTIONS
GHC_EHC_OPTIONS
CABAL_CMD
cabalCmd
GHC_VERSION
GHC_CMD
ghcCmd
Expand All @@ -728,6 +730,7 @@ arCmd
RANLIB_CMD
ranlibCmd
cppCmd
ENABLE_SANDBOX
ENABLE_TAUPHI
ENABLE_CORESYSF
ENABLE_CORE_ASINPOUTP
Expand Down Expand Up @@ -819,6 +822,7 @@ enable_tycore
enable_core_asinpoutp
enable_coresysf
enable_tauphi
enable_sandbox
with_cpp
with_aspects
with_build_suffix
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -1521,6 +1527,9 @@ Optional Packages:
--with-hc=<haskell compiler>
Use a command different from 'ghc' to compile with
GHC.
--with-cabal=<cabal package installer>
Use a command different from 'cabal' to build
libraries with GHC.
--with-ghc-ehc-options=<haskell compiler options for compiling ehc>
Additional options to pass to GHC when compiling
EHC.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions EHC/configure.ac
Expand Up @@ -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=<cpp preprocessor>],[Use a command different from 'cpp' to compile with CPP.])],
Expand Down Expand Up @@ -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=<cabal package installer>],[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=<haskell compiler options for compiling ehc>],[Additional options to pass to GHC when compiling EHC.])],
Expand Down
5 changes: 5 additions & 0 deletions EHC/mk/config.mk.in
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions EHC/mk/shared.mk.in
Expand Up @@ -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@
Expand Down
12 changes: 12 additions & 0 deletions EHC/src/ehc/files1.mk
Expand Up @@ -392,13 +392,25 @@ $(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) && \
$(LIB_EHC_SETUP) configure $(CABAL_SETUP_OPTS) --prefix=$(INSTALLFORBLDABS_PREFIX) $(CABAL_OPT_INSTALL_LOC) && \
$(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)
Expand Down

0 comments on commit 6d100c1

Please sign in to comment.