You can control the symlink in / /opt/local/bin/gcc using port select . You can view the available version with port select --list gcc . Everything that is specified in the mp- prefix refers to the native MacPorts port, gcc42 and llvm-gcc42 refer to the compilers that come with Apple's Xcode.
An example from my system:
$ port select --list gcc Available versions for gcc: gcc42 llvm-gcc42 mp-gcc45 none (active) $ sudo port select --set gcc mp-gcc45 Password: Selecting 'mp-gcc45' for 'gcc' succeeded. 'mp-gcc45' is now active.
After that, open a new terminal window or enter hash -r so that bash recognizes the change.
raimue Dec 04 '11 at 1:12
source share