>From cbedc43a3b18e99995cbc35146567382ec29d948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Fri, 22 Mar 2013 13:58:55 +0000 Subject: [PATCH] build: fix building with GMP on Mac OS X * m4/gmp.m4 (cu_GMP): Also check that gmp.h is available which is required on one Mac OS X 10.5.8 system at least. --- m4/gmp.m4 | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/m4/gmp.m4 b/m4/gmp.m4 index 2592090..ffe0113 100644 --- a/m4/gmp.m4 +++ b/m4/gmp.m4 @@ -23,18 +23,23 @@ AC_DEFUN([cu_GMP], [cu_use_gmp=auto]) if test $cu_use_gmp != no; then - cu_saved_libs=$LIBS - AC_SEARCH_LIBS([__gmpz_init], [gmp], - [test "$ac_cv_search___gmpz_init" = "none required" || - { - LIB_GMP=$ac_cv_search___gmpz_init - AC_DEFINE([HAVE_GMP], [1], - [Define if you have GNU libgmp (or replacement)]) - # This only available in GMP >= 5 - AC_CHECK_DECLS([mpz_inits], [], [], [[#include ]]) - }], - [AC_MSG_WARN([libgmp development library was not found or not usable.]) - AC_MSG_WARN([AC_PACKAGE_NAME will be built without GMP support.])]) - LIBS=$cu_saved_libs + dnl It was noticed on one MacOS X 10.5.8 system at least + dnl that the libs were available but the header wasn't + AC_CHECK_HEADERS_ONCE([gmp.h]) + if test $ac_cv_header_gmp_h = yes; then + cu_saved_libs=$LIBS + AC_SEARCH_LIBS([__gmpz_init], [gmp], + [test "$ac_cv_search___gmpz_init" = "none required" || + { + LIB_GMP=$ac_cv_search___gmpz_init + AC_DEFINE([HAVE_GMP], [1], + [Define if you have GNU libgmp (or replacement)]) + # This only available in GMP >= 5 + AC_CHECK_DECLS([mpz_inits], [], [], [[#include ]]) + }], + [AC_MSG_WARN([libgmp development library was not found or not usable.]) + AC_MSG_WARN([AC_PACKAGE_NAME will be built without GMP support.])]) + LIBS=$cu_saved_libs + fi fi ]) -- 1.7.7.6