From: Pádraig Brady
Date: Mon, 8 Oct 2012 10:38:41 +0000 (+0100)
Subject: build: support older GMP versions
X-Git-Tag: v8.20~12
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf9cd8958bbf294c30b82c2d5e9ea64ef14f37b9;p=thirdparty%2Fcoreutils.git
build: support older GMP versions
The new factor code introduced usage of mpz_inits() and
mpz_clears(), which are only available since GMP >= 5,
and will result in a compile error when missing.
* m4/gmp.m4 (cu_GMP): Define HAVE_DECL_MPZ_INITS appropriately.
* src/factor (mpz_inits): New function, defined where missing.
(mpz_clears): Likewise.
---
diff --git a/m4/gmp.m4 b/m4/gmp.m4
index e337e161fa..59a664f744 100644
--- a/m4/gmp.m4
+++ b/m4/gmp.m4
@@ -30,6 +30,8 @@ AC_DEFUN([cu_GMP],
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