>From 8052c5bf1c5c6dc92b420ce2ed3c6595d9b31797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Mon, 8 Oct 2012 11:38:41 +0100 Subject: [PATCH] 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. --- m4/gmp.m4 | 2 ++ src/factor.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 0 deletions(-) diff --git a/m4/gmp.m4 b/m4/gmp.m4 index e337e16..59a664f 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