2005-09-16 07:40:48 +00:00
|
|
|
#serial 11
|
2005-01-23 09:07:57 +00:00
|
|
|
|
2005-01-29 00:16:39 +00:00
|
|
|
# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
|
2005-01-23 09:07:57 +00:00
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
2000-01-04 17:12:12 +00:00
|
|
|
|
|
|
|
|
dnl From Jim Meyering
|
|
|
|
|
|
2003-08-07 07:37:51 +00:00
|
|
|
AC_DEFUN([gl_TIMESPEC],
|
|
|
|
|
[
|
2005-01-29 00:16:39 +00:00
|
|
|
AC_LIBSOURCES([timespec.h])
|
|
|
|
|
|
2003-08-07 07:37:51 +00:00
|
|
|
dnl Prerequisites of lib/timespec.h.
|
2005-09-16 07:40:48 +00:00
|
|
|
AC_REQUIRE([AC_C_INLINE])
|
2003-08-07 07:37:51 +00:00
|
|
|
AC_REQUIRE([AC_HEADER_TIME])
|
|
|
|
|
AC_CHECK_HEADERS_ONCE(sys/time.h)
|
2004-04-13 15:28:45 +00:00
|
|
|
gl_CHECK_TYPE_STRUCT_TIMESPEC
|
2003-08-07 07:37:51 +00:00
|
|
|
|
|
|
|
|
dnl Persuade glibc <time.h> to declare nanosleep().
|
|
|
|
|
AC_REQUIRE([AC_GNU_SOURCE])
|
|
|
|
|
|
|
|
|
|
AC_CHECK_DECLS(nanosleep, , , [#include <time.h>])
|
|
|
|
|
])
|
|
|
|
|
|
2000-01-25 07:26:14 +00:00
|
|
|
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
|
|
|
|
|
dnl in time.h or sys/time.h.
|
2000-01-04 17:12:12 +00:00
|
|
|
|
2004-04-13 15:28:45 +00:00
|
|
|
AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
|
2000-01-04 17:12:12 +00:00
|
|
|
[
|
2003-08-09 14:03:59 +00:00
|
|
|
dnl Persuade pedantic Solaris to declare struct timespec.
|
|
|
|
|
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
|
|
|
|
|
2000-03-02 09:44:43 +00:00
|
|
|
AC_REQUIRE([AC_HEADER_TIME])
|
2003-08-07 07:37:51 +00:00
|
|
|
AC_CHECK_HEADERS_ONCE(sys/time.h)
|
2000-01-04 17:12:12 +00:00
|
|
|
AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
|
|
|
|
|
[AC_TRY_COMPILE(
|
|
|
|
|
[
|
2000-01-25 07:26:14 +00:00
|
|
|
# if TIME_WITH_SYS_TIME
|
|
|
|
|
# include <sys/time.h>
|
|
|
|
|
# include <time.h>
|
|
|
|
|
# else
|
|
|
|
|
# if HAVE_SYS_TIME_H
|
|
|
|
|
# include <sys/time.h>
|
|
|
|
|
# else
|
|
|
|
|
# include <time.h>
|
|
|
|
|
# endif
|
|
|
|
|
# endif
|
2000-01-04 17:12:12 +00:00
|
|
|
],
|
|
|
|
|
[static struct timespec x; x.tv_sec = x.tv_nsec;],
|
|
|
|
|
fu_cv_sys_struct_timespec=yes,
|
|
|
|
|
fu_cv_sys_struct_timespec=no)
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
if test $fu_cv_sys_struct_timespec = yes; then
|
2001-09-17 21:44:03 +00:00
|
|
|
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
|
|
|
|
|
[Define if struct timespec is declared in <time.h>. ])
|
2000-01-04 17:12:12 +00:00
|
|
|
fi
|
|
|
|
|
])
|