Skip to content
Snippets Groups Projects
Commit 3ad1873e authored by Jorrit Fahlke's avatar Jorrit Fahlke
Browse files

Make --without-gmp/--with-gmp=no work.

[[Imported from SVN: r5920]]
parent 73430c29
No related branches found
No related tags found
No related merge requests found
......@@ -22,33 +22,38 @@
AC_DEFUN([DUNE_PATH_GMP],[
AC_REQUIRE([AC_PROG_CXX])
AC_ARG_WITH(gmp,
AS_HELP_STRING([--with-gmp=PATH],
[directory to GMP (GNU MP Bignum Library)]))
AS_IF([test x$with_gmp = x],[with_gmp=/usr])
AC_ARG_WITH([gmp],
[AS_HELP_STRING([--with-gmp=PATH],
[directory to GMP (GNU MP Bignum Library)])],
[],
[with_gmp=/usr])
HAVE_GMP=no
GMP_CPPFLAGS="-I$with_gmp/include -DENABLE_GMP=1"
GMP_LIBS="-L$with_gmp/lib -lgmpxx -lgmp"
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"
AC_LANG_PUSH([C++])
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
AC_CHECK_HEADER([gmpxx.h], [HAVE_GMP=yes],
AC_MSG_WARN([gmpxx.h not found in $with_gmp]))
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 $HAVE_GMP = yes],[
DUNE_CHECK_LIB_EXT([$with_gmp/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++])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
AC_LANG_POP([C++])
])
AS_IF([test $HAVE_GMP = yes],[
AC_DEFINE([HAVE_GMP],[ENABLE_GMP],[Was GMP found and GMP_CPPFLAGS used?])
......
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