[PATCH] Require GMP 4.2 and MPFR 2.2

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Apr 16 05:27:00 GMT 2006


On Sat, Apr 15, 2006 at 09:47:46PM -0700, Brooks Moses wrote:
> Steve Kargl wrote:
> >The attached patch raises the bar on the versions of gmp and
> >mpfr that are needed for building gfortran.  This is my first
> >attempt at editing the toplevel configure.in, so I would
> >appreciate the scrutiny of someone who actually understand
> >autoconf.  In fact, someone else will need to commit this patch
> >or an improved version because I believe my write access is
> >limited to gfortran changes.
> [...]
> >+#if __GNU_MP_VERSION < 4 || __GNU_MP_VERSION_MINOR < 2
> > choke me
> > #endif
> [...]
> >+#include <mpfr.h>],[
> >+#if MPFR_VERSION_MAJOR < 2 || MPFR_VERSION_MINOR < 2
> >+  choke me
> >+#endif
> 
> The above will fail for versions 5.0 and 3.0, respectively.  I presume 
> that's not actually the desired behavior?
> 

No, that is not the desired behavior.  See the attached revised patch.

-- 
Steve
-------------- next part --------------
Index: configure.in
===================================================================
--- configure.in	(revision 112970)
+++ configure.in	(working copy)
@@ -1130,14 +1130,21 @@ CFLAGS="$CFLAGS $gmpinc"
 # Check GMP actually works
 AC_MSG_CHECKING([for correct version of gmp.h])
 AC_TRY_COMPILE([#include "gmp.h"],[
-#if __GNU_MP_VERSION < 3
+#if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 2)
 choke me
 #endif
 ], [AC_MSG_RESULT([yes])],
   [AC_MSG_RESULT([no]); have_gmp=no])
 
 if test x"$have_gmp" = xyes; then
-  AC_MSG_CHECKING([for MPFR])
+  AC_MSG_CHECKING([for correct version of mpfr.h])
+  AC_TRY_COMPILE([#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([no]); have_gmp=no])
 
   saved_LIBS="$LIBS"
   LIBS="$LIBS $gmplibs"
@@ -1269,7 +1276,7 @@ if test -d ${srcdir}/gcc; then
         case ,${enable_languages},:${have_gmp}:${need_gmp} in
           *,${language},*:no:yes)
             # Specifically requested language; tell them.
-            AC_MSG_ERROR([GMP with MPFR support is required to build $language])
+            AC_MSG_ERROR([GMP 4.2 and MPFR 2.2 or newer versions required by $language])
             ;;
           *:no:yes)
             # Silently disable.


More information about the Fortran mailing list