From 54adbd6f0f173c5c2633c316670793322f08d44d Mon Sep 17 00:00:00 2001 From: Michael Gran Date: Mon, 1 Mar 2021 22:57:30 -0800 Subject: 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 --- configure.ac | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9be807ff1..559f0ed50 100644 --- a/configure.ac +++ b/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 -- cgit v1.2.1