Probably the easiest way is to install a modern tool chain on an old OS.
RHEL 2.1 or 3 may be the best, as they were supported until recently.
Compiling gcc 4 can be complicated, as you will need math libraries. You may need to take a multi-step approach.
EDIT:
To compile the new gcc:
- Compile last make - add to PATH
- Unpack gcc
- Unpack mpfr, gmp, mpc to gcc directory
- The symbol for linking directory versions to the base (mpfr, gmp, mpc).
- Build and install gcc
Something like that:
cd ~/software tar xjf $DOWNLOAD/gcc/gcc-core-${GCCVER}.tar.bz2 || failure "unpack gcc failed" tar xjf $DOWNLOAD/gcc/gcc-g++-${GCCVER}.tar.bz2 || failure "unpack g++ failed" cd gcc-${GCCVER} tar xjf $DOWNLOAD/gmp-5.0.2.tar.bz2 || failure "unpack gmp failed" #tar xjf $DOWNLOAD/gmp-4.3.2.tar.bz2 || failure "unpack gmp failed" ln -s gmp-* gmp tar xjf $DOWNLOAD/mpfr-2.4.2.tar.bz2 || failure "unpack mpfr failed" #tar xjf $DOWNLOAD/mpfr-2.4.2.tar.bz2 || failure "unpack mpfr failed" ln -s mpfr-* mpfr tar xzf $DOWNLOAD/mpc-0.9.tar.gz || failure "unpack mpc failed" ln -s mpc-* mpc cd .. mkdir gcc-build cd gcc-build ../gcc-${GCCVER}/configure --prefix=/opt/tools || failure "configure failed" make || failure "make failed" make install || failure "install failed"
Douglas leder
source share