~ubuntu-branches/ubuntu/trusty/patch/trusty-security

« back to all changes in this revision

Viewing changes to m4/rmdir.m4

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-01-03 17:34:45 UTC
  • mto: (6.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20130103173445-5vf8qmnfgd7ug67h
Tags: upstream-2.7.1
ImportĀ upstreamĀ versionĀ 2.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# rmdir.m4 serial 10
2
 
dnl Copyright (C) 2002, 2005, 2009-2011 Free Software Foundation, Inc.
 
1
# rmdir.m4 serial 13
 
2
dnl Copyright (C) 2002, 2005, 2009-2012 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
7
7
AC_DEFUN([gl_FUNC_RMDIR],
8
8
[
9
9
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
 
10
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
10
11
  dnl Detect cygwin 1.5.x bug.
 
12
  AC_CHECK_HEADERS_ONCE([unistd.h])
11
13
  AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
12
14
    [mkdir conftest.dir
13
15
     touch conftest.file
15
17
       [AC_LANG_PROGRAM(
16
18
         [[#include <stdio.h>
17
19
           #include <errno.h>
18
 
           #include <unistd.h>
 
20
           #if HAVE_UNISTD_H
 
21
           # include <unistd.h>
 
22
           #else /* on Windows with MSVC */
 
23
           # include <direct.h>
 
24
           #endif
19
25
]], [[int result = 0;
20
26
      if (!rmdir ("conftest.file/"))
21
27
        result |= 1;
26
32
      return result;
27
33
    ]])],
28
34
       [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
29
 
       [gl_cv_func_rmdir_works="guessing no"])
 
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
       ])
30
42
     rm -rf conftest.dir conftest.file])
31
 
  if test x"$gl_cv_func_rmdir_works" != xyes; then
32
 
    REPLACE_RMDIR=1
33
 
    AC_LIBOBJ([rmdir])
34
 
  fi
 
43
  case "$gl_cv_func_rmdir_works" in
 
44
    *yes) ;;
 
45
    *)
 
46
      REPLACE_RMDIR=1
 
47
      ;;
 
48
  esac
35
49
])