Blame m4/opendir.m4

Packit Service a2489d
# opendir.m4 serial 5
Packit Service a2489d
dnl Copyright (C) 2011-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
AC_DEFUN([gl_FUNC_OPENDIR],
Packit Service a2489d
[
Packit Service a2489d
  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
Packit Service a2489d
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
Packit Service a2489d
Packit Service a2489d
  AC_CHECK_FUNCS([opendir])
Packit Service a2489d
  if test $ac_cv_func_opendir = no; then
Packit Service a2489d
    HAVE_OPENDIR=0
Packit Service a2489d
  fi
Packit Service a2489d
  dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
Packit Service a2489d
  dnl to keep fchdir's bookkeeping up-to-date.
Packit Service a2489d
  m4_ifdef([gl_FUNC_FCHDIR], [
Packit Service a2489d
    gl_TEST_FCHDIR
Packit Service a2489d
    if test $HAVE_FCHDIR = 0; then
Packit Service a2489d
      if test $HAVE_OPENDIR = 1; then
Packit Service a2489d
        REPLACE_OPENDIR=1
Packit Service a2489d
      fi
Packit Service a2489d
    fi
Packit Service a2489d
  ])
Packit Service a2489d
  dnl Replace opendir() on OS/2 kLIBC to support dirfd() function replaced
Packit Service a2489d
  dnl by gnulib.
Packit Service a2489d
  case $host_os,$HAVE_OPENDIR in
Packit Service a2489d
    os2*,1)
Packit Service a2489d
      REPLACE_OPENDIR=1;;
Packit Service a2489d
  esac
Packit Service a2489d
])