diff options
-rw-r--r-- | acinclude.m4 | 10 |
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) |