summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2012-12-05 17:38:38 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2012-12-05 17:38:38 +0000
commit01413f51321a698fb44649d6b4e0dc80f8e900e5 (patch)
tree2a9d65182468c61875c2835fb33ccf18d35c315e /acinclude.m4
parentbb67164f507bfab4aadc99d7564cdb82bd0e189f (diff)
downloadmpfr-01413f51321a698fb44649d6b4e0dc80f8e900e5.tar.gz
[acinclude.m4,configure.ac] Moved the "double-to-integer conversion bug"
test after the gmp.h detection as it uses gmp.h (otherwise one gets an incorrect error on this test if gmp.h can't be found or is unusable). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8432 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m478
1 files changed, 43 insertions, 35 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 5f855e2e0..d02b078e8 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -29,11 +29,13 @@ AC_PREREQ(2.60)
dnl ------------------------------------------------------------
dnl You must put in MPFR_CONFIGS everything which configure MPFR
dnl except:
-dnl -everything dealing with CC and CFLAGS in particular the ABI
-dnl but the IEEE-754 specific flags must be set here.
-dnl -GMP's linkage.
-dnl -Libtool stuff.
-dnl -Handling of special arguments of MPFR's configure.
+dnl - Everything dealing with CC and CFLAGS in particular the ABI
+dnl but the IEEE-754 specific flags must be set here.
+dnl - Tests that depend on gmp.h (see MPFR_CHECK_DBL2INT_BUG as an example:
+dnl a function needs to be defined and called in configure.ac).
+dnl - GMP's linkage.
+dnl - Libtool stuff.
+dnl - Handling of special arguments of MPFR's configure.
AC_DEFUN([MPFR_CONFIGS],
[
AC_REQUIRE([AC_OBJEXT])
@@ -226,36 +228,6 @@ static double get_max (void) { static volatile double d = DBL_MAX; return d; }
fi
fi
-dnl Check for double-to-integer conversion bug
-dnl https://gforge.inria.fr/tracker/index.php?func=detail&aid=14435
-AC_CACHE_CHECK([for double-to-integer conversion bug], mpfr_cv_dbl_int_bug, [
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <gmp.h>
-]], [[
- double d;
- mp_limb_t u;
- int i;
-
- d = 1.0;
- for (i = 0; i < GMP_NUMB_BITS - 1; i++)
- d = d + d;
- u = (mp_limb_t) d;
- for (; i > 0; i--)
- {
- if (u & 1)
- break;
- u = u >> 1;
- }
- return (i == 0 && u == 1UL) ? 0 : 1;
-]])], [mpfr_cv_dbl_int_bug="no"],
- [mpfr_cv_dbl_int_bug="yes"],
- [mpfr_cv_dbl_int_bug="cannot test, assume not present"])
-])
-if test "$mpfr_cv_dbl_int_bug" = "yes"; then
- AC_MSG_ERROR([double-to-integer conversion is incorrect.
-You need to use another compiler (or lower the optimization level).])
-fi
-
dnl Check if subnormal (denormalized) numbers are supported
AC_CACHE_CHECK([for subnormal numbers], mpfr_cv_have_denorms, [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -551,6 +523,42 @@ CPPFLAGS="$saved_CPPFLAGS"
dnl end of MPFR_CONFIGS
+dnl MPFR_CHECK_DBL2INT_BUG
+dnl ----------------------
+dnl Check for double-to-integer conversion bug
+dnl https://gforge.inria.fr/tracker/index.php?func=detail&aid=14435
+AC_DEFUN([MPFR_CHECK_DBL2INT_BUG], [
+AC_REQUIRE([MPFR_CONFIGS])dnl
+AC_CACHE_CHECK([for double-to-integer conversion bug], mpfr_cv_dbl_int_bug, [
+AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <gmp.h>
+]], [[
+ double d;
+ mp_limb_t u;
+ int i;
+
+ d = 1.0;
+ for (i = 0; i < GMP_NUMB_BITS - 1; i++)
+ d = d + d;
+ u = (mp_limb_t) d;
+ for (; i > 0; i--)
+ {
+ if (u & 1)
+ break;
+ u = u >> 1;
+ }
+ return (i == 0 && u == 1UL) ? 0 : 1;
+]])], [mpfr_cv_dbl_int_bug="no"],
+ [mpfr_cv_dbl_int_bug="yes"],
+ [mpfr_cv_dbl_int_bug="cannot test, assume not present"])
+])
+if test "$mpfr_cv_dbl_int_bug" = "yes"; then
+ AC_MSG_ERROR([double-to-integer conversion is incorrect.
+You need to use another compiler (or lower the optimization level).])
+fi
+])
+
+
dnl MPFR_C_LONG_DOUBLE_FORMAT
dnl -------------------------
dnl Determine the format of a long double.