Fix GMP v4 compatibility.
[packages/integer-gmp.git] / aclocal.m4
index 8a9c467..be24861 100644 (file)
@@ -6,13 +6,18 @@ dnl--------------------------------------------------------------------
 AC_DEFUN([LOOK_FOR_GMP_LIB],[
     if test "$HaveFrameworkGMP" = "NO"
     then
-        AC_CHECK_LIB([gmp],  [__gmpz_fdiv_qr],
+        AC_CHECK_LIB([gmp],  [__gmpz_powm],
                      [HaveLibGmp=YES; GMP_LIBS=gmp])
         if test "$HaveLibGmp" = "NO"
         then
-            AC_CHECK_LIB([gmp3], [__gmpz_fdiv_qr],
+            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
 ])
 
@@ -28,7 +33,7 @@ AC_DEFUN([LOOK_FOR_GMP_FRAMEWORK],[
             AC_MSG_CHECKING([for GMP.framework])
             save_libs="$LIBS"
             LIBS="-framework GMP"
-            AC_TRY_LINK_FUNC(__gmpz_fdiv_qr,
+            AC_TRY_LINK_FUNC(__gmpz_powm_sec,
                              [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP])
             LIBS="$save_libs"
             AC_MSG_RESULT([$HaveFrameworkGMP])