you can set it up by hand but rez makes most of it much easier.
the link i send above is really the main set of things you will want to start off with. the reason i said its a deeply Configured version of rez is that I started the process of generating these external repositories for rez is implemented them. however our technique is pretty much the same.
protip: ones you have compiled GCC remove it from your base install. that way it cannot get confused when it's trying to compile any other packages. Linux has a nasty habit of using hardcoded GCC paths.