This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Including GMP/MPFR in GCC repository?

On Wed, 11 Oct 2006, Steve Kargl wrote:

> Kaveh,
> It should be straight forward to modify the current configure tests
> in toplevel for the versions of gmp and mpfr you need.  I would
> recommend at least mpfr 2.2.0 (which would allow me to kill the ugly
> hacks in gfortran).  For gmp, you may be able to use a version as
> old as 4.1.0.
> --
> Steve

Like this?  I combined the two MPFR tests into one and had it stop if
configure can't find the right versions of the libraries.

Tested on sparc-sun-solaris2.10 via "configure" with no GMP/MPFR, with an
older MPFR version and with current versions.  It did the "right thing" in
all cases.

Okay for stage1?


PS: nuts, I just realized I need up update install.texi accordingly.  If
this patch is acceptable I'll post a followup patch for that.

2006-10-12  Kaveh R. Ghazi  <>

	* Require GMP-4.1+ and MPFR-2.2+.
	* configure: Regenerate.

diff -rup orig/egcc-SVN20061011/ egcc-SVN20061011/
--- orig/egcc-SVN20061011/	2006-09-27 20:01:59.000000000 -0400
+++ egcc-SVN20061011/	2006-10-12 13:55:25.073919479 -0400
@@ -1103,24 +1103,24 @@ choke me
 ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])

 if test x"$have_gmp" = xyes; then
+  saved_LIBS="$LIBS"
+  LIBS="$LIBS $gmplibs"
   AC_MSG_CHECKING([for correct version of mpfr.h])
-  AC_TRY_COMPILE([#include "gmp.h"
+  AC_TRY_LINK([#include <gmp.h>
 #include <mpfr.h>],[
   choke me
-], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy version of MPFR detected])])
-  saved_LIBS="$LIBS"
-  LIBS="$LIBS $gmplibs"
-  AC_MSG_CHECKING([for any version of mpfr.h])
-  AC_TRY_LINK([#include <gmp.h>
-#include <mpfr.h>], [mpfr_t n; mpfr_init(n);],
-    [AC_MSG_RESULT([yes])],  [AC_MSG_RESULT([no]); have_gmp=no])
+  mpfr_t n; mpfr_init(n);
+], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])

+if test x$have_gmp != xyes; then
+  AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.2+.  Try the --with-gmp and/or --with-mpfr options.])
 # Flags needed for both GMP and/or MPFR

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]