aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2023-08-12 12:50:15 -0700
committerPaul Eggert2023-08-12 12:57:35 -0700
commitf3868cb9d1806b35186eabc0262393316ebe689a (patch)
treeb94176760150b6994aacf74292a12ba0890b9222 /m4
parentb66c16c789d8046ff40c48b9346b26238b1b97e1 (diff)
downloademacs-f3868cb9d1806b35186eabc0262393316ebe689a.tar.gz
emacs-f3868cb9d1806b35186eabc0262393316ebe689a.zip
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'm4')
-rw-r--r--m4/clock_time.m432
-rw-r--r--m4/mktime.m43
-rw-r--r--m4/nanosleep.m46
-rw-r--r--m4/stdalign.m410
-rw-r--r--m4/time_h.m435
-rw-r--r--m4/time_r.m44
-rw-r--r--m4/timegm.m43
7 files changed, 50 insertions, 43 deletions
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
index d624a73d35d..28534db1c76 100644
--- a/m4/clock_time.m4
+++ b/m4/clock_time.m4
@@ -1,4 +1,4 @@
1# clock_time.m4 serial 12 1# clock_time.m4 serial 13
2dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -12,9 +12,17 @@ dnl with or without modifications, as long as this notice is preserved.
12 12
13AC_DEFUN([gl_CLOCK_TIME], 13AC_DEFUN([gl_CLOCK_TIME],
14[ 14[
15 AC_REQUIRE([AC_CANONICAL_HOST])
16
15 dnl Persuade glibc and Solaris <time.h> to declare these functions. 17 dnl Persuade glibc and Solaris <time.h> to declare these functions.
16 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 18 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
17 19
20 # On mingw, these functions are defined in the libwinpthread library,
21 # which is better avoided. In fact, the clock_gettime function is buggy
22 # in 32-bit mingw, when -D__MINGW_USE_VC2005_COMPAT is used (which Gnulib's
23 # year2038 module does): It leaves the upper 32 bits of the tv_sec field
24 # of the result uninitialized.
25
18 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. 26 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
19 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. 27 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
20 28
@@ -23,12 +31,22 @@ AC_DEFUN([gl_CLOCK_TIME],
23 # library, inducing unnecessary run-time overhead. 31 # library, inducing unnecessary run-time overhead.
24 CLOCK_TIME_LIB= 32 CLOCK_TIME_LIB=
25 AC_SUBST([CLOCK_TIME_LIB]) 33 AC_SUBST([CLOCK_TIME_LIB])
26 gl_saved_libs=$LIBS 34 case "$host_os" in
27 AC_SEARCH_LIBS([clock_gettime], [rt posix4], 35 mingw*)
28 [test "$ac_cv_search_clock_gettime" = "none required" || 36 ac_cv_func_clock_getres=no
29 CLOCK_TIME_LIB=$ac_cv_search_clock_gettime]) 37 ac_cv_func_clock_gettime=no
30 AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime]) 38 ac_cv_func_clock_settime=no
31 LIBS=$gl_saved_libs 39 ;;
40 *)
41 gl_saved_libs=$LIBS
42 AC_SEARCH_LIBS([clock_gettime], [rt posix4],
43 [test "$ac_cv_search_clock_gettime" = "none required" ||
44 CLOCK_TIME_LIB=$ac_cv_search_clock_gettime])
45 AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
46 LIBS=$gl_saved_libs
47 ;;
48 esac
49
32 # For backward compatibility. 50 # For backward compatibility.
33 LIB_CLOCK_GETTIME="$CLOCK_TIME_LIB" 51 LIB_CLOCK_GETTIME="$CLOCK_TIME_LIB"
34 AC_SUBST([LIB_CLOCK_GETTIME]) 52 AC_SUBST([LIB_CLOCK_GETTIME])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index e9d31f35a46..69cce86da5a 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 37 1# serial 38
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, 2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -280,7 +280,6 @@ AC_DEFUN([gl_FUNC_MKTIME],
280 AC_REQUIRE([AC_CANONICAL_HOST]) 280 AC_REQUIRE([AC_CANONICAL_HOST])
281 AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) 281 AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
282 282
283 REPLACE_MKTIME=0
284 if test "$gl_cv_func_working_mktime" != yes; then 283 if test "$gl_cv_func_working_mktime" != yes; then
285 REPLACE_MKTIME=1 284 REPLACE_MKTIME=1
286 AC_DEFINE([NEED_MKTIME_WORKING], [1], 285 AC_DEFINE([NEED_MKTIME_WORKING], [1],
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
index e21a3e343cb..b7f22d7b606 100644
--- a/m4/nanosleep.m4
+++ b/m4/nanosleep.m4
@@ -1,4 +1,4 @@
1# serial 43 1# serial 44
2 2
3dnl From Jim Meyering. 3dnl From Jim Meyering.
4dnl Check for the nanosleep function. 4dnl Check for the nanosleep function.
@@ -126,9 +126,7 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
126 ]) 126 ])
127 ]) 127 ])
128 case "$gl_cv_func_nanosleep" in 128 case "$gl_cv_func_nanosleep" in
129 *yes) 129 *yes) ;;
130 REPLACE_NANOSLEEP=0
131 ;;
132 *) 130 *)
133 REPLACE_NANOSLEEP=1 131 REPLACE_NANOSLEEP=1
134 case "$gl_cv_func_nanosleep" in 132 case "$gl_cv_func_nanosleep" in
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index 1a236d66d2f..6a39ffe7565 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -68,8 +68,10 @@ AC_DEFUN([gl_ALIGNASOF],
68 dnl The "zz" puts this toward config.h's end, to avoid potential 68 dnl The "zz" puts this toward config.h's end, to avoid potential
69 dnl collisions with other definitions. 69 dnl collisions with other definitions.
70 AH_VERBATIM([zzalignas], 70 AH_VERBATIM([zzalignas],
71[#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof 71[#if !defined HAVE_C_ALIGNASOF \
72# if HAVE_STDALIGN_H 72 && !(defined __cplusplus && 201103 <= __cplusplus) \
73 && !defined alignof
74# if defined HAVE_STDALIGN_H
73# include <stdalign.h> 75# include <stdalign.h>
74# endif 76# endif
75 77
@@ -166,7 +168,7 @@ AC_DEFUN([gl_ALIGNASOF],
166# define _Alignas(a) __declspec (align (a)) 168# define _Alignas(a) __declspec (align (a))
167# endif 169# endif
168# endif 170# endif
169# if !HAVE_STDALIGN_H 171# if !defined HAVE_STDALIGN_H
170# if ((defined _Alignas \ 172# if ((defined _Alignas \
171 && !(defined __cplusplus \ 173 && !(defined __cplusplus \
172 && (201103 <= __cplusplus || defined _MSC_VER))) \ 174 && (201103 <= __cplusplus || defined _MSC_VER))) \
@@ -175,7 +177,7 @@ AC_DEFUN([gl_ALIGNASOF],
175# endif 177# endif
176# endif 178# endif
177 179
178# if _GL_STDALIGN_NEEDS_STDDEF 180# if defined _GL_STDALIGN_NEEDS_STDDEF
179# include <stddef.h> 181# include <stddef.h>
180# endif 182# endif
181#endif]) 183#endif])
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index 51d553a2f1a..632d18fc071 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -2,7 +2,7 @@
2 2
3# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. 3# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
4 4
5# serial 22 5# serial 24
6 6
7# This file is free software; the Free Software Foundation 7# This file is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it, 8# gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,10 @@ AC_DEFUN_ONCE([gl_TIME_H],
23 dnl corresponding gnulib module is not in use. 23 dnl corresponding gnulib module is not in use.
24 gl_WARN_ON_USE_PREPARE([[ 24 gl_WARN_ON_USE_PREPARE([[
25#include <time.h> 25#include <time.h>
26 ]], [asctime_r ctime_r]) 26 ]], [
27 asctime asctime_r ctime ctime_r gmtime_r localtime localtime_r mktime
28 nanosleep strftime strptime time timegm timespec_get timespec_getres tzset
29 ])
27 30
28 AC_REQUIRE([AC_C_RESTRICT]) 31 AC_REQUIRE([AC_C_RESTRICT])
29 32
@@ -162,25 +165,15 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
162 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) 165 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
163 dnl Even GNU libc does not have timezone_t yet. 166 dnl Even GNU libc does not have timezone_t yet.
164 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) 167 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
165 dnl If another module says to replace or to not replace, do that. 168 REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME])
166 dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
167 dnl this lets maintainers check for portability.
168 REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
169 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
170 REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
171 REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
172 REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
173 REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
174 REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
175 REPLACE_TIMESPEC_GET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMESPEC_GET])
176 REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
177
178 dnl Hack so that the time module doesn't depend on the sys_time module.
179 dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
180 : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
181 dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
182 dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
183 dnl is no longer a big deal.
184 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) 169 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
185 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) 170 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
171 REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R])
172 REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME])
173 REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP])
174 REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME])
175 REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
176 REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
177 REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
178 REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
186]) 179])
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index adce438abf1..4831eb26f90 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -57,9 +57,7 @@ AC_DEFUN([gl_TIME_R],
57 [gl_cv_time_r_posix=yes], 57 [gl_cv_time_r_posix=yes],
58 [gl_cv_time_r_posix=no]) 58 [gl_cv_time_r_posix=no])
59 ]) 59 ])
60 if test $gl_cv_time_r_posix = yes; then 60 if test $gl_cv_time_r_posix != yes; then
61 REPLACE_LOCALTIME_R=0
62 else
63 REPLACE_LOCALTIME_R=1 61 REPLACE_LOCALTIME_R=1
64 fi 62 fi
65 else 63 else
diff --git a/m4/timegm.m4 b/m4/timegm.m4
index 8ab265e65fe..6da07807698 100644
--- a/m4/timegm.m4
+++ b/m4/timegm.m4
@@ -1,4 +1,4 @@
1# timegm.m4 serial 15 1# timegm.m4 serial 16
2dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,6 @@ AC_DEFUN([gl_FUNC_TIMEGM],
8[ 8[
9 AC_REQUIRE([gl_TIME_H_DEFAULTS]) 9 AC_REQUIRE([gl_TIME_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) 10 AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
11 REPLACE_TIMEGM=0
12 gl_CHECK_FUNCS_ANDROID([timegm], [[#include <time.h>]]) 11 gl_CHECK_FUNCS_ANDROID([timegm], [[#include <time.h>]])
13 if test $ac_cv_func_timegm = yes; then 12 if test $ac_cv_func_timegm = yes; then
14 if test "$gl_cv_func_working_mktime" != yes; then 13 if test "$gl_cv_func_working_mktime" != yes; then