| 1 |
# time.m4 |
| 2 |
# serial 6 |
| 3 |
dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
dnl From Bruno Haible. |
| 10 |
|
| 11 |
AC_DEFUN([gl_FUNC_TIME], |
| 12 |
[ |
| 13 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 14 |
dnl glibc has the bug https://sourceware.org/bugzilla/show_bug.cgi?id=30200 . |
| 15 |
AC_CACHE_CHECK([whether time() works], |
| 16 |
[gl_cv_func_time_works], |
| 17 |
[dnl Guess that it works except on |
| 18 |
dnl - glibc >= 2.31 with Linux. And binaries produced on glibc < 2.31 |
| 19 |
dnl need to run fine on newer glibc versions as well; therefore ignore |
| 20 |
dnl __GLIBC_MINOR__. |
| 21 |
dnl - FreeBSD, on machines with 2 or more CPUs, |
| 22 |
dnl - AIX, |
| 23 |
dnl - native Windows. |
| 24 |
case "$host_os" in |
| 25 |
linux*-gnu*) |
| 26 |
AC_EGREP_CPP([Unlucky], [ |
| 27 |
#include <features.h> |
| 28 |
#ifdef __GNU_LIBRARY__ |
| 29 |
#if __GLIBC__ == 2 |
| 30 |
Unlucky GNU user |
| 31 |
#endif |
| 32 |
#endif |
| 33 |
], |
| 34 |
[gl_cv_func_time_works="guessing no"], |
| 35 |
[gl_cv_func_time_works="guessing yes"]) |
| 36 |
;; |
| 37 |
freebsd*) gl_cv_func_time_works="guessing no";; |
| 38 |
aix*) gl_cv_func_time_works="guessing no";; |
| 39 |
mingw* | windows*) gl_cv_func_time_works="guessing no";; |
| 40 |
*) gl_cv_func_time_works="guessing yes";; |
| 41 |
esac |
| 42 |
]) |
| 43 |
case "$gl_cv_func_time_works" in |
| 44 |
*no) REPLACE_TIME=1 ;; |
| 45 |
esac |
| 46 |
]) |
| 47 |
|
| 48 |
# Prerequisites of lib/time.c. |
| 49 |
AC_DEFUN([gl_PREREQ_TIME], |
| 50 |
[ |
| 51 |
: |
| 52 |
]) |