|
|
# Building on MacOS X
|
|
|
|
|
|
|
|
|
These instructions were last updated for GHC 7.2.
|
|
|
These instructions were last updated for GHC 7.4.
|
|
|
|
|
|
## Get the latest development tools
|
|
|
|
|
|
### For Lion, Xcode 7.3 or higher
|
|
|
|
|
|
|
|
|
Firstly, you need to install the command line tools from Apple. You can do that in two ways (the second is faster as it is a much smaller download):
|
|
|
|
|
|
1. Install all of Xcode:
|
|
|
|
|
|
- Install Xcode from the Mac App Store.
|
|
|
- Launch Xcode.
|
|
|
- In the Preference dialog of Xcode, select the "Downloads" pane and install "Command line tools".
|
|
|
1. Install the command line tools only:
|
|
|
|
|
|
- At the [ downloads page of Apple Developer](http://developer.apple.com/downloads), download the latest "Command line tools".
|
|
|
- Install them.
|
|
|
|
|
|
|
|
|
In both cases, you need to [ register](https://developer.apple.com/programs/register/) as an Apple developer first. (This is a free registration.)
|
|
|
|
|
|
|
|
|
Secondly, if you want to build the development version of GHC from the Git repositories, you also need to install the GNU auto tools (which are no longer distributed by Apple). You can get them as follows:
|
|
|
|
|
|
- Install [ Homebrew](http://mxcl.github.com/homebrew/) (as per instructions on that webpage)
|
|
|
- To install the auto tools execute the following: `brew install autoconf automake`
|
|
|
|
|
|
|
|
|
Thirdly, if you like to use GHC's LLVM backend, also execute: `brew install llvm`
|
|
|
|
|
|
**NB:** You need to use a binary distribution of GHC 7.4.1 (or later) as a bootstrap compiler. (Earlier versions fail with an error message complaining about the lack of `/Developer/usr/bin/gcc`. You can fix this by editing the GHC wrapper script if you prefer to use an older compiler.)
|
|
|
|
|
|
### Previous versions of OS X and Xcode
|
|
|
|
|
|
|
|
|
Get the most recent version of Apple's Xcode tools that you can. Your OS X CD has a version on it. You may be able to download a newer version from the [ Apple Developer Connection](http://developer.apple.com/tools/xcode) website. You may need to sign up for a free membership in the Apple Developer Connection, and downloading may still cost a little money. In later versions of OS X (10.6 / 10.7), Apple added the "App Store". Xcode is available within the App Store for "Free".
|
|
|
|
... | ... | |