mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
new strerror_r checks
This commit is contained in:
parent
0cd5b9f766
commit
7f0c73bf49
4 changed files with 920 additions and 732 deletions
|
|
@ -971,6 +971,8 @@ fi
|
||||||
])
|
])
|
||||||
dnl
|
dnl
|
||||||
dnl ====================================================================
|
dnl ====================================================================
|
||||||
|
dnl Error string checks
|
||||||
|
dnl
|
||||||
dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
|
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 Declaration of sys_errlist on BSD4.4 interferes with our declaration.
|
||||||
dnl Reported by Keith Bostic.
|
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])
|
[define if you actually have sys_errlist in your libs])
|
||||||
fi
|
fi
|
||||||
])dnl
|
])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
|
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 ====================================================================
|
||||||
dnl Early MIPS compilers (used in Ultrix 4.2) don't like
|
dnl Early MIPS compilers (used in Ultrix 4.2) don't like
|
||||||
dnl "int x; int *volatile a = &x; *a = 0;"
|
dnl "int x; int *volatile a = &x; *a = 0;"
|
||||||
|
|
|
||||||
|
|
@ -882,6 +882,10 @@ fi
|
||||||
dnl check to see if system call automatically restart
|
dnl check to see if system call automatically restart
|
||||||
dnl AC_SYS_RESTARTABLE_SYSCALLS
|
dnl AC_SYS_RESTARTABLE_SYSCALLS
|
||||||
|
|
||||||
|
dnl ----------------------------------------------------------------
|
||||||
|
# strerror checks
|
||||||
|
OL_STRERROR
|
||||||
|
|
||||||
dnl ----------------------------------------------------------------
|
dnl ----------------------------------------------------------------
|
||||||
dnl require POSIX regex
|
dnl require POSIX regex
|
||||||
AC_CHECK_HEADERS( regex.h )
|
AC_CHECK_HEADERS( regex.h )
|
||||||
|
|
@ -2346,7 +2350,6 @@ AC_CHECK_FUNCS( \
|
||||||
signal \
|
signal \
|
||||||
sigset \
|
sigset \
|
||||||
strdup \
|
strdup \
|
||||||
strerror \
|
|
||||||
strpbrk \
|
strpbrk \
|
||||||
strrchr \
|
strrchr \
|
||||||
strsep \
|
strsep \
|
||||||
|
|
@ -2386,10 +2389,6 @@ if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl ----------------------------------------------------------------
|
|
||||||
# Check Configuration
|
|
||||||
OL_SYS_ERRLIST
|
|
||||||
|
|
||||||
dnl ----------------------------------------------------------------
|
dnl ----------------------------------------------------------------
|
||||||
dnl Sort out defines
|
dnl Sort out defines
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -284,6 +284,9 @@
|
||||||
/* Define if you have the strerror function. */
|
/* Define if you have the strerror function. */
|
||||||
#undef HAVE_STRERROR
|
#undef HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the strerror_r function. */
|
||||||
|
#undef HAVE_STRERROR_R
|
||||||
|
|
||||||
/* Define if you have the strpbrk function. */
|
/* Define if you have the strpbrk function. */
|
||||||
#undef HAVE_STRPBRK
|
#undef HAVE_STRPBRK
|
||||||
|
|
||||||
|
|
@ -671,6 +674,15 @@
|
||||||
/* define if you have winsock2 */
|
/* define if you have winsock2 */
|
||||||
#undef 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() */
|
/* define if you have uuid_to_str() */
|
||||||
#undef HAVE_UUID_TO_STR
|
#undef HAVE_UUID_TO_STR
|
||||||
|
|
||||||
|
|
@ -890,12 +902,6 @@
|
||||||
/* define to snprintf routine */
|
/* define to snprintf routine */
|
||||||
#undef vsnprintf
|
#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 */
|
/* define if you have libtool -ltdl */
|
||||||
#undef HAVE_LIBLTDL
|
#undef HAVE_LIBLTDL
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue