There are at least a couple of options.
- I have my GCC 4.8.2 installed under
/usr/gcc/v4.8.2
and I ensure that/usr/gcc/v4.8.2/bin
is on myPATH
ahead of/usr/bin
. That way, the undecorated namegcc
means GCC 4.8.2. (This is on Mac OS X 10.9.1 Mavericks, just for the record.) - Specify CC=
/usr/gcc/v4.8.2/bin/gcc
on command lines, etc. Painful, so I don't regard it as a real option. - Make
/usr/bin/gcc
point to/usr/gcc/v4.8.2/bin/gcc
instead of being an executable that runsclang
.
I distrust modifying /usr/bin
or /bin
(or /sbin
or /usr/sbin
). I seldom use the system-provided Perl, for example, but always use my own build, using the same general technique.