Annotation of embedaddon/libiconv/srcm4/errno_h.m4, revision 1.1.1.3

1.1.1.3 ! misho       1: # errno_h.m4 serial 13
        !             2: dnl Copyright (C) 2004, 2006, 2008-2019 Free Software Foundation, Inc.
1.1       misho       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: 
1.1.1.3 ! misho       7: AC_PREREQ([2.61])
        !             8: 
1.1       misho       9: AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
                     10: [
                     11:   AC_REQUIRE([AC_PROG_CC])
                     12:   AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
                     13:     AC_EGREP_CPP([booboo],[
                     14: #include <errno.h>
1.1.1.3 ! misho      15: #if !defined ETXTBSY
        !            16: booboo
        !            17: #endif
1.1       misho      18: #if !defined ENOMSG
                     19: booboo
                     20: #endif
                     21: #if !defined EIDRM
                     22: booboo
                     23: #endif
                     24: #if !defined ENOLINK
                     25: booboo
                     26: #endif
                     27: #if !defined EPROTO
                     28: booboo
                     29: #endif
                     30: #if !defined EMULTIHOP
                     31: booboo
                     32: #endif
                     33: #if !defined EBADMSG
                     34: booboo
                     35: #endif
                     36: #if !defined EOVERFLOW
                     37: booboo
                     38: #endif
                     39: #if !defined ENOTSUP
                     40: booboo
                     41: #endif
1.1.1.2   misho      42: #if !defined ENETRESET
                     43: booboo
                     44: #endif
                     45: #if !defined ECONNABORTED
                     46: booboo
                     47: #endif
1.1       misho      48: #if !defined ESTALE
                     49: booboo
                     50: #endif
1.1.1.2   misho      51: #if !defined EDQUOT
                     52: booboo
                     53: #endif
1.1       misho      54: #if !defined ECANCELED
                     55: booboo
                     56: #endif
1.1.1.3 ! misho      57: #if !defined EOWNERDEAD
        !            58: booboo
        !            59: #endif
        !            60: #if !defined ENOTRECOVERABLE
        !            61: booboo
        !            62: #endif
        !            63: #if !defined EILSEQ
        !            64: booboo
        !            65: #endif
1.1       misho      66:       ],
                     67:       [gl_cv_header_errno_h_complete=no],
                     68:       [gl_cv_header_errno_h_complete=yes])
                     69:   ])
                     70:   if test $gl_cv_header_errno_h_complete = yes; then
                     71:     ERRNO_H=''
                     72:   else
1.1.1.2   misho      73:     gl_NEXT_HEADERS([errno.h])
1.1       misho      74:     ERRNO_H='errno.h'
                     75:   fi
                     76:   AC_SUBST([ERRNO_H])
1.1.1.2   misho      77:   AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
1.1       misho      78:   gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
                     79:   gl_REPLACE_ERRNO_VALUE([ENOLINK])
                     80:   gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
                     81: ])
                     82: 
                     83: # Assuming $1 = EOVERFLOW.
                     84: # The EOVERFLOW errno value ought to be defined in <errno.h>, according to
                     85: # POSIX.  But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
                     86: # some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
                     87: # Check for the value of EOVERFLOW.
                     88: # Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
                     89: AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
                     90: [
                     91:   if test -n "$ERRNO_H"; then
                     92:     AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
                     93:       AC_EGREP_CPP([yes],[
                     94: #include <errno.h>
                     95: #ifdef ]$1[
                     96: yes
                     97: #endif
                     98:       ],
                     99:       [gl_cv_header_errno_h_]$1[=yes],
                    100:       [gl_cv_header_errno_h_]$1[=no])
                    101:       if test $gl_cv_header_errno_h_]$1[ = no; then
                    102:         AC_EGREP_CPP([yes],[
                    103: #define _XOPEN_SOURCE_EXTENDED 1
                    104: #include <errno.h>
                    105: #ifdef ]$1[
                    106: yes
                    107: #endif
                    108:           ], [gl_cv_header_errno_h_]$1[=hidden])
                    109:         if test $gl_cv_header_errno_h_]$1[ = hidden; then
                    110:           dnl The macro exists but is hidden.
                    111:           dnl Define it to the same value.
                    112:           AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
                    113: #define _XOPEN_SOURCE_EXTENDED 1
                    114: #include <errno.h>
                    115: /* The following two lines are a workaround against an autoconf-2.52 bug.  */
                    116: #include <stdio.h>
                    117: #include <stdlib.h>
                    118: ])
                    119:         fi
                    120:       fi
                    121:     ])
                    122:     case $gl_cv_header_errno_h_]$1[ in
                    123:       yes | no)
                    124:         ]$1[_HIDDEN=0; ]$1[_VALUE=
                    125:         ;;
                    126:       *)
                    127:         ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
                    128:         ;;
                    129:     esac
                    130:     AC_SUBST($1[_HIDDEN])
                    131:     AC_SUBST($1[_VALUE])
                    132:   fi
                    133: ])

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>