When gmp/mpfr are already installed _and_ their sources have been unpacked into the gcc source directory, building mpfr fails due to gmp.h not found. I would expect such a scenario when building and using the supplied gmp/mpfr sources is preferred over the installed (system) libraries, which typically are outdated (but cannot be uninstalled due to dependencies). FreeBSD 8.1 i386 the configure command line was ../gcc-4.5.3/configure --prefix=${HOME}/opt/gcc/4.5.3 --enable-languages=c,c++,fortran
Hmm, I already have gmp and mpfr already installed but I also use the sources inside the source directory, it works for me and uses the newly compiled ones too.
tar jxf gcc-4.5.3.tar.bz2 tar jxf gmp-4.3.2.tar.bz2 tar jxf mpfr-3.0.0.tar.bz2 tar zxf mpc-0.9.tar.gz patch -p1 -d mpfr-3.0.0 <mpfr-3.0.0-p8.diff cd gcc-4.5.3 ln -s ../gmp-4.3.2 gmp ln -s ../mpfr-3.0.0 mpfr ln -s ../mpc-0.9 mpc cd .. mkdir objdir-4.5.3 cd objdir-4.5.3/ ../gcc-4.5.3/configure --prefix=${HOME}/opt/gcc/4.5.3 --enable-languages=c,c++,fortran gmake fails with: checking for gmp.h... no configure: error: gmp.h can't be found, or is unusable. gmake[2]: *** [configure-stage1-mpfr] Error 1 gmake[2]: Leaving directory `/usr/home/sliwa/src/gcc/objdir-4.5.3' gmake[1]: *** [stage1-bubble] Error 2 gmake[1]: Leaving directory `/usr/home/sliwa/src/gcc/objdir-4.5.3' gmake: *** [all] Error 2 $ ls -l gmp/gmp.h -rw-r--r-- 1 sliwa users 84253 Dec 16 14:12 gmp/gmp.h $ ls -l gmp/.libs/ total 1778 -rw-r--r-- 1 sliwa users 1801182 Dec 16 14:13 libgmp.a lrwxr-xr-x 1 sliwa users 12 Dec 16 14:13 libgmp.la -> ../libgmp.la -rw-r--r-- 1 sliwa users 752 Dec 16 14:13 libgmp.lai
mpfr-3.1.0 and above are required to build in source for GCC 4.5.2/4.5.3 which is why it is failing. See PR 44455 for the details on why. Anyways closing as works for me.