summaryrefslogtreecommitdiff
path: root/distrib/cross-port
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-05-02 13:33:27 +0000
committersimonmar <unknown>2002-05-02 13:33:27 +0000
commit95792891d27d6e5409f8d4fa53e4817f4a26f723 (patch)
treeacf0decce3acbc1a0421ae5e6bd488e8929d5088 /distrib/cross-port
parent5248496621bd23d3d42f8e0929278e110797d1c1 (diff)
downloadhaskell-95792891d27d6e5409f8d4fa53e4817f4a26f723.tar.gz
[project @ 2002-05-02 13:33:27 by simonmar]
Add this script which does an unregisterised bootstrap to build HC files for porting GHC.
Diffstat (limited to 'distrib/cross-port')
-rw-r--r--distrib/cross-port59
1 files changed, 59 insertions, 0 deletions
diff --git a/distrib/cross-port b/distrib/cross-port
new file mode 100644
index 0000000000..ea616bee1d
--- /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