summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2016-03-02 15:24:12 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2016-03-02 15:24:12 +0000
commita0d6b645176301a4b6dcdfb797167be0811af749 (patch)
tree6f021221946cd82dad7d4c2ee2ffd17f9d585c79 /acinclude.m4
parenta84797a33288aee708a5b47c4415ddc562caa8a3 (diff)
downloadmpfr-a0d6b645176301a4b6dcdfb797167be0811af749.tar.gz
autodetect support for decimal floats (as suggested in revision 10179)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10185 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m430
1 files changed, 17 insertions, 13 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 26102b8c6..31277b1a3 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -518,18 +518,14 @@ then
fi
dnl Check if decimal floats are available
-if test "$enable_decimal_float" = yes; then
- AC_DEFINE([MPFR_WANT_DECIMAL_FLOATS],1,
- [Build decimal float functions])
+if test "$enable_decimal_float" != no; then
AC_MSG_CHECKING(if compiler knows _Decimal64)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[_Decimal64 x;]])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- AC_MSG_ERROR([Compiler doesn't know _Decimal64 (ISO/IEC TR 24732).
- Please use another compiler or build MPFR with --disable-decimal-float.])]
- )
- AC_MSG_CHECKING(decimal float format)
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([MPFR_WANT_DECIMAL_FLOATS],1,
+ [Build decimal float functions])
+ AC_MSG_CHECKING(decimal float format)
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
]], [[
volatile _Decimal64 x = 1;
@@ -542,13 +538,21 @@ return y.d == 0.14894469406741037E-123 ? 0 :
AC_DEFINE([DPD_FORMAT],1,[])],
[case "$?" in
1) AC_MSG_RESULT(BID) ;;
- 2) AC_MSG_FAILURE(neither DPD nor BID) ;;
- 3) AC_MSG_FAILURE([_Decimal64 support is broken.
-Please use another compiler or build MPFR with --disable-decimal-float.]) ;;
+ 2) AC_MSG_RESULT(neither DPD nor BID)
+ if test "$enable_decimal_float" = yes; then
+ AC_MSG_ERROR([unsupported decimal float format.
+Please build MPFR with --disable-decimal-float.])
+ fi ;;
*) AC_MSG_FAILURE(internal error) ;;
esac],
[AC_MSG_RESULT(assuming DPD)
AC_DEFINE([DPD_FORMAT],1,[])])
+ ],
+ [AC_MSG_RESULT(no)
+ if test "$enable_decimal_float" = yes; then
+ AC_MSG_ERROR([Compiler doesn't know _Decimal64 (ISO/IEC TR 24732).
+Please use another compiler or build MPFR with --disable-decimal-float.])
+ fi])
fi
dnl Check if Static Assertions are supported.