aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/mktime.m411
1 files changed, 7 insertions, 4 deletions
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index d3d376a4e2c..faefb770092 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 24 1# serial 25
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation, 2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 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
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_MKTIME],
14 dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained 14 dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
15 dnl in Autoconf and because it invokes AC_LIBOBJ. 15 dnl in Autoconf and because it invokes AC_LIBOBJ.
16 AC_CHECK_HEADERS_ONCE([unistd.h]) 16 AC_CHECK_HEADERS_ONCE([unistd.h])
17 AC_CHECK_FUNCS_ONCE([alarm]) 17 AC_CHECK_DECLS_ONCE([alarm])
18 AC_REQUIRE([gl_MULTIARCH]) 18 AC_REQUIRE([gl_MULTIARCH])
19 if test $APPLE_UNIVERSAL_BUILD = 1; then 19 if test $APPLE_UNIVERSAL_BUILD = 1; then
20 # A universal build on Apple Mac OS X platforms. 20 # A universal build on Apple Mac OS X platforms.
@@ -34,8 +34,8 @@ AC_DEFUN([gl_FUNC_MKTIME],
34# include <unistd.h> 34# include <unistd.h>
35#endif 35#endif
36 36
37#ifndef HAVE_ALARM 37#if HAVE_DECL_ALARM
38# define alarm(X) /* empty */ 38# include <signal.h>
39#endif 39#endif
40 40
41/* Work around redefinition to rpl_putenv by other config tests. */ 41/* Work around redefinition to rpl_putenv by other config tests. */
@@ -171,10 +171,13 @@ main ()
171 int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; 171 int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
172 int time_t_signed = ! ((time_t) 0 < (time_t) -1); 172 int time_t_signed = ! ((time_t) 0 < (time_t) -1);
173 173
174#if HAVE_DECL_ALARM
174 /* This test makes some buggy mktime implementations loop. 175 /* This test makes some buggy mktime implementations loop.
175 Give up after 60 seconds; a mktime slower than that 176 Give up after 60 seconds; a mktime slower than that
176 isn't worth using anyway. */ 177 isn't worth using anyway. */
178 signal (SIGALRM, SIG_DFL);
177 alarm (60); 179 alarm (60);
180#endif
178 181
179 time_t_max = (! time_t_signed 182 time_t_max = (! time_t_signed
180 ? (time_t) -1 183 ? (time_t) -1