Newer
Older
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
have_k5=yes
else
echo "$ac_t""no" 1>&6
have_k5=no
fi
if test $have_k5 = yes ; then
ol_with_kerberos=found
ol_link_kerberos=yes
KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
LIBS="$KRB_LIBS $LIBS"
echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
echo "configure:4039: checking for des_debug in Kerberos libraries" >&5
if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
save_LIBS="$LIBS"
LIBS="$KRB_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4047 "configure"
#include "confdefs.h"
#include <kerberosIV/krb.h>
#include <kerberosIV/des.h>
extern int des_debug;
int main() {
des_debug = 1;
; return 0; }
EOF
if { (eval echo configure:4060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ol_cv_var_des_debug=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ol_cv_var_des_debug=no
fi
rm -f conftest*
LIBS="$save_LIBS"
fi
echo "$ac_t""$ol_cv_var_des_debug" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_DES_DEBUG 1
EOF
fi
LIBS="$save_LIBS"
if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
for ac_hdr in krb.h des.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4093: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4098 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_krb_h = yes ; then
echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
echo "configure:4132: checking for main in -lkrb" >&5
ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lkrb -ldes $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4140 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
have_k4=yes
else
echo "$ac_t""no" 1>&6
have_k4=no
fi
if test $have_k4 = yes ; then
ol_with_kerberos=found
ol_link_kerberos=yes
KRB_LIBS="-lkrb -ldes"
if test $ol_link_kerberos = yes ; then
cat >> confdefs.h <<\EOF
#define HAVE_KERBEROS 1
EOF
fi
ol_link_tls=no
if test $ol_with_tls != no ; then
for ac_hdr in ssl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4192: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4197 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_ssl_h = yes ; then
echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
echo "configure:4231: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lssl -lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4239 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char SSLeay_add_ssl_algorithms();
int main() {
SSLeay_add_ssl_algorithms()
; return 0; }
EOF
if { (eval echo configure:4250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
have_ssleay=yes
else
echo "$ac_t""no" 1>&6
have_ssleay=no
fi
if test $have_ssleay = no ; then
echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
echo "configure:4275: checking for ssl3_accept in -lssl" >&5
ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4283 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char ssl3_accept();
int main() {
ssl3_accept()
; return 0; }
EOF
if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
have_ssleay=yes
else
echo "$ac_t""no" 1>&6
have_ssleay=no
fi
fi
if test $have_ssleay = yes ; then
ol_with_tls=found
ol_link_tls=yes
cat >> confdefs.h <<\EOF
#define HAVE_SSLEAY 1
EOF
if test $need_rsaref = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_RSAREF 1
EOF
TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
else
TLS_LIBS="-lssl -lcrypto"
fi
fi
fi
fi
if test $ol_link_tls = yes ; then
cat >> confdefs.h <<\EOF
#define HAVE_TLS 1
EOF
fi
for ac_func in \
ctime_r \
gethostbyname_r gethostbyaddr_r \
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4354: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4359 "configure"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
if { (eval echo configure:4382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
#define $ac_tr_func 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
if test "$ac_cv_func_ctime_r" = no ; then
ol_cv_func_ctime_r_nargs=0
else
echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
echo "configure:4411: checking number of arguments of ctime_r" >&5
if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
cat > conftest.$ac_ext <<EOF
#line 4416 "configure"
#include <time.h>
int main() {
time_t ti; char *buffer; ctime_r(&ti,buffer,32);
; return 0; }
if { (eval echo configure:4423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ol_cv_func_ctime_r_nargs=3
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
cat > conftest.$ac_ext <<EOF
#line 4431 "configure"
#include <time.h>
int main() {
time_t ti; char *buffer; ctime_r(&ti,buffer);
; return 0; }
if { (eval echo configure:4438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ol_cv_func_ctime_r_nargs=2
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
ol_cv_func_ctime_r_nargs=0
fi
rm -f conftest*
echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
cat >> confdefs.h <<EOF
#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
if test "$ac_cv_func_gethostbyname_r" = yes ; then
echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
echo "configure:4464: checking number of arguments of gethostbyname_r" >&5
if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4469 "configure"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)
struct hostent hent; char buffer[BUFSIZE];
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
buffer, bufsize, &h_errno);
if { (eval echo configure:4483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ol_cv_func_gethostbyname_r_nargs=5
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 4491 "configure"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)
struct hostent hent;struct hostent *rhent;
char buffer[BUFSIZE];
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyname_r("localhost", &hent, buffer, bufsize,
&rhent, &h_errno);
if { (eval echo configure:4506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ol_cv_func_gethostbyname_r_nargs=6
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ol_cv_func_gethostbyname_r_nargs=0
fi
rm -f conftest*
fi
rm -f conftest*
echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
cat >> confdefs.h <<EOF
#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
EOF
else
ol_cv_func_gethostbyname_r_nargs=0
fi
if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
echo "configure:4534: checking number of arguments of gethostbyaddr_r" >&5
if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4539 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)
struct hostent hent; char buffer[BUFSIZE];
size_t alen=sizeof(struct in_addr);
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyaddr_r( (void *)&(add.s_addr),
alen, AF_INET, &hent, buffer, bufsize, &h_errno);
; return 0; }
EOF
if { (eval echo configure:4555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ol_cv_func_gethostbyaddr_r_nargs=7
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
#line 4563 "configure"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)
struct hostent hent;
struct hostent *rhent; char buffer[BUFSIZE];
size_t alen=sizeof(struct in_addr);
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyaddr_r( (void *)&(add.s_addr),
alen, AF_INET, &hent, buffer, bufsize,
&rhent, &h_errno);
if { (eval echo configure:4581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ol_cv_func_gethostbyaddr_r_nargs=8
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ol_cv_func_gethostbyaddr_r_nargs=0
fi
rm -f conftest*
echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
cat >> confdefs.h <<EOF
#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
EOF
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 "$ac_cv_func_gethostbyname_r" = yes \
-a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
-a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
-a "$ac_cv_func_gethostbyaddr_r" = yes \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
; then
cat >> confdefs.h <<\EOF
#define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
EOF
fi
ol_link_threads=no
if test $ol_with_threads = auto -o $ol_with_threads = yes \
-o $ol_with_threads = posix ; then
for ac_hdr in pthread.h sched.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4632: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4637 "configure"
#include "confdefs.h"
#include <$ac_hdr>
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_pthread_h = yes ; then
echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
echo "configure:4671: checking POSIX thread version" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4677 "configure"
# include <pthread.h>
/* this check could be improved */
# ifdef PTHREAD_ONCE_INIT
pthread_version_final
# endif
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "pthread_version_final" >/dev/null 2>&1; then
ol_pthread_final=yes
else
rm -rf conftest*
ol_pthread_final=no
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 4699 "configure"
# include <pthread.h>
/* this check could be improved */
# ifdef pthread_once_init
pthread_version_draft4
# endif
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "pthread_version_draft4" >/dev/null 2>&1; then
ol_pthread_draft4=yes
ol_pthread_draft4=no
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
ol_cv_pthread_version=final
elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
ol_cv_pthread_version=draft4
else
ol_cv_pthread_version=unknown
fi
fi
echo "$ac_t""$ol_cv_pthread_version" 1>&6
if test $ol_cv_pthread_version = final ; then
cat >> confdefs.h <<\EOF
#define HAVE_PTHREADS_FINAL 1
EOF
elif test $ol_cv_pthread_version = draft4 ; then
cat >> confdefs.h <<\EOF
#define HAVE_PTHREADS_D4 1
EOF
else
{ echo "configure: error: unknown pthread version" 1>&2; exit 1; }
fi
# consider threads found
ol_with_threads=found
echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
echo "configure:4752: checking for LinuxThreads pthread.h" >&5
if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
cat > conftest.$ac_ext <<EOF
#line 4757 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
rm -rf conftest*
ol_cv_header_linux_threads=yes
else
rm -rf conftest*
ol_cv_header_linux_threads=no
rm -f conftest*
fi
echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
if test $ol_cv_header_linux_threads = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_LINUX_THREADS 1
EOF
fi
echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
echo "configure:4785: checking for pthread_create in default libraries" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ol_cv_pthread_create=yes
else
cat > conftest.$ac_ext <<EOF
#line 4794 "configure"
#include "confdefs.h"
#include <pthread.h>
#ifndef NULL
#define NULL (void*)0
#endif
static void *task(p)
void *p;
{
return (void *) (p == NULL);
}
int main(argc, argv)
int argc;
char **argv;
{
pthread_t t;
int status;
/* make sure pthread_create() isn't just a stub */
#if HAVE_PTHREADS_D4
Hallvard Furuseth
committed
status = pthread_create(&t, pthread_attr_default, task, NULL);
#else
status = pthread_create(&t, NULL, task, NULL);
#endif
if( status ) return status;
/* make sure pthread_detach() isn't just a stub */
#if HAVE_PTHREADS_D4
status = pthread_detach( &t );
#else
status = pthread_detach( t );
#endif
if( status ) return status;
return status;
if { (eval echo configure:4837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ol_cv_pthread_create=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ol_cv_pthread_create=no
rm -fr conftest*
echo "$ac_t""$ol_cv_pthread_create" 1>&6
if test $ol_cv_pthread_create != no ; then
ol_link_threads=posix
ol_link_pthreads=""
# Pthread try link: -mt (ol_cv_pthread_mt)
if test "$ol_link_threads" = no ; then
# try -mt
echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
echo "configure:4862: checking for pthread link with -mt" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
# save the flags
LIBS="-mt $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4872 "configure"
#include <pthread.h>
#ifndef NULL
#define NULL (void*)0
#endif
pthread_t t;
#if HAVE_PTHREADS_D4
pthread_create(&t, pthread_attr_default, NULL, NULL);
pthread_detach( &t );
#else
pthread_create(&t, NULL, NULL, NULL);
pthread_detach( t );
#endif
#ifdef HAVE_LINUX_THREADS
pthread_kill_other_threads_np();
#endif
if { (eval echo configure:4897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ol_cv_pthread_mt=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ol_cv_pthread_mt=no
# restore the LIBS
echo "$ac_t""$ol_cv_pthread_mt" 1>&6
if test $ol_cv_pthread_mt = yes ; then
ol_link_pthreads="-mt"
ol_link_threads=posix
fi
# Pthread try link: -kthread (ol_cv_pthread_kthread)
if test "$ol_link_threads" = no ; then
# try -kthread
echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
echo "configure:4925: checking for pthread link with -kthread" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# save the flags
LIBS="-kthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4935 "configure"
#include <pthread.h>
#ifndef NULL
#define NULL (void*)0
#endif
pthread_t t;
#if HAVE_PTHREADS_D4
pthread_create(&t, pthread_attr_default, NULL, NULL);
pthread_detach( &t );
#else
pthread_create(&t, NULL, NULL, NULL);
pthread_detach( t );
#endif
#ifdef HAVE_LINUX_THREADS
pthread_kill_other_threads_np();
#endif
if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ol_cv_pthread_kthread=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ol_cv_pthread_kthread=no
# restore the LIBS
echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
if test $ol_cv_pthread_kthread = yes ; then
ol_link_pthreads="-kthread"
ol_link_threads=posix
fi
# Pthread try link: -pthread (ol_cv_pthread_pthread)
if test "$ol_link_threads" = no ; then
# try -pthread
echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
echo "configure:4988: checking for pthread link with -pthread" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
# save the flags
LIBS="-pthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4998 "configure"
#include <pthread.h>