* m4/getdate.m4 (gl_C_COMPOUND_LITERALS): New macro.
[gnulib.git] / m4 / stat-time.m4
1 # Checks for stat-related time functions.
2
3 # Copyright (C) 1998, 1999, 2001, 2003, 2005 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.
7
8 dnl From Paul Eggert.
9
10 # st_atim.tv_nsec - Linux, Solaris
11 # st_atimespec.tv_nsec - FreeBSD, if ! defined _POSIX_SOURCE
12 # st_atimensec - FreeBSD, if defined _POSIX_SOURCE
13 # st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
14 # st_spare1 - Cygwin?
15
16 AC_DEFUN([gl_STAT_TIME],
17 [
18   AC_LIBSOURCES([stat-time.h])
19
20   AC_REQUIRE([AC_C_INLINE])
21   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
22
23   AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], [],
24     [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
25        [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
26           [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [],
27              [AC_CHECK_MEMBERS([struct stat.st_spare1], [],
28                 [],
29                 [#include <sys/types.h>
30                  #include <sys/stat.h>])],
31              [#include <sys/types.h>
32               #include <sys/stat.h>])],
33           [#include <sys/types.h>
34            #include <sys/stat.h>])],
35        [#include <sys/types.h>
36         #include <sys/stat.h>])],
37     [#include <sys/types.h>
38      #include <sys/stat.h>])
39 ])