Changes between Version 10 and Version 11 of Building/Preparation/FreeBSD


Ignore:
Timestamp:
Jan 18, 2014 2:48:37 AM (15 months ago)
Author:
pgj
Comment:

Update build instructions for FreeBSD

Legend:

Unmodified
Added
Removed
Modified
  • Building/Preparation/FreeBSD

    v10 v11  
    44= Setting Up a FreeBSD System for Building GHC = 
    55 
    6 Building GHC on FreeBSD is currently supported on 8.1-RELEASE or later, on {{{i386}}} (x86) and {{{amd64}}} (x86_64) architectures.  One might be able to build GHC on different architectures and earlier versions but they are not maintained actively.  Note that 8.1-RELEASE is used for the FreeBSD nightly builds ([http://darcs.haskell.org/ghcBuilder/builders/pgj/ amd64 head], [http://darcs.haskell.org/ghcBuilder/builders/pgj2/ i386 head], [http://darcs.haskell.org/ghcBuilder/builders/pgj-freebsd-amd64-stable/ amd64 stable], [http://darcs.haskell.org/ghcBuilder/builders/pgj-freebsd-i386-stable/ i386 stable]). 
     6Building GHC on FreeBSD is currently supported on {{{8.4-RELEASE}}} or later, on {{{i386}}} (x86) and {{{amd64}}} (x86_64) architectures.  One might be able to build GHC on different architectures and earlier versions but they are not maintained actively.  Note that {{{8.4-RELEASE}}} is used for the FreeBSD nightly builds ([http://haskell.inf.elte.hu/builders/freebsd-amd64-head/ amd64 head], [http://haskell.inf.elte.hu/builders/freebsd-i386-head/ i386 head]). 
    77 
    88'''Note that this section is primarily intended for developers and early adopters.'''  ''If you are just want to install GHC on your system, simply use the [http://www.freshports.org/devel/hs-haskell-platform devel/hs-haskell-platform] port instead.  This port does all the things described below for you.  It is usually kept updated to match the latest Haskell Platform specifications.'' 
     
    2121 * [http://www.freshports.org/ftp/curl ftp/curl] (HTTP support for git) 
    2222 * [http://www.freshports.org/lang/ghc lang/ghc] (bootstrap compiler, usually tracking Haskell Platform specifications) 
    23  * [http://www.freshports.org/lang/perl5.14 lang/perl5.14] (Perl) 
     23 * [http://www.freshports.org/lang/perl5.16 lang/perl5.16] (Perl) 
    2424 * [http://www.freshports.org/lang/python27 lang/python27] (Python, for the test suite) 
    2525 * [http://www.freshports.org/math/gmp math/gmp] (GNU GMP) 
    2626 
    27 Probably it is possible to use a [http://www.haskell.org/ghc/download_ghc_7_6_2#freebsd vanilla binary distribution] to bootstrap the build, but one must note that it is built on 8.1-RELEASE, hence it will require installing [http://www.freshports.org/misc/compat8x misc/compat8x] in order to make it work on 9.x and later systems. 
     27Probably it is possible to use a [http://www.haskell.org/ghc/download_ghc_7_6_3#freebsd vanilla binary distribution] to bootstrap the build, but one must note that it is built on {{{8.4-RELEASE}}}, hence it will require installing [http://www.freshports.org/misc/compat8x misc/compat8x] in order to make it work on 9.x and later systems. 
    2828 
    2929== Optional Ports == 
     
    5858{{{ 
    5959  --with-gcc=$LOCALBASE/bin/gcc46 --with-gcc-4.2=$LOCALBASE/bin/gcc46 \ 
    60   --with-ld=$LOCALBASE/bin/ld --with-ar=$LOCALBASE/bin/ar \ 
    61   --with-ranlib=$LOCALBASE/bin/ranlib 
     60  --with-ld=$LOCALBASE/bin/ld 
    6261}}} 
     62 
     63Note that one may also want to set the `CC` environment variable to `gcc46` before running {{{configure}}}. 
    6364 
    6465To use `libffi` from the Ports Collection: 
     
    7475 
    7576{{{ 
    76 $ gmake 
     77$ gmake -j `sysctl -n hw.ncpu` 
    7778}}} 
    7879 
     
    8182Here is a random list of thoughts about things that are good to know when working on FreeBSD. 
    8283 
    83  - The FreeBSD base system contains GCC and the GNU toolchain (at least for the time being) but they are not or only slowly updated.  GCC is technically stuck at version 4.2.1 which may not be optimal for building GHC these days.  Hence it is highly recommended to use the toolchain ([http://www.freshports.org/devel/binutils devel/binutils]) and GCC ([http://www.freshports.org/lang/gcc lang/gcc]) from the Ports Collection instead. 
     84 - The Alex and Happy ports may not be up-to-date enough for building GHC (as they are tracking the versions specified in the Haskell Platform).  Install {{{cabal-install}}} and install those tools using {{{cabal}}} instead. 
     85 
     86 - The FreeBSD base system contains GCC and the GNU toolchain in older (pre-10.0) versions.  GCC is technically stuck at version 4.2.1 which may not be optimal for building GHC these days.  Hence it is highly recommended to use the GNU toolchain ([http://www.freshports.org/devel/binutils devel/binutils]) and GCC ([http://www.freshports.org/lang/gcc lang/gcc]) from the Ports Collection instead. 
     87 
     88 - Clang is the default base system compiler for FreeBSD 10.0 or later.  So one may try to build GHC using Clang on such systems (however, Clang can also be installed on earlier versions from the [http://www.freshports.org/lang/clang33 lang/clang33] port).  It should work, but have not yet been extensively tested. 
    8489 
    8590 - The FreeBSD base system is shipped with a version of `ncurses` but this may not be the latest.  Unfortunately, when [http://www.freshports.org/devel/ncurses devel/ncurses] is installed one should add some extra lines to `mk/build.mk` to tell GNU make we want to use `ncurses` from `$LOCALBASE` (see above) instead, otherwise `terminfo` (which uses `ncurses`) becomes linked to `ncurses` in the base: