[Home]

Building GHC on Mac OS X 10.3 (Panther)

Building GHC on Mac OS X can be a nightmare. And it makes a difference whether you're doing it on Mac OS 10.2 (Jaguar) or 10.3 (Panther). I no longer have access to a machine running Jaguar so these instructions will be aimed solely at the Panther platform.

cpp

Since cpp works a little bit differently on Panther I found it necessary to run configure with the CPP environment variable set thusly.
CPP=gcc3 -E

Note that I did not add the -traditionalflag since then frameworks are not detected. I also found it necessary to add the flag -pgmP "gcc3 -E -traditional" to SRC_HC_OPTS (which can be done in mk/build.mk). This time I have left in the -traditionalflag at the suggestion of Wolfgang Thaller.

readline

If you want to build GHC with readline support through the use of Fink then you need to provide the following flags.
CFLAGS=-I/sw/include -L/sw/lib
CPPFLAGS=-I/sw/include

SRC_HC_OPTS += -I/sw/include
SRC_CC_OPTS += -I/sw/include -L/sw/lib

Otherwise just substitute in directories which contain the GNU readline includes and libs.

The -O flag

You must build libraries with the -O flag. Do this by setting it in GhcLibHcOpts in mk/build.mk. My option line is:
GhcLibHcOpts = -O -H80m -dcore-lint -fvia-C -keep-hc-file

[Home]