summaryrefslogtreecommitdiff
path: root/libraries/integer-gmp/aclocal.m4
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-02-26 16:18:20 -0600
committerAustin Seipp <austin@well-typed.com>2014-02-26 16:18:20 -0600
commit4775d0060a7027196f7c5dd521d5754080667a84 (patch)
treea197a5951489216f606fff2e594f2eafcc90e05c /libraries/integer-gmp/aclocal.m4
parentbcd38ea7f97cc3a3ed192bc0666c816c027bd9fc (diff)
downloadhaskell-4775d0060a7027196f7c5dd521d5754080667a84.tar.gz
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>
Diffstat (limited to 'libraries/integer-gmp/aclocal.m4')
-rw-r--r--libraries/integer-gmp/aclocal.m49
1 files changed, 7 insertions, 2 deletions
diff --git a/libraries/integer-gmp/aclocal.m4 b/libraries/integer-gmp/aclocal.m4
index c174ee2c06..be248615f5 100644
--- a/libraries/integer-gmp/aclocal.m4
+++ b/libraries/integer-gmp/aclocal.m4
@@ -6,13 +6,18 @@ dnl--------------------------------------------------------------------
AC_DEFUN([LOOK_FOR_GMP_LIB],[
if test "$HaveFrameworkGMP" = "NO"
then
- AC_CHECK_LIB([gmp], [__gmpz_powm_sec],
+ AC_CHECK_LIB([gmp], [__gmpz_powm],
[HaveLibGmp=YES; GMP_LIBS=gmp])
if test "$HaveLibGmp" = "NO"
then
- AC_CHECK_LIB([gmp3], [__gmpz_powm_sec],
+ AC_CHECK_LIB([gmp3], [__gmpz_powm],
[HaveLibGmp=YES; GMP_LIBS=gmp3])
fi
+ if test "$HaveLibGmp" = "YES"
+ then
+ AC_CHECK_LIB([$GMP_LIBS], [__gmpz_powm_sec],
+ [HaveSecurePowm=1])
+ fi
fi
])