Home » Questions » Computers [ Ask a new question ]

How to add a hand-compiled gcc to gcc_select

How to add a hand-compiled gcc to gcc_select

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.

Asked by: Guest | Views: 176
Total answers/comments: 1
bert [Entry]

"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."