annotate m4/errno_h.m4 @ 445:7899511b2102 3.0

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