I\'m sure there must be a way to do this. As you are probably aware the latest versions of Xcode (and in fact I think all versions of Xcode) on Leopard come with GCC 4.0.1 a
Im my experience (limited), changing CC in .profile does not change Lion's (10.7.2) defaulting to i686-apple-darwin11-llvm-gcc-4.2. I wonder if this has anything to do with Apple's own sym linking:
a partial: ls -la /usr/bin | grep .*gcc.* :
lrwxr-xr-x 1 root wheel 12 25 oct 19:31 cc -> llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 12 25 oct 19:31 gcc -> llvm-gcc-4.2
lrwxr-xr-x 1 root admin 32 25 oct 19:31 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
I am wary about breaking these and adding my own to usr/bin/gcc-4.2 per Martin v. Löwis's answer.