This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[PATCH]: Warn that mpfr-2.2.0 is buggy when configuring


I had previously proposed upgrading out mpfr required version here:
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00135.html

After some discussion in that thread and others, it seems like the
consensus is against this for now.
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00221.html
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00262.html

Instead we'll warn the user there may be bugs and let them proceed:

I've added a testsuite case to catch it at the end, over here:
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01247.html

However this patch additionally updates configure to let the user know as
early as possible.

Tested on sparc-sun-solaris2.10 via configure --with-mpfr=X, where "X"
contains an old mpfr included with gmp-4.1.4, mpfr-2.2.0, mpfr-2.2.0 +
cumulative patch and finally mpfr-2.2.1.

In the first case it hard errors.  In the second and third, it says buggy
version, but continues.  In the last case, it passes.  (All as expected.)

Okay for mainline?

		Thanks,
		--Kaveh


2006-12-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* configure.in: Warn that MPFR 2.2.0 is buggy.

	* configure: Regenerate.

diff -rup orig/egcc-SVN20061216/configure.in egcc-SVN20061216/configure.in
--- orig/egcc-SVN20061216/configure.in	2006-12-11 20:01:58.000000000 -0500
+++ egcc-SVN20061216/configure.in	2006-12-17 20:21:02.651322044 -0500
@@ -1117,14 +1117,22 @@ choke me
 if test x"$have_gmp" = xyes; then
   saved_LIBS="$LIBS"
   LIBS="$LIBS $gmplibs"
+  dnl MPFR 2.2.0 is acceptable but buggy, MPFR 2.2.1 is better.
   AC_MSG_CHECKING([for correct version of mpfr.h])
   AC_TRY_LINK([#include <gmp.h>
 #include <mpfr.h>],[
-#if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
+#if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0)
   choke me
 #endif
   mpfr_t n; mpfr_init(n);
-], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); have_gmp=no])
+], [AC_TRY_LINK([#include <gmp.h>
+#include <mpfr.h>],[
+#if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1)
+  choke me
+#endif
+  mpfr_t n; mpfr_init(n);
+], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy version])])],
+   [AC_MSG_RESULT([no]); have_gmp=no])
   LIBS="$saved_LIBS"
 fi
 CFLAGS="$saved_CFLAGS"


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