]> git.cworth.org Git - gzip/blob - m4/utimbuf.m4
Imported Debian patch 1.3.9-1
[gzip] / m4 / utimbuf.m4
1 #serial 7
2
3 # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 Free Software
4 # Foundation, Inc.
5 #
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 dnl From Jim Meyering
11
12 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
13 dnl usually in <utime.h>.
14 dnl Some systems have utime.h but don't declare the struct anywhere.
15
16 AC_DEFUN([gl_CHECK_TYPE_STRUCT_UTIMBUF],
17 [
18   AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
19   AC_REQUIRE([AC_HEADER_TIME])
20   AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
21     [AC_TRY_COMPILE(
22       [
23 #ifdef TIME_WITH_SYS_TIME
24 # include <sys/time.h>
25 # include <time.h>
26 #else
27 # ifdef HAVE_SYS_TIME_H
28 #  include <sys/time.h>
29 # else
30 #  include <time.h>
31 # endif
32 #endif
33 #ifdef HAVE_UTIME_H
34 # include <utime.h>
35 #endif
36       ],
37       [static struct utimbuf x; x.actime = x.modtime;],
38       fu_cv_sys_struct_utimbuf=yes,
39       fu_cv_sys_struct_utimbuf=no)
40     ])
41
42   if test $fu_cv_sys_struct_utimbuf = yes; then
43     AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
44       [Define if struct utimbuf is declared -- usually in <utime.h>.
45        Some systems have utime.h but don't declare the struct anywhere. ])
46   fi
47 ])