I would like to use an old version of gcc for one of my program (versions 3.* would be good), any idea how to do this?
Just compile and install it somewhere and optionally add its location to your $PATH
. Do this in a directory where you downloaded gcc
source code:
$ contrib/download_prerequisites
$ cd ..
$ mkdir objdir
$ cd objdir
$ ../gcc/configure --enable-languages=c --disable-multilib --prefix=$HOME/gcc-4.6.2 # modify option to suit your needs
$ make -j8
$ make install
Run it in $HOME/gcc-4.6.2
:
$ usr/local/bin/gcc --version
(or use make install DESTDIR=<DIR>
instead of --prefix
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With