#!/bin/bash
# could do on a machine with llvm and hscolour

set -e
set -x
date
hostname
aklog sipb
tarballs=/mit/ghc/src
version=7.10.2
target=/scratch/kenta/afs/sipb.mit.edu/project/ghc/arch/$ATHENA_SYS/install/$version
#target=/tmp/$version

source=$tarballs/tarballs/ghc-$version-src.tar.xz


if [ -e $target ]
then exit 1
fi


#d=$(mktemp -d --tmpdir=/run/shm/kenta ghccompile-kenta.XXXXXXXXXX)
#d=/tmp/keng1
#mkdir $d
d=/scratch/kenta/ghccompile
mkdir $d
cd $d
tar xf $source
cd ghc-$version
./configure --prefix=$target
nice time make -j8
