|
Packit Service |
a2ae7a |
# errno_h.m4 serial 13
|
|
Packit Service |
a2ae7a |
dnl Copyright (C) 2004, 2006, 2008-2019 Free Software Foundation, Inc.
|
|
Packit Service |
a2ae7a |
dnl This file is free software; the Free Software Foundation
|
|
Packit Service |
a2ae7a |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit Service |
a2ae7a |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
AC_PREREQ([2.61])
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
|
|
Packit Service |
a2ae7a |
[
|
|
Packit Service |
a2ae7a |
AC_REQUIRE([AC_PROG_CC])
|
|
Packit Service |
a2ae7a |
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
|
|
Packit Service |
a2ae7a |
AC_EGREP_CPP([booboo],[
|
|
Packit Service |
a2ae7a |
#include <errno.h>
|
|
Packit Service |
a2ae7a |
#if !defined ETXTBSY
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ENOMSG
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EIDRM
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ENOLINK
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EPROTO
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EMULTIHOP
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EBADMSG
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EOVERFLOW
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ENOTSUP
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ENETRESET
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ECONNABORTED
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ESTALE
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EDQUOT
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ECANCELED
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EOWNERDEAD
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined ENOTRECOVERABLE
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
#if !defined EILSEQ
|
|
Packit Service |
a2ae7a |
booboo
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
],
|
|
Packit Service |
a2ae7a |
[gl_cv_header_errno_h_complete=no],
|
|
Packit Service |
a2ae7a |
[gl_cv_header_errno_h_complete=yes])
|
|
Packit Service |
a2ae7a |
])
|
|
Packit Service |
a2ae7a |
if test $gl_cv_header_errno_h_complete = yes; then
|
|
Packit Service |
a2ae7a |
ERRNO_H=''
|
|
Packit Service |
a2ae7a |
else
|
|
Packit Service |
a2ae7a |
gl_NEXT_HEADERS([errno.h])
|
|
Packit Service |
a2ae7a |
ERRNO_H='errno.h'
|
|
Packit Service |
a2ae7a |
fi
|
|
Packit Service |
a2ae7a |
AC_SUBST([ERRNO_H])
|
|
Packit Service |
a2ae7a |
AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
|
|
Packit Service |
a2ae7a |
gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
|
|
Packit Service |
a2ae7a |
gl_REPLACE_ERRNO_VALUE([ENOLINK])
|
|
Packit Service |
a2ae7a |
gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
|
|
Packit Service |
a2ae7a |
])
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# Assuming $1 = EOVERFLOW.
|
|
Packit Service |
a2ae7a |
# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
|
|
Packit Service |
a2ae7a |
# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
|
|
Packit Service |
a2ae7a |
# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
|
|
Packit Service |
a2ae7a |
# Check for the value of EOVERFLOW.
|
|
Packit Service |
a2ae7a |
# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
|
|
Packit Service |
a2ae7a |
AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
|
|
Packit Service |
a2ae7a |
[
|
|
Packit Service |
a2ae7a |
if test -n "$ERRNO_H"; then
|
|
Packit Service |
a2ae7a |
AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
|
|
Packit Service |
a2ae7a |
AC_EGREP_CPP([yes],[
|
|
Packit Service |
a2ae7a |
#include <errno.h>
|
|
Packit Service |
a2ae7a |
#ifdef ]$1[
|
|
Packit Service |
a2ae7a |
yes
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
],
|
|
Packit Service |
a2ae7a |
[gl_cv_header_errno_h_]$1[=yes],
|
|
Packit Service |
a2ae7a |
[gl_cv_header_errno_h_]$1[=no])
|
|
Packit Service |
a2ae7a |
if test $gl_cv_header_errno_h_]$1[ = no; then
|
|
Packit Service |
a2ae7a |
AC_EGREP_CPP([yes],[
|
|
Packit Service |
a2ae7a |
#define _XOPEN_SOURCE_EXTENDED 1
|
|
Packit Service |
a2ae7a |
#include <errno.h>
|
|
Packit Service |
a2ae7a |
#ifdef ]$1[
|
|
Packit Service |
a2ae7a |
yes
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
], [gl_cv_header_errno_h_]$1[=hidden])
|
|
Packit Service |
a2ae7a |
if test $gl_cv_header_errno_h_]$1[ = hidden; then
|
|
Packit Service |
a2ae7a |
dnl The macro exists but is hidden.
|
|
Packit Service |
a2ae7a |
dnl Define it to the same value.
|
|
Packit Service |
a2ae7a |
AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
|
|
Packit Service |
a2ae7a |
#define _XOPEN_SOURCE_EXTENDED 1
|
|
Packit Service |
a2ae7a |
#include <errno.h>
|
|
Packit Service |
a2ae7a |
/* The following two lines are a workaround against an autoconf-2.52 bug. */
|
|
Packit Service |
a2ae7a |
#include <stdio.h>
|
|
Packit Service |
a2ae7a |
#include <stdlib.h>
|
|
Packit Service |
a2ae7a |
])
|
|
Packit Service |
a2ae7a |
fi
|
|
Packit Service |
a2ae7a |
fi
|
|
Packit Service |
a2ae7a |
])
|
|
Packit Service |
a2ae7a |
case $gl_cv_header_errno_h_]$1[ in
|
|
Packit Service |
a2ae7a |
yes | no)
|
|
Packit Service |
a2ae7a |
]$1[_HIDDEN=0; ]$1[_VALUE=
|
|
Packit Service |
a2ae7a |
;;
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
|
|
Packit Service |
a2ae7a |
;;
|
|
Packit Service |
a2ae7a |
esac
|
|
Packit Service |
a2ae7a |
AC_SUBST($1[_HIDDEN])
|
|
Packit Service |
a2ae7a |
AC_SUBST($1[_VALUE])
|
|
Packit Service |
a2ae7a |
fi
|
|
Packit Service |
a2ae7a |
])
|