#!/bin/bash rootname=$(cat /etc/debian_chroot 2>/dev/null) warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" exts="-XOverloadedStrings -XRecordWildCards" defs="-DBENCODE_AESON -DTHREAD_DEBUG" hide="-hide-package crypto-random -hide-package crypto-api -hide-package crypto-numbers -hide-package cryptohash -hide-package prettyclass" if [ "$rootname" == "stretch" ] then echo "Building with cryptonite backport. (chroot = $rootname)" defs="$defs -DCRYPTONITE_BACKPORT -icryptonite-backport" warn="build/b/cbits/cryptonite_salsa.o build/b/cbits/cryptonite_xsalsa.o $warn" fi root=${0%/*} cd "$root" me=${0##*/} me=${me%.*} ghc -threaded \ $hide \ $exts \ $defs \ -hidir build/$me$rootname -odir build/$me$rootname \ -iPresence \ -iArchive \ -isrc \ build/b/Presence/monitortty.o \ $warn \ "$@"