mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
improve autoconfigury for minigmp
* configure.ac: add SCM_I_GSC_ENABLE_MINI_GMP var and rename GUILE_MINI_GMP to ENABLE_MINI_GMP * libguile/bytevectors (GUILE_MINI_GMP): rename to ENABLE_MINI_GMP * libguile/gen-scmconfig.c: renamed GUILE_MINI_GMP to ENABLE_MINI_GMP. rename GUILE_MINI_GMP to SCM_ENABLE_MINI_GMP * libguile/gen-scmconfig.h: add SCM_I_GSC_ENABLE_MINI_GMP * libguile/init.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile/numbers.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile/numbers.h: include scmconfig.h rename GUILE_MINI_GMP to SCM_ENABLE_MINI_GMP * libguile/random.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile/socket.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP * libguile.h [GUILE_MINI_GMP]: prefer SCM_ENABLE_MINI_GMP
This commit is contained in:
parent
eb1bd8050e
commit
54adbd6f0f
10 changed files with 23 additions and 15 deletions
13
configure.ac
13
configure.ac
|
@ -651,19 +651,24 @@ PKG_CHECK_MODULES([GMP],[gmp],
|
|||
[],
|
||||
[$enable_mini_gmp=yes])
|
||||
|
||||
SCM_I_GSC_ENABLE_MINI_GMP=0
|
||||
AC_ARG_ENABLE(mini-gmp,
|
||||
[ --enable-mini-gmp use mini-gmp instead of the full GMP library])
|
||||
if test "$enable_mini_gmp" = yes; then
|
||||
AC_DEFINE([GUILE_MINI_GMP], 1,
|
||||
[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
|
||||
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"
|
||||
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 GUILE_MINI_GMP
|
||||
[[#if ENABLE_MINI_GMP
|
||||
#include "libguile/mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#if GUILE_MINI_GMP
|
||||
#if SCM_ENABLE_MINI_GMP
|
||||
#include "libguile/mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <alloca.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if GUILE_MINI_GMP
|
||||
#if ENABLE_MINI_GMP
|
||||
#include "mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
|
@ -377,10 +377,12 @@ main (int argc, char *argv[])
|
|||
pf ("/* Define to 1 if there is an auxiliary stack, as in ia64. */\n");
|
||||
pf ("#define SCM_HAVE_AUXILIARY_STACK %d\n", SCM_I_GSC_HAVE_AUXILIARY_STACK);
|
||||
|
||||
#ifdef GUILE_MINI_GMP
|
||||
pf ("#define GUILE_MINI_GMP 1\n");
|
||||
pf ("\n");
|
||||
pf ("/* Define to 1 to use mini GMP. */\n");
|
||||
#ifdef ENABLE_MINI_GMP
|
||||
pf ("#define SCM_ENABLE_MINI_GMP 1\n");
|
||||
#else
|
||||
pf ("#undef GUILE_MINI_GMP\n");
|
||||
pf ("#undef SCM_ENABLE_MINI_GMP\n");
|
||||
#endif
|
||||
|
||||
printf ("#endif\n");
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#define SCM_I_GSC_ICONVEH_QUESTION_MARK @SCM_I_GSC_ICONVEH_QUESTION_MARK@
|
||||
#define SCM_I_GSC_ICONVEH_ESCAPE_SEQUENCE @SCM_I_GSC_ICONVEH_ESCAPE_SEQUENCE@
|
||||
#define SCM_I_GSC_HAVE_AUXILIARY_STACK @SCM_I_GSC_HAVE_AUXILIARY_STACK@
|
||||
|
||||
#define SCM_I_GSC_ENABLE_MINI_GMP @SCM_I_GSC_ENABLE_MINI_GMP@
|
||||
/*
|
||||
Local Variables:
|
||||
mode: c
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if GUILE_MINI_GMP
|
||||
#if ENABLE_MINI_GMP
|
||||
#include "mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
|
@ -399,7 +399,7 @@ scm_i_big2dbl_2exp (SCM b, long *expon_p)
|
|||
{
|
||||
long expon;
|
||||
double signif;
|
||||
#if GUILE_MINI_GMP
|
||||
#if ENABLE_MINI_GMP
|
||||
int iexpon;
|
||||
signif = mpz_get_d (SCM_I_BIG_MPZ (b));
|
||||
signif = frexp (signif, &iexpon);
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
|
||||
|
||||
|
||||
#include "libguile/scmconfig.h"
|
||||
#include "libguile/error.h"
|
||||
#include "libguile/gc.h"
|
||||
#include "libguile/print.h"
|
||||
#if GUILE_MINI_GMP
|
||||
#if SCM_ENABLE_MINI_GMP
|
||||
#include "libguile/mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include "generalized-vectors.h"
|
||||
#include "gsubr.h"
|
||||
#include "list.h"
|
||||
#if GUILE_MINI_GMP
|
||||
#if ENABLE_MINI_GMP
|
||||
#include "mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#if GUILE_MINI_GMP
|
||||
#if ENABLE_MINI_GMP
|
||||
#include "mini-gmp.h"
|
||||
#else
|
||||
#include <gmp.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue