Fix GMP v4 compatibility.
[packages/integer-gmp.git] / aclocal.m4
1
2 dnl--------------------------------------------------------------------
3 dnl * Check whether this machine has gmp/gmp3 installed
4 dnl--------------------------------------------------------------------
5
6 AC_DEFUN([LOOK_FOR_GMP_LIB],[
7     if test "$HaveFrameworkGMP" = "NO"
8     then
9         AC_CHECK_LIB([gmp],  [__gmpz_powm],
10                      [HaveLibGmp=YES; GMP_LIBS=gmp])
11         if test "$HaveLibGmp" = "NO"
12         then
13             AC_CHECK_LIB([gmp3], [__gmpz_powm],
14                          [HaveLibGmp=YES; GMP_LIBS=gmp3])
15         fi
16         if test "$HaveLibGmp" = "YES"
17         then
18             AC_CHECK_LIB([$GMP_LIBS], [__gmpz_powm_sec],
19                          [HaveSecurePowm=1])
20         fi
21     fi
22 ])
23
24 dnl--------------------------------------------------------------------
25 dnl * Mac OS X only: check for GMP.framework
26 dnl--------------------------------------------------------------------
27
28 AC_DEFUN([LOOK_FOR_GMP_FRAMEWORK],[
29     if test "$HaveLibGmp" = "NO"
30     then
31         case $target_os in
32         darwin*)
33             AC_MSG_CHECKING([for GMP.framework])
34             save_libs="$LIBS"
35             LIBS="-framework GMP"
36             AC_TRY_LINK_FUNC(__gmpz_powm_sec,
37                              [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP])
38             LIBS="$save_libs"
39             AC_MSG_RESULT([$HaveFrameworkGMP])
40             ;;
41         esac
42     fi
43 ])
44