Provide a way for OS X users to indicate a preference for the GMP framework
[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_fdiv_qr],
10                      [HaveLibGmp=YES; GMP_LIBS=gmp])
11         if test "$HaveLibGmp" = "NO"
12         then
13             AC_CHECK_LIB([gmp3], [__gmpz_fdiv_qr],
14                          [HaveLibGmp=YES; GMP_LIBS=gmp3])
15         fi
16     fi
17 ])
18
19 dnl--------------------------------------------------------------------
20 dnl * Mac OS X only: check for GMP.framework
21 dnl--------------------------------------------------------------------
22
23 AC_DEFUN([LOOK_FOR_GMP_FRAMEWORK],[
24     if test "$HaveLibGmp" = "NO"
25     then
26         case $target_os in
27         darwin*)
28             AC_MSG_CHECKING([for GMP.framework])
29             save_libs="$LIBS"
30             LIBS="-framework GMP"
31             AC_TRY_LINK_FUNC(__gmpz_fdiv_qr,
32                              [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP])
33             LIBS="$save_libs"
34             AC_MSG_RESULT([$HaveFrameworkGMP])
35             ;;
36         esac
37     fi
38 ])
39