summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2024-01-30 17:22:50 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2024-01-30 17:23:26 -0800
commitdd177b7b88c81ab71e1d5a97b872d85d524fee9b (patch)
tree208a0601121687bbbf16043d0bdee0a2cf250123 /m4
parent17771b2a425e776c81e7454d942ec238264ce12b (diff)
downloademacs-dd177b7b88c81ab71e1d5a97b872d85d524fee9b.tar.gz
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'm4')
-rw-r--r--m4/copy-file-range.m441
-rw-r--r--m4/gettime.m44
-rw-r--r--m4/gnulib-common.m44
-rw-r--r--m4/gnulib-comp.m43
-rw-r--r--m4/memset_explicit.m46
-rw-r--r--m4/string_h.m43
-rw-r--r--m4/time_h.m43
7 files changed, 41 insertions, 23 deletions
diff --git a/m4/copy-file-range.m4 b/m4/copy-file-range.m4
index e9198549510..443e598ba55 100644
--- a/m4/copy-file-range.m4
+++ b/m4/copy-file-range.m4
@@ -1,4 +1,4 @@
-# copy-file-range.m4
+# copy-file-range.m4 serial 5
dnl Copyright 2019-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,22 +17,33 @@ AC_DEFUN([gl_FUNC_COPY_FILE_RANGE],
dnl Programs that use copy_file_range must fall back on read+write
dnl anyway, and there's little point to substituting the Gnulib stub
dnl for a glibc stub.
- AC_CACHE_CHECK([for copy_file_range], [gl_cv_func_copy_file_range],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <unistd.h>
- ]],
- [[ssize_t (*func) (int, off_t *, int, off_t *, size_t, unsigned)
- = copy_file_range;
- return func (0, 0, 0, 0, 0, 0) & 127;
- ]])
- ],
- [gl_cv_func_copy_file_range=yes],
- [gl_cv_func_copy_file_range=no])
- ])
-
+ case "$host_os" in
+ *-gnu* | gnu*)
+ AC_CACHE_CHECK([for copy_file_range], [gl_cv_func_copy_file_range],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ ]],
+ [[ssize_t (*func) (int, off_t *, int, off_t *, size_t, unsigned)
+ = copy_file_range;
+ return func (0, 0, 0, 0, 0, 0) & 127;
+ ]])
+ ],
+ [gl_cv_func_copy_file_range=yes],
+ [gl_cv_func_copy_file_range=no])
+ ])
+ gl_cv_onwards_func_copy_file_range="$gl_cv_func_copy_file_range"
+ ;;
+ *)
+ gl_CHECK_FUNCS_ANDROID([copy_file_range], [[#include <unistd.h>]])
+ gl_cv_func_copy_file_range="$ac_cv_func_copy_file_range"
+ ;;
+ esac
if test "$gl_cv_func_copy_file_range" != yes; then
HAVE_COPY_FILE_RANGE=0
+ case "$gl_cv_onwards_func_copy_file_range" in
+ future*) REPLACE_COPY_FILE_RANGE=1 ;;
+ esac
else
AC_DEFINE([HAVE_COPY_FILE_RANGE], 1,
[Define to 1 if the function copy_file_range exists.])
diff --git a/m4/gettime.m4 b/m4/gettime.m4
index e450e6b9d05..1ec018d5154 100644
--- a/m4/gettime.m4
+++ b/m4/gettime.m4
@@ -1,4 +1,4 @@
-# gettime.m4 serial 14
+# gettime.m4 serial 15
dnl Copyright (C) 2002, 2004-2006, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -64,5 +64,5 @@ AC_DEFUN([gl_GETTIME_RES],
dnl Prerequisites of lib/gettime-res.c.
AC_REQUIRE([gl_CLOCK_TIME])
AC_REQUIRE([gl_TIMESPEC])
- AC_CHECK_FUNCS_ONCE([timespec_getres])
+ gl_CHECK_FUNCS_ANDROID([timespec_getres], [[#include <time.h>]])
])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 03d10fa51ea..00691c0d6c3 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 90
+# gnulib-common.m4 serial 91
dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -79,7 +79,7 @@ AC_DEFUN([gl_COMMON_BODY], [
#if (defined __has_attribute \
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
- ? 6000000 <= __apple_build_version__ \
+ ? 7000000 <= __apple_build_version__ \
: 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 2e5b328e3d8..7a7ebb0f34e 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -432,7 +432,8 @@ AC_DEFUN([gl_INIT],
])
gl_STRING_MODULE_INDICATOR([memrchr])
gl_FUNC_MEMSET_EXPLICIT
- gl_CONDITIONAL([GL_COND_OBJ_MEMSET_EXPLICIT], [test $HAVE_MEMSET_EXPLICIT = 0])
+ gl_CONDITIONAL([GL_COND_OBJ_MEMSET_EXPLICIT],
+ [test $HAVE_MEMSET_EXPLICIT = 0 || test $REPLACE_MEMSET_EXPLICIT = 1])
AM_COND_IF([GL_COND_OBJ_MEMSET_EXPLICIT], [
gl_PREREQ_MEMSET_EXPLICIT
])
diff --git a/m4/memset_explicit.m4 b/m4/memset_explicit.m4
index 6ac798d4557..19514ff917e 100644
--- a/m4/memset_explicit.m4
+++ b/m4/memset_explicit.m4
@@ -1,3 +1,4 @@
+# memset_explicit.m4 serial 2
dnl Copyright 2022-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,9 +8,12 @@ AC_DEFUN([gl_FUNC_MEMSET_EXPLICIT],
[
AC_REQUIRE([gl_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([memset_explicit])
+ gl_CHECK_FUNCS_ANDROID([memset_explicit], [[#include <string.h>]])
if test $ac_cv_func_memset_explicit = no; then
HAVE_MEMSET_EXPLICIT=0
+ case "$gl_cv_onwards_func_memset_explicit" in
+ future*) REPLACE_MEMSET_EXPLICIT=1 ;;
+ esac
fi
])
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 8b12101447f..9ea748cc774 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -5,7 +5,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 38
+# serial 39
# Written by Paul Eggert.
@@ -132,6 +132,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY])
+ REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT])
REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY])
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index 367f69efae6..32fade0f401 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -2,7 +2,7 @@
# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc.
-# serial 24
+# serial 25
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -175,5 +175,6 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
+ REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES])
REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
])