I am using Homebrew exclusively (i.e. I don’t, and won’t, use MacPorts or Fink). I also want to keep manual installations to a bare minimum.1
… But how can I install GCC?
First of all, I’ve of course installed Xcode but the current version doesn’t ship with a decently up to date GCC (I need ata least 4.5, but would prefer the most recent one) – in fact, it doesn’t ship with a proper GCC at all (it only ships Clang) and that seems to be a problem for Homebrew …
I’m aware of a list of custom GCC and cross compilers but in fact all of those installations require an already installed GCC – at least,
brewing them fails with linker errors on Lion which I attribute to Clang, and
-use-gcc doesn’t work for obvious reasons.
brew doctor only mentions what I already know, that there is no GCC (4.2.x) installed.
1 I’ve previously mixed MacPorts, Homebrew and some manual installations and have ended up with a maintenance and versioning hell. I don’t want to go there again.
gcc --version? I get
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)and I simply installed Xcode from the MAS. Also what's the output of
$PATHis the usual (this is an almost blank system, after all):
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin… but I don’t think that this matters. The formulae provided by homebrew-alt are simply outdated and don’t work with Clang.