2 # Configure the GMP library or a replacement.
3 dnl Copyright 2020 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
9 dnl Searches for an installed libgmp.
10 dnl If found, it sets and AC_SUBSTs HAVE_LIBGMP=yes and the LIBGMP and LTLIBGMP
11 dnl variables, and augments the CPPFLAGS variable, and #defines HAVE_LIBGMP
12 dnl and HAVE_GMP to 1.
13 dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBGMP=no and LIBGMP and LTLIBGMP to
19 [AS_HELP_STRING([--without-libgmp],
20 [do not use the GNU Multiple Precision (GMP) library;
21 this is the default on systems lacking libgmp.])])
22 case "$with_libgmp" in
29 AC_LIB_HAVE_LINKFLAGS([gmp], [],
31 [static const mp_limb_t x[2] = { 0x73, 0x55 };
33 mpz_roinit_n (tmp, x, 2);
36 if test $HAVE_LIBGMP = no; then
37 case "$with_libgmp" in
39 AC_MSG_ERROR([GMP not found, although --with-libgmp was specified. Try specifying --with-libgmp-prefix=DIR.])
45 if test $HAVE_LIBGMP = yes; then
47 dnl This is redundant, as HAVE_LIBGMP is also defined to 1.
48 AC_DEFINE([HAVE_GMP], [1],
49 [Define to 1 if you have the GMP library instead of just the
50 mini-gmp replacement.])
55 AM_CONDITIONAL([GL_GENERATE_GMP_H], [test -n "$GMP_H"])
57 dnl For backward compatibility.