diff options
| author | Paul Eggert | 2020-08-06 15:24:47 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-08-06 15:25:30 -0700 |
| commit | 33b293b41b2cc64aa085bad9051507922434ceda (patch) | |
| tree | 298002879802151ae9c9dd7dc82674185b591354 | |
| parent | 6cb6215cbe65a183e16adf9122280f8a0155ae10 (diff) | |
| download | emacs-33b293b41b2cc64aa085bad9051507922434ceda.tar.gz emacs-33b293b41b2cc64aa085bad9051507922434ceda.zip | |
Update from Gnulib
This incorporates:
2020-08-06 libgmp: add <gmp/gmp.h> support
2020-08-06 Consider that clang defines __OPTIMIZE__ like GCC does
2020-08-06 Use __builtin_expect with clang everywhere
2020-08-05 Use __builtin_clz{,l,ll} with clang, also on Windows
2020-08-05 Use __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang
2020-07-31 _GL_CMP: Improve documentation
2020-07-30 alloca, largefile: sync with Autoconf master
* lib/c++defs.h, lib/cdefs.h, lib/count-leading-zeros.h:
* lib/count-trailing-zeros.h, m4/alloca.m4, m4/gnulib-common.m4:
* m4/largefile.m4, m4/libgmp.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
| -rw-r--r-- | lib/c++defs.h | 4 | ||||
| -rw-r--r-- | lib/cdefs.h | 2 | ||||
| -rw-r--r-- | lib/count-leading-zeros.h | 3 | ||||
| -rw-r--r-- | lib/count-trailing-zeros.h | 3 | ||||
| -rw-r--r-- | lib/gnulib.mk.in | 13 | ||||
| -rw-r--r-- | m4/alloca.m4 | 14 | ||||
| -rw-r--r-- | m4/gnulib-common.m4 | 6 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 2 | ||||
| -rw-r--r-- | m4/largefile.m4 | 2 | ||||
| -rw-r--r-- | m4/libgmp.m4 | 88 |
10 files changed, 78 insertions, 59 deletions
diff --git a/lib/c++defs.h b/lib/c++defs.h index 3e6aaabc9ce..182c2b3a88d 100644 --- a/lib/c++defs.h +++ b/lib/c++defs.h | |||
| @@ -268,7 +268,7 @@ | |||
| 268 | _GL_CXXALIASWARN_2 (func, namespace) | 268 | _GL_CXXALIASWARN_2 (func, namespace) |
| 269 | /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, | 269 | /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, |
| 270 | we enable the warning only when not optimizing. */ | 270 | we enable the warning only when not optimizing. */ |
| 271 | # if !__OPTIMIZE__ | 271 | # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) |
| 272 | # define _GL_CXXALIASWARN_2(func,namespace) \ | 272 | # define _GL_CXXALIASWARN_2(func,namespace) \ |
| 273 | _GL_WARN_ON_USE (func, \ | 273 | _GL_WARN_ON_USE (func, \ |
| 274 | "The symbol ::" #func " refers to the system function. " \ | 274 | "The symbol ::" #func " refers to the system function. " \ |
| @@ -296,7 +296,7 @@ | |||
| 296 | _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) | 296 | _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) |
| 297 | /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, | 297 | /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, |
| 298 | we enable the warning only when not optimizing. */ | 298 | we enable the warning only when not optimizing. */ |
| 299 | # if !__OPTIMIZE__ | 299 | # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) |
| 300 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ | 300 | # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
| 301 | _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ | 301 | _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ |
| 302 | "The symbol ::" #func " refers to the system function. " \ | 302 | "The symbol ::" #func " refers to the system function. " \ |
diff --git a/lib/cdefs.h b/lib/cdefs.h index d8e4a000333..f6c447ad377 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h | |||
| @@ -401,7 +401,7 @@ | |||
| 401 | # endif | 401 | # endif |
| 402 | #endif | 402 | #endif |
| 403 | 403 | ||
| 404 | #if __GNUC__ >= 3 | 404 | #if (__GNUC__ >= 3) || (__clang_major__ >= 4) |
| 405 | # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) | 405 | # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) |
| 406 | # define __glibc_likely(cond) __builtin_expect ((cond), 1) | 406 | # define __glibc_likely(cond) __builtin_expect ((cond), 1) |
| 407 | #else | 407 | #else |
diff --git a/lib/count-leading-zeros.h b/lib/count-leading-zeros.h index 7e88c8cb9d0..7cf605a5f64 100644 --- a/lib/count-leading-zeros.h +++ b/lib/count-leading-zeros.h | |||
| @@ -38,7 +38,8 @@ extern "C" { | |||
| 38 | expand to code that computes the number of leading zeros of the local | 38 | expand to code that computes the number of leading zeros of the local |
| 39 | variable 'x' of type TYPE (an unsigned integer type) and return it | 39 | variable 'x' of type TYPE (an unsigned integer type) and return it |
| 40 | from the current function. */ | 40 | from the current function. */ |
| 41 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) | 41 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ |
| 42 | || (__clang_major__ >= 4) | ||
| 42 | # define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ | 43 | # define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ |
| 43 | return x ? BUILTIN (x) : CHAR_BIT * sizeof x; | 44 | return x ? BUILTIN (x) : CHAR_BIT * sizeof x; |
| 44 | #elif _MSC_VER | 45 | #elif _MSC_VER |
diff --git a/lib/count-trailing-zeros.h b/lib/count-trailing-zeros.h index 1eb5fb919f4..727b21dcc56 100644 --- a/lib/count-trailing-zeros.h +++ b/lib/count-trailing-zeros.h | |||
| @@ -38,7 +38,8 @@ extern "C" { | |||
| 38 | expand to code that computes the number of trailing zeros of the local | 38 | expand to code that computes the number of trailing zeros of the local |
| 39 | variable 'x' of type TYPE (an unsigned integer type) and return it | 39 | variable 'x' of type TYPE (an unsigned integer type) and return it |
| 40 | from the current function. */ | 40 | from the current function. */ |
| 41 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) | 41 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ |
| 42 | || (__clang_major__ >= 4) | ||
| 42 | # define COUNT_TRAILING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ | 43 | # define COUNT_TRAILING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ |
| 43 | return x ? BUILTIN (x) : CHAR_BIT * sizeof x; | 44 | return x ? BUILTIN (x) : CHAR_BIT * sizeof x; |
| 44 | #elif _MSC_VER | 45 | #elif _MSC_VER |
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 4dc180d2e33..92d0621c61a 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in | |||
| @@ -246,9 +246,10 @@ GL_GENERATE_ALLOCA_H = @GL_GENERATE_ALLOCA_H@ | |||
| 246 | GL_GENERATE_BYTESWAP_H = @GL_GENERATE_BYTESWAP_H@ | 246 | GL_GENERATE_BYTESWAP_H = @GL_GENERATE_BYTESWAP_H@ |
| 247 | GL_GENERATE_ERRNO_H = @GL_GENERATE_ERRNO_H@ | 247 | GL_GENERATE_ERRNO_H = @GL_GENERATE_ERRNO_H@ |
| 248 | GL_GENERATE_EXECINFO_H = @GL_GENERATE_EXECINFO_H@ | 248 | GL_GENERATE_EXECINFO_H = @GL_GENERATE_EXECINFO_H@ |
| 249 | GL_GENERATE_GMP_H = @GL_GENERATE_GMP_H@ | 249 | GL_GENERATE_GMP_GMP_H = @GL_GENERATE_GMP_GMP_H@ |
| 250 | GL_GENERATE_IEEE754_H = @GL_GENERATE_IEEE754_H@ | 250 | GL_GENERATE_IEEE754_H = @GL_GENERATE_IEEE754_H@ |
| 251 | GL_GENERATE_LIMITS_H = @GL_GENERATE_LIMITS_H@ | 251 | GL_GENERATE_LIMITS_H = @GL_GENERATE_LIMITS_H@ |
| 252 | GL_GENERATE_MINI_GMP_H = @GL_GENERATE_MINI_GMP_H@ | ||
| 252 | GL_GENERATE_STDALIGN_H = @GL_GENERATE_STDALIGN_H@ | 253 | GL_GENERATE_STDALIGN_H = @GL_GENERATE_STDALIGN_H@ |
| 253 | GL_GENERATE_STDDEF_H = @GL_GENERATE_STDDEF_H@ | 254 | GL_GENERATE_STDDEF_H = @GL_GENERATE_STDDEF_H@ |
| 254 | GL_GENERATE_STDINT_H = @GL_GENERATE_STDINT_H@ | 255 | GL_GENERATE_STDINT_H = @GL_GENERATE_STDINT_H@ |
| @@ -1085,7 +1086,6 @@ gamedir = @gamedir@ | |||
| 1085 | gamegroup = @gamegroup@ | 1086 | gamegroup = @gamegroup@ |
| 1086 | gameuser = @gameuser@ | 1087 | gameuser = @gameuser@ |
| 1087 | gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7 = @gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7@ | 1088 | gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7 = @gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7@ |
| 1088 | gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9 = @gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9@ | ||
| 1089 | gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b = @gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b@ | 1089 | gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b = @gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b@ |
| 1090 | gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31 = @gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31@ | 1090 | gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31 = @gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31@ |
| 1091 | gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c = @gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c@ | 1091 | gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c = @gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c@ |
| @@ -2021,15 +2021,22 @@ ifeq (,$(OMIT_GNULIB_MODULE_libgmp)) | |||
| 2021 | 2021 | ||
| 2022 | BUILT_SOURCES += $(GMP_H) | 2022 | BUILT_SOURCES += $(GMP_H) |
| 2023 | 2023 | ||
| 2024 | ifneq (,$(GL_GENERATE_MINI_GMP_H)) | ||
| 2024 | # Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp. | 2025 | # Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp. |
| 2025 | ifneq (,$(GL_GENERATE_GMP_H)) | ||
| 2026 | gmp.h: $(top_builddir)/config.status | 2026 | gmp.h: $(top_builddir)/config.status |
| 2027 | echo '#include "mini-gmp.h"' >$@-t | 2027 | echo '#include "mini-gmp.h"' >$@-t |
| 2028 | mv $@-t $@ | 2028 | mv $@-t $@ |
| 2029 | else | 2029 | else |
| 2030 | ifneq (,$(GL_GENERATE_GMP_GMP_H)) | ||
| 2031 | # Build gmp.h as a wrapper for gmp/gmp.h. | ||
| 2032 | gmp.h: $(top_builddir)/config.status | ||
| 2033 | echo '#include <gmp/gmp.h>' >$@-t | ||
| 2034 | mv $@-t $@ | ||
| 2035 | else | ||
| 2030 | gmp.h: $(top_builddir)/config.status | 2036 | gmp.h: $(top_builddir)/config.status |
| 2031 | rm -f $@ | 2037 | rm -f $@ |
| 2032 | endif | 2038 | endif |
| 2039 | endif | ||
| 2033 | MOSTLYCLEANFILES += gmp.h gmp.h-t | 2040 | MOSTLYCLEANFILES += gmp.h gmp.h-t |
| 2034 | 2041 | ||
| 2035 | EXTRA_DIST += mini-gmp-gnulib.c mini-gmp.c mini-gmp.h | 2042 | EXTRA_DIST += mini-gmp-gnulib.c mini-gmp.c mini-gmp.h |
diff --git a/m4/alloca.m4 b/m4/alloca.m4 index d3e98c51bf4..b777f8450ce 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # alloca.m4 serial 16 | 1 | # alloca.m4 serial 17 |
| 2 | dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, | 2 | dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, |
| 3 | dnl Inc. | 3 | dnl Inc. |
| 4 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| @@ -50,10 +50,13 @@ AC_DEFUN([gl_FUNC_ALLOCA], | |||
| 50 | # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. | 50 | # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. |
| 51 | AC_DEFUN([gl_PREREQ_ALLOCA], [:]) | 51 | AC_DEFUN([gl_PREREQ_ALLOCA], [:]) |
| 52 | 52 | ||
| 53 | # This works around a bug in autoconf <= 2.68. | 53 | m4_version_prereq([2.70], [], [ |
| 54 | # See <https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html> and | 54 | |
| 55 | # <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497>. | 55 | # This works around a bug in autoconf <= 2.68 and has simplifications |
| 56 | # Also it has a simplification that is not yet in Autoconf. | 56 | # from 2.70. See: |
| 57 | # https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html | ||
| 58 | # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 | ||
| 59 | # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a | ||
| 57 | 60 | ||
| 58 | # _AC_LIBOBJ_ALLOCA | 61 | # _AC_LIBOBJ_ALLOCA |
| 59 | # ----------------- | 62 | # ----------------- |
| @@ -102,3 +105,4 @@ AH_VERBATIM([STACK_DIRECTION], | |||
| 102 | @%:@undef STACK_DIRECTION])dnl | 105 | @%:@undef STACK_DIRECTION])dnl |
| 103 | AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) | 106 | AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) |
| 104 | ]) | 107 | ]) |
| 108 | ]) | ||
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 57f3a780118..50acc0a474b 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # gnulib-common.m4 serial 52 | 1 | # gnulib-common.m4 serial 53 |
| 2 | dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -300,7 +300,9 @@ AC_DEFUN([gl_COMMON_BODY], [ | |||
| 300 | #define _GL_ASYNC_SAFE | 300 | #define _GL_ASYNC_SAFE |
| 301 | ]) | 301 | ]) |
| 302 | AH_VERBATIM([micro_optimizations], | 302 | AH_VERBATIM([micro_optimizations], |
| 303 | [/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2. | 303 | [/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where |
| 304 | n1 and n2 are expressions without side effects, that evaluate to real | ||
| 305 | numbers (excluding NaN). | ||
| 304 | It returns | 306 | It returns |
| 305 | 1 if n1 > n2 | 307 | 1 if n1 > n2 |
| 306 | 0 if n1 == n2 | 308 | 0 if n1 == n2 |
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 4472af81b70..5bfa1473edd 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -346,7 +346,7 @@ AC_DEFUN([gl_INIT], | |||
| 346 | AC_REQUIRE([gl_LARGEFILE]) | 346 | AC_REQUIRE([gl_LARGEFILE]) |
| 347 | gl___INLINE | 347 | gl___INLINE |
| 348 | gl_LIBGMP | 348 | gl_LIBGMP |
| 349 | if test -n "$GMP_H"; then | 349 | if test $HAVE_LIBGMP != yes; then |
| 350 | AC_LIBOBJ([mini-gmp-gnulib]) | 350 | AC_LIBOBJ([mini-gmp-gnulib]) |
| 351 | fi | 351 | fi |
| 352 | gl_LIMITS_H | 352 | gl_LIMITS_H |
diff --git a/m4/largefile.m4 b/m4/largefile.m4 index 8017ca70eb4..f7140dd0a3a 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 | |||
| @@ -35,7 +35,7 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], | |||
| 35 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | 35 | We can't simply define LARGE_OFF_T to be 9223372036854775807, |
| 36 | since some C++ compilers masquerading as C compilers | 36 | since some C++ compilers masquerading as C compilers |
| 37 | incorrectly reject 9223372036854775807. */ | 37 | incorrectly reject 9223372036854775807. */ |
| 38 | @%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | 38 | @%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
| 39 | int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 | 39 | int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 |
| 40 | && LARGE_OFF_T % 2147483647 == 1) | 40 | && LARGE_OFF_T % 2147483647 == 1) |
| 41 | ? 1 : -1]];[]dnl | 41 | ? 1 : -1]];[]dnl |
diff --git a/m4/libgmp.m4 b/m4/libgmp.m4 index 82c065e2c2c..1025f06a775 100644 --- a/m4/libgmp.m4 +++ b/m4/libgmp.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # libgmp.m4 serial 4 | 1 | # libgmp.m4 serial 5 |
| 2 | # Configure the GMP library or a replacement. | 2 | # Configure the GMP library or a replacement. |
| 3 | dnl Copyright 2020 Free Software Foundation, Inc. | 3 | dnl Copyright 2020 Free Software Foundation, Inc. |
| 4 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| @@ -18,50 +18,54 @@ AC_DEFUN([gl_LIBGMP], | |||
| 18 | [AS_HELP_STRING([--without-libgmp], | 18 | [AS_HELP_STRING([--without-libgmp], |
| 19 | [do not use the GNU Multiple Precision (GMP) library; | 19 | [do not use the GNU Multiple Precision (GMP) library; |
| 20 | this is the default on systems lacking libgmp.])]) | 20 | this is the default on systems lacking libgmp.])]) |
| 21 | case "$with_libgmp" in | 21 | HAVE_LIBGMP=no |
| 22 | no) | 22 | LIBGMP= |
| 23 | HAVE_LIBGMP=no | 23 | LTLIBGMP= |
| 24 | LIBGMP= | 24 | AS_IF([test "$with_libgmp" != no], |
| 25 | LTLIBGMP= | 25 | [AC_CHECK_HEADERS([gmp.h gmp/gmp.h], [break]) |
| 26 | ;; | 26 | dnl Prefer AC_LIB_HAVE_LINKFLAGS if the havelib module is also in use. |
| 27 | *) | 27 | AS_IF([test "$ac_cv_header_gmp_h" = yes || |
| 28 | dnl Prefer AC_LIB_HAVE_LINKFLAGS if the havelib module is also in use. | 28 | test "$ac_cv_header_gmp_gmp_h" = yes], |
| 29 | m4_ifdef([gl_HAVE_MODULE_HAVELIB], | 29 | [m4_ifdef([gl_HAVE_MODULE_HAVELIB], |
| 30 | [AC_LIB_HAVE_LINKFLAGS([gmp], [], | 30 | [AC_LIB_HAVE_LINKFLAGS([gmp], [], |
| 31 | [#include <gmp.h>], | 31 | [#if HAVE_GMP_H |
| 32 | [static const mp_limb_t x[2] = { 0x73, 0x55 }; | 32 | # include <gmp.h> |
| 33 | mpz_t tmp; | 33 | #else |
| 34 | mpz_roinit_n (tmp, x, 2); | 34 | # include <gmp/gmp.h> |
| 35 | ], | 35 | #endif], |
| 36 | [no])], | 36 | [static const mp_limb_t x[2] = { 0x73, 0x55 }; |
| 37 | [gl_saved_LIBS=$LIBS | 37 | mpz_t tmp; |
| 38 | AC_SEARCH_LIBS([__gmpz_roinit_n], [gmp]) | 38 | mpz_roinit_n (tmp, x, 2); |
| 39 | LIBS=$gl_saved_LIBS | 39 | ], |
| 40 | case $ac_cv_search___gmpz_roinit_n in | 40 | [no])], |
| 41 | 'none needed') | 41 | [gl_saved_LIBS=$LIBS |
| 42 | HAVE_LIBGMP=yes LIBGMP=;; | 42 | AC_SEARCH_LIBS([__gmpz_roinit_n], [gmp]) |
| 43 | -*) | 43 | LIBS=$gl_saved_LIBS |
| 44 | HAVE_LIBGMP=yes LIBGMP=$ac_cv_search___gmpz_roinit_n;; | 44 | case $ac_cv_search___gmpz_roinit_n in |
| 45 | *) | 45 | 'none needed') |
| 46 | HAVE_LIBGMP=no LIBGMP=;; | 46 | HAVE_LIBGMP=yes;; |
| 47 | esac | 47 | -*) |
| 48 | LTLIBGMP=$LIBGMP | 48 | HAVE_LIBGMP=yes |
| 49 | AC_SUBST([HAVE_LIBGMP]) | 49 | LIBGMP=$ac_cv_search___gmpz_roinit_n |
| 50 | AC_SUBST([LIBGMP]) | 50 | LTLIBGMP=$LIBGMP;; |
| 51 | AC_SUBST([LTLIBGMP])]) | 51 | esac |
| 52 | if test "$with_libgmp,$HAVE_LIBGMP" = yes,no; then | 52 | AC_SUBST([HAVE_LIBGMP]) |
| 53 | AC_MSG_ERROR( | 53 | AC_SUBST([LIBGMP]) |
| 54 | [GMP not found, although --with-libgmp was specified.m4_ifdef( | 54 | AC_SUBST([LTLIBGMP])])]) |
| 55 | [AC_LIB_HAVE_LINKFLAGS], | 55 | if test "$with_libgmp,$HAVE_LIBGMP" = yes,no; then |
| 56 | [ Try specifying --with-libgmp-prefix=DIR.])]) | 56 | AC_MSG_ERROR( |
| 57 | fi | 57 | [GMP not found, although --with-libgmp was specified.m4_ifdef( |
| 58 | ;; | 58 | [AC_LIB_HAVE_LINKFLAGS], |
| 59 | esac | 59 | [ Try specifying --with-libgmp-prefix=DIR.])]) |
| 60 | if test $HAVE_LIBGMP = yes; then | 60 | fi]) |
| 61 | if test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" = yes; then | ||
| 61 | GMP_H= | 62 | GMP_H= |
| 62 | else | 63 | else |
| 63 | GMP_H=gmp.h | 64 | GMP_H=gmp.h |
| 64 | fi | 65 | fi |
| 65 | AC_SUBST([GMP_H]) | 66 | AC_SUBST([GMP_H]) |
| 66 | AM_CONDITIONAL([GL_GENERATE_GMP_H], [test -n "$GMP_H"]) | 67 | AM_CONDITIONAL([GL_GENERATE_MINI_GMP_H], |
| 68 | [test $HAVE_LIBGMP != yes]) | ||
| 69 | AM_CONDITIONAL([GL_GENERATE_GMP_GMP_H], | ||
| 70 | [test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" != yes]) | ||
| 67 | ]) | 71 | ]) |