GDB support: add frame annotators and filters
[bpt/guile.git] / m4 / rmdir.m4
CommitLineData
005de2e8 1# rmdir.m4 serial 13
5e69ceb7 2dnl Copyright (C) 2002, 2005, 2009-2014 Free Software Foundation, Inc.
a67f2fce
AW
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_FUNC_RMDIR],
8[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
005de2e8 10 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
a67f2fce 11 dnl Detect cygwin 1.5.x bug.
35428fb6 12 AC_CHECK_HEADERS_ONCE([unistd.h])
a67f2fce
AW
13 AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
14 [mkdir conftest.dir
15 touch conftest.file
16 AC_RUN_IFELSE(
17 [AC_LANG_PROGRAM(
18 [[#include <stdio.h>
19 #include <errno.h>
35428fb6
LC
20 #if HAVE_UNISTD_H
21 # include <unistd.h>
22 #else /* on Windows with MSVC */
23 # include <direct.h>
24 #endif
a67f2fce
AW
25]], [[int result = 0;
26 if (!rmdir ("conftest.file/"))
27 result |= 1;
28 else if (errno != ENOTDIR)
29 result |= 2;
30 if (!rmdir ("conftest.dir/./"))
31 result |= 4;
32 return result;
33 ]])],
34 [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
005de2e8
LC
35 [case "$host_os" in
36 # Guess yes on glibc systems.
37 *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
38 # If we don't know, assume the worst.
39 *) gl_cv_func_rmdir_works="guessing no" ;;
40 esac
41 ])
a67f2fce 42 rm -rf conftest.dir conftest.file])
005de2e8
LC
43 case "$gl_cv_func_rmdir_works" in
44 *yes) ;;
45 *)
46 REPLACE_RMDIR=1
47 ;;
48 esac
a67f2fce 49])