diff options
Diffstat (limited to 'gl/m4/time_r.m4')
-rw-r--r-- | gl/m4/time_r.m4 | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4 index 9e82d39..c388a83 100644 --- a/gl/m4/time_r.m4 +++ b/gl/m4/time_r.m4 | |||
@@ -1,6 +1,6 @@ | |||
1 | dnl Reentrant time functions: localtime_r, gmtime_r. | 1 | dnl Reentrant time functions: localtime_r, gmtime_r. |
2 | 2 | ||
3 | dnl Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc. | 3 | dnl Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc. |
4 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
5 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
6 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
@@ -15,8 +15,16 @@ AC_DEFUN([gl_TIME_R], | |||
15 | AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) | 15 | AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) |
16 | AC_REQUIRE([AC_C_RESTRICT]) | 16 | AC_REQUIRE([AC_C_RESTRICT]) |
17 | 17 | ||
18 | dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is | ||
19 | dnl not defined. | ||
20 | AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]]) | ||
21 | if test $ac_cv_have_decl_localtime_r = no; then | ||
22 | HAVE_DECL_LOCALTIME_R=0 | ||
23 | fi | ||
24 | |||
18 | AC_CHECK_FUNCS_ONCE([localtime_r]) | 25 | AC_CHECK_FUNCS_ONCE([localtime_r]) |
19 | if test $ac_cv_func_localtime_r = yes; then | 26 | if test $ac_cv_func_localtime_r = yes; then |
27 | HAVE_LOCALTIME_R=1 | ||
20 | AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], | 28 | AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], |
21 | [gl_cv_time_r_posix], | 29 | [gl_cv_time_r_posix], |
22 | [AC_COMPILE_IFELSE( | 30 | [AC_COMPILE_IFELSE( |
@@ -42,10 +50,6 @@ AC_DEFUN([gl_TIME_R], | |||
42 | else | 50 | else |
43 | HAVE_LOCALTIME_R=0 | 51 | HAVE_LOCALTIME_R=0 |
44 | fi | 52 | fi |
45 | if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then | ||
46 | AC_LIBOBJ([time_r]) | ||
47 | gl_PREREQ_TIME_R | ||
48 | fi | ||
49 | ]) | 53 | ]) |
50 | 54 | ||
51 | # Prerequisites of lib/time_r.c. | 55 | # Prerequisites of lib/time_r.c. |