1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

don't presume availability of gmp.pc

This suggests moving the conditional that determines if mini-gmp is used
into scmconfig.h.

* configure.ac: replace PKG_CHECK_MODULES for gmp with AC_LIB_HAVE_LINKFLAGS
    Remove ENABLE_MINI_GMP define.  Also don't run mpz_inits test for
    --enable-mini-gmp.
* libguile/gen-scmconfig.c (main) [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
    with SCM_I_GSC_ENABLE_MINI_GMP
* libguile/bytevectors.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
    with SCM_ENABLE_MINI_GMP
* libguile/init.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
    with SCM_ENABLE_MINI_GMP
* libguile/numbers.c: include scm.h
    [SCM_ENABLE_MINI_GMP]: provide mpz_inits and mpz_clears
    [ENABLE_MINI_GMP]: prefer SCM_ENABLE_MINI_GMP to ENABLE_MINI_GMP
* libguile/numbers.h: include scm.h
* libguile/random.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
    with SCM_ENABLE_MINI_GMP
* libguile/socket.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
    with SCM_ENABLE_MINI_GMP
This commit is contained in:
Michael Gran 2021-03-03 10:54:04 -08:00
parent eb5ffda6ce
commit 6ca3ab621c
8 changed files with 34 additions and 32 deletions

View file

@ -647,33 +647,26 @@ AC_CACHE_SAVE
dnl GMP tests
PKG_CHECK_MODULES([GMP],[gmp],
[],
[$enable_mini_gmp=yes])
SCM_I_GSC_ENABLE_MINI_GMP=0
AC_ARG_ENABLE(mini-gmp,
[AS_HELP_STRING([--enable-mini-gmp],
[use mini-gmp instead of the full GMP library])])
if test "$enable_mini_gmp" = yes || test "$enable_mini_gmp" = y; then
if test "x$enable_mini_gmp" = xyes || test "x$enable_mini_gmp" = xy; then
SCM_I_GSC_ENABLE_MINI_GMP=1
AC_DEFINE([ENABLE_MINI_GMP], 1,
[Define this if you want to use mini-gmp.])
else
LIBS="$GMP_LIBS $LIBS"
CFLAGS="$GMP_CFLAGS $CFLAGS"
AC_LIB_HAVE_LINKFLAGS([gmp],[],[#include <gmp.h>], [mpz_import (0,0,0,0,0,0,0);])
if test "x$HAVE_LIBGMP" != "xyes"; then
AC_MSG_ERROR([GNU MP 4.1 or greater not found])
fi
if test "x$LIBGMP_PREFIX" != "x"; then
CPPFLAGS="-I$LIBGMP_PREFIX $CPPFLAGS"
fi
AC_CHECK_DECLS([mpz_inits], [], [], [[#include <gmp.h>]])
fi
AC_SUBST([SCM_I_GSC_ENABLE_MINI_GMP])
AM_CONDITIONAL([USE_MINI_GMP], [test "x$enable_mini_gmp" = "xyes"])
AC_CHECK_DECLS([mpz_inits], [], [],
[[#if ENABLE_MINI_GMP
#include "libguile/mini-gmp.h"
#else
#include <gmp.h>
#endif]])
dnl GNU libunistring is checked for by Gnulib's `libunistring' module.
if test "x$LTLIBUNISTRING" = "x"; then
AC_MSG_ERROR([GNU libunistring is required, please install it.])