1 # Configure a replacement for <sys/time.h>.
3 # Copyright (C) 2007 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
8 # Written by Paul Eggert and Martin Lambers.
10 AC_DEFUN([gl_HEADER_SYS_TIME_H],
12 AC_REQUIRE([AC_C_RESTRICT])
13 AC_CHECK_HEADERS_ONCE([sys/time.h])
15 if test $ac_cv_header_sys_time_h = yes; then
16 gl_ABSOLUTE_HEADER([sys/time.h])
17 ABSOLUTE_SYS_TIME_H=\"$gl_cv_absolute_sys_time_h\"
20 ABSOLUTE_SYS_TIME_H=\"no/such/file/sys/time.h\"
23 AC_SUBST([ABSOLUTE_SYS_TIME_H])
24 AC_SUBST([HAVE_SYS_TIME_H])
26 AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
34 [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
35 [gl_cv_sys_struct_timeval=yes],
36 [gl_cv_sys_struct_timeval=no])])
37 if test $gl_cv_sys_struct_timeval = yes; then
42 AC_SUBST([HAVE_STRUCT_TIMEVAL])
44 dnl Assume POSIX behavior unless another module says otherwise.
45 HAVE_GETTIMEOFDAY_POSIX_SIGNATURE=1
46 AC_SUBST([HAVE_GETTIMEOFDAY_POSIX_SIGNATURE])
47 GETTIMEOFDAY_CLOBBERS_LOCALTIME=0
48 AC_SUBST([GETTIMEOFDAY_CLOBBERS_LOCALTIME])