I guess it's not very magic, probably even only a shell script. I'm
assuming all they are doing is to move the frontend symlinks for the
individual compiler version around to the default name "cc". For
example, if I look into my tools directory, I see the following
versions of avr-gcc around there:

As it is now (by default), that avr-gcc is simply a hard link to the
latest (avr-gcc-4.1.1 in this case) version of the compiler. So in
order to switch compilers, something like the following might work: