Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On an old iBook G4 running Tiger, and which should not be upgraded to Leopard, and which thus cannot be upgraded past XCode 2.5, I would like to compile some packages from source from either Fink or MacPorts, packages which require gcc 4.0.

I have a perfectly decent gcc 4.0 compiled by hand, but gcc_select, which is used by both Fink and MacPorts to select gcc versions, does not know of their existence, but only of the gcc 3.3 that came with XCode. How do I get gcc_select to acknowledge this compilers existence?

Answer Following Chris' suggestion, I saw that my gcc_select -n 4.0 found gcc-4.0, but not g++-4.0. Installing XCode 2.5 did the trick.

share|improve this question
up vote 1 down vote accepted

Which gcc_select and gcc are you using? There is one that comes with the system, and one available in MacPorts (I do not use Fink, and I did not find one in their package list). I do not have the MacPorts one installed, but looking at its Portfile, it seems that it is setup to only manage the MacPorts gcc installations (/opt/local/bin/gcc). The system gcc_select manages /usr/bin/gcc.

The system gcc_select is from the normal Developer Tools (DeveloperToolsCLI.pkg). Using it to select a gcc other than the ones provided by the Developer Tools installations is probably “unsupported”. It might work, but it would require installation into (or at least symlinks in) various "system" directories. Try (e.g.) gcc_select -n 4.9 to see what is says it expects.

My iBook G4 running 10.4 with the Developer Tools installed has gcc 4.0.1 as the default.

% gcc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5370)

Also, my gcc-3.3 is a different build from yours.

% gcc-3.3 --version
gcc-3.3 (GCC) 3.3 20030304 (Apple Computer, Inc. build 1819)

Maybe you have an old and/or incomplete Developer Tools installation. According to the receipts, my gcc-4.0 came from gcc4.0.pkg. Looking in my archive, I have xcode25_8m2558_developerdvd.dmg (946768492 bytes), that I downloaded through the Apple Developer Connection a long time ago.

share|improve this answer

Assuming you've installed gcc_select through MacPorts (I'm not sure if it's the same as the one from Apple or from Fink), you should be able to add an entry by navigating to /opt/local/etc/select/gcc. Check out the base file, which will be your reference, and then create a new file which provides corresponding locations to your hand compiled gcc. For example, on my machine:

$ cat base

$ cat mp-gcc43 

I haven't actually tried this (I'm not really a C coder so I'm afraid to screw things up), but hopefully this helps!

Another thing: at least for python_select, items in the base file that aren't contained in the select file are replaced with a -.

share|improve this answer
Thanks. It is not from MacPorts; I assumed that it comes from XCode (which gives \usr\sbin\gcc_select; version string "gcc version 3.3 20030304 (Apple Computer, Inc. build 1809)". I'll take a look for something resembling the cfg file you give. – Charles Stewart Jan 14 '10 at 6:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.