Skip to content
Snippets Groups Projects
Commit ab7268fa authored by Christian Engwer's avatar Christian Engwer
Browse files

fix GMP test (FS#811)

[[Imported from SVN: r6102]]
parent 96a9c039
No related branches found
No related tags found
No related merge requests found
......@@ -24,35 +24,21 @@ AC_DEFUN([DUNE_PATH_GMP],[
AC_ARG_WITH([gmp],
[AS_HELP_STRING([--with-gmp=PATH],
[directory to GMP (GNU MP Bignum Library)])],
[],
[with_gmp=/usr])
[directory to GMP (GNU MP Bignum Library)])])
HAVE_GMP=no
AS_IF([test x"$with_gmp" = x"no"], [
AC_MSG_NOTICE([skipping check for GMP])
], [
GMP_CPPFLAGS="-I$with_gmp/include -DENABLE_GMP=1"
GMP_LIBS="-L$with_gmp/lib -lgmpxx -lgmp"
AC_LANG_PUSH([C++])
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
AC_CHECK_HEADER([gmpxx.h], [HAVE_GMP=yes],
[AC_MSG_WARN([gmpxx.h not found in $with_gmp])])
AS_IF([test $HAVE_GMP = yes],[
DUNE_CHECK_LIB_EXT([$with_gmp/lib], gmp,[__gmpz_abs],[],[
HAVE_GMP=no
AC_MSG_WARN(libgmp not found)])
AS_IF([test x"$with_gmp" = x || test x"$with_gmp" = xyes], [
for d in /usr /usr/local; do
AC_MSG_NOTICE([searching for GMP in $d...])
DUNE_CHECK_PATH_GMP($d)
AS_IF([test $HAVE_GMP = yes],[break])
done],[
DUNE_CHECK_PATH_GMP($with_gmp)
])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
AC_LANG_POP([C++])
])
AS_IF([test $HAVE_GMP = yes],[
......@@ -70,3 +56,28 @@ AC_DEFUN([DUNE_PATH_GMP],[
AM_CONDITIONAL(GMP,[test $HAVE_GMP = yes])
DUNE_ADD_SUMMARY_ENTRY([GMP],[$HAVE_GMP])
])
AC_DEFUN([DUNE_CHECK_PATH_GMP],[
GMP_CPPFLAGS="-I$1/include -DENABLE_GMP=1"
GMP_LIBS="-L$1/lib -lgmpxx -lgmp"
AC_LANG_PUSH([C++])
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
AC_CHECK_HEADER([gmpxx.h], [HAVE_GMP=yes],
[AC_MSG_WARN([gmpxx.h not found in $1])])
AS_IF([test $HAVE_GMP = yes],[
DUNE_CHECK_LIB_EXT([$1/lib], gmp,[__gmpz_abs],[],[
HAVE_GMP=no
AC_MSG_WARN(libgmp not found)])
])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
AC_LANG_POP([C++])
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment