The build of gcc-4.5.1 is well documented, and LQ members are building it all the time.
Most often as part of LFS http://www.linuxfromscratch.org/lfs/
> > LFS-BOOK-6.7 http://www.linuxfromscratch.org/lfs/downloads/stable/
From my notes, CentOS 5.5 / Scientific Linux SL55 :
Unpack gmp, mpfr, mpc into gcc-4.5.1/ and rename them to gmp/ mpfr/ mpc/ .
Go to the build directory outside gcc-4.5.1/ , and do
../gcc-4.5.1/configure --prefix=/usr/local/gcc451 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs
Requirements, probably # yum install \
gcc-g++ binutils-devel elfutils-libelf-devel glibc-devel
( You seem to be missing glibc-devel ? ).
make : No errors.
P.S. : /root/ should not be used for compiling.
/root/ is not meant to be used for anything.
Default is /home/<name>/tmp/ or any other folder in /home/<name>/.