22
AC_DEFUN([DUNE_PATH_GMP],[
23
AC_REQUIRE([AC_PROG_CXX])
26
[AS_HELP_STRING([--with-gmp=PATH],
27
[directory to GMP (GNU MP Bignum Library)])])
30
AS_IF([test x"$with_gmp" = x"no"], [
31
AC_MSG_NOTICE([skipping check for GMP])
33
AS_IF([test x"$with_gmp" = x || test x"$with_gmp" = xyes], [
34
for d in /usr /usr/local; do
35
AC_MSG_NOTICE([searching for GMP in $d...])
36
DUNE_CHECK_PATH_GMP($d)
37
AS_IF([test $HAVE_GMP = yes],[break])
39
DUNE_CHECK_PATH_GMP($with_gmp)
44
AS_IF([test $HAVE_GMP = yes],[
45
AC_DEFINE([HAVE_GMP],[ENABLE_GMP],[Was GMP found and GMP_CPPFLAGS used?])
46
DUNE_ADD_ALL_PKG([GMP], [\${GMP_CPPFLAGS}],
53
AC_SUBST([GMP_CPPFLAGS])
56
AM_CONDITIONAL(GMP,[test $HAVE_GMP = yes])
57
DUNE_ADD_SUMMARY_ENTRY([GMP],[$HAVE_GMP])
60
AC_DEFUN([DUNE_CHECK_PATH_GMP],[
61
GMP_CPPFLAGS="-I$1/include -DENABLE_GMP=1"
62
GMP_LIBS="-L$1/lib -lgmpxx -lgmp"
65
ac_save_CPPFLAGS="$CPPFLAGS"
68
CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
70
AC_CHECK_HEADER([gmpxx.h], [HAVE_GMP=yes],
71
[AC_MSG_WARN([gmpxx.h not found in $1])])
73
AS_IF([test $HAVE_GMP = yes],[
74
DUNE_CHECK_LIB_EXT([$1/lib], gmp,[__gmpz_abs],[],[
76
AC_MSG_WARN(libgmp not found)])
79
CPPFLAGS="$ac_save_CPPFLAGS"