source: git/m4/gmp-check.m4 @ 7c9f0a

spielwiese
Last change on this file since 7c9f0a was 4ad5cde, checked in by Matthias Koeppe <mkoeppe@…>, 3 years ago
m4/*-check.m4: Check DEFAULTS first, following flint-check.m4 This removes /usr from the end of DEFAULT_CHECKING_PATH and instead puts the special token DEFAULTS to the front of NTL_HOME_PATH, GMP_HOME_PATH. Because ccluster-check.m4 has not been switched to compiler-based header file detection, we do not change the search algorithm there. We add /usr back at the end of CCLUSTER_HOME_PATH to compensate for the change of DEFAULT_CHECKING_PATH. We also fix a typo that makes --with-ccluster=PATH actually work (untested, as this library does not seem available)
  • 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_TRY_LINK([#include <gmp.h>
35                ],
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.