]> git.cworth.org Git - tar/blob - m4/unistd_h.m4
Imported Upstream version 1.21
[tar] / m4 / unistd_h.m4
1 # unistd_h.m4 serial 16
2 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl Written by Simon Josefsson, Bruno Haible.
8
9 AC_DEFUN([gl_UNISTD_H],
10 [
11   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12   dnl once only, before all statements that occur in other macros.
13   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
14
15   gl_CHECK_NEXT_HEADERS([unistd.h])
16
17   AC_CHECK_HEADERS_ONCE([unistd.h])
18   if test $ac_cv_header_unistd_h = yes; then
19     HAVE_UNISTD_H=1
20   else
21     HAVE_UNISTD_H=0
22   fi
23   AC_SUBST([HAVE_UNISTD_H])
24 ])
25
26 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
27 [
28   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
29   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
30   GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
31 ])
32
33 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
34 [
35   GNULIB_CHOWN=0;            AC_SUBST([GNULIB_CHOWN])
36   GNULIB_CLOSE=0;            AC_SUBST([GNULIB_CLOSE])
37   GNULIB_DUP2=0;             AC_SUBST([GNULIB_DUP2])
38   GNULIB_ENVIRON=0;          AC_SUBST([GNULIB_ENVIRON])
39   GNULIB_EUIDACCESS=0;       AC_SUBST([GNULIB_EUIDACCESS])
40   GNULIB_FCHDIR=0;           AC_SUBST([GNULIB_FCHDIR])
41   GNULIB_FSYNC=0;            AC_SUBST([GNULIB_FSYNC])
42   GNULIB_FTRUNCATE=0;        AC_SUBST([GNULIB_FTRUNCATE])
43   GNULIB_GETCWD=0;           AC_SUBST([GNULIB_GETCWD])
44   GNULIB_GETDOMAINNAME=0;    AC_SUBST([GNULIB_GETDOMAINNAME])
45   GNULIB_GETDTABLESIZE=0;    AC_SUBST([GNULIB_GETDTABLESIZE])
46   GNULIB_GETHOSTNAME=0;      AC_SUBST([GNULIB_GETHOSTNAME])
47   GNULIB_GETLOGIN_R=0;       AC_SUBST([GNULIB_GETLOGIN_R])
48   GNULIB_GETPAGESIZE=0;      AC_SUBST([GNULIB_GETPAGESIZE])
49   GNULIB_GETUSERSHELL=0;     AC_SUBST([GNULIB_GETUSERSHELL])
50   GNULIB_LCHOWN=0;           AC_SUBST([GNULIB_LCHOWN])
51   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
52   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
53   GNULIB_SLEEP=0;            AC_SUBST([GNULIB_SLEEP])
54   GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
55   GNULIB_WRITE=0;            AC_SUBST([GNULIB_WRITE])
56   dnl Assume proper GNU behavior unless another module says otherwise.
57   HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
58   HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
59   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
60   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
61   HAVE_GETDOMAINNAME=1;   AC_SUBST([HAVE_GETDOMAINNAME])
62   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
63   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
64   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
65   HAVE_GETUSERSHELL=1;    AC_SUBST([HAVE_GETUSERSHELL])
66   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
67   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
68   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
69   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
70   HAVE_OS_H=0;            AC_SUBST([HAVE_OS_H])
71   HAVE_SYS_PARAM_H=0;     AC_SUBST([HAVE_SYS_PARAM_H])
72   REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
73   REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
74   REPLACE_FCHDIR=0;       AC_SUBST([REPLACE_FCHDIR])
75   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
76   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
77   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
78   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
79   REPLACE_WRITE=0;        AC_SUBST([REPLACE_WRITE])
80   UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
81 ])