update nearly all FSF copyright year lists to include 2009
[gnulib.git] / m4 / utimbuf.m4
1 # serial 9
2
3 # Copyright (C) 1998-2001, 2003-2004, 2007, 2009 Free Software Foundation, Inc.
4 #
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 dnl From Jim Meyering
10
11 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
12 dnl usually in <utime.h>.
13 dnl Some systems have utime.h but don't declare the struct anywhere.
14
15 AC_DEFUN([gl_CHECK_TYPE_STRUCT_UTIMBUF],
16 [
17   AC_CHECK_HEADERS_ONCE([sys/time.h utime.h])
18   AC_CACHE_CHECK([for struct utimbuf], [gl_cv_sys_struct_utimbuf],
19     [AC_COMPILE_IFELSE(
20        [AC_LANG_PROGRAM(
21           [[#if HAVE_SYS_TIME_H
22              #include <sys/time.h>
23             #endif
24             #include <time.h>
25             #ifdef HAVE_UTIME_H
26              #include <utime.h>
27             #endif
28           ]],
29           [[static struct utimbuf x; x.actime = x.modtime;]])],
30        [gl_cv_sys_struct_utimbuf=yes],
31        [gl_cv_sys_struct_utimbuf=no])])
32
33   if test $gl_cv_sys_struct_utimbuf = yes; then
34     AC_DEFINE([HAVE_STRUCT_UTIMBUF], [1],
35       [Define if struct utimbuf is declared -- usually in <utime.h>.
36        Some systems have utime.h but don't declare the struct anywhere. ])
37   fi
38 ])