I\'d like to build the latest version of gcc on a mac. I have the latest xcode but I\'m looking for some of the c++0x features that are in more recent versions (the lambda funct
One option is to install MacPorts and install the gcc46
package:
sudo port install gcc46
Another option is to download the source code and build it as follows:
tar xzvf gcc-4.6.0.tar.gz
cd gcc-4.6.0
./configure
make
Note that GCC 4.6.0 requires as prerequisites GMP 4.2+, MPFR 2.3.1+, and MPC 0.8.0+. If ./configure
fails, it's probably because you're missing one of these (though it should give you a helpful error message in any case).
Building will take a while—likely several hours, depending on your hardware.