annotate m4/errno_h.m4 @ 423:079d43b6967b 3.0-beta2 3.0-beta2

Added missing file
author lost@l-w.ca
date Sun, 19 Sep 2010 01:44:47 -0600
parents 3c2e1f24cc7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
421
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1 # errno_h.m4 serial 6
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
2 dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
6
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
7 AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
8 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
9 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
10 AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
11 AC_EGREP_CPP([booboo],[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
12 #include <errno.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
13 #if !defined ENOMSG
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
14 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
15 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
16 #if !defined EIDRM
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
17 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
18 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
19 #if !defined ENOLINK
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
20 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
21 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
22 #if !defined EPROTO
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
23 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
24 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
25 #if !defined EMULTIHOP
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
26 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
27 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
28 #if !defined EBADMSG
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
29 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
30 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
31 #if !defined EOVERFLOW
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
32 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
33 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
34 #if !defined ENOTSUP
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
35 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
36 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
37 #if !defined ESTALE
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
38 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
39 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
40 #if !defined ECANCELED
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
41 booboo
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
42 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
43 ],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
44 [gl_cv_header_errno_h_complete=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
45 [gl_cv_header_errno_h_complete=yes])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
46 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
47 if test $gl_cv_header_errno_h_complete = yes; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
48 ERRNO_H=''
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
49 else
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
50 gl_CHECK_NEXT_HEADERS([errno.h])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
51 ERRNO_H='errno.h'
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
52 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
53 AC_SUBST([ERRNO_H])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
54 gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
55 gl_REPLACE_ERRNO_VALUE([ENOLINK])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
56 gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
57 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
58
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
59 # Assuming $1 = EOVERFLOW.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
60 # The EOVERFLOW errno value ought to be defined in <errno.h>, according to
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
61 # POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
62 # some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
63 # Check for the value of EOVERFLOW.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
64 # Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
65 AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
66 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
67 if test -n "$ERRNO_H"; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
68 AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
69 AC_EGREP_CPP([yes],[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
70 #include <errno.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
71 #ifdef ]$1[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
72 yes
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
73 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
74 ],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
75 [gl_cv_header_errno_h_]$1[=yes],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
76 [gl_cv_header_errno_h_]$1[=no])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
77 if test $gl_cv_header_errno_h_]$1[ = no; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
78 AC_EGREP_CPP([yes],[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
79 #define _XOPEN_SOURCE_EXTENDED 1
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
80 #include <errno.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
81 #ifdef ]$1[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
82 yes
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
83 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
84 ], [gl_cv_header_errno_h_]$1[=hidden])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
85 if test $gl_cv_header_errno_h_]$1[ = hidden; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
86 dnl The macro exists but is hidden.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
87 dnl Define it to the same value.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
88 AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
89 #define _XOPEN_SOURCE_EXTENDED 1
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
90 #include <errno.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
91 /* The following two lines are a workaround against an autoconf-2.52 bug. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
92 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
93 #include <stdlib.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
94 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
95 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
96 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
97 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
98 case $gl_cv_header_errno_h_]$1[ in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
99 yes | no)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
100 ]$1[_HIDDEN=0; ]$1[_VALUE=
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
101 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
102 *)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
103 ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
104 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
105 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
106 AC_SUBST($1[_HIDDEN])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
107 AC_SUBST($1[_VALUE])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
108 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
109 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
110
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
111 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
112 dnl Remove this when we can assume autoconf >= 2.61.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
113 m4_ifdef([AC_COMPUTE_INT], [], [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
114 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
115 ])