Relocate reentrant function checks to before thread library checks.

Disable ctime_r() type check.  Need better test.
This commit is contained in:
Kurt Zeilenga 1999-03-07 00:22:11 +00:00
parent df1672bd02
commit 9e71e09bac
3 changed files with 688 additions and 721 deletions

1302
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -505,6 +505,51 @@ if test $ol_link_tls = yes ; then
AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
fi
dnl
dnl Tests for reentrant functions necessary to build a
dnl thread_safe -lldap.
dnl
AC_CHECK_FUNCS( \
ctime_r \
gethostbyaddr_r \
gethostbyname_r \
)
if test "$ac_cv_func_ctime_r" = yes ; then
OL_FUNC_CTIME_R_NARGS
dnl OL_FUNC_CTIME_R_TYPE
else
ol_cv_func_ctime_r_nargs=0
fi
if test "$ac_cv_func_gethostbyname_r" = yes ; then
OL_FUNC_GETHOSTBYNAME_R_NARGS
else
ol_cv_func_gethostbyname_r_nargs=0
fi
if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
OL_FUNC_GETHOSTBYADDR_R_NARGS
else
ol_cv_func_gethostbyaddr_r_nargs=0
fi
if test "$ac_cv_func_ctime_r" = yes \
-a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
-a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
-a "$ac_cv_func_gethostbyaddr_r" = yes \
-a "$ac_cv_func_gethostbyname_r" = yes \
; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT, 1)
fi
if test $ol_link_threads != no ; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE, 1)
fi
ol_link_threads=no
if test $ol_with_threads = auto -o $ol_with_threads = yes \
-o $ol_with_threads = posix ; then
@ -1579,47 +1624,6 @@ AC_CHECK_FUNCS( \
waitpid \
)
# these functions are required to build a thread_safe -lldap
AC_CHECK_FUNCS( \
ctime_r \
gethostbyaddr_r \
gethostbyname_r \
)
if test "$ac_cv_func_ctime_r" = yes ; then
OL_FUNC_CTIME_R_NARGS
OL_FUNC_CTIME_R_TYPE
else
ol_cv_func_ctime_r_nargs=0
fi
if test "$ac_cv_func_gethostbyname_r" = yes ; then
OL_FUNC_GETHOSTBYNAME_R_NARGS
else
ol_cv_func_gethostbyname_r_nargs=0
fi
if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
OL_FUNC_GETHOSTBYADDR_R_NARGS
else
ol_cv_func_gethostbyaddr_r_nargs=0
fi
if test "$ac_cv_func_ctime_r" = yes \
-a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
-a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
-a "$ac_cv_func_gethostbyaddr_r" = yes \
-a "$ac_cv_func_gethostbyname_r" = yes \
; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT, 1)
fi
if test $ol_link_threads != no ; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE, 1)
fi
dnl We actually may need to replace more than this.
AC_REPLACE_FUNCS(getopt tempnam)

View File

@ -567,6 +567,15 @@
/* define if you have TLS */
#undef HAVE_TLS
/* set to the number of arguments ctime_r() expects */
#undef CTIME_R_NARGS
/* set to the number of arguments gethostbyname_r() expects */
#undef GETHOSTBYNAME_R_NARGS
/* set to the number of arguments gethostbyaddr_r() expects */
#undef GETHOSTBYADDR_R_NARGS
/* define if pthreads API compatible with final spec */
#undef HAVE_PTHREADS_FINAL
@ -636,18 +645,6 @@
/* define if cross compiling */
#undef CROSS_COMPILING
/* set to the number of arguments ctime_r() expects */
#undef CTIME_R_NARGS
/* define if ctime_r() returns int */
#undef CTIME_R_RETURNS_INT
/* set to the number of arguments gethostbyname_r() expects */
#undef GETHOSTBYNAME_R_NARGS
/* set to the number of arguments gethostbyaddr_r() expects */
#undef GETHOSTBYADDR_R_NARGS
/* define if sys_errlist is declared in stdio.h or errno.h */
#undef DECL_SYS_ERRLIST