summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2013-09-15 22:46:47 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2013-09-15 22:46:47 +0000
commitfb7aa04d8f522b1350ef5f1fdde90a8a92c1d8b4 (patch)
treefc15318ab256a820c36df65c4e90c89dcbe85a81 /configure.ac
parent7ecd359041b902320f6bf9216166a457f34ab330 (diff)
downloadmpfr-fb7aa04d8f522b1350ef5f1fdde90a8a92c1d8b4.tar.gz
[configure.ac] Detect broken _Decimal64 support on powerpc64 with
the mode32 ABI. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8679 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 12 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 614848583..a32106fc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,6 +263,9 @@ dnl be disabled in the GCC build). See:
dnl http://gcc.gnu.org/gcc-4.3/changes.html
dnl _Decimal64 is not yet defined in GCC for C++:
dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51364
+dnl _Decimal64 support is broken with GCC 4.6.3 and 4.7.2 on powerpc64
+dnl with the mode32 ABI, e.g. "-m32 -mpowerpc64 -mtune=970 -O3"; this
+dnl is detected by the x != x test below.
AC_ARG_ENABLE(decimal-float,
[ --enable-decimal-float build conversion functions from/to decimal floats
[[default=no]]],
@@ -280,16 +283,21 @@ Please use another compiler or build MPFR without --enable-decimal-float.])]
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
]], [[
+volatile _Decimal64 x = 1;
union { double d; _Decimal64 d64; } y;
+if (x != x) return 3;
y.d64 = 1234567890123456.0dd;
return y.d == 0.14894469406741037E-123 ? 0 :
y.d == 0.59075095508629822E-68 ? 1 : 2;
]])], [AC_MSG_RESULT(DPD)
AC_DEFINE([DPD_FORMAT],1,[])],
- [if test "$?" != 1 ; then
- AC_MSG_FAILURE(neither DPD nor BID)
- fi
- AC_MSG_RESULT(BID)],
+ [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 without --enable-decimal-float.]) ;;
+ *) AC_MSG_FAILURE(internal error) ;;
+ esac],
[AC_MSG_RESULT(assuming DPD)
AC_DEFINE([DPD_FORMAT],1,[])])
;;