source: git/m4/gmp-check.m4 @ cc4d1d4

fieker-DuValspielwiese
Last change on this file since cc4d1d4 was 2b7db4b, checked in by Matthias Koeppe <mkoeppe@…>, 3 years ago
Replace '-Wl,-rpath -Wl,...' by '-Wl,-rpath,...'
  • Property mode set to 100644
File size: 1.0 KB
Line 
1AC_DEFUN([SING_CHECK_GMP], [
2# Check whether --with-gmp was given.
3AC_ARG_WITH([gmp],[AS_HELP_STRING([--with-gmp=path],
4                    [provide a non-standard location of gmp])])
5DEFAULT_CHECKING_PATH="/opt/homebrew /opt/local /sw /usr/local /usr"
6GMP_HOME_PATH="${DEFAULT_CHECKING_PATH}"
7if test "$with_gmp" = yes ; then
8        GMP_HOME_PATH="${DEFAULT_CHECKING_PATH}"
9elif test "$with_gmp" != no ; then
10        GMP_HOME_PATH="$with_gmp"
11fi
12
13BACKUP_CFLAGS=${CFLAGS}
14BACKUP_LIBS=${LIBS}
15
16for GMP_HOME in ${GMP_HOME_PATH}
17do
18  if test "x$GMP_HOME" != "x/usr"; then
19    if test -e ${GMP_HOME}/include/gmp.h; then
20      GMP_CPPFLAGS="-I${GMP_HOME}/include"
21      GMP_LIBS="-L${GMP_HOME}/lib -Wl,-rpath,${GMP_HOME}/lib -lgmp"
22      break
23    fi
24  fi
25done
26if test -z "${GMP_LIBS}"
27then
28  GMP_LIBS="-lgmp"
29fi
30
31CFLAGS="${BACKUP_CFLAGS} ${GMP_CPPFLAGS}"
32LIBS=" ${GMP_LIBS} ${BACKUP_LIBS}"
33
34AC_SUBST(GMP_CPPFLAGS)
35AC_SUBST(GMP_LIBS)
36
37AC_CHECK_HEADERS([gmp.h], ,[AC_MSG_ERROR([GNU MP not found])])
38AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found])])
39
40])
Note: See TracBrowser for help on using the repository browser.