annotate m4/errno_h.m4 @ 272:d5392bb5da3c 2.5

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