2 dnl Copyright (C) 2002, 2005, 2009-2017 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.
7 AC_DEFUN([gl_FUNC_RMDIR],
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11 dnl Detect cygwin 1.5.x bug.
12 AC_CHECK_HEADERS_ONCE([unistd.h])
13 AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
22 #else /* on Windows with MSVC */
26 if (!rmdir ("conftest.file/"))
28 else if (errno != ENOTDIR)
30 if (!rmdir ("conftest.dir/./"))
34 [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
36 # Guess yes on glibc systems.
37 *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
38 # Guess no on native Windows.
39 mingw*) gl_cv_func_rmdir_works="guessing no" ;;
40 # If we don't know, assume the worst.
41 *) gl_cv_func_rmdir_works="guessing no" ;;
44 rm -rf conftest.dir conftest.file])
45 case "$gl_cv_func_rmdir_works" in