You can theoretically rigidly tie it to the right place.
The official way to do this is to install additional command line tools using the Xcode installer. This takes several hundred megabytes when installing a new copy of the same compiler.
I wrote a shell script once to compare the installation trees of the "Xcode" installation and the "command line" installation and merge all the files that were identical. It worked fine, but the next update turned it off.
Another alternative is to load the GCC source from their CVS (not much more than loading the massive Xcode installer) and embed it in usr/bin/
yourself. Then you have the latest and best (or your choice of many newer and better versions).
source share