file-has-acl-tests: omit string.h include
[gnulib.git] / m4 / closedir.m4
blob111baf5fd5b2108137bdb92236b16b9417958cba
1 # closedir.m4
2 # serial 8
3 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_CLOSEDIR],
10   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
11   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13   AC_CHECK_FUNCS([closedir])
14   if test $ac_cv_func_closedir = no; then
15     HAVE_CLOSEDIR=0
16   else
17     dnl Replace closedir() on native Windows and OS/2 kLIBC,
18     dnl to support fdopendir().
19     AC_REQUIRE([gl_DIRENT_DIR])
20     if test $DIR_HAS_FD_MEMBER = 0; then
21       REPLACE_CLOSEDIR=1
22     fi
23     dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
24     dnl to keep fchdir's bookkeeping up-to-date.
25     m4_ifdef([gl_FUNC_FCHDIR], [
26       gl_TEST_FCHDIR
27       if test $HAVE_FCHDIR = 0; then
28         REPLACE_CLOSEDIR=1
29       fi
30     ])
31   fi