source: git/m4/gmp-check.m4 @ 3c6f0f

spielwiese
Last change on this file since 3c6f0f was 3c6f0f, checked in by Hans Schoenemann <hannes@…>, 17 months ago
fix: search gmp,flint at default locations
  • Property mode set to 100644
File size: 1.2 KB
Line 
1AC_DEFUN([SING_CHECK_GMP], [
2AC_REQUIRE([SING_DEFAULT_CHECKING_PATH])
3# Check whether --with-gmp was given.
4AC_ARG_WITH([gmp],[AS_HELP_STRING([--with-gmp=path],
5                    [provide a non-standard location of gmp])], [
6    dnl Given
7if test "$with_gmp" = yes ; then
8        GMP_HOME_PATH="DEFAULTS ${DEFAULT_CHECKING_PATH}"
9elif test "$with_gmp" != no ; then
10        GMP_HOME_PATH="$with_gmp"
11else
12     AC_MSG_ERROR([Use of GNU MP is required, cannot use --without-gmp])
13fi
14], [
15    dnl Not given
16    GMP_HOME_PATH="DEFAULTS ${DEFAULT_CHECKING_PATH}"
17])
18
19BACKUP_CFLAGS=${CFLAGS}
20BACKUP_LIBS=${LIBS}
21
22gmp_found=no
23for GMP_HOME in ${GMP_HOME_PATH}
24do
25    if test "$GMP_HOME" != "DEFAULTS"; then
26      GMP_CPPFLAGS="-I${GMP_HOME}/include"
27      GMP_LIBS="-L${GMP_HOME}/lib -Wl,-rpath,${GMP_HOME}/lib -lgmp"
28    else
29      GMP_CPPFLAGS=""
30      GMP_LIBS="-lgmp"
31    fi
32    CFLAGS="${GMP_CPPFLAGS} ${BACKUP_CFLAGS}"
33    LIBS=" ${GMP_LIBS} ${BACKUP_LIBS}"
34    AC_LINK_IFELSE(
35      [AC_LANG_PROGRAM([[#include <gmp.h>]],
36                [[mpz_t a; mpz_init (a);]])],
37         [gmp_found=yes
38         break],
39         )
40done
41if test "$gmp_found" != yes; then
42    AC_MSG_ERROR([GNU MP not found])
43fi
44
45AC_SUBST(GMP_CPPFLAGS)
46AC_SUBST(GMP_LIBS)
47
48])
Note: See TracBrowser for help on using the repository browser.