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

* Document output of the test.

* Libraries are in .../lib, not .../libs.
* When using AC_CHECK_LIB, the -L option has to be put into LDFLAGS
  temporarily.  Use DUNE_CHECK_LIB_EXT, which does that automatically.
* Clear the output variables if GMP was not found.
* Put result into ALL_PKG_* instead of DUNE_PKG_*

[[Imported from SVN: r5852]]
parent 10bf2654
No related branches found
No related tags found
No related merge requests found
## -*- autoconf -*-
# DUNE_PATH_GMP()
#
# shell variables
# with_gmp
# no or path
# HAVE_GMP
# no or yes
# GMP_CPPFLAGS
# GMP_LIBS
#
# substitutions
# GMP_CPPFLAGS
# GMP_LIBS
#
# defines:
# HAVE_GMP
#
# conditionals:
# GMP
AC_DEFUN([DUNE_PATH_GMP],[
AC_REQUIRE([AC_PROG_CXX])
......@@ -8,20 +29,19 @@ AC_DEFUN([DUNE_PATH_GMP],[
HAVE_GMP=no
GMP_CPPFLAGS="-I$with_gmp/include -DENABLE_GMP=1"
GMP_LIBS="-L$with_gmp/libs -lgmpxx -lgmp"
GMP_LIBS="-L$with_gmp/lib -lgmpxx -lgmp"
AC_LANG_PUSH([C++])
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
LIBS="$LIBS $GMP_LIBS"
AC_CHECK_HEADER([gmpxx.h], [HAVE_GMP=yes],
AC_MSG_WARN([gmpxx.h not found in $with_gmp]))
AS_IF([test $HAVE_GMP = yes],[
AC_CHECK_LIB(gmp,[__gmpz_abs],[],[
DUNE_CHECK_LIB_EXT([$with_gmp/lib], gmp,[__gmpz_abs],[],[
HAVE_GMP=no
AC_MSG_WARN(libgmp not found)])
])
......@@ -32,12 +52,16 @@ AC_DEFUN([DUNE_PATH_GMP],[
AS_IF([test $HAVE_GMP = yes],[
AC_DEFINE([HAVE_GMP],[ENABLE_GMP],[Was GMP found and GMP_CPPFLAGS used?])
AC_SUBST([GMP_CPPFLAGS],[$GMP_CPPFLAGS])
AC_SUBST([GMP_LIBS],[$GMP_LIBS])
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $GMP_CPPFLAGS"
DUNE_PKG_LIBS="$DUNE_PKG_LIBS $GMP_LIBS"
DUNE_ADD_ALL_PKG([GMP], [\${GMP_CPPFLAGS}],
[], [\${GMP_LIBS}])
], [
GMP_CPPFLAGS=
GMP_LIBS=
])
AC_SUBST([GMP_CPPFLAGS])
AC_SUBST([GMP_LIBS])
AM_CONDITIONAL(GMP,[test $HAVE_GMP = yes])
DUNE_ADD_SUMMARY_ENTRY([GMP],[$HAVE_GMP])
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment