Blame m4/dirent_h.m4

Packit Service a2489d
# dirent_h.m4 serial 16
Packit Service a2489d
dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
Packit Service a2489d
dnl This file is free software; the Free Software Foundation
Packit Service a2489d
dnl gives unlimited permission to copy and/or distribute it,
Packit Service a2489d
dnl with or without modifications, as long as this notice is preserved.
Packit Service a2489d
Packit Service a2489d
dnl Written by Bruno Haible.
Packit Service a2489d
Packit Service a2489d
AC_DEFUN([gl_DIRENT_H],
Packit Service a2489d
[
Packit Service a2489d
  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
Packit Service a2489d
  dnl once only, before all statements that occur in other macros.
Packit Service a2489d
  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
Packit Service a2489d
Packit Service a2489d
  dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
Packit Service a2489d
  gl_CHECK_NEXT_HEADERS([dirent.h])
Packit Service a2489d
  if test $ac_cv_header_dirent_h = yes; then
Packit Service a2489d
    HAVE_DIRENT_H=1
Packit Service a2489d
  else
Packit Service a2489d
    HAVE_DIRENT_H=0
Packit Service a2489d
  fi
Packit Service a2489d
  AC_SUBST([HAVE_DIRENT_H])
Packit Service a2489d
Packit Service a2489d
  dnl Check for declarations of anything we want to poison if the
Packit Service a2489d
  dnl corresponding gnulib module is not in use.
Packit Service a2489d
  gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
Packit Service a2489d
    ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
Packit Service a2489d
[
Packit Service a2489d
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit Service a2489d
  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
Packit Service a2489d
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit Service a2489d
  dnl Define it also as a C macro, for the benefit of the unit tests.
Packit Service a2489d
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AC_DEFUN([gl_DIRENT_H_DEFAULTS],
Packit Service a2489d
[
Packit Service a2489d
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
Packit Service a2489d
  GNULIB_OPENDIR=0;     AC_SUBST([GNULIB_OPENDIR])
Packit Service a2489d
  GNULIB_READDIR=0;     AC_SUBST([GNULIB_READDIR])
Packit Service a2489d
  GNULIB_REWINDDIR=0;   AC_SUBST([GNULIB_REWINDDIR])
Packit Service a2489d
  GNULIB_CLOSEDIR=0;    AC_SUBST([GNULIB_CLOSEDIR])
Packit Service a2489d
  GNULIB_DIRFD=0;       AC_SUBST([GNULIB_DIRFD])
Packit Service a2489d
  GNULIB_FDOPENDIR=0;   AC_SUBST([GNULIB_FDOPENDIR])
Packit Service a2489d
  GNULIB_SCANDIR=0;     AC_SUBST([GNULIB_SCANDIR])
Packit Service a2489d
  GNULIB_ALPHASORT=0;   AC_SUBST([GNULIB_ALPHASORT])
Packit Service a2489d
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit Service a2489d
  HAVE_OPENDIR=1;       AC_SUBST([HAVE_OPENDIR])
Packit Service a2489d
  HAVE_READDIR=1;       AC_SUBST([HAVE_READDIR])
Packit Service a2489d
  HAVE_REWINDDIR=1;     AC_SUBST([HAVE_REWINDDIR])
Packit Service a2489d
  HAVE_CLOSEDIR=1;      AC_SUBST([HAVE_CLOSEDIR])
Packit Service a2489d
  HAVE_DECL_DIRFD=1;    AC_SUBST([HAVE_DECL_DIRFD])
Packit Service a2489d
  HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
Packit Service a2489d
  HAVE_FDOPENDIR=1;     AC_SUBST([HAVE_FDOPENDIR])
Packit Service a2489d
  HAVE_SCANDIR=1;       AC_SUBST([HAVE_SCANDIR])
Packit Service a2489d
  HAVE_ALPHASORT=1;     AC_SUBST([HAVE_ALPHASORT])
Packit Service a2489d
  REPLACE_OPENDIR=0;    AC_SUBST([REPLACE_OPENDIR])
Packit Service a2489d
  REPLACE_CLOSEDIR=0;   AC_SUBST([REPLACE_CLOSEDIR])
Packit Service a2489d
  REPLACE_DIRFD=0;      AC_SUBST([REPLACE_DIRFD])
Packit Service a2489d
  REPLACE_FDOPENDIR=0;  AC_SUBST([REPLACE_FDOPENDIR])
Packit Service a2489d
])