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?
Thanks,
--Kaveh
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 <[EMAIL PROTECTED]>
* configure.in: Require GMP-4.1+ and MPFR-2.2+.
* configure: Regenerate.
diff -rup orig/egcc-SVN20061011/configure.in egcc-SVN20061011/configure.in
--- orig/egcc-SVN20061011/configure.in 2006-09-27 20:01:59.000000000 -0400
+++ egcc-SVN20061011/configure.in 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>],[
#if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR <
2)
choke me
#endif
-], [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])
LIBS="$saved_LIBS"
fi
CFLAGS="$saved_CFLAGS"
+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.])
+fi
+
# Flags needed for both GMP and/or MPFR
AC_SUBST(gmplibs)
AC_SUBST(gmpinc)