I compiled GCC 4.4.3 and installed it in /usr/local/bin, but whenever I install a port via MacPorts 1.8.2 the verbose output says MacPorts is using /usr/bin/gcc-4.2:
checking for gcc… /usr/bin/gcc-4.2
How do I make MacPorts find my own GCC 4.4.3? Here is my existing path:
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/lib:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
I am running Mac OS X 10.6.2 Snow Leopard.
Best Answer
First answer: Don't! In my experience, GCC 4.4.3 will not work properly on Snow Leopard. It will cause problems with zero-length strings.
Second answer: edit your symbolic links in /usr/bin to refer to the 4.4 stuff. Here's a script I wrote to do so:
I called it chgCver, so to change my compiler to 4.4, I'd type
chgCver 4.4
. Of course, before you run this, you'll also need to make sure that, for example, c++-4.4 points to the correct place (probably/opt/local/bin/gcc-mp-4.4
), etc. I can give you more specifics, if you're inclined to ignore my first and third answers.Third answer: Don't! (See first answer.)