1 # sys_stat_h.m4 serial 21 -*- Autoconf -*-
2 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
8 dnl Provide a GNU-like <sys/stat.h>.
10 AC_DEFUN([gl_HEADER_SYS_STAT_H],
12 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
14 dnl For the mkdir substitute.
15 AC_REQUIRE([AC_C_INLINE])
17 dnl Check for broken stat macros.
18 AC_REQUIRE([AC_HEADER_STAT])
20 gl_CHECK_NEXT_HEADERS([sys/stat.h])
22 dnl Define types that are supposed to be defined in <sys/types.h> or
24 AC_CHECK_TYPE([nlink_t], [],
25 [AC_DEFINE([nlink_t], [int],
26 [Define to the type of st_nlink in struct stat, or a supertype.])],
27 [#include <sys/types.h>
28 #include <sys/stat.h>])
30 ]) # gl_HEADER_SYS_STAT_H
32 AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
34 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
35 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
36 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
39 AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
41 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
42 GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT])
43 GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT])
44 GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS])
45 GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
46 GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
47 GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT])
48 GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO])
49 GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT])
50 GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD])
51 GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT])
52 GNULIB_STAT=0; AC_SUBST([GNULIB_STAT])
53 GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT])
54 dnl Assume proper GNU behavior unless another module says otherwise.
55 HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
56 HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
57 HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
58 HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
59 HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
60 HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
61 HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO])
62 HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT])
63 HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
64 HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
65 HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
66 REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
67 REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
68 REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
69 REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
70 REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
71 REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO])
72 REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
73 REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
74 REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])