summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-07-30 13:58:58 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-07-30 14:01:49 -0700
commit5d89a9c2846d32b4726faaf5c8652f3f23dc7d73 (patch)
tree9a27cdda7b90665cb8e953885ccfa9f4b6f7456a /m4
parent88b4516cf8c3ff39803430452b8adbb86a73642a (diff)
downloademacs-5d89a9c2846d32b4726faaf5c8652f3f23dc7d73.tar.gz
Update from Gnulib
This incorporates: 2020-07-30 work around some Oracle Studio attribute bugs 2020-07-29 fsusage, regex, stat-size: remove Cray support 2020-07-26 inttypes: remove support for AIX 4 2020-07-26 gettimeofday: remove workaround for Mac OS X 10.0 2020-07-26 don't require gl_LOCALTIME_BUFFER_DEFAULTS 2020-07-26 alloca: remove Cray-2 and Cray Y-MP support 2020-07-26 libgmp: remove dependency on havelib 2020-07-26 libgmp: remove HAVE_GMP, LIB_GMP 2020-07-25 multiarch: prepare for x86_64+arm64 universal in macOS 11 2020-07-25 sigprocmask: small autoconf macro improvement 2020-07-25 small autoconf macro improvements 2020-07-24 timespec: remove dependence on ‘verify’ 2020-07-24 optimize a few more three-valued comparisons 2020-07-24 fix _GL_CMP parenthesization typo 2020-07-23 optimize three-valued comparison between integers 2020-07-24 doc: update for Mac OS X 10.13 2020-07-23 fchmodat, lchmod: use /proc on Cygwin 2020-07-21 inttypes: fix PRI*PTR and SCN*PTR on 64-bit native Windows 2020-07-12 libgmp: avoid warning when --without-libgmp is used 2020-07-12 libgmp: link to the correct shared library * lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for * build-aux/config.guess, build-aux/config.sub: * build-aux/install-sh, doc/misc/texinfo.tex, lib/c-strcasecmp.c: * lib/c-strncasecmp.c, lib/fchmodat.c, lib/fsusage.c: * lib/gettimeofday.c, lib/inttypes.in.h, lib/lchmod.c: * lib/mini-gmp-gnulib.c, lib/nstrftime.c, lib/regex.h, lib/timespec.h: * m4/alloca.m4, m4/getgroups.m4, m4/gettimeofday.m4: * m4/gnulib-common.m4, m4/inttypes.m4, m4/libgmp.m4, m4/mktime.m4: * m4/multiarch.m4: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * src/Makefile.in, test/Makefile.in (LIBGMP): Rename from LIB_GMP for compatibility with Gnulib. All uses changed.
Diffstat (limited to 'm4')
-rw-r--r--m4/alloca.m432
-rw-r--r--m4/getgroups.m45
-rw-r--r--m4/gettimeofday.m461
-rw-r--r--m4/gnulib-common.m437
-rw-r--r--m4/gnulib-comp.m417
-rw-r--r--m4/inttypes.m418
-rw-r--r--m4/libgmp.m465
-rw-r--r--m4/mktime.m435
-rw-r--r--m4/multiarch.m467
9 files changed, 150 insertions, 187 deletions
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index 59225245b91..d3e98c51bf4 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,4 +1,4 @@
-# alloca.m4 serial 15
+# alloca.m4 serial 16
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -51,12 +51,9 @@ AC_DEFUN([gl_FUNC_ALLOCA],
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
# This works around a bug in autoconf <= 2.68.
-# See <https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html>.
-
-m4_version_prereq([2.69], [] ,[
-
-# This is taken from the following Autoconf patch:
-# https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# See <https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html> and
+# <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497>.
+# Also it has a simplification that is not yet in Autoconf.
# _AC_LIBOBJ_ALLOCA
# -----------------
@@ -72,26 +69,6 @@ AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
-AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
-[AC_EGREP_CPP(webecray,
-[#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
-if test $ac_cv_os_cray = yes; then
- for ac_func in _getb67 GETB67 getb67; do
- AC_CHECK_FUNC($ac_func,
- [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
- [Define to one of '_getb67', 'GETB67',
- 'getb67' for Cray-2 and Cray-YMP
- systems. This function is required for
- 'alloca.c' support on those systems.])
- break])
- done
-fi
-
AC_CACHE_CHECK([stack direction for C alloca],
[ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
@@ -124,5 +101,4 @@ AH_VERBATIM([STACK_DIRECTION],
STACK_DIRECTION = 0 => direction of growth unknown */
@%:@undef STACK_DIRECTION])dnl
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
-])# _AC_LIBOBJ_ALLOCA
])
diff --git a/m4/getgroups.m4 b/m4/getgroups.m4
index 3e7e46f8672..e3441621b25 100644
--- a/m4/getgroups.m4
+++ b/m4/getgroups.m4
@@ -1,4 +1,4 @@
-# serial 23
+# serial 24
dnl From Jim Meyering.
dnl A wrapper around AC_FUNC_GETGROUPS.
@@ -79,7 +79,8 @@ AC_DEFUN([gl_FUNC_GETGROUPS],
AC_DEFINE([GETGROUPS_ZERO_BUG], [1], [Define this to 1 if
getgroups(0,NULL) does not return the number of groups.])
else
- dnl Detect FreeBSD bug; POSIX requires getgroups(-1,ptr) to fail.
+ dnl Detect Mac OS X and FreeBSD bug; POSIX requires getgroups(-1,ptr)
+ dnl to fail.
AC_CACHE_CHECK([whether getgroups handles negative values],
[gl_cv_func_getgroups_works],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index c72b3eacc63..578ed49b077 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,4 +1,4 @@
-# serial 27
+# serial 28
# Copyright (C) 2001-2003, 2005, 2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -19,7 +19,6 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
if test $ac_cv_func_gettimeofday != yes; then
HAVE_GETTIMEOFDAY=0
else
- gl_FUNC_GETTIMEOFDAY_CLOBBER
AC_CACHE_CHECK([for gettimeofday with POSIX signature],
[gl_cv_func_gettimeofday_posix_signature],
[AC_COMPILE_IFELSE(
@@ -66,63 +65,5 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict);
declaration of the second argument to gettimeofday.])
])
-
-dnl See if gettimeofday clobbers the static buffer that localtime uses
-dnl for its return value. The gettimeofday function from Mac OS X 10.0.4
-dnl (i.e., Darwin 1.3.7) has this problem.
-dnl
-dnl If it does, then arrange to use gettimeofday and localtime only via
-dnl the wrapper functions that work around the problem.
-
-AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
-[
- AC_REQUIRE([gl_HEADER_SYS_TIME_H])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS])
-
- AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
- [gl_cv_func_gettimeofday_clobber],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <string.h>
- #include <sys/time.h>
- #include <time.h>
- #include <stdlib.h>
- ]],
- [[
- time_t t = 0;
- struct tm *lt;
- struct tm saved_lt;
- struct timeval tv;
- lt = localtime (&t);
- saved_lt = *lt;
- gettimeofday (&tv, NULL);
- return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
- ]])],
- [gl_cv_func_gettimeofday_clobber=no],
- [gl_cv_func_gettimeofday_clobber=yes],
- [# When cross-compiling:
- case "$host_os" in
- # Guess all is fine on glibc systems.
- *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
- # Guess all is fine on musl systems.
- *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
- # Guess no on native Windows.
- mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;;
- esac
- ])])
-
- case "$gl_cv_func_gettimeofday_clobber" in
- *yes)
- REPLACE_GETTIMEOFDAY=1
- AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
- [Define if gettimeofday clobbers the localtime buffer.])
- gl_LOCALTIME_BUFFER_NEEDED
- ;;
- esac
-])
-
# Prerequisites of lib/gettimeofday.c.
AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index f4ba5e3a00d..57f3a780118 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 50
+# gnulib-common.m4 serial 52
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -120,9 +120,14 @@ AC_DEFUN([gl_COMMON_BODY], [
#endif
/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
- <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
-# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
#else
# define _GL_ATTRIBUTE_COLD
#endif
@@ -176,7 +181,8 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_ATTRIBUTE_LEAF
#endif
-#if _GL_HAS_ATTRIBUTE (may_alias)
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
#else
# define _GL_ATTRIBUTE_MAY_ALIAS
@@ -293,6 +299,20 @@ AC_DEFUN([gl_COMMON_BODY], [
errno. */
#define _GL_ASYNC_SAFE
])
+ AH_VERBATIM([micro_optimizations],
+[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2.
+ It returns
+ 1 if n1 > n2
+ 0 if n1 == n2
+ -1 if n1 < n2
+ The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
+ jump with nearly all GCC versions up to GCC 10.
+ This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
+ GCC versions up to GCC 9.
+ The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
+ avoids conditional jumps in all GCC versions >= 3.4. */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+])
dnl Hint which direction to take regarding cross-compilation guesses:
dnl When a user installs a program on a platform they are not intimately
dnl familiar with, --enable-cross-guesses=conservative is the appropriate
@@ -612,6 +632,15 @@ AC_DEFUN([gl_BIGENDIAN],
AC_C_BIGENDIAN
])
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+AC_DEFUN([gl_SILENT],
+[
+ {
+ $1
+ } AS_MESSAGE_FD>/dev/null
+])
+
# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
# output a spurious "(cached)" mark in the midst of other configure output.
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index f577a6fa741..4472af81b70 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -120,7 +120,6 @@ AC_DEFUN([gl_EARLY],
# Code from module libc-config:
# Code from module libgmp:
# Code from module limits-h:
- # Code from module localtime-buffer:
# Code from module lstat:
# Code from module malloca:
# Code from module manywarnings:
@@ -508,7 +507,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
gl_gnulib_enabled_lchmod=false
- gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false
gl_gnulib_enabled_malloca=false
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
gl_gnulib_enabled_open=false
@@ -624,14 +622,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_lchmod=true
fi
}
- func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 ()
- {
- if ! $gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9; then
- AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS])
- AC_LIBOBJ([localtime-buffer])
- gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=true
- fi
- }
func_gl_gnulib_m4code_malloca ()
{
if ! $gl_gnulib_enabled_malloca; then
@@ -751,9 +741,6 @@ AC_DEFUN([gl_INIT],
if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then
func_gl_gnulib_m4code_open
fi
- if test $NEED_LOCALTIME_BUFFER = 1; then
- func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9
- fi
if test $HAVE_READLINKAT = 0; then
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
fi
@@ -785,7 +772,6 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9])
AM_CONDITIONAL([gl_GNULIB_ENABLED_malloca], [$gl_gnulib_enabled_malloca])
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
@@ -1030,8 +1016,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/lchmod.c
lib/libc-config.h
lib/limits.in.h
- lib/localtime-buffer.c
- lib/localtime-buffer.h
lib/lstat.c
lib/malloca.c
lib/malloca.h
@@ -1176,7 +1160,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/lchmod.m4
m4/libgmp.m4
m4/limits-h.m4
- m4/localtime-buffer.m4
m4/lstat.m4
m4/malloca.m4
m4/manywarnings-c++.m4
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 224d0cdd8e2..28bac816b69 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 29
+# inttypes.m4 serial 31
dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -35,12 +35,19 @@ AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
# Ensure that the PRI* and SCN* macros are defined appropriately.
AC_DEFUN([gl_INTTYPES_PRI_SCN],
[
- AC_REQUIRE([gt_INTTYPES_PRI])
-
PRIPTR_PREFIX=
if test -n "$STDINT_H"; then
- dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
- PRIPTR_PREFIX='"l"'
+ dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
+ dnl 'long long', depending on _WIN64.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef _WIN64
+ LLP64
+ #endif
+ ]]),
+ ],
+ [PRIPTR_PREFIX='"l"'],
+ [PRIPTR_PREFIX='"ll"'])
else
dnl Using the system's <stdint.h>.
for glpfx in '' l ll I64; do
@@ -152,7 +159,6 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
- PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN])
PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
diff --git a/m4/libgmp.m4 b/m4/libgmp.m4
index b569bb73462..82c065e2c2c 100644
--- a/m4/libgmp.m4
+++ b/m4/libgmp.m4
@@ -1,44 +1,67 @@
+# libgmp.m4 serial 4
# Configure the GMP library or a replacement.
-
dnl Copyright 2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl gl_LIBGMP
+dnl Search for an installed libgmp.
+dnl If found, set and AC_SUBST HAVE_LIBGMP=yes and the LIBGMP and LTLIBGMP
+dnl variables, and augment the CPPFLAGS variable, and #define HAVE_LIBGMP to 1.
+dnl Otherwise, set and AC_SUBST HAVE_LIBGMP=no and LIBGMP and LTLIBGMP to
+dnl empty.
+
AC_DEFUN([gl_LIBGMP],
[
AC_ARG_WITH([libgmp],
[AS_HELP_STRING([--without-libgmp],
[do not use the GNU Multiple Precision (GMP) library;
this is the default on systems lacking libgmp.])])
-
- AC_CHECK_HEADERS_ONCE([gmp.h])
- GMP_H=gmp.h
- LIB_GMP=
-
- case $with_libgmp in
- no) ;;
- yes) GMP_H= LIB_GMP=-lgmp;;
- *) if test "$ac_cv_header_gmp_h" = yes; then
- gl_saved_LIBS=$LIBS
+ case "$with_libgmp" in
+ no)
+ HAVE_LIBGMP=no
+ LIBGMP=
+ LTLIBGMP=
+ ;;
+ *)
+ dnl Prefer AC_LIB_HAVE_LINKFLAGS if the havelib module is also in use.
+ m4_ifdef([gl_HAVE_MODULE_HAVELIB],
+ [AC_LIB_HAVE_LINKFLAGS([gmp], [],
+ [#include <gmp.h>],
+ [static const mp_limb_t x[2] = { 0x73, 0x55 };
+ mpz_t tmp;
+ mpz_roinit_n (tmp, x, 2);
+ ],
+ [no])],
+ [gl_saved_LIBS=$LIBS
AC_SEARCH_LIBS([__gmpz_roinit_n], [gmp])
LIBS=$gl_saved_LIBS
case $ac_cv_search___gmpz_roinit_n in
'none needed')
- GMP_H=;;
+ HAVE_LIBGMP=yes LIBGMP=;;
-*)
- GMP_H= LIB_GMP=$ac_cv_search___gmpz_roinit_n;;
+ HAVE_LIBGMP=yes LIBGMP=$ac_cv_search___gmpz_roinit_n;;
+ *)
+ HAVE_LIBGMP=no LIBGMP=;;
esac
- fi;;
+ LTLIBGMP=$LIBGMP
+ AC_SUBST([HAVE_LIBGMP])
+ AC_SUBST([LIBGMP])
+ AC_SUBST([LTLIBGMP])])
+ if test "$with_libgmp,$HAVE_LIBGMP" = yes,no; then
+ AC_MSG_ERROR(
+ [GMP not found, although --with-libgmp was specified.m4_ifdef(
+ [AC_LIB_HAVE_LINKFLAGS],
+ [ Try specifying --with-libgmp-prefix=DIR.])])
+ fi
+ ;;
esac
-
- if test -z "$GMP_H"; then
- AC_DEFINE([HAVE_GMP], 1,
- [Define to 1 if you have the GMP library instead of just the
- mini-gmp replacement.])
+ if test $HAVE_LIBGMP = yes; then
+ GMP_H=
+ else
+ GMP_H=gmp.h
fi
-
- AC_SUBST([LIB_GMP])
AC_SUBST([GMP_H])
AM_CONDITIONAL([GL_GENERATE_GMP_H], [test -n "$GMP_H"])
])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index c00843f0f40..8d9b827fe21 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
-# serial 31
+# serial 32
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -33,15 +33,15 @@ AC_DEFUN([gl_FUNC_MKTIME_WORKS],
AC_CHECK_DECLS_ONCE([alarm])
AC_CHECK_FUNCS_ONCE([tzset])
AC_REQUIRE([gl_MULTIARCH])
- if test $APPLE_UNIVERSAL_BUILD = 1; then
- # A universal build on Apple Mac OS X platforms.
- # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
- # But we need a configuration result that is valid in both modes.
- gl_cv_func_working_mktime=no
- fi
AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
- [AC_RUN_IFELSE(
- [AC_LANG_SOURCE(
+ [if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime="guessing no"
+ else
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
[[/* Test program from Paul Eggert and Tony Leneis. */
#include <limits.h>
#include <stdlib.h>
@@ -242,14 +242,15 @@ main ()
result |= 64;
return result;
}]])],
- [gl_cv_func_working_mktime=yes],
- [gl_cv_func_working_mktime=no],
- [case "$host_os" in
- # Guess no on native Windows.
- mingw*) gl_cv_func_working_mktime="guessing no" ;;
- *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
- esac
- ])
+ [gl_cv_func_working_mktime=yes],
+ [gl_cv_func_working_mktime=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mktime="guessing no" ;;
+ *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ fi
])
])
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 3c2034c5e00..2c61afbd76e 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,4 +1,4 @@
-# multiarch.m4 serial 7
+# multiarch.m4 serial 9
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -21,37 +21,40 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN_ONCE([gl_MULTIARCH],
[
dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
- gl_cv_c_multiarch=no
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
- ]])],
- [
- dnl Check for potential -arch flags. It is not universal unless
- dnl there are at least two -arch flags with different values.
- arch=
- prev=
- for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
- if test -n "$prev"; then
- case $word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$arch" || test "$arch" = "$word"; then
- arch="$word"
- else
- gl_cv_c_multiarch=yes
- fi
- ;;
- esac
- prev=
- else
- if test "x$word" = "x-arch"; then
- prev=arch
- fi
- fi
- done
+ AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
+ [gl_cv_c_multiarch],
+ [gl_cv_c_multiarch=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+ ]])],
+ [
+ dnl Check for potential -arch flags. It is not universal unless
+ dnl there are at least two -arch flags with different values.
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+ ])
])
if test $gl_cv_c_multiarch = yes; then
APPLE_UNIVERSAL_BUILD=1