In gcc 4.3, you can unpack the gmp and mpfr libraries into your source tree, and gcc will build, even if gmp and mpfr are not installed on the host system. That appears to be broken in mainline as of 2008-10-22. The problem is that the top level configury passes --with-gmp-build when configuring mpfr. The mpfr library records that in its Makefile using CPPFLAGS. Now the top level Makefile overrides CPPFLAGS. The effect:
make[4]: Entering directory `/home/jingyu/projects/gcc/obj-gcc-i686/mpfr' /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I../../gcc_src/mpfr -g -fkeep-inline-functions -MT exceptions.lo -MD -MP -MF .deps/exceptions.Tpo -c -o exceptions.lo ../../gcc_src/mpfr/exceptions.c gcc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1 -DHAVE_ALLOCA_H=1 -I. -I../../gcc_src/mpfr -g -fkeep-inline-functions -MT exceptions.lo -MD -MP -MF .deps/exceptions.Tpo -c ../../gcc_src/mpfr/exceptions.c -o exceptions.o In file included from ../../gcc_src/mpfr/exceptions.c:23: ../../gcc_src/mpfr/mpfr-impl.h:74:19: error: gmp.h: No such file or directory In file included from ../../gcc_src/mpfr/mpfr-impl.h:77, from ../../gcc_src/mpfr/exceptions.c:23: ../../gcc_src/mpfr/mpfr.h:39:18: error: gmp.h: No such file or directory -- Summary: [4.4 regression] in-tree gmp and mpfr libraries no longer work Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: drow at gcc dot gnu dot org ReportedBy: ian at airs dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38014