summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-13 10:31:07 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-13 10:31:07 +0000
commit09419715411a5b966eb8d74b94bd94a232375659 (patch)
treebfd52d351df280f125cdc16f7d3a0548827c87e7
parentc9506237993ec644c5ec5fe3003f0bc58322287c (diff)
downloadmpfr-09419715411a5b966eb8d74b94bd94a232375659.tar.gz
[acinclude.m4] Fixed the __float128 detection for NetBSD: Optimization
made the "undefined reference" error disappear, so that __float128 was misdetected as being supported. Also updated the message. Note: this change is similar to the r12921-12922 ones in the trunk. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/4.0@12923 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--acinclude.m410
1 files changed, 8 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index e4b8ff9b0..9d6835963 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -639,9 +639,15 @@ dnl Note: We use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE since an
dnl error may occur only at link time, such as under NetBSD:
dnl https://mail-index.netbsd.org/pkgsrc-users/2018/02/02/msg026220.html
dnl https://mail-index.netbsd.org/pkgsrc-users/2018/02/05/msg026238.html
+dnl By using volatile and making the exit code depend on the value of
+dnl this variable, we also make sure that optimization doesn't make
+dnl the "undefined reference" error disappear.
if test "$enable_float128" != no; then
- AC_MSG_CHECKING(if compiler knows __float128 with C99 constants)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[__float128 x = 0x1.fp+16383q;]])],
+ AC_MSG_CHECKING(if __float128 with hex constants is supported)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
+volatile __float128 x = 0x1.fp+16383q;
+return x == 0;
+]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([MPFR_WANT_FLOAT128],1,[Build float128 functions])],
[AC_MSG_RESULT(no)