24
votes

I just did a fresh installation of Mac OS X Lion, and installed Xcode 4.3 & Haskell platform 2011.4.0.0.

When I tried installing packages by Cabal, I got the following error:

cabal install cabal-install
Resolving dependencies...
Configuring cabal-install-0.10.2...
ghc: could not execute: /Developer/usr/bin/gcc
cabal: Error: some packages failed to install:
cabal-install-0.10.2 failed during the configure step. The exception was:
ExitFailure 1

I found Xcode 4.3 is not installed in /Developer any longer. Actually, gcc can be found in /usr/bin.

I tried cabal install flag --with-gcc /usr/bin/gcc (and --with-gcc=/usr/bin/gcc). It doesn't work.

I tried to create a link of gcc in /Developer/usr/bin, but gcc complains it cannot find some files.

Any ideas?

Thanks

1

1 Answers

29
votes

I'm not using Lion, but if you do cat /usr/bin/ghc you will find that ghc is really a shell script which defines a variable for which gcc to use. I assume the obvious surgery will work. In any case mine looks like this, which wouldn't be right for you:

#!/bin/sh
exedir="/Library/Frameworks/GHC.framework/Versions/7.0.4-i386/usr/lib/ghc-7.0.4"
exeprog="ghc-stage2"
executablename="$exedir/$exeprog"
datadir="/Library/Frameworks/GHC.framework/Versions/7.0.4-i386/usr/share"
bindir="/Library/Frameworks/GHC.framework/Versions/7.0.4-i386/usr/bin"
topdir="/Library/Frameworks/GHC.framework/Versions/7.0.4-i386/usr/lib/ghc-7.0.4"
pgmgcc="/Developer/usr/bin/gcc"
executablename="$exedir/ghc"
exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" -optl"-Wl,-read_only_relocs,suppress" ${1+"$@"}