X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=TODO;h=31d0f86838bdf023acd83507b79cbd2734615891;hb=HEAD;hp=d4c5fdbd6c71d3f3838ea3f71d06cfa7791f8cd4;hpb=f4afb39c623b1c077a5ffeddbad2b4f451f0d975;p=pkgsrc-ghc.git diff --git a/TODO b/TODO index d4c5fdb..31d0f86 100644 --- a/TODO +++ b/TODO @@ -1,108 +1,30 @@ .. -*- rst -*- -============ wip/ghc TODO ============ -* Build more bootstrapping HC archives to support more platforms. - - --------------------------- -How to build an HC archive --------------------------- - -It's basically the same as the `Porting Guide -`_, plus -some minor tweaks. - -Extract the source archive and duplicate the source tree, one for -``-target`` and one for ``-host``:: - - $ tar jxf ghc-{VERSION}-src.tar.bz2 - $ cp -r ghc-{VERSION} ghc-{VERSION}-target - $ mv ghc-{VERSION} ghc-{VERSION}-host - -Build some configuration files:: - - $ cd ghc-{VERSION}-target - $ ./configure --enable-hc-boot - $ echo "INTEGER_LIBRARY = integer-simple" > mk/build.mk - $ gmake bootstrapping-files - $ cd .. - -Run ``./configure`` on the host tree:: - - $ cd ghc-{VERSION}-host - $ ./configure \ - --with-iconv-includes=/usr/pkg/include \ - --with-iconv-libraries=/usr/pkg/lib - -Then create ``ghc-{VERSION}-host/mk/build.mk`` with the following -contents:: - - PORTING_HOST = YES - GhcUnregisterised = YES - GhcLibHcOpts = -O -fvia-C -keep-hc-files - GhcRtsHcOpts = -keep-hc-files - GhcLibWays = v - GhcRTSWays = - SplitObjs = NO - GhcWithNativeCodeGen = NO - GhcWithInterpreter = NO - GhcStage1HcOpts = -O - GhcStage2HcOpts = -O -fvia-C -keep-hc-files - SRC_HC_OPTS += -H32m - GhcWithSMP = NO - utils/ghc-pkg_dist-install_v_HC_OPTS += -keep-hc-files - - INTEGER_LIBRARY = integer-simple - libraries/terminfo_CONFIGURE_OPTS += \ - --configure-option=--with-curses-includes=/usr/pkg/include \ - --configure-option=--with-curses-libraries=/usr/pkg/lib - -Copy some configuration files from the ``-target`` tree:: - - $ cp -r ../ghc-{VERSION}-target/includes/dist-{ghcconstants,derivedconstants} includes/ - $ cp ../ghc-{VERSION}-target/includes/ghcautoconf.h includes/ - -Build it:: - - $ gmake - -Create an intermediate tarball:: +* Modify configure.ac and rules/build-package-data.mk to allow + ``--with-curses-{includes,libraries}`` to be passed to the top-level + ``configure``, and send a patch to the upstream. +* Add the following ``./configure`` flags to eliminate + ``patch-Makefile`` and ``patch-ghc.mk``: - $ rm -f list mkfiles boot.tar.gz - $ find . -name "*.hi" >> list - $ find . -name "*.hc" >> list - $ find . -name "*_stub.c" >> list - $ find . -name "*_stub.h" >> list - $ find . -name package-data.mk >> list - $ find . -name package.conf.d >> list - $ find . -name package.conf.inplace >> list - $ ls compiler/stage?/build/Config.hs >> list - $ echo compiler/prelude/primops.txt >> list - $ ls compiler/primop-*.hs-incl >> list - $ find . -name .depend | sed -e 's/^/mkdir -p `dirname /' -e 's/$/`/' >> mkfiles - $ find . -name .depend | sed "s/^/touch /" >> mkfiles - $ echo mkfiles >> list - $ tar -zcf boot.tar.gz -T list + * ``--with-dist-archiver={bzip2,xz} [default=bzip2]`` + * ``BZIP2FLAGS`` + * ``XZFLAGS`` -Then extract it again, in a different directory:: +* Let ``./configure`` check for broken binutils and provide a better + fix for ``patch-rts_StgCRun.c``. +* Build more bootstrapping compilers to support more platforms. - $ mkdir ghc-{VERSION} - $ cd ghc-{VERSION} - $ tar zxf ../boot.tar.gz -Modify hard-coded paths in inplace ``.conf`` files, and then -re-archive the HC tree:: +How to build a bootstrapping compiler +------------------------------------- - $ gsed -i.bak \ - -e 's#/usr/pkg#[[PREFIX]]#g' \ - -e 's#'`dirname \`pwd\``'#[[GHC_SOURCE_PATH]]#g' \ - inplace/lib/package.conf.d/*.conf \ - */*/package-data.mk \ - */*/*/package-data.mk - $ cd .. - $ tar jcf ghc-{VERSION}-boot-{PLATFORM}.tar.bz2 ghc-{VERSION} +You need a working compiler to build one. If you think there are no +bindists for your platform, you may need to cross-build a compiler +yourself: `Cross-compiling GHC +`_ -Done. Upload the archive to some host and add it to the ``Makefile``. +Assuming you have a working ghc in your PATH, just run ``bmake patch +&& bmake bootstrap`` and see if you are lucky enough.