http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51935
Bug #: 51935 Summary: Configure fails on included mpc/mpfr Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: bootstrap AssignedTo: unassig...@gcc.gnu.org ReportedBy: psm...@gnu.org Created attachment 26404 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26404 Add /src to mpfr directories in configure.ac I was trying to follow the advice of various people by including GMP/MPC/MPFR into the GCC source tree (GCC 4.6.2 / GMP 5.0.2 / MPFR 3.1.0 / MPC 0.9), however this failed during configure: checking whether time.h and sys/time.h may both be included... yes checking for creal in -lm... yes checking for __gmpz_init in -lgmp... yes checking for MPFR... yes checking for recent GMP... yes checking for recent MPFR... no configure: error: MPFR version >= 2.4.2 required make[4]: *** [configure-stage1-mpc] Error 1 make[4]: Leaving directory `/usr/src/gcc/obj-stage1/gcc' make[3]: *** [stage1-bubble] Error 2 make[3]: Leaving directory `/usr/src/gcc/obj-stage1/gcc' make[2]: *** [all] Error 2 make[2]: Leaving directory `/usr/src/gcc/obj-stage1/gcc' make[1]: *** [/usr/src/gcc/.stamp/stage1.install] Error 2 Investigating, I found the configure was using the wrong path to location mpfr headers and libraries; for example mpc/config.log says: configure:11278: checking for recent MPFR configure:11290: gcc -c -g -fkeep-inline-functions -I/usr/src/gcc/obj-stage1/gcc /./gmp -I/usr/src/gcc/gcc-4.6.2/mpfr conftest.c >&5 conftest.c:34:3: error: #error "Minimal MPFR version is 2.4.2" conftest.c:35: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input configure:11290: $? = 1 This is due to the configure script assuming that MPFR headers are in the root MPFR directory, but they're not: they live the "src" subdirectory in MPFR. If you fix the headers then it will fail during link because it's looking for libmpfr.a in the wrong place, too. I have an MPFR installed natively on the system, but it's version 2.2.1. My suspicion is that most people who test this already have a "new enough" MPFR installed in /usr/include so they don't notice that this path is wrong, since configure finds the one in /usr/include and is happy with it. The attached patch to configure.ac that fixes things.