X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=distrib%2Fcross-port;h=690e60b16aa157366204f495bcbf163b39909623;hp=ea616bee1d1d06fc5714ff95fd84169069f8adb5;hb=f30908b63b7bda01ac4fc8a3a62ea2a23da01ae9;hpb=95792891d27d6e5409f8d4fa53e4817f4a26f723 diff --git a/distrib/cross-port b/distrib/cross-port index ea616be..690e60b 100644 --- a/distrib/cross-port +++ b/distrib/cross-port @@ -12,25 +12,36 @@ set -e -long='-optc-DNO_REGS -optc-DUSE_MINIINTERPRETER -fno-asm-mangling -funregisterised -fvia-C' - base=`pwd` +# set this to the location of your source tree +fptools_dir=$HOME/fptools + if [ ! -f b1-stamp ]; then mkdir b1 cd b1 - lndir ../fptools + lndir $fptools_dir 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 + ./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 + cd .. touch b1-stamp @@ -41,18 +52,25 @@ fi if [ ! -f b2-stamp ]; then mkdir b2 cd b2 - lndir ../fptools + lndir $fptools_dir 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 + ./configure --with-ghc=$base/b1/ghc/compiler/stage1/ghc-inplace + + touch mk/build.mk + # The bootstrapped compiler should probably generate unregisterised + # code too. If you don't want it to, then comment out this line: + echo "GhcUnregisterised = YES" >> mk/build.mk + echo "SRC_HC_OPTS += -keep-hc-file -fvia-C" >> mk/build.mk + echo "GhcWithNativeCodeGen = NO" >> mk/build.mk + echo "GhcWithInterpreter = NO" >> mk/build.mk + + # we just need to build the compiler and utils... + (cd glafp-utils && make boot && make) + (cd ghc && make boot) + (cd ghc/utils && make) + (cd ghc/compiler && make stage=1) cd .. touch b2-stamp