new strerror_r checks

This commit is contained in:
Kurt Zeilenga 2004-04-24 21:30:28 +00:00
parent 0cd5b9f766
commit 7f0c73bf49
4 changed files with 920 additions and 732 deletions

View File

@ -971,6 +971,8 @@ fi
])
dnl
dnl ====================================================================
dnl Error string checks
dnl
dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
dnl Reported by Keith Bostic.
@ -1004,7 +1006,44 @@ if test $ol_cv_have_sys_errlist = yes ; then
[define if you actually have sys_errlist in your libs])
fi
])dnl
AC_DEFUN([OL_NONPOSIX_STRERROR_R],
[AC_CACHE_CHECK([non-posix strerror_r],ol_cv_nonposix_strerror_r,[
AC_EGREP_CPP(strerror_r,[#include <string.h>],
ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
if test $ol_decl_strerror_r = yes ; then
AC_TRY_COMPILE([#include <string.h>],
[ /* from autoconf 2.59 */
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
char *p = strerror_r (0, buf, sizeof buf);
], ol_cv_nonposix_strerror_r=yes, ol_cv_nonposix_strerror_r=no)
else
AC_TRY_RUN([
main() {
char buf[100];
buf[0] = 0;
strerror_r( 1, buf, sizeof buf );
exit( buf[0] == 0 );
}
], ol_cv_nonposix_strerror_r=yes, ol_cv_nonposix_strerror=no)
fi
])
if test $ol_cv_nonposix_strerror_r = yes ; then
AC_DEFINE(HAVE_NONPOSIX_STRERROR_R,1,
[define if strerror_r returns char* instead of int])
fi
])dnl
dnl
AC_DEFUN([OL_STRERROR],
[AC_CHECK_FUNCS(strerror strerror_r)
ol_cv_func_strerror_r=no
if test "${ac_cv_func_strerror_r}" = yes ; then
OL_NONPOSIX_STRERROR_R
elif test "${ac_cv_func_strerror}" = no ; then
OL_SYS_ERRLIST
fi
])dnl
dnl ====================================================================
dnl Early MIPS compilers (used in Ultrix 4.2) don't like
dnl "int x; int *volatile a = &x; *a = 0;"

1586
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -882,6 +882,10 @@ fi
dnl check to see if system call automatically restart
dnl AC_SYS_RESTARTABLE_SYSCALLS
dnl ----------------------------------------------------------------
# strerror checks
OL_STRERROR
dnl ----------------------------------------------------------------
dnl require POSIX regex
AC_CHECK_HEADERS( regex.h )
@ -2346,7 +2350,6 @@ AC_CHECK_FUNCS( \
signal \
sigset \
strdup \
strerror \
strpbrk \
strrchr \
strsep \
@ -2386,10 +2389,6 @@ if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
fi
fi
dnl ----------------------------------------------------------------
# Check Configuration
OL_SYS_ERRLIST
dnl ----------------------------------------------------------------
dnl Sort out defines

View File

@ -284,6 +284,9 @@
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strerror_r function. */
#undef HAVE_STRERROR_R
/* Define if you have the strpbrk function. */
#undef HAVE_STRPBRK
@ -671,6 +674,15 @@
/* define if you have winsock2 */
#undef HAVE_WINSOCK2
/* define if strerror_r returns char* instead of int */
#undef HAVE_NONPOSIX_STRERROR_R
/* define if sys_errlist is not declared in stdio.h or errno.h */
#undef DECL_SYS_ERRLIST
/* define if you actually have sys_errlist in your libs */
#undef HAVE_SYS_ERRLIST
/* define if you have uuid_to_str() */
#undef HAVE_UUID_TO_STR
@ -890,12 +902,6 @@
/* define to snprintf routine */
#undef vsnprintf
/* define if sys_errlist is not declared in stdio.h or errno.h */
#undef DECL_SYS_ERRLIST
/* define if you actually have sys_errlist in your libs */
#undef HAVE_SYS_ERRLIST
/* define if you have libtool -ltdl */
#undef HAVE_LIBLTDL