Changes between Version 21 and Version 22 of Building/MacOSX


Ignore:
Timestamp:
Jul 14, 2011 12:26:41 PM (4 years ago)
Author:
igloo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/MacOSX

    v21 v22  
    33== Get the latest development tools ==
    44
    5 Certain versions of Apple's Xcode tools are known to cause problems when building some versions of GHC. You should download the latest Xcode (currently 3.1) from the [http://developer.apple.com/tools/xcode Apple Developer Connection] website. Downloading requires that you sign up for a free membership in the Apple Developer Connection.
     5Get the most recent version of Apple's Xcode tools that you can. Your OS X CD has a version on. You may be able to download a newer version from the [http://developer.apple.com/tools/xcode Apple Developer Connection] website. You may need to sign up for a free membership in the Apple Developer Connection, and downloading may still cost a little money.
    66
    77Once upon a time Apple distributed updates to Xcode by using their Software Update service but not anymore. You must download the development tools manually.
     
    99Successful builds of older GHC sources have been reported using Xcode 3.0, 2.4 and 2.4.1 on Intel Macs. Xcode 2.2.1 is known ''not'' to work out of the box on Intel Macs, and Xcode 3.0 is known ''not'' to work out of the box on PowerPC Macs (#2887). Versions prior to 3.1 may build GHC successfully, but choke on certain libraries.
    1010
    11 == Building installer packages ==
    12 
    13 After running `./configure`, you can create a Mac installer package (.pkg) fully automatically by issuing
    14 {{{
    15 make framework-pkg
    16 }}}
    17 The result will be a file `GHC-<version>-<arch>.pkg`, where `<version>` is the full version string and `<arch>` is `i386` or `ppc`.  The build process uses `xcodebuild` and `packagemaker` and has only been tested with Xcode 3.0.
    18 
    19 More details about [wiki:Building/MacOSX/Installer building installer packages] are available, this includes how to specify non-standard library locations (.e.g, for readline) and information about the build process.
    20 
    21 == Getting Readline to work ==
    22 
    23 '''With recent versions of GHC (6.10 and above) it is no longer necessary to take any
    24 special steps to get readline features in GHCi -- GHC now uses editline.'''
    25 
    26 Thanks to Paul R Brown for the following [http://mult.ifario.us/articles/2006/10/17/ghc-6-6-and-mac-os-x-readline-quick-fix instructions].
    27 
    28 Building GHC 6.6 out of the box on MacOS X will leave you with a GHCi binary that has no readline support.  This is because MacOS X comes NetBSD's libedit and Apple has made /usr/lib/libreadline.dylib a symlink to libedit. libedit does not support all of the libreadline API that GHC requires, so the GHC configure script decides not to use it.
    29 
    30 To get readline working, you first need to install GNU readline:
    31 
    32 {{{
    33 cd ~/work
    34 mkdir gnu-readline
    35 cd !$
    36 curl -O ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
    37 tar xzvf readline-5.2.tar.gz
    38 cd readline-5.2
    39 ./configure
    40 make && sudo make install
    41 }}}
    42 
    43 Now you have to tell the GHC build about readline:
    44 
    45 {{{
    46 cd ~/work
    47 mkdir ghc
    48 cd !$
    49 curl -O http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src.tar.bz2
    50 curl -O http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src-extralibs.tar.bz2
    51 tar xjvf ghc-6.6-src.tar.bz2
    52 tar xjvf ghc-6.6-src-extralibs.tar.bz2
    53 cd ghc-6.6
    54 ./configure --with-readline-includes=/usr/local/include \
    55             --with-readline-libraries=/usr/local/lib
    56 make -j && sudo make install
    57 }}}
    58 
    59 (`-j` tells make to spawn lots of processes building in parallel, it will probably save some time especially if you have a multi-core machine).
    60 
    61 == Building the distrbution ==
     11== Building the distribution ==
    6212The following instructions are from Audrey Tang
    6313
     
    7323
    7424then "make binary-dist", and tar the ghc-6.6/ directory produced.
     25
     26== Building installer packages ==
     27
     28After making the binary-dist, you can create a Mac installer package (.pkg) by running
     29{{{
     30cd distrib/MacOS
     31sh mkinstaller ../../ghc*.tar.bz2
     32}}}
     33The result will be a file `GHC-<version>-<arch>.pkg`, where `<version>` is the full version string and `<arch>` is `x86_64`, `i386` or `ppc`. The build process uses `xcodebuild` and `packagemaker`.
     34
     35More details about [wiki:Building/MacOSX/Installer building installer packages] are available.
    7536
    7637== Building using !MacPorts ==