~ubuntu-branches/ubuntu/vivid/parted/vivid

« back to all changes in this revision

Viewing changes to m4/time_h.m4

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-07-21 10:23:16 UTC
  • mfrom: (7.2.32 sid)
  • Revision ID: package-import@ubuntu.com-20140721102316-jsyv3yzmbo8vlde5
Tags: 3.1-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Configure a more-standard replacement for <time.h>.
2
2
 
3
 
# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
 
3
# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
4
 
 
5
# serial 6
4
6
 
5
7
# This file is free software; the Free Software Foundation
6
8
# gives unlimited permission to copy and/or distribute it,
19
21
[
20
22
  AC_REQUIRE([AC_C_RESTRICT])
21
23
  AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
22
 
  gl_CHECK_NEXT_HEADERS([time.h])
 
24
  gl_NEXT_HEADERS([time.h])
23
25
  AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
24
26
])
25
27
 
26
 
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
27
 
dnl in time.h or sys/time.h.
 
28
dnl Define HAVE_STRUCT_TIMESPEC if 'struct timespec' is declared
 
29
dnl in time.h, sys/time.h, or pthread.h.
28
30
 
29
31
AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
30
32
[
41
43
 
42
44
  TIME_H_DEFINES_STRUCT_TIMESPEC=0
43
45
  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
 
46
  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
44
47
  if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
45
48
    TIME_H_DEFINES_STRUCT_TIMESPEC=1
46
49
  else
55
58
         [gl_cv_sys_struct_timespec_in_sys_time_h=no])])
56
59
    if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
57
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
74
    fi
59
75
  fi
60
76
  AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
61
77
  AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
 
78
  AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
62
79
])
63
80
 
64
81
AC_DEFUN([gl_TIME_MODULE_INDICATOR],
78
95
  GNULIB_TIMEGM=0;                       AC_SUBST([GNULIB_TIMEGM])
79
96
  GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
80
97
  dnl Assume proper GNU behavior unless another module says otherwise.
81
 
  HAVE_LOCALTIME_R=1;                    AC_SUBST([HAVE_LOCALTIME_R])
 
98
  HAVE_DECL_LOCALTIME_R=1;               AC_SUBST([HAVE_DECL_LOCALTIME_R])
82
99
  HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
83
100
  HAVE_STRPTIME=1;                       AC_SUBST([HAVE_STRPTIME])
84
101
  HAVE_TIMEGM=1;                         AC_SUBST([HAVE_TIMEGM])