summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-08-20 01:27:44 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-08-20 01:27:44 +0000
commita5997262942f80375a23688fb645facce69c6bef (patch)
tree722e57aa24c4b7e9a6cb667ff85d4a04c5135f81
parenta227948da60e86331ad5db76dcec77dd39d67288 (diff)
downloadmpfr-a5997262942f80375a23688fb645facce69c6bef.tar.gz
[configure.ac] Added test for usability of gmp.h at link time
(merged changeset r9644 from the 3.1 branch, with minor changes due to the fact that a known problem between GMP 4.1 and GCC 5 can no longer occur, now that we require GMP 4.2.0 or newer). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9645 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 0297fae48..587a14af6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -533,6 +533,23 @@ error
AC_MSG_ERROR([GMP 4.2.0 or newer is 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 (this problem with
+dnl GMP 4.1 is no longer possible as we now require GMP 4.2.0 or newer,
+dnl but the same kind of problem may occur in the future).
+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.])
+])
+
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)