Blame m4/unistd_h.m4

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