Skip to content

Instantly share code, notes, and snippets.

@leroux
Last active December 29, 2015 01:59
Show Gist options
  • Save leroux/7597066 to your computer and use it in GitHub Desktop.
Save leroux/7597066 to your computer and use it in GitHub Desktop.
#!/bin/bash -xe
SYSTEM=$(uname)
case $SYSTEM in
Darwin)
export PUBLIC=/data/Home/Dropbox/ghc
;;
Linux)
export PUBLIC=/srv/dropbox/ghc
;;
esac
export LOGDIR=$PUBLIC/logs
perl sync-all -r http://darcs.haskell.org/ --no-dph --nofib --testsuite get
git checkout origin/master
cat > mk/build.mk <<EOF
V=1
SRC_HC_OPTS = -H64m -O -fasm
GhcLibHcOpts = -O -dcore-lint
GhcStage1HcOpts = -Rghc-timing -O -fasm
GhcStage2HcOpts = -Rghc-timing -O0 -DDEBUG
SplitObjs = NO
LAX_DEPENDENCIES = YES
HADDOCK_DOCS=YES
LATEX_DOCS=YES
HSCOLOUR_SRCS=YES
BUILD_DOCBOOK_HTML=YES
BUILD_DOCBOOK_PDF=YES
BUILD_DOCBOOK_PS=YES
# After stage 1 and the libraries have been built, you can uncomment this line:
# stage=2
# Then stage 1 will not be touched by the build system, until
# you comment the line again. This is a useful trick for when you're
# working on stage 2 and want to freeze stage 1 and the libraries for
# a while.
EOF
case $SYSTEM in
Darwin)
INSTALLROOT=/usr/local/Cellar/ghc/HEAD
export PATH=/usr/local/bin:/Users/johnw/.cabal/bin:$PATH
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog
;;
Linux)
INSTALLROOT=/usr/local
export PATH=/usr/lib/llvm-3.1/bin:/srv/jenkins/.cabal/bin:$PATH
export XML_CATALOG_FILES=/etc/xml/catalog
echo "BeConservative=YES" >> mk/build.mk
;;
esac
perl boot
./configure --prefix=$INSTALLROOT
make -j8
make binary-dist
cp -p ghc-*.tar.bz2 $PUBLIC/dist
echo Running tests...
(cd testsuite/tests ; make THREADS=32) \
> $LOGDIR/ghc-fulltest-$(date +'%y%m%d')-$SYSTEM.log 2>&1
echo Running nofib...
cabal install html regex-compat || exit 0
(cd nofib ; make boot ; make) \
> $LOGDIR/ghc-nofib-$(date +'%y%m%d')-$SYSTEM.log 2>&1
#xz -9ve $LOGDIR/*.log
echo Build complete
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment