Blame m4/sys_stat_h.m4

Packit Service fdd496
# sys_stat_h.m4 serial 31   -*- Autoconf -*-
Packit Service fdd496
dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
Packit Service fdd496
dnl This file is free software; the Free Software Foundation
Packit Service fdd496
dnl gives unlimited permission to copy and/or distribute it,
Packit Service fdd496
dnl with or without modifications, as long as this notice is preserved.
Packit Service fdd496
Packit Service fdd496
dnl From Eric Blake.
Packit Service fdd496
dnl Provide a GNU-like <sys/stat.h>.
Packit Service fdd496
Packit Service fdd496
AC_DEFUN([gl_HEADER_SYS_STAT_H],
Packit Service fdd496
[
Packit Service fdd496
  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
Packit Service fdd496
Packit Service fdd496
  dnl Check for broken stat macros.
Packit Service fdd496
  AC_REQUIRE([AC_HEADER_STAT])
Packit Service fdd496
Packit Service fdd496
  gl_CHECK_NEXT_HEADERS([sys/stat.h])
Packit Service fdd496
Packit Service fdd496
  dnl Ensure the type mode_t gets defined.
Packit Service fdd496
  AC_REQUIRE([AC_TYPE_MODE_T])
Packit Service fdd496
Packit Service fdd496
  dnl Whether to enable precise timestamps in 'struct stat'.
Packit Service fdd496
  m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [
Packit Service fdd496
    AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC])
Packit Service fdd496
  ], [
Packit Service fdd496
    WINDOWS_STAT_TIMESPEC=0
Packit Service fdd496
  ])
Packit Service fdd496
  AC_SUBST([WINDOWS_STAT_TIMESPEC])
Packit Service fdd496
Packit Service fdd496
  dnl Whether to ensure that struct stat.st_size is 64-bit wide.
Packit Service fdd496
  m4_ifdef([gl_LARGEFILE], [
Packit Service fdd496
    AC_REQUIRE([gl_LARGEFILE])
Packit Service fdd496
  ], [
Packit Service fdd496
    WINDOWS_64_BIT_ST_SIZE=0
Packit Service fdd496
  ])
Packit Service fdd496
  AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
Packit Service fdd496
Packit Service fdd496
  dnl Define types that are supposed to be defined in <sys/types.h> or
Packit Service fdd496
  dnl <sys/stat.h>.
Packit Service fdd496
  AC_CHECK_TYPE([nlink_t], [],
Packit Service fdd496
    [AC_DEFINE([nlink_t], [int],
Packit Service fdd496
       [Define to the type of st_nlink in struct stat, or a supertype.])],
Packit Service fdd496
    [#include <sys/types.h>
Packit Service fdd496
     #include <sys/stat.h>])
Packit Service fdd496
Packit Service fdd496
  dnl Check for declarations of anything we want to poison if the
Packit Service fdd496
  dnl corresponding gnulib module is not in use.
Packit Service fdd496
  gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
Packit Service fdd496
    ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
Packit Service fdd496
    mknod mknodat stat utimensat])
Packit Service fdd496
]) # gl_HEADER_SYS_STAT_H
Packit Service fdd496
Packit Service fdd496
AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
Packit Service fdd496
[
Packit Service fdd496
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit Service fdd496
  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
Packit Service fdd496
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit Service fdd496
  dnl Define it also as a C macro, for the benefit of the unit tests.
Packit Service fdd496
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
Packit Service fdd496
])
Packit Service fdd496
Packit Service fdd496
AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
Packit Service fdd496
[
Packit Service fdd496
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
Packit Service fdd496
  GNULIB_FCHMODAT=0;    AC_SUBST([GNULIB_FCHMODAT])
Packit Service fdd496
  GNULIB_FSTAT=0;       AC_SUBST([GNULIB_FSTAT])
Packit Service fdd496
  GNULIB_FSTATAT=0;     AC_SUBST([GNULIB_FSTATAT])
Packit Service fdd496
  GNULIB_FUTIMENS=0;    AC_SUBST([GNULIB_FUTIMENS])
Packit Service fdd496
  GNULIB_LCHMOD=0;      AC_SUBST([GNULIB_LCHMOD])
Packit Service fdd496
  GNULIB_LSTAT=0;       AC_SUBST([GNULIB_LSTAT])
Packit Service fdd496
  GNULIB_MKDIRAT=0;     AC_SUBST([GNULIB_MKDIRAT])
Packit Service fdd496
  GNULIB_MKFIFO=0;      AC_SUBST([GNULIB_MKFIFO])
Packit Service fdd496
  GNULIB_MKFIFOAT=0;    AC_SUBST([GNULIB_MKFIFOAT])
Packit Service fdd496
  GNULIB_MKNOD=0;       AC_SUBST([GNULIB_MKNOD])
Packit Service fdd496
  GNULIB_MKNODAT=0;     AC_SUBST([GNULIB_MKNODAT])
Packit Service fdd496
  GNULIB_STAT=0;        AC_SUBST([GNULIB_STAT])
Packit Service fdd496
  GNULIB_UTIMENSAT=0;   AC_SUBST([GNULIB_UTIMENSAT])
Packit Service fdd496
  GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT])
Packit Service fdd496
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit Service fdd496
  HAVE_FCHMODAT=1;      AC_SUBST([HAVE_FCHMODAT])
Packit Service fdd496
  HAVE_FSTATAT=1;       AC_SUBST([HAVE_FSTATAT])
Packit Service fdd496
  HAVE_FUTIMENS=1;      AC_SUBST([HAVE_FUTIMENS])
Packit Service fdd496
  HAVE_LCHMOD=1;        AC_SUBST([HAVE_LCHMOD])
Packit Service fdd496
  HAVE_LSTAT=1;         AC_SUBST([HAVE_LSTAT])
Packit Service fdd496
  HAVE_MKDIRAT=1;       AC_SUBST([HAVE_MKDIRAT])
Packit Service fdd496
  HAVE_MKFIFO=1;        AC_SUBST([HAVE_MKFIFO])
Packit Service fdd496
  HAVE_MKFIFOAT=1;      AC_SUBST([HAVE_MKFIFOAT])
Packit Service fdd496
  HAVE_MKNOD=1;         AC_SUBST([HAVE_MKNOD])
Packit Service fdd496
  HAVE_MKNODAT=1;       AC_SUBST([HAVE_MKNODAT])
Packit Service fdd496
  HAVE_UTIMENSAT=1;     AC_SUBST([HAVE_UTIMENSAT])
Packit Service fdd496
  REPLACE_FSTAT=0;      AC_SUBST([REPLACE_FSTAT])
Packit Service fdd496
  REPLACE_FSTATAT=0;    AC_SUBST([REPLACE_FSTATAT])
Packit Service fdd496
  REPLACE_FUTIMENS=0;   AC_SUBST([REPLACE_FUTIMENS])
Packit Service fdd496
  REPLACE_LSTAT=0;      AC_SUBST([REPLACE_LSTAT])
Packit Service fdd496
  REPLACE_MKDIR=0;      AC_SUBST([REPLACE_MKDIR])
Packit Service fdd496
  REPLACE_MKFIFO=0;     AC_SUBST([REPLACE_MKFIFO])
Packit Service fdd496
  REPLACE_MKNOD=0;      AC_SUBST([REPLACE_MKNOD])
Packit Service fdd496
  REPLACE_STAT=0;       AC_SUBST([REPLACE_STAT])
Packit Service fdd496
  REPLACE_UTIMENSAT=0;  AC_SUBST([REPLACE_UTIMENSAT])
Packit Service fdd496
])