From: simonmar Date: Thu, 2 May 2002 13:33:27 +0000 (+0000) Subject: [project @ 2002-05-02 13:33:27 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~2061 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=95792891d27d6e5409f8d4fa53e4817f4a26f723;ds=sidebyside [project @ 2002-05-02 13:33:27 by simonmar] Add this script which does an unregisterised bootstrap to build HC files for porting GHC. --- diff --git a/distrib/cross-port b/distrib/cross-port new file mode 100644 index 0000000..ea616be --- /dev/null +++ b/distrib/cross-port @@ -0,0 +1,59 @@ +#! /bin/bash + +# This script can be used to generate some unregisterised .hc files +# for bootstrapping GHC on a new/unsupported platform. It involves a +# two-stage bootstrap: the first stage builds an unregisterised set of +# libraries & RTS, and the second stage builds an unregisterised +# compiler. + +# Take the .hc files from the libraries of stage 1, and the compiler +# of stage 2, to the target system and bootstrap from these to get a +# working (unregisterised) compiler. + +set -e + +long='-optc-DNO_REGS -optc-DUSE_MINIINTERPRETER -fno-asm-mangling -funregisterised -fvia-C' + +base=`pwd` + +if [ ! -f b1-stamp ]; then + mkdir b1 + cd b1 + lndir ../fptools + cd .. + + mkdir b1-obj + + cd b1 + ./configure --prefix=$base/b1-obj + echo "GhcLibHcOpts = -O -H24m -keep-hc-files-too $long" >> mk/config.mk + echo "GhcRtsHcOpts = -O $long" >> mk/config.mk + make boot + make all + make install + cd .. + + touch b1-stamp +fi + +# exit 0 + +if [ ! -f b2-stamp ]; then + mkdir b2 + cd b2 + lndir ../fptools + cd .. + + mkdir b2-obj + cd b2 + ./configure --prefix=$base/b2-obj --with-hc=$base/b1-obj/bin/ghc + echo "WithGhcHc = $base/b1-obj/bin/ghc" >> mk/config.mk + echo "GhcHcOpts = -O -H24m -keep-hc-files-too $long" >> mk/config.mk + echo "GhcWithNativeCodeGen=NO" >> mk/config.mk + make boot + make all + make install + cd .. + + touch b2-stamp +fi