summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-08-20 01:21:21 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-08-20 01:21:21 +0000
commitb22e2121bd46ba21f2f6c47b9f7935a74a74dbdc (patch)
tree3c674694ecdad738a883a2062ae400df2b8a8063
parent54f6a7e440d8159022d8d6f7bd2a364dedfe420e (diff)
downloadmpfr-b22e2121bd46ba21f2f6c47b9f7935a74a74dbdc.tar.gz
[configure.ac] Added test for usability of gmp.h at link time (needed
because of a known incompatibility between GMP 4.1 and GCC 5). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9644 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d0247c4e7..366e5e606 100644
--- a/configure.ac
+++ b/configure.ac
@@ -473,6 +473,23 @@ error
AC_MSG_ERROR([GMP 4.1.0 min required])
])
+dnl Check if gmp.h is usable at link time; this may detect errors such as
+dnl with GMP 4.1, which uses "extern __inline__" unconditionally with all
+dnl GCC versions, which breaks by default with GCC 5.
+dnl Note: No linking is done against the GMP library at this time, as we
+dnl do not use any GMP symbol. The goal of this test is to avoid obscure
+dnl errors with the following gmp.h tests.
+AC_MSG_CHECKING(usable gmp.h at link time)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include "gmp.h"
+]],[[]])],[AC_MSG_RESULT(yes)],[
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([There is an incompatibility between gmp.h and the compiler.
+See 'config.log' for details.
+Such an incompatibility is known between GMP 4.1, which uses
+"extern __inline__" with all GCC versions, and GCC 5.])
+])
+
dnl Check if we can use internal header files of GMP (only --with-gmp-build)
if test "$use_gmp_build" = yes ; then
AC_MSG_CHECKING(for gmp internal files)