For Linux I have always made a dual install RPM. I find I often need the
native GCC / libstdc++ for kernel drivers and such, I like to use dkms
which compiles at time of install. It also mitigates the issues around
dependencies for current distribution RPM's. The RPM I made was fairly
straight forward and just installed under /opt/gcc-4.6.1/. my spec file is
just a .configure, make and install. I pass --prefix=/opt/gcc-4.6.1/ in
the .configure. The two rpm's that I had to upgrade I think were mpfr and
gmp. Now this of course makes one large RPM and is not broken up into the
smaller packages like you get with a standard distribution, but since it is
a dual install I have not found that to be an issues since I am not
upgrading the base gcc install. I can't post the spec since I created it at
work and for work, but there is really nothing special about it.
The other way I have see it is to pass --program-suffix=46 to
the .configure. This allows you to install side by side, where gcc is named
gcc46. There is a little more work that needs to be done to get it to
install and play nice with the current version of gcc, but some developers
prefer this.
I found this helpful.
http://gcc.gnu.org/faq.html#installation
Jolynn