unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Ulrich Mueller <ulm@gentoo.org>, emacs-devel@gnu.org
Subject: Re: Merging bignum to master
Date: Sun, 12 Aug 2018 01:09:26 -0700	[thread overview]
Message-ID: <48742e8c-fffb-7fe0-bb12-2ce3dc171603@cs.ucla.edu> (raw)
In-Reply-To: <w6g8t5cayj2.fsf@kph.uni-mainz.de>

[-- Attachment #1: Type: text/plain, Size: 507 bytes --]

Ulrich Mueller wrote:
> I noticed that there is no --with-gmp configure option to control
> linking against libgmp. It this as it is supposed to be?

We should have an option, for the same reason we have an option for building 
versus linking to the regex library. I installed the attached to try to do that. 
I didn't call the option --with-gmp, since the idea is that Emacs always uses 
GMP in some form or another. I called it --with-mini-gmp, as it controls whether 
Emacs uses mini-gmp or regular GMP.

[-- Attachment #2: 0001-New-configure-arg-with-mini-gmp.patch --]
[-- Type: text/x-patch, Size: 2524 bytes --]

From 3fc948a36c0f70f73d2e8eb688b1599fa6b73036 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 12 Aug 2018 01:06:15 -0700
Subject: [PATCH] New 'configure' arg --with-mini-gmp

* configure.ac: It lets the builder override default of whther
mini-gmp is used.  Use AC_SEARCH_LIBS as per Autoconf manual.
---
 configure.ac | 35 ++++++++++++++++++++++++-----------
 etc/NEWS     |  7 +++++--
 2 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 690b999125..58bdefab6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4302,19 +4302,32 @@ AC_DEFUN
 AC_SUBST(DESLIB)
 AC_SUBST(KRB4LIB)
 
+AC_ARG_WITH([mini-gmp],
+  [AS_HELP_STRING([--without-mini-gmp],
+		  [don't compile and use mini-gmp, a substitute for the
+		   GNU Multiple Precision (GMP) library; this is the
+		   default on systems with recent-enough GMP.])])
 GMP_LIB=
-GMP_OBJ=
+GMP_OBJ=mini-gmp.o
 HAVE_GMP=no
-AC_CHECK_LIB(gmp, __gmpz_roinit_n, [
-  AC_CHECK_HEADERS(gmp.h, [
-    GMP_LIB=-lgmp
-    HAVE_GMP=yes
-    AC_DEFINE(HAVE_GMP, 1, [Define to 1 if you have gmp.h and -lgmp])])])
-if test $HAVE_GMP = no; then
-   GMP_OBJ=mini-gmp.o
-fi
-AC_SUBST(GMP_LIB)
-AC_SUBST(GMP_OBJ)
+case $with_mini_gmp in
+  yes) ;;
+  no) HAVE_GMP=yes;;
+  *) AC_CHECK_HEADERS([gmp.h],
+       [OLIBS=$LIBS
+	AC_SEARCH_LIBS([__gmpz_roinit_n], [gmp])
+	LIBS=$OLIBS
+	case $ac_cv_search___gmpz_roinit_n in
+	  'none needed') HAVE_GMP=yes;;
+	  -*) HAVE_GMP=yes GMP_LIB=$ac_cv_search___gmpz_roinit_n;;
+	esac]);;
+esac
+if test "$HAVE_GMP" = yes; then
+  GMP_OBJ=
+  AC_DEFINE([HAVE_GMP], 1, [Define to 1 if you have recent-enough GMP.])
+fi
+AC_SUBST([GMP_LIB])
+AC_SUBST([GMP_OBJ])
 
 AC_CHECK_HEADERS(valgrind/valgrind.h)
 
diff --git a/etc/NEWS b/etc/NEWS
index d684e35524..decc5e3954 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -24,8 +24,11 @@ When you add a new item, use the appropriate mark if you are sure it applies,
 \f
 * Installation Changes in Emacs 27.1
 
-** configure now checks for the GMP library.  If not found, the
-included "mini-gmp" library is used instead.
+** Emacs now uses GMP, the GNU Multiple Precision library.
+By default, if 'configure' does not find a suitable libgmp, it
+arranges for the included mini-gmp library to be built and used.
+The new 'configure' option --with-mini-gmp uses mini-gmp even if a
+suitable libgmp is available.
 
 ** The new configure option '--with-json' adds support for JSON using
 the Jansson library.  It is on by default; use 'configure
-- 
2.17.1


  reply	other threads:[~2018-08-12  8:09 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-11 19:47 Merging bignum to master Tom Tromey
2018-08-11 21:28 ` Basil L. Contovounesios
2018-08-12 16:34   ` Tom Tromey
2018-08-13 12:21     ` Basil L. Contovounesios
2018-08-14  0:21     ` Andy Moreton
2018-08-15 23:41       ` Andy Moreton
2018-08-16 15:38         ` Basil L. Contovounesios
2018-08-19  8:26         ` Paul Eggert
2018-08-17 14:58   ` Eli Zaretskii
2018-08-12  6:29 ` Ulrich Mueller
2018-08-12  8:09   ` Paul Eggert [this message]
2018-08-12 17:21     ` Ulrich Mueller
2018-08-12 18:20       ` Eli Zaretskii
2018-08-12 19:30         ` Ulrich Mueller
2018-08-13  0:15           ` Paul Eggert
2018-08-12 18:05     ` Eli Zaretskii
2018-08-12 23:53       ` Paul Eggert
2018-08-13  0:20         ` Tom Tromey
2018-08-13  7:51         ` Andreas Schwab
2018-08-13  8:06           ` Ulrich Mueller
2018-08-13  9:14             ` Paul Eggert
2018-08-14 23:09               ` Paul Eggert
2018-08-16  2:46                 ` Richard Stallman
2018-08-13 23:31         ` Richard Stallman
2018-08-14  1:41           ` Paul Eggert
2018-08-16  2:41             ` Richard Stallman
2018-08-16 19:31               ` Paul Eggert
2018-08-16 22:02               ` Stefan Monnier
2018-08-12  7:37 ` John Wiegley
2018-08-12 18:21   ` Eli Zaretskii
2018-08-12 11:48 ` Pip Cet
2018-08-12 16:02   ` Tom Tromey
2018-08-13 22:58   ` Paul Eggert
2018-08-14  1:12     ` Noam Postavsky
2018-08-14 13:04     ` Pip Cet
2018-08-14 18:01       ` Paul Eggert
2018-08-15 15:20         ` Pip Cet
2018-08-15 16:17           ` Paul Eggert
2018-08-15 23:57           ` Andy Moreton
2018-08-16 22:00             ` Stefan Monnier
2018-08-20 16:28         ` Some vars now limited to fixnum size. (Was: Merging bignum to master) Karl Fogel
2018-08-20 16:54           ` Paul Eggert
2018-08-20 17:27             ` Eli Zaretskii
2018-08-20 17:27             ` Paul Eggert
2018-08-20 18:00               ` Eli Zaretskii
2018-08-20 19:55                 ` Pip Cet
2018-08-20 23:15                   ` Paul Eggert
2018-08-21 15:01               ` Some vars now limited to fixnum size Tom Tromey
2018-08-21 16:36                 ` Andy Moreton
2018-08-21 18:46                 ` Paul Eggert
2018-08-22 15:39                   ` Tom Tromey
2018-08-21  3:38             ` Some vars now limited to fixnum size. (Was: Merging bignum to master) Richard Stallman
2018-08-21  4:09               ` Paul Eggert
2018-08-22  4:03                 ` Richard Stallman
2018-08-22  4:53                   ` Paul Eggert
2018-08-20 17:25           ` Eli Zaretskii
2018-08-14  0:51 ` Merging bignum to master Andy Moreton
2018-08-15 15:46 ` Andy Moreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48742e8c-fffb-7fe0-bb12-2ce3dc171603@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).