- ./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
+ ./configure
+
+ # For cross-compilation, at this stage you may want to set up a source
+ # tree on the target machine, run the configure script there, and bring
+ # the resulting mk/config.h file back into this tree before building
+ # the libraries.
+
+ touch mk/build.mk
+ echo "GhcUnregisterised = YES" >> mk/build.mk
+ echo "GhcLibHcOpts = -O -H32m -fvia-C -keep-hc-files" >> mk/build.mk
+ echo "GhcLibWays =" >> mk/build.mk
+ echo "SplitObjs = NO" >> mk/build.mk
+
+ # We could optimise slightly by not building hslibs here. Also, building
+ # the RTS is not necessary (and might not be desirable if we're using
+ # a config.h from the target system).
+ make stage1
+