summaryrefslogtreecommitdiffstats
path: root/gl/m4/time_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/time_h.m4')
-rw-r--r--gl/m4/time_h.m448
1 files changed, 22 insertions, 26 deletions
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index f6bf3a4..d2f3c97 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -1,12 +1,11 @@
1# Configure a more-standard replacement for <time.h>. 1# time_h.m4
2 2# serial 25
3# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc.
4 4dnl This file is free software; the Free Software Foundation
5# serial 20 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
6 7
7# This file is free software; the Free Software Foundation 8# Configure a more-standard replacement for <time.h>.
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10 9
11# Written by Paul Eggert and Jim Meyering. 10# Written by Paul Eggert and Jim Meyering.
12 11
@@ -23,7 +22,10 @@ AC_DEFUN_ONCE([gl_TIME_H],
23 dnl corresponding gnulib module is not in use. 22 dnl corresponding gnulib module is not in use.
24 gl_WARN_ON_USE_PREPARE([[ 23 gl_WARN_ON_USE_PREPARE([[
25#include <time.h> 24#include <time.h>
26 ]], [asctime_r ctime_r]) 25 ]], [
26 asctime asctime_r ctime ctime_r gmtime_r localtime localtime_r mktime
27 nanosleep strftime strptime time timegm timespec_get timespec_getres tzset
28 ])
27 29
28 AC_REQUIRE([AC_C_RESTRICT]) 30 AC_REQUIRE([AC_C_RESTRICT])
29 31
@@ -137,6 +139,7 @@ AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP]) 139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP])
138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME]) 140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME])
139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME]) 141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME])
142 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME])
140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM]) 143 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM])
141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET]) 144 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET])
142 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES]) 145 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES])
@@ -161,23 +164,16 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
161 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) 164 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
162 dnl Even GNU libc does not have timezone_t yet. 165 dnl Even GNU libc does not have timezone_t yet.
163 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) 166 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
164 dnl If another module says to replace or to not replace, do that. 167 REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME])
165 dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
166 dnl this lets maintainers check for portability.
167 REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
168 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
169 REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
170 REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
171 REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
172 REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
173 REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
174
175 dnl Hack so that the time module doesn't depend on the sys_time module.
176 dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
177 : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
178 dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
179 dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
180 dnl is no longer a big deal.
181 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) 168 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
182 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) 169 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
170 REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R])
171 REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME])
172 REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP])
173 REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME])
174 REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
175 REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
176 REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
177 REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES])
178 REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
183]) 179])