summaryrefslogtreecommitdiff
path: root/bin/build-binary-dist.sh
diff options
context:
space:
mode:
authorThomas Hallgren <th-github@altocumulus.org>2018-12-01 15:53:27 +0100
committerThomas Hallgren <th-github@altocumulus.org>2018-12-01 15:53:27 +0100
commit883a7a95a14b9d3c15713678e24572153d2fbfec (patch)
tree307e0a121a5f7c2c5bf2d1b458c01b5679f3808d /bin/build-binary-dist.sh
parent831252eb81989584ea9bc5b0d7e146dc5f71ca67 (diff)
build-binary-dist.sh: make it easy to choose which version of ghc to use
Diffstat (limited to 'bin/build-binary-dist.sh')
-rwxr-xr-xbin/build-binary-dist.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh
index ebc72a5e1..053fd1d81 100755
--- a/bin/build-binary-dist.sh
+++ b/bin/build-binary-dist.sh
@@ -16,13 +16,14 @@ name="gf-$ver"
destdir="$PWD/dist/$name" # assemble binary dist here
prefix=${PREFIX:-/usr/local} # where to install
fmt=${FMT:-tar.gz} # binary package format (tar.gz or pkg)
+ghc=${GHC:-ghc} # which Haskell compiler to use
extralib="$destdir$prefix/lib"
extrainclude="$destdir$prefix/include"
extra="--extra-lib-dirs=$extralib --extra-include-dirs=$extrainclude"
set -e # Stop if an error occurs
-set -x # print commands before exuting them
+set -x # print commands before executing them
## First configure & build the C run-time system
pushd src/runtime/c
@@ -64,8 +65,8 @@ else
fi
## Build GF, with C run-time support enabled
-cabal install --only-dependencies -fserver -fc-runtime $extra
-cabal configure --prefix="$prefix" -fserver -fc-runtime $extra
+cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra
+cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
# Building the example grammars will fail, because the RGL is missing
cabal copy --destdir="$destdir" # create www directory