From 883a7a95a14b9d3c15713678e24572153d2fbfec Mon Sep 17 00:00:00 2001 From: Thomas Hallgren Date: Sat, 1 Dec 2018 15:53:27 +0100 Subject: [PATCH] build-binary-dist.sh: make it easy to choose which version of ghc to use --- bin/build-binary-dist.sh | 7 ++++--- 1 file 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