How does Macport work?

Ryan Schmidt ryandesign at
Wed Jun 10 21:48:41 PDT 2009

On Jun 10, 2009, at 19:08, Timothy Goins wrote:

> Fon's question got me thinking.  While /opt/local/bin precedes /usr/ 
> bin in my $PATH, when I `which gcc` I get /usr/bin/gcc.  Huh?   
> Since I've never had insurmountable compiler glitches, I'd lost  
> track of how I'd worked around previous issues.  I have created a  
> mess!  In /usr/bin/ I've got two executables, gcc-4.0 and gcc-4.2  
> (renamed mp files, if I recall correctly) and two links:
> gcc -> /usr/bin/gcc-4.0 and
> gcc-4.3 -> /opt/local/bin/gcc-mp-4.3
> In /opt/local/bin, I've got gcc-mp-4.3 and gcc-mp-4.4 (and the  
> gccbug executables).
> I would like to be able to type gcc and fire up the latest C  
> compiler (gcc-mp-4.4?), which is not as problem; however, I don't  
> want to try to compile older code that might (?) not be compatible  
> with gcc-mp 4.4.
> What is the "clean", correct way to manage my C compiler(s)?

The gcc_select port exists to help you create a symlink called "gcc"  
in /opt/local/bin pointing to whatever version of MacPorts-installed  
gcc you would like to use.

More information about the macports-users mailing list