[project @ 2002-05-02 13:33:27 by simonmar]
authorsimonmar <unknown>
Thu, 2 May 2002 13:33:27 +0000 (13:33 +0000)
committersimonmar <unknown>
Thu, 2 May 2002 13:33:27 +0000 (13:33 +0000)
Add this script which does an unregisterised bootstrap to build HC
files for porting GHC.

distrib/cross-port [new file with mode: 0644]

diff --git a/distrib/cross-port b/distrib/cross-port
new file mode 100644 (file)
index 0000000..ea616be
--- /dev/null
@@ -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