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.m419
1 files changed, 18 insertions, 1 deletions
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index b88ba94d..a45a10a9 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -2,6 +2,8 @@
2 2
3# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc. 3# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
4 4
5# serial 2
6
5# This file is free software; the Free Software Foundation 7# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it, 8# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved. 9# with or without modifications, as long as this notice is preserved.
@@ -24,7 +26,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
24]) 26])
25 27
26dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared 28dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
27dnl in time.h or sys/time.h. 29dnl in time.h, sys/time.h, or pthread.h.
28 30
29AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], 31AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
30[ 32[
@@ -41,6 +43,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
41 43
42 TIME_H_DEFINES_STRUCT_TIMESPEC=0 44 TIME_H_DEFINES_STRUCT_TIMESPEC=0
43 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 45 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
46 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
44 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then 47 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
45 TIME_H_DEFINES_STRUCT_TIMESPEC=1 48 TIME_H_DEFINES_STRUCT_TIMESPEC=1
46 else 49 else
@@ -55,10 +58,24 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
55 [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) 58 [gl_cv_sys_struct_timespec_in_sys_time_h=no])])
56 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then 59 if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
57 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 60 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
61 else
62 AC_CACHE_CHECK([for struct timespec in <pthread.h>],
63 [gl_cv_sys_struct_timespec_in_pthread_h],
64 [AC_COMPILE_IFELSE(
65 [AC_LANG_PROGRAM(
66 [[#include <pthread.h>
67 ]],
68 [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
69 [gl_cv_sys_struct_timespec_in_pthread_h=yes],
70 [gl_cv_sys_struct_timespec_in_pthread_h=no])])
71 if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
72 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
73 fi
58 fi 74 fi
59 fi 75 fi
60 AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) 76 AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
61 AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) 77 AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
78 AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
62]) 79])
63 80
64AC_DEFUN([gl_TIME_MODULE_INDICATOR], 81AC_DEFUN([gl_TIME_MODULE_INDICATOR],