I'm on Fedora 23 which installs GCC 5.3.1 by default.
For a cross compilation project with libraries which have been compiled with GCC 4.9 I'd like to install GCC 4.9 in parallel.
This (very old) post describes how to do this for GCC 3.8 and recommends to build any other version from scratch.
Now it's 3 years later – Is there a way to provide an older version of GCC in a separate directory (using the package manager) which can be used in parallel to the installed GCC 5.3?
Best Answer
This is NOT an answer to my question since I only show how to build and use GCC 4.9 in a way which works on Fedora 23 (and on any other platform probably, too). It's only the compilation of steps I had to do to compile with another version of GCC than the shipped one.
The shown steps are taken from here.
lookup and download and exctract the appropriate archive from http://www.gnu.org/software/gcc/mirrors.html:
download prerequisites:
configure the build (add
--disable-multilib
when you don't need a 32 bit build, set the install-prefix
, add/remove languages):actually build and install GCC:
You can now use this new compiler by just setting
CC
(maybe alsoCXX
) before you runmake
orcmake
:or