Fix GMP v4 compatibility. ghc-7.8.1-release ghc-7.8.2-release integer-gmp-0.5.1.0-release
authorAustin Seipp <austin@well-typed.com>
Wed, 26 Feb 2014 22:18:20 +0000 (16:18 -0600)
committerAustin Seipp <austin@well-typed.com>
Wed, 26 Feb 2014 22:20:17 +0000 (16:20 -0600)
commitf57a632600713b4067caa2774f77797ef9d4d60e
tree9fb885dbb09c03c96905d8bb8930ca73362e1230
parent2f841fdf5b33c4eb32cfc5d1b8207585f1880d9a
Fix GMP v4 compatibility.

We had started relying on GMP 5.x (for usage of mpz_powm_sec), but this
is pretty painful on RHEL-esque targets, which still use GMP 4.x.

In the mean time while we're still supporting this, it's easier to just
fallback to mpz_powm when _sec is unavailable, and emit a WARNING for
using the primitive.

This also installs a header, HsIntegerGmp.h, which clients could use for
a fallback.

As a side note, this will probably also help Debian oldstable users who
might have outdated GMP versions (which I believe is the cause for #8666.)

Reviewed-by: Herbert Valerio Riedel <hvr@gnu.org>
Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit d7bff4dddfa10389156ca11f75a5a23e78cf3ab0)
.gitignore
GHC/Integer/Type.lhs
aclocal.m4
cbits/gmp-wrappers.cmm
configure.ac
include/HsIntegerGmp.h.in [new file with mode: 0644]
integer-gmp.buildinfo.in
integer-gmp.cabal