Blame gnulib/m4/unistd_h.m4

Packit Service b70e42
# unistd_h.m4 serial 66
Packit Service b70e42
dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
Packit Service b70e42
dnl This file is free software; the Free Software Foundation
Packit Service b70e42
dnl gives unlimited permission to copy and/or distribute it,
Packit Service b70e42
dnl with or without modifications, as long as this notice is preserved.
Packit Service b70e42
Packit Service b70e42
dnl Written by Simon Josefsson, Bruno Haible.
Packit Service b70e42
Packit Service b70e42
AC_DEFUN([gl_UNISTD_H],
Packit Service b70e42
[
Packit Service b70e42
  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
Packit Service b70e42
  dnl once only, before all statements that occur in other macros.
Packit Service b70e42
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit Service b70e42
Packit Service b70e42
  gl_CHECK_NEXT_HEADERS([unistd.h])
Packit Service b70e42
  if test $ac_cv_header_unistd_h = yes; then
Packit Service b70e42
    HAVE_UNISTD_H=1
Packit Service b70e42
  else
Packit Service b70e42
    HAVE_UNISTD_H=0
Packit Service b70e42
  fi
Packit Service b70e42
  AC_SUBST([HAVE_UNISTD_H])
Packit Service b70e42
Packit Service b70e42
  dnl Ensure the type pid_t gets defined.
Packit Service b70e42
  AC_REQUIRE([AC_TYPE_PID_T])
Packit Service b70e42
Packit Service b70e42
  dnl Determine WINDOWS_64_BIT_OFF_T.
Packit Service b70e42
  AC_REQUIRE([gl_TYPE_OFF_T])
Packit Service b70e42
Packit Service b70e42
  dnl Check for declarations of anything we want to poison if the
Packit Service b70e42
  dnl corresponding gnulib module is not in use.
Packit Service b70e42
  gl_WARN_ON_USE_PREPARE([[
Packit Service b70e42
#if HAVE_UNISTD_H
Packit Service b70e42
# include <unistd.h>
Packit Service b70e42
#endif
Packit Service b70e42
/* Some systems declare various items in the wrong headers.  */
Packit Service b70e42
#if !(defined __GLIBC__ && !defined __UCLIBC__)
Packit Service b70e42
# include <fcntl.h>
Packit Service b70e42
# include <stdio.h>
Packit Service b70e42
# include <stdlib.h>
Packit Service b70e42
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
Packit Service b70e42
#  include <io.h>
Packit Service b70e42
# endif
Packit Service b70e42
#endif
Packit Service b70e42
    ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
Packit Service b70e42
    fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
Packit Service b70e42
    gethostname getlogin getlogin_r getpagesize
Packit Service b70e42
    getusershell setusershell endusershell
Packit Service b70e42
    group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
Packit Service b70e42
    readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
Packit Service b70e42
    unlink unlinkat usleep])
Packit Service b70e42
])
Packit Service b70e42
Packit Service b70e42
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
Packit Service b70e42
[
Packit Service b70e42
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit Service b70e42
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit Service b70e42
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit Service b70e42
  dnl Define it also as a C macro, for the benefit of the unit tests.
Packit Service b70e42
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
Packit Service b70e42
])
Packit Service b70e42
Packit Service b70e42
AC_DEFUN([gl_UNISTD_H_DEFAULTS],
Packit Service b70e42
[
Packit Service b70e42
  GNULIB_CHDIR=0;                AC_SUBST([GNULIB_CHDIR])
Packit Service b70e42
  GNULIB_CHOWN=0;                AC_SUBST([GNULIB_CHOWN])
Packit Service b70e42
  GNULIB_CLOSE=0;                AC_SUBST([GNULIB_CLOSE])
Packit Service b70e42
  GNULIB_DUP=0;                  AC_SUBST([GNULIB_DUP])
Packit Service b70e42
  GNULIB_DUP2=0;                 AC_SUBST([GNULIB_DUP2])
Packit Service b70e42
  GNULIB_DUP3=0;                 AC_SUBST([GNULIB_DUP3])
Packit Service b70e42
  GNULIB_ENVIRON=0;              AC_SUBST([GNULIB_ENVIRON])
Packit Service b70e42
  GNULIB_EUIDACCESS=0;           AC_SUBST([GNULIB_EUIDACCESS])
Packit Service b70e42
  GNULIB_FACCESSAT=0;            AC_SUBST([GNULIB_FACCESSAT])
Packit Service b70e42
  GNULIB_FCHDIR=0;               AC_SUBST([GNULIB_FCHDIR])
Packit Service b70e42
  GNULIB_FCHOWNAT=0;             AC_SUBST([GNULIB_FCHOWNAT])
Packit Service b70e42
  GNULIB_FDATASYNC=0;            AC_SUBST([GNULIB_FDATASYNC])
Packit Service b70e42
  GNULIB_FSYNC=0;                AC_SUBST([GNULIB_FSYNC])
Packit Service b70e42
  GNULIB_FTRUNCATE=0;            AC_SUBST([GNULIB_FTRUNCATE])
Packit Service b70e42
  GNULIB_GETCWD=0;               AC_SUBST([GNULIB_GETCWD])
Packit Service b70e42
  GNULIB_GETDOMAINNAME=0;        AC_SUBST([GNULIB_GETDOMAINNAME])
Packit Service b70e42
  GNULIB_GETDTABLESIZE=0;        AC_SUBST([GNULIB_GETDTABLESIZE])
Packit Service b70e42
  GNULIB_GETGROUPS=0;            AC_SUBST([GNULIB_GETGROUPS])
Packit Service b70e42
  GNULIB_GETHOSTNAME=0;          AC_SUBST([GNULIB_GETHOSTNAME])
Packit Service b70e42
  GNULIB_GETLOGIN=0;             AC_SUBST([GNULIB_GETLOGIN])
Packit Service b70e42
  GNULIB_GETLOGIN_R=0;           AC_SUBST([GNULIB_GETLOGIN_R])
Packit Service b70e42
  GNULIB_GETPAGESIZE=0;          AC_SUBST([GNULIB_GETPAGESIZE])
Packit Service b70e42
  GNULIB_GETUSERSHELL=0;         AC_SUBST([GNULIB_GETUSERSHELL])
Packit Service b70e42
  GNULIB_GROUP_MEMBER=0;         AC_SUBST([GNULIB_GROUP_MEMBER])
Packit Service b70e42
  GNULIB_ISATTY=0;               AC_SUBST([GNULIB_ISATTY])
Packit Service b70e42
  GNULIB_LCHOWN=0;               AC_SUBST([GNULIB_LCHOWN])
Packit Service b70e42
  GNULIB_LINK=0;                 AC_SUBST([GNULIB_LINK])
Packit Service b70e42
  GNULIB_LINKAT=0;               AC_SUBST([GNULIB_LINKAT])
Packit Service b70e42
  GNULIB_LSEEK=0;                AC_SUBST([GNULIB_LSEEK])
Packit Service b70e42
  GNULIB_PIPE=0;                 AC_SUBST([GNULIB_PIPE])
Packit Service b70e42
  GNULIB_PIPE2=0;                AC_SUBST([GNULIB_PIPE2])
Packit Service b70e42
  GNULIB_PREAD=0;                AC_SUBST([GNULIB_PREAD])
Packit Service b70e42
  GNULIB_PWRITE=0;               AC_SUBST([GNULIB_PWRITE])
Packit Service b70e42
  GNULIB_READ=0;                 AC_SUBST([GNULIB_READ])
Packit Service b70e42
  GNULIB_READLINK=0;             AC_SUBST([GNULIB_READLINK])
Packit Service b70e42
  GNULIB_READLINKAT=0;           AC_SUBST([GNULIB_READLINKAT])
Packit Service b70e42
  GNULIB_RMDIR=0;                AC_SUBST([GNULIB_RMDIR])
Packit Service b70e42
  GNULIB_SETHOSTNAME=0;          AC_SUBST([GNULIB_SETHOSTNAME])
Packit Service b70e42
  GNULIB_SLEEP=0;                AC_SUBST([GNULIB_SLEEP])
Packit Service b70e42
  GNULIB_SYMLINK=0;              AC_SUBST([GNULIB_SYMLINK])
Packit Service b70e42
  GNULIB_SYMLINKAT=0;            AC_SUBST([GNULIB_SYMLINKAT])
Packit Service b70e42
  GNULIB_TTYNAME_R=0;            AC_SUBST([GNULIB_TTYNAME_R])
Packit Service b70e42
  GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
Packit Service b70e42
  GNULIB_UNISTD_H_SIGPIPE=0;     AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
Packit Service b70e42
  GNULIB_UNLINK=0;               AC_SUBST([GNULIB_UNLINK])
Packit Service b70e42
  GNULIB_UNLINKAT=0;             AC_SUBST([GNULIB_UNLINKAT])
Packit Service b70e42
  GNULIB_USLEEP=0;               AC_SUBST([GNULIB_USLEEP])
Packit Service b70e42
  GNULIB_WRITE=0;                AC_SUBST([GNULIB_WRITE])
Packit Service b70e42
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit Service b70e42
  HAVE_CHOWN=1;           AC_SUBST([HAVE_CHOWN])
Packit Service b70e42
  HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
Packit Service b70e42
  HAVE_DUP3=1;            AC_SUBST([HAVE_DUP3])
Packit Service b70e42
  HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
Packit Service b70e42
  HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
Packit Service b70e42
  HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
Packit Service b70e42
  HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
Packit Service b70e42
  HAVE_FDATASYNC=1;       AC_SUBST([HAVE_FDATASYNC])
Packit Service b70e42
  HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
Packit Service b70e42
  HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
Packit Service b70e42
  HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
Packit Service b70e42
  HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
Packit Service b70e42
  HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
Packit Service b70e42
  HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
Packit Service b70e42
  HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
Packit Service b70e42
  HAVE_GROUP_MEMBER=1;    AC_SUBST([HAVE_GROUP_MEMBER])
Packit Service b70e42
  HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
Packit Service b70e42
  HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
Packit Service b70e42
  HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
Packit Service b70e42
  HAVE_PIPE=1;            AC_SUBST([HAVE_PIPE])
Packit Service b70e42
  HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
Packit Service b70e42
  HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
Packit Service b70e42
  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
Packit Service b70e42
  HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
Packit Service b70e42
  HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
Packit Service b70e42
  HAVE_SETHOSTNAME=1;     AC_SUBST([HAVE_SETHOSTNAME])
Packit Service b70e42
  HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
Packit Service b70e42
  HAVE_SYMLINK=1;         AC_SUBST([HAVE_SYMLINK])
Packit Service b70e42
  HAVE_SYMLINKAT=1;       AC_SUBST([HAVE_SYMLINKAT])
Packit Service b70e42
  HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
Packit Service b70e42
  HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
Packit Service b70e42
  HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
Packit Service b70e42
  HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
Packit Service b70e42
  HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
Packit Service b70e42
  HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
Packit Service b70e42
  HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
Packit Service b70e42
  HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
Packit Service b70e42
  HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
Packit Service b70e42
  HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
Packit Service b70e42
  HAVE_DECL_TTYNAME_R=1;  AC_SUBST([HAVE_DECL_TTYNAME_R])
Packit Service b70e42
  HAVE_OS_H=0;            AC_SUBST([HAVE_OS_H])
Packit Service b70e42
  HAVE_SYS_PARAM_H=0;     AC_SUBST([HAVE_SYS_PARAM_H])
Packit Service b70e42
  REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
Packit Service b70e42
  REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
Packit Service b70e42
  REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
Packit Service b70e42
  REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
Packit Service b70e42
  REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
Packit Service b70e42
  REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
Packit Service b70e42
  REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
Packit Service b70e42
  REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
Packit Service b70e42
  REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
Packit Service b70e42
  REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
Packit Service b70e42
  REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
Packit Service b70e42
  REPLACE_ISATTY=0;       AC_SUBST([REPLACE_ISATTY])
Packit Service b70e42
  REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
Packit Service b70e42
  REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
Packit Service b70e42
  REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
Packit Service b70e42
  REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
Packit Service b70e42
  REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
Packit Service b70e42
  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
Packit Service b70e42
  REPLACE_READ=0;         AC_SUBST([REPLACE_READ])
Packit Service b70e42
  REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
Packit Service b70e42
  REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
Packit Service b70e42
  REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
Packit Service b70e42
  REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
Packit Service b70e42
  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
Packit Service b70e42
  REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
Packit Service b70e42
  REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
Packit Service b70e42
  REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
Packit Service b70e42
  REPLACE_WRITE=0;        AC_SUBST([REPLACE_WRITE])
Packit Service b70e42
  UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
Packit Service b70e42
  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
Packit Service b70e42
                           AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
Packit Service b70e42
])