From bbd645a8fcbb077929fb0568e1a59df79de20815 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 17 Sep 2002 20:50:38 +0000 Subject: [PATCH] Back out new pthread changes from RE21, needs more work --- build/openldap.m4 | 115 +- configure | 2880 ++++++++++++++++++------------- configure.in | 14 +- include/portable.h.in | 10 +- libraries/libldap_r/thr_posix.c | 199 +-- 5 files changed, 1794 insertions(+), 1424 deletions(-) diff --git a/build/openldap.m4 b/build/openldap.m4 index 8369493b66..c50acd4a96 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -621,47 +621,36 @@ dnl dnl ==================================================================== dnl Check POSIX Thread version dnl -dnl defines ol_cv_pthread_version to 4, 5, 6, 7, 10, depending on the -dnl version of the POSIX.4a Draft that is implemented. -dnl 10 == POSIX.4a Final == POSIX.1c-1996 for our purposes. -dnl Existence of pthreads.h should be tested separately. -dnl -dnl tests: -dnl pthread_yield() was dropped in Draft 9, so -dnl only a Draft <= 8 library will define this -dnl pthread_detach() was dropped in Draft 8, it is present -dnl in every other version -dnl PTHREAD_CREATE_UNDETACHED is only in Draft 7, it was called -dnl PTHREAD_CREATE_JOINABLE after that -dnl pthread_attr_default was dropped in Draft 6, only 4 and 5 have it -dnl PTHREAD_MUTEX_INITIALIZER was introduced in Draft 5. It's not -dnl interesting to us because we don't try to statically -dnl initialize mutexes. 5-10 has it. -dnl pthread_attr_create was renamed to pthread_attr_init in Draft 6. -dnl Draft 6-10 has _init, Draft 4-5 has _create. -dnl -dnl Draft 9 and 10 are equivalent for our purposes. +dnl defines ol_cv_posix_version to 'final' or 'draft' or 'unknown' +dnl 'unknown' implies that the version could not be detected +dnl or that pthreads.h does exist. Existance of pthreads.h +dnl should be tested separately. dnl AC_DEFUN([OL_POSIX_THREAD_VERSION], [AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[ - AC_EGREP_HEADER(pthread_yield,pthread.h,[ - AC_EGREP_HEADER(pthread_detach,pthread.h,[ - AC_EGREP_CPP(draft7,[ + AC_EGREP_CPP(pthread_version_final,[ # include -# ifdef PTHREAD_CREATE_UNDETACHED - draft7 + /* this check could be improved */ +# ifdef PTHREAD_ONCE_INIT + pthread_version_final; # endif - ], ol_cv_pthread_version=7, [ - AC_EGREP_HEADER(pthread_attr_default,pthread.h,[ - AC_EGREP_CPP(draft5,[ + ], ol_pthread_final=yes, ol_pthread_final=no) + + AC_EGREP_CPP(pthread_version_draft4,[ # include -#ifdef PTHREAD_MUTEX_INITIALIZER - draft5 -#endif - ], ol_cv_pthread_version=5, ol_cv_pthread_version=4) ], - ol_cv_pthread_version=6) ]) ], - ol_cv_pthread_version=8) ], - ol_cv_pthread_version=10) + /* this check could be improved */ +# ifdef pthread_once_init + pthread_version_draft4; +# endif + ], ol_pthread_draft4=yes, ol_pthread_draft4=no) + + 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 ]) ])dnl dnl @@ -669,9 +658,6 @@ dnl -------------------------------------------------------------------- AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [/* pthread test headers */ #include -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -684,43 +670,60 @@ static void *task(p) ]) AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[ /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS diff --git a/configure b/configure index 29160a56c0..b44edb36e9 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # $OpenLDAP$ -# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.12 2002/09/06 01:46:19 kurt Exp +# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.13 2002/09/17 02:45:05 kurt Exp # Copyright 1998-2002 The OpenLDAP Foundation. All Rights Reserved. # @@ -11672,97 +11672,68 @@ else cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pthread_yield" >/dev/null 2>&1; then - rm -rf conftest* - - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pthread_detach" >/dev/null 2>&1; then - rm -rf conftest* - - cat > conftest.$ac_ext < -# ifdef PTHREAD_CREATE_UNDETACHED - draft7 + /* this check could be improved */ +# ifdef PTHREAD_ONCE_INIT + pthread_version_final; # endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "draft7" >/dev/null 2>&1; then + egrep "pthread_version_final" >/dev/null 2>&1; then rm -rf conftest* - ol_cv_pthread_version=7 + ol_pthread_final=yes else rm -rf conftest* - - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pthread_attr_default" >/dev/null 2>&1; then - rm -rf conftest* - + ol_pthread_final=no +fi +rm -f conftest* + + cat > conftest.$ac_ext < -#ifdef PTHREAD_MUTEX_INITIALIZER - draft5 -#endif + /* this check could be improved */ +# ifdef pthread_once_init + pthread_version_draft4; +# endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "draft5" >/dev/null 2>&1; then - rm -rf conftest* - ol_cv_pthread_version=5 -else - rm -rf conftest* - ol_cv_pthread_version=4 -fi -rm -f conftest* - -else - rm -rf conftest* - ol_cv_pthread_version=6 -fi -rm -f conftest* - -fi -rm -f conftest* - -else + egrep "pthread_version_draft4" >/dev/null 2>&1; then rm -rf conftest* - ol_cv_pthread_version=8 -fi -rm -f conftest* - + ol_pthread_draft4=yes else rm -rf conftest* - ol_cv_pthread_version=10 + ol_pthread_draft4=no fi rm -f conftest* + 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 != 0 ; then - cat >> confdefs.h <> 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 @@ -11774,12 +11745,12 @@ EOF echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6 -echo "configure:11778: checking for LinuxThreads pthread.h" >&5 +echo "configure:11749: checking for LinuxThreads pthread.h" >&5 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -11806,12 +11777,12 @@ EOF echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6 -echo "configure:11810: checking for GNU Pth pthread.h" >&5 +echo "configure:11781: checking for GNU Pth pthread.h" >&5 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef _POSIX_THREAD_IS_GNU_PTH @@ -11840,17 +11811,17 @@ echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11844: checking for $ac_hdr" >&5 +echo "configure:11815: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11825: \"$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* @@ -11880,20 +11851,17 @@ done echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6 -echo "configure:11884: checking for pthread_create in default libraries" >&5 +echo "configure:11855: checking for pthread_create in default libraries" >&5 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -11907,43 +11875,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -11954,7 +11939,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:11958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_create=yes else @@ -11966,13 +11951,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -11990,43 +11972,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12038,7 +12037,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:12042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12041: \"$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 @@ -12063,7 +12062,7 @@ echo "$ac_t""$ol_cv_pthread_create" 1>&6 if test "$ol_link_threads" = no ; then # try -kthread echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6 -echo "configure:12067: checking for pthread link with -kthread" >&5 +echo "configure:12066: checking for pthread link with -kthread" >&5 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12074,13 +12073,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12094,43 +12090,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12141,7 +12154,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_kthread=yes else @@ -12153,13 +12166,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12177,43 +12187,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12225,7 +12252,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:12229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_kthread=yes else @@ -12255,7 +12282,7 @@ fi if test "$ol_link_threads" = no ; then # try -pthread echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6 -echo "configure:12259: checking for pthread link with -pthread" >&5 +echo "configure:12286: checking for pthread link with -pthread" >&5 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12266,13 +12293,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12286,43 +12310,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12333,7 +12374,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_pthread=yes else @@ -12345,13 +12386,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12369,43 +12407,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); #endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12417,7 +12472,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:12421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_pthread=yes else @@ -12447,7 +12502,7 @@ fi if test "$ol_link_threads" = no ; then # try -pthreads echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6 -echo "configure:12451: checking for pthread link with -pthreads" >&5 +echo "configure:12506: checking for pthread link with -pthreads" >&5 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12458,13 +12513,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12478,43 +12530,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); #endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12525,7 +12594,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_pthreads=yes else @@ -12537,13 +12606,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12561,43 +12627,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12609,7 +12692,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:12613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_pthreads=yes else @@ -12639,7 +12722,7 @@ fi if test "$ol_link_threads" = no ; then # try -mthreads echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6 -echo "configure:12643: checking for pthread link with -mthreads" >&5 +echo "configure:12726: checking for pthread link with -mthreads" >&5 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12650,13 +12733,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12670,43 +12750,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12717,7 +12814,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_mthreads=yes else @@ -12729,13 +12826,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12753,43 +12847,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12801,7 +12912,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:12805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:12916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_mthreads=yes else @@ -12831,7 +12942,7 @@ fi if test "$ol_link_threads" = no ; then # try -thread echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6 -echo "configure:12835: checking for pthread link with -thread" >&5 +echo "configure:12946: checking for pthread link with -thread" >&5 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12842,13 +12953,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12862,43 +12970,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12909,7 +13034,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_thread=yes else @@ -12921,13 +13046,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -12945,43 +13067,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); #endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -12993,7 +13132,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:12997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:13136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_thread=yes else @@ -13024,7 +13163,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthread -lmach -lexc -lc_r echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6 -echo "configure:13028: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 +echo "configure:13167: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -13035,13 +13174,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13055,43 +13191,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13102,7 +13255,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:13106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes else @@ -13114,13 +13267,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13138,43 +13288,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13186,7 +13353,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:13190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:13357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes else @@ -13216,7 +13383,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthread -lmach -lexc echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6 -echo "configure:13220: checking for pthread link with -lpthread -lmach -lexc" >&5 +echo "configure:13387: checking for pthread link with -lpthread -lmach -lexc" >&5 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -13227,13 +13394,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13247,43 +13411,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13294,7 +13475,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:13298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lpthread_lmach_lexc=yes else @@ -13306,13 +13487,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13330,43 +13508,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13378,7 +13573,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:13382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:13577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lpthread_lmach_lexc=yes else @@ -13409,7 +13604,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthread -Wl,-woff,85 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6 -echo "configure:13413: checking for pthread link with -lpthread -Wl,-woff,85" >&5 +echo "configure:13608: checking for pthread link with -lpthread -Wl,-woff,85" >&5 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -13420,13 +13615,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13440,43 +13632,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); #endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13487,7 +13696,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:13491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lib_lpthread_woff=yes else @@ -13499,13 +13708,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13523,43 +13729,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); #endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#endif + } if( status ) return status; +#endif + status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; -#endif if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13571,7 +13794,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:13575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:13798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lib_lpthread_woff=yes else @@ -13602,7 +13825,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthread echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6 -echo "configure:13606: checking for pthread link with -lpthread" >&5 +echo "configure:13829: checking for pthread link with -lpthread" >&5 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -13613,13 +13836,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13633,43 +13853,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13680,7 +13917,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:13684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lpthread=yes else @@ -13692,13 +13929,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13716,43 +13950,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13764,7 +14015,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:13768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lpthread=yes else @@ -13794,7 +14045,7 @@ fi if test "$ol_link_threads" = no ; then # try -lc_r echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6 -echo "configure:13798: checking for pthread link with -lc_r" >&5 +echo "configure:14049: checking for pthread link with -lc_r" >&5 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -13805,13 +14056,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13825,43 +14073,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13872,7 +14137,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:13876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lc_r=yes else @@ -13884,13 +14149,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -13908,43 +14170,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -13956,7 +14235,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:13960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lc_r=yes else @@ -13987,7 +14266,7 @@ fi if test "$ol_link_threads" = no ; then # try -threads echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6 -echo "configure:13991: checking for pthread link with -threads" >&5 +echo "configure:14270: checking for pthread link with -threads" >&5 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -13998,13 +14277,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14018,43 +14294,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14065,7 +14358,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_threads=yes else @@ -14077,13 +14370,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14101,43 +14391,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14149,7 +14456,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:14153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_threads=yes else @@ -14180,7 +14487,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthreads -lmach -lexc -lc_r echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6 -echo "configure:14184: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 +echo "configure:14491: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14191,13 +14498,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14211,43 +14515,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14258,7 +14579,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes else @@ -14270,13 +14591,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14294,43 +14612,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14342,7 +14677,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:14346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes else @@ -14372,7 +14707,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthreads -lmach -lexc echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6 -echo "configure:14376: checking for pthread link with -lpthreads -lmach -lexc" >&5 +echo "configure:14711: checking for pthread link with -lpthreads -lmach -lexc" >&5 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14383,13 +14718,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14403,43 +14735,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14450,7 +14799,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lpthreads_lmach_lexc=yes else @@ -14462,13 +14811,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14486,43 +14832,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14534,7 +14897,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:14538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lpthreads_lmach_lexc=yes else @@ -14564,7 +14927,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthreads -lexc echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6 -echo "configure:14568: checking for pthread link with -lpthreads -lexc" >&5 +echo "configure:14931: checking for pthread link with -lpthreads -lexc" >&5 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14575,13 +14938,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14595,43 +14955,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14642,7 +15019,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lpthreads_lexc=yes else @@ -14654,13 +15031,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14678,43 +15052,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14726,7 +15117,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:14730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:15121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lpthreads_lexc=yes else @@ -14757,7 +15148,7 @@ fi if test "$ol_link_threads" = no ; then # try -lpthreads echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6 -echo "configure:14761: checking for pthread link with -lpthreads" >&5 +echo "configure:15152: checking for pthread link with -lpthreads" >&5 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14768,13 +15159,10 @@ else if test "$cross_compiling" = yes; then cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14788,43 +15176,60 @@ static void *task(p) int main() { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14835,7 +15240,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_pthread_lib_lpthreads=yes else @@ -14847,13 +15252,10 @@ fi rm -f conftest* else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -14871,43 +15273,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -14919,7 +15338,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:14923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:15342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_lib_lpthreads=yes else @@ -14947,6 +15366,11 @@ fi if test $ol_link_threads != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_PTHREADS 1 +EOF + + LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" save_CPPFLAGS="$CPPFLAGS" @@ -14956,12 +15380,12 @@ fi for ac_func in sched_yield pthread_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14960: checking for $ac_func" >&5 +echo "configure:15384: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15013,7 +15437,7 @@ done if test $ac_cv_func_sched_yield = no -a \ $ac_cv_func_pthread_yield = no ; then echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6 -echo "configure:15017: checking for sched_yield in -lrt" >&5 +echo "configure:15441: checking for sched_yield in -lrt" >&5 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -15021,7 +15445,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15460: \"$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 @@ -15064,12 +15488,12 @@ fi for ac_func in thr_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15068: checking for $ac_func" >&5 +echo "configure:15492: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15127,12 +15551,12 @@ done for ac_func in pthread_kill pthread_rwlock_destroy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15131: checking for $ac_func" >&5 +echo "configure:15555: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15182,13 +15606,13 @@ done echo $ac_n "checking for pthread_detach with ""... $ac_c" 1>&6 -echo "configure:15186: checking for pthread_detach with " >&5 +echo "configure:15610: checking for pthread_detach with " >&5 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -15200,7 +15624,7 @@ int main() { pthread_detach(NULL); ; return 0; } EOF -if { (eval echo configure:15204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_func_pthread_detach=yes else @@ -15232,12 +15656,12 @@ EOF do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15236: checking for $ac_func" >&5 +echo "configure:15660: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15290,12 +15714,12 @@ done for ac_func in pthread_kill_other_threads_np do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15294: checking for $ac_func" >&5 +echo "configure:15718: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15344,7 +15768,7 @@ fi done echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6 -echo "configure:15348: checking for LinuxThreads implementation" >&5 +echo "configure:15772: checking for LinuxThreads implementation" >&5 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -15357,7 +15781,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6 echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6 -echo "configure:15361: checking for LinuxThreads consistency" >&5 +echo "configure:15785: checking for LinuxThreads consistency" >&5 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -15382,7 +15806,7 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6 fi echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6 -echo "configure:15386: checking if pthread_create() works" >&5 +echo "configure:15810: checking if pthread_create() works" >&5 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -15391,13 +15815,10 @@ else ol_cv_pthread_create_works=yes else cat > conftest.$ac_ext < -#if HAVE_PTHREADS < 7 -#include -#endif #ifndef NULL #define NULL (void*)0 #endif @@ -15415,43 +15836,60 @@ int main(argc, argv) { /* pthread test function */ -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif pthread_t t; int status; - int detach = PTHREAD_CREATE_DETACHED; + int detach = 1; -#if HAVE_PTHREADS > 4 +#ifdef HAVE_PTHREADS_FINAL /* Final pthreads */ pthread_attr_t attr; status = pthread_attr_init(&attr); if( status ) return status; -#if HAVE_PTHREADS < 7 - status = pthread_attr_setdetachstate(&attr, &detach); - if( status < 0 ) status = errno; +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if( !detach ) { +#if defined( PTHREAD_CREATE_JOINABLE ) + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - status = pthread_attr_setdetachstate(&attr, detach); + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif + +#ifdef PTHREAD_CREATE_DETACHED + } else { + status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif + } if( status ) return status; - status = pthread_create( &t, &attr, task, NULL ); -#if HAVE_PTHREADS < 7 - if( status < 0 ) status = errno; #endif + + status = pthread_create( &t, &attr, task, NULL ); if( status ) return status; + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); + + status = pthread_detach( t ); + if( status ) return status; + } +#endif + #else /* Draft 4 pthreads */ status = pthread_create( &t, pthread_attr_default, task, NULL ); - if( status ) return errno; + if( status ) return status; - /* give thread a chance to complete */ - /* it should remain joinable and hence detachable */ - sleep( 1 ); + if( detach ) { + /* give thread a chance to complete */ + /* it should remain joinable and hence detachable */ + sleep( 1 ); - status = pthread_detach( &t ); - if( status ) return errno; + status = pthread_detach( &t ); + if( status ) return status; + } #endif #ifdef HAVE_LINUX_THREADS @@ -15463,7 +15901,7 @@ int main(argc, argv) } EOF -if { (eval echo configure:15467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:15905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_create_works=yes else @@ -15485,7 +15923,7 @@ echo "$ac_t""$ol_cv_pthread_create_works" 1>&6 if test $ol_with_yielding_select = auto ; then echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6 -echo "configure:15489: checking if select yields when using pthreads" >&5 +echo "configure:15927: checking if select yields when using pthreads" >&5 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -15494,7 +15932,7 @@ else ol_cv_pthread_select_yields=cross else cat > conftest.$ac_ext < @@ -15553,7 +15991,7 @@ int main(argc, argv) #endif #endif -#if HAVE_PTHREADS < 6 +#if HAVE_PTHREADS_D4 pthread_create(&t, pthread_attr_default, task, NULL); #else pthread_create(&t, NULL, task, NULL); @@ -15570,7 +16008,7 @@ int main(argc, argv) exit(2); } EOF -if { (eval echo configure:15574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:16012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_pthread_select_yields=no else @@ -15614,17 +16052,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:15618: checking for $ac_hdr" >&5 +echo "configure:16056: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16066: \"$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* @@ -15654,12 +16092,12 @@ done ol_with_threads=found echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6 -echo "configure:15658: checking for cthread_fork" >&5 +echo "configure:16096: checking for cthread_fork" >&5 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_cthread_fork=yes" else @@ -15705,7 +16143,7 @@ fi if test $ol_link_threads = no ; then echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6 -echo "configure:15709: checking for cthread_fork with -all_load" >&5 +echo "configure:16147: checking for cthread_fork with -all_load" >&5 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -15713,7 +16151,7 @@ else save_LIBS="$LIBS" LIBS="-all_load $LIBS" cat > conftest.$ac_ext < int main() { @@ -15722,7 +16160,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:15726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_cthread_all_load=yes else @@ -15752,12 +16190,12 @@ echo "$ac_t""$ol_cv_cthread_all_load" 1>&6 save_LIBS="$LIBS" LIBS="$LIBS -lthreads" echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6 -echo "configure:15756: checking for cthread_fork" >&5 +echo "configure:16194: checking for cthread_fork" >&5 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_cthread_fork=yes" else @@ -15831,17 +16269,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:15835: checking for $ac_hdr" >&5 +echo "configure:16273: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16283: \"$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* @@ -15870,7 +16308,7 @@ done if test $ac_cv_header_pth_h = yes ; then echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6 -echo "configure:15874: checking for pth_version in -lpth" >&5 +echo "configure:16312: checking for pth_version in -lpth" >&5 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -15878,7 +16316,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpth $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16331: \"$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 @@ -15934,17 +16372,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:15938: checking for $ac_hdr" >&5 +echo "configure:16376: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16386: \"$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* @@ -15972,7 +16410,7 @@ done if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 -echo "configure:15976: checking for thr_create in -lthread" >&5 +echo "configure:16414: checking for thr_create in -lthread" >&5 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -15980,7 +16418,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16433: \"$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 @@ -16031,12 +16469,12 @@ EOF do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:16035: checking for $ac_func" >&5 +echo "configure:16473: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -16091,17 +16529,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16095: checking for $ac_hdr" >&5 +echo "configure:16533: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16543: \"$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* @@ -16129,7 +16567,7 @@ done if test $ac_cv_header_lwp_lwp_h = yes ; then echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6 -echo "configure:16133: checking for lwp_create in -llwp" >&5 +echo "configure:16571: checking for lwp_create in -llwp" >&5 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -16137,7 +16575,7 @@ else ac_save_LIBS="$LIBS" LIBS="-llwp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16590: \"$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 @@ -16201,17 +16639,17 @@ if test $ol_with_threads = manual ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16205: checking for $ac_hdr" >&5 +echo "configure:16643: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16653: \"$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* @@ -16240,12 +16678,12 @@ done for ac_func in sched_yield pthread_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:16244: checking for $ac_func" >&5 +echo "configure:16682: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -16295,12 +16733,12 @@ done echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6 -echo "configure:16299: checking for LinuxThreads pthread.h" >&5 +echo "configure:16737: checking for LinuxThreads pthread.h" >&5 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -16330,17 +16768,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16334: checking for $ac_hdr" >&5 +echo "configure:16772: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16782: \"$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* @@ -16370,17 +16808,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16374: checking for $ac_hdr" >&5 +echo "configure:16812: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16822: \"$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* @@ -16410,17 +16848,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16414: checking for $ac_hdr" >&5 +echo "configure:16852: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16862: \"$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* @@ -16479,20 +16917,20 @@ EOF echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6 -echo "configure:16483: checking for thread specific errno" >&5 +echo "configure:16921: checking for thread specific errno" >&5 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { errno = 0; ; return 0; } EOF -if { (eval echo configure:16496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_errno_thread_specific=yes else @@ -16508,20 +16946,20 @@ fi echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6 echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6 -echo "configure:16512: checking for thread specific h_errno" >&5 +echo "configure:16950: checking for thread specific h_errno" >&5 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { h_errno = 0; ; return 0; } EOF -if { (eval echo configure:16525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_h_errno_thread_specific=yes else @@ -16579,17 +17017,17 @@ if test $ol_with_ldbm_api = auto \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:16583: checking for $ac_hdr" >&5 +echo "configure:17021: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:17031: \"$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* @@ -16617,13 +17055,13 @@ done if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6 -echo "configure:16621: checking if Berkeley DB header compatibility" >&5 +echo "configure:17059: checking if Berkeley DB header compatibility" >&5 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ol_cv_lib_db=no if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6 -echo "configure:16664: checking for Berkeley DB link (default)" >&5 +echo "configure:17102: checking for Berkeley DB link (default)" >&5 if eval "test \"\${ol_cv_db_none+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -16670,7 +17108,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_none=yes else @@ -16741,7 +17179,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6 -echo "configure:16745: checking for Berkeley DB link (-ldb4)" >&5 +echo "configure:17183: checking for Berkeley DB link (-ldb4)" >&5 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -16751,7 +17189,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db4=yes else @@ -16822,7 +17260,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6 -echo "configure:16826: checking for Berkeley DB link (-ldb-4)" >&5 +echo "configure:17264: checking for Berkeley DB link (-ldb-4)" >&5 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -16832,7 +17270,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_4=yes else @@ -16903,7 +17341,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6 -echo "configure:16907: checking for Berkeley DB link (-ldb)" >&5 +echo "configure:17345: checking for Berkeley DB link (-ldb)" >&5 if eval "test \"\${ol_cv_db_db+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -16913,7 +17351,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db=yes else @@ -16984,7 +17422,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6 -echo "configure:16988: checking for Berkeley DB link (-ldb3)" >&5 +echo "configure:17426: checking for Berkeley DB link (-ldb3)" >&5 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -16994,7 +17432,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db3=yes else @@ -17065,7 +17503,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6 -echo "configure:17069: checking for Berkeley DB link (-ldb-3)" >&5 +echo "configure:17507: checking for Berkeley DB link (-ldb-3)" >&5 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17075,7 +17513,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_3=yes else @@ -17146,7 +17584,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6 -echo "configure:17150: checking for Berkeley DB link (-ldb2)" >&5 +echo "configure:17588: checking for Berkeley DB link (-ldb2)" >&5 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17156,7 +17594,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db2=yes else @@ -17227,7 +17665,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6 -echo "configure:17231: checking for Berkeley DB link (-ldb-2)" >&5 +echo "configure:17669: checking for Berkeley DB link (-ldb-2)" >&5 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17237,7 +17675,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_2=yes else @@ -17308,7 +17746,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6 -echo "configure:17312: checking for Berkeley DB link (-ldb1)" >&5 +echo "configure:17750: checking for Berkeley DB link (-ldb1)" >&5 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17318,7 +17756,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db1=yes else @@ -17389,7 +17827,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6 -echo "configure:17393: checking for Berkeley DB link (-ldb-1)" >&5 +echo "configure:17831: checking for Berkeley DB link (-ldb-1)" >&5 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17399,7 +17837,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_1=yes else @@ -17481,17 +17919,17 @@ for ac_hdr in db.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:17485: checking for $ac_hdr" >&5 +echo "configure:17923: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:17495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:17933: \"$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* @@ -17521,7 +17959,7 @@ if test $ac_cv_header_db_h = yes; then ol_cv_lib_db=no if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6 -echo "configure:17525: checking for Berkeley DB link (default)" >&5 +echo "configure:17963: checking for Berkeley DB link (default)" >&5 if eval "test \"\${ol_cv_db_none+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17531,7 +17969,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_none=yes else @@ -17602,7 +18040,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6 -echo "configure:17606: checking for Berkeley DB link (-ldb4)" >&5 +echo "configure:18044: checking for Berkeley DB link (-ldb4)" >&5 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17612,7 +18050,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db4=yes else @@ -17683,7 +18121,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6 -echo "configure:17687: checking for Berkeley DB link (-ldb-4)" >&5 +echo "configure:18125: checking for Berkeley DB link (-ldb-4)" >&5 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17693,7 +18131,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_4=yes else @@ -17764,7 +18202,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6 -echo "configure:17768: checking for Berkeley DB link (-ldb)" >&5 +echo "configure:18206: checking for Berkeley DB link (-ldb)" >&5 if eval "test \"\${ol_cv_db_db+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17774,7 +18212,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db=yes else @@ -17845,7 +18283,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6 -echo "configure:17849: checking for Berkeley DB link (-ldb3)" >&5 +echo "configure:18287: checking for Berkeley DB link (-ldb3)" >&5 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17855,7 +18293,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db3=yes else @@ -17926,7 +18364,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6 -echo "configure:17930: checking for Berkeley DB link (-ldb-3)" >&5 +echo "configure:18368: checking for Berkeley DB link (-ldb-3)" >&5 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -17936,7 +18374,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_3=yes else @@ -18007,7 +18445,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6 -echo "configure:18011: checking for Berkeley DB link (-ldb2)" >&5 +echo "configure:18449: checking for Berkeley DB link (-ldb2)" >&5 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18017,7 +18455,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db2=yes else @@ -18088,7 +18526,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6 -echo "configure:18092: checking for Berkeley DB link (-ldb-2)" >&5 +echo "configure:18530: checking for Berkeley DB link (-ldb-2)" >&5 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18098,7 +18536,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_2=yes else @@ -18169,7 +18607,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6 -echo "configure:18173: checking for Berkeley DB link (-ldb1)" >&5 +echo "configure:18611: checking for Berkeley DB link (-ldb1)" >&5 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18179,7 +18617,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db1=yes else @@ -18250,7 +18688,7 @@ fi if test $ol_cv_lib_db = no ; then echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6 -echo "configure:18254: checking for Berkeley DB link (-ldb-1)" >&5 +echo "configure:18692: checking for Berkeley DB link (-ldb-1)" >&5 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18260,7 +18698,7 @@ else LIBS="$ol_DB_LIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:18749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_db_db_1=yes else @@ -18333,7 +18771,7 @@ fi if test "$ol_cv_lib_db" != no ; then ol_cv_berkeley_db=yes echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6 -echo "configure:18337: checking for Berkeley DB thread support" >&5 +echo "configure:18775: checking for Berkeley DB thread support" >&5 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18347,7 +18785,7 @@ else ol_cv_berkeley_db_thread=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:18856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_berkeley_db_thread=yes else @@ -18475,13 +18913,13 @@ if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; } elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6 -echo "configure:18479: checking Berkeley DB version for BDB backend" >&5 +echo "configure:18917: checking Berkeley DB version for BDB backend" >&5 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -18528,18 +18966,18 @@ fi if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then echo $ac_n "checking for MDBM library""... $ac_c" 1>&6 -echo "configure:18532: checking for MDBM library" >&5 +echo "configure:18970: checking for MDBM library" >&5 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6 -echo "configure:18538: checking for mdbm_set_chain" >&5 +echo "configure:18976: checking for mdbm_set_chain" >&5 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_mdbm_set_chain=yes" else @@ -18582,7 +19020,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6 -echo "configure:18586: checking for mdbm_set_chain in -lmdbm" >&5 +echo "configure:19024: checking for mdbm_set_chain in -lmdbm" >&5 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -18590,7 +19028,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmdbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19043: \"$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 @@ -18636,17 +19074,17 @@ echo "$ac_t""$ol_cv_lib_mdbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:18640: checking for $ac_hdr" >&5 +echo "configure:19078: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:18650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:19088: \"$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* @@ -18673,7 +19111,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:18677: checking for db" >&5 +echo "configure:19115: checking for db" >&5 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18706,18 +19144,18 @@ fi if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then echo $ac_n "checking for GDBM library""... $ac_c" 1>&6 -echo "configure:18710: checking for GDBM library" >&5 +echo "configure:19148: checking for GDBM library" >&5 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6 -echo "configure:18716: checking for gdbm_open" >&5 +echo "configure:19154: checking for gdbm_open" >&5 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gdbm_open=yes" else @@ -18760,7 +19198,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:18764: checking for gdbm_open in -lgdbm" >&5 +echo "configure:19202: checking for gdbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -18768,7 +19206,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgdbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19221: \"$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 @@ -18814,17 +19252,17 @@ echo "$ac_t""$ol_cv_lib_gdbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:18818: checking for $ac_hdr" >&5 +echo "configure:19256: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:18828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:19266: \"$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* @@ -18851,7 +19289,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:18855: checking for db" >&5 +echo "configure:19293: checking for db" >&5 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -18885,18 +19323,18 @@ fi if test $ol_with_ldbm_api = ndbm ; then echo $ac_n "checking for NDBM library""... $ac_c" 1>&6 -echo "configure:18889: checking for NDBM library" >&5 +echo "configure:19327: checking for NDBM library" >&5 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:18895: checking for dbm_open" >&5 +echo "configure:19333: checking for dbm_open" >&5 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -18939,7 +19377,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6 -echo "configure:18943: checking for dbm_open in -lndbm" >&5 +echo "configure:19381: checking for dbm_open in -lndbm" >&5 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -18947,7 +19385,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lndbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19400: \"$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 @@ -18978,7 +19416,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:18982: checking for dbm_open in -ldbm" >&5 +echo "configure:19420: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -18986,7 +19424,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19439: \"$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 @@ -19034,17 +19472,17 @@ echo "$ac_t""$ol_cv_lib_ndbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:19038: checking for $ac_hdr" >&5 +echo "configure:19476: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:19048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:19486: \"$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* @@ -19071,7 +19509,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:19075: checking for db" >&5 +echo "configure:19513: checking for db" >&5 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -19128,17 +19566,17 @@ if test $ol_enable_wrappers != no ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:19132: checking for $ac_hdr" >&5 +echo "configure:19570: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:19142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:19580: \"$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* @@ -19160,11 +19598,11 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then EOF echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6 -echo "configure:19164: checking for TCP wrappers library" >&5 +echo "configure:19602: checking for TCP wrappers library" >&5 save_LIBS="$LIBS" LIBS="$LIBS -lwrap" cat > conftest.$ac_ext < @@ -19179,7 +19617,7 @@ hosts_access(req) ; return 0; } EOF -if { (eval echo configure:19183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""-lwrap" 1>&6 have_wrappers=yes @@ -19191,7 +19629,7 @@ else LIBS="$LIBS -lnsl" cat > conftest.$ac_ext < @@ -19206,7 +19644,7 @@ hosts_access(req) ; return 0; } EOF -if { (eval echo configure:19210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""-lwrap -lnsl" 1>&6 have_wrappers=yes @@ -19246,12 +19684,12 @@ fi if test $ol_enable_syslog != no ; then echo $ac_n "checking for openlog""... $ac_c" 1>&6 -echo "configure:19250: checking for openlog" >&5 +echo "configure:19688: checking for openlog" >&5 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_openlog=yes" else @@ -19304,7 +19742,7 @@ fi ol_link_sql=no if test $ol_enable_sql != no ; then echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6 -echo "configure:19308: checking for SQLDriverConnect in -liodbc" >&5 +echo "configure:19746: checking for SQLDriverConnect in -liodbc" >&5 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19312,7 +19750,7 @@ else ac_save_LIBS="$LIBS" LIBS="-liodbc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19765: \"$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 @@ -19348,7 +19786,7 @@ fi ol_link_sql="-liodbc" else echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6 -echo "configure:19352: checking for SQLDriverConnect in -lodbc" >&5 +echo "configure:19790: checking for SQLDriverConnect in -lodbc" >&5 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19356,7 +19794,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lodbc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19809: \"$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 @@ -19406,17 +19844,17 @@ for ac_hdr in termcap.h ncurses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:19410: checking for $ac_hdr" >&5 +echo "configure:19848: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:19420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:19858: \"$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* @@ -19445,7 +19883,7 @@ done if test $ol_link_termcap = no ; then echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6 -echo "configure:19449: checking for tputs in -ltermcap" >&5 +echo "configure:19887: checking for tputs in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19453,7 +19891,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19906: \"$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 @@ -19497,7 +19935,7 @@ fi if test $ol_link_termcap = no ; then echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:19501: checking for initscr in -lncurses" >&5 +echo "configure:19939: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19505,7 +19943,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:19958: \"$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 @@ -19562,17 +20000,17 @@ if test $ol_with_cyrus_sasl != no ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:19566: checking for $ac_hdr" >&5 +echo "configure:20004: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:19576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:20014: \"$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* @@ -19601,7 +20039,7 @@ done if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6 -echo "configure:19605: checking for sasl_client_init in -lsasl2" >&5 +echo "configure:20043: checking for sasl_client_init in -lsasl2" >&5 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19609,7 +20047,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsasl2 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20062: \"$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 @@ -19639,7 +20077,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6 -echo "configure:19643: checking for sasl_client_init in -lsasl" >&5 +echo "configure:20081: checking for sasl_client_init in -lsasl" >&5 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19647,7 +20085,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsasl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20100: \"$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 @@ -19694,13 +20132,13 @@ fi fi else echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6 -echo "configure:19698: checking Cyrus SASL library version" >&5 +echo "configure:20136: checking Cyrus SASL library version" >&5 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:19755: checking for sasl_version" >&5 +echo "configure:20193: checking for sasl_version" >&5 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sasl_version=yes" else @@ -19839,13 +20277,13 @@ if test $ol_with_fetch != no ; then ol_LIBS=$LIBS LIBS="-lfetch -lcom_err $LIBS" echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6 -echo "configure:19843: checking fetch(3) library" >&5 +echo "configure:20281: checking fetch(3) library" >&5 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -19855,7 +20293,7 @@ int main() { struct url *u = fetchParseURL("file:///"); ; return 0; } EOF -if { (eval echo configure:19859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_lib_fetch=yes else @@ -19893,17 +20331,17 @@ if test $ol_with_readline != no ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:19897: checking for $ac_hdr" >&5 +echo "configure:20335: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:19907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:20345: \"$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* @@ -19934,7 +20372,7 @@ done save_LIBS="$LIBS" LIBS="$TERMCAP_LIBS $LIBS" echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:19938: checking for readline in -lreadline" >&5 +echo "configure:20376: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -19942,7 +20380,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20395: \"$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 @@ -19995,12 +20433,12 @@ fi if test $ol_enable_crypt != no ; then echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:19999: checking for crypt" >&5 +echo "configure:20437: checking for crypt" >&5 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -20043,7 +20481,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:20047: checking for crypt in -lcrypt" >&5 +echo "configure:20485: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -20051,7 +20489,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20504: \"$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 @@ -20105,12 +20543,12 @@ fi if test $ol_enable_proctitle != no ; then echo $ac_n "checking for setproctitle""... $ac_c" 1>&6 -echo "configure:20109: checking for setproctitle" >&5 +echo "configure:20547: checking for setproctitle" >&5 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_setproctitle=yes" else @@ -20153,7 +20591,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 -echo "configure:20157: checking for setproctitle in -lutil" >&5 +echo "configure:20595: checking for setproctitle in -lutil" >&5 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -20161,7 +20599,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20614: \"$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 @@ -20212,17 +20650,17 @@ if test $ol_enable_slp != no ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:20216: checking for $ac_hdr" >&5 +echo "configure:20654: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:20226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:20664: \"$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* @@ -20251,7 +20689,7 @@ done if test $ac_cv_header_slp_h = yes ; then echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6 -echo "configure:20255: checking for SLPOpen in -lslp" >&5 +echo "configure:20693: checking for SLPOpen in -lslp" >&5 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -20259,7 +20697,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lslp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:20712: \"$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 @@ -20305,12 +20743,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:20309: checking for ANSI C header files" >&5 +echo "configure:20747: checking for ANSI C header files" >&5 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -20318,7 +20756,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:20322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:20760: \"$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* @@ -20335,7 +20773,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -20353,7 +20791,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -20374,7 +20812,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #if ((' ' & 0x0FF) == 0x020) @@ -20392,7 +20830,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:20396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:20834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -20416,12 +20854,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:20420: checking for mode_t" >&5 +echo "configure:20858: checking for mode_t" >&5 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -20452,12 +20890,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:20456: checking for off_t" >&5 +echo "configure:20894: checking for off_t" >&5 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -20488,12 +20926,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:20492: checking for pid_t" >&5 +echo "configure:20930: checking for pid_t" >&5 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -20524,19 +20962,19 @@ EOF fi echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:20528: checking for ptrdiff_t" >&5 +echo "configure:20966: checking for ptrdiff_t" >&5 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { ptrdiff_t p ; return 0; } EOF -if { (eval echo configure:20540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:20978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_type_ptrdiff_t=yes else @@ -20557,12 +20995,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:20561: checking return type of signal handlers" >&5 +echo "configure:20999: checking return type of signal handlers" >&5 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -20579,7 +21017,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:20583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -20598,12 +21036,12 @@ EOF echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:20602: checking for size_t" >&5 +echo "configure:21040: checking for size_t" >&5 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -20635,12 +21073,12 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:20639: checking for ssize_t" >&5 +echo "configure:21077: checking for ssize_t" >&5 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -20671,12 +21109,12 @@ EOF fi echo $ac_n "checking for caddr_t""... $ac_c" 1>&6 -echo "configure:20675: checking for caddr_t" >&5 +echo "configure:21113: checking for caddr_t" >&5 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -20708,12 +21146,12 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:20712: checking for socklen_t" >&5 +echo "configure:21150: checking for socklen_t" >&5 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_type_socklen_t=yes else @@ -20748,12 +21186,12 @@ EOF fi echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6 -echo "configure:20752: checking for member st_blksize in aggregate type struct stat" >&5 +echo "configure:21190: checking for member st_blksize in aggregate type struct stat" >&5 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -20761,7 +21199,7 @@ int main() { struct stat foo; foo.st_blksize; ; return 0; } EOF -if { (eval echo configure:20765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_struct_member_st_blksize=yes else @@ -20783,12 +21221,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:20787: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:21225: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"\${ac_cv_header_time+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -20797,7 +21235,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:20801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -20818,12 +21256,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:20822: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:21260: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -20831,7 +21269,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:20835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -20852,12 +21290,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:20856: checking for uid_t in sys/types.h" >&5 +echo "configure:21294: checking for uid_t in sys/types.h" >&5 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -20886,19 +21324,19 @@ EOF fi echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6 -echo "configure:20890: checking for sig_atomic_t" >&5 +echo "configure:21328: checking for sig_atomic_t" >&5 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { sig_atomic_t atomic; ; return 0; } EOF -if { (eval echo configure:20902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_type_sig_atomic_t=yes else @@ -20922,13 +21360,13 @@ EOF # test for pw_gecos in struct passwd echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6 -echo "configure:20926: checking struct passwd for pw_gecos" >&5 +echo "configure:21364: checking struct passwd for pw_gecos" >&5 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -20938,7 +21376,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:20942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_struct_passwd_pw_gecos=yes else @@ -20960,13 +21398,13 @@ fi # test for pw_passwd in struct passwd echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6 -echo "configure:20964: checking struct passwd for pw_passwd" >&5 +echo "configure:21402: checking struct passwd for pw_passwd" >&5 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -20976,7 +21414,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:20980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_struct_passwd_pw_passwd=yes else @@ -20998,7 +21436,7 @@ fi echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 -echo "configure:21002: checking if toupper() requires islower()" >&5 +echo "configure:21440: checking if toupper() requires islower()" >&5 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -21007,7 +21445,7 @@ else ol_cv_c_upper_lower=safe else cat > conftest.$ac_ext < @@ -21019,7 +21457,7 @@ main() exit(1); } EOF -if { (eval echo configure:21023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:21461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_c_upper_lower=no else @@ -21042,12 +21480,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:21046: checking for working const" >&5 +echo "configure:21484: checking for working const" >&5 if eval "test \"\${ac_cv_c_const+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -21117,12 +21555,12 @@ EOF fi echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6 -echo "configure:21121: checking if compiler understands volatile" >&5 +echo "configure:21559: checking if compiler understands volatile" >&5 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_c_volatile=yes else @@ -21161,14 +21599,14 @@ EOF else echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:21165: checking whether byte ordering is bigendian" >&5 +echo "configure:21603: checking whether byte ordering is bigendian" >&5 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -21179,11 +21617,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:21183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -21194,7 +21632,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:21198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -21214,7 +21652,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:21669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -21253,13 +21691,13 @@ fi fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:21257: checking size of short" >&5 +echo "configure:21695: checking size of short" >&5 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -21269,7 +21707,7 @@ int main() { switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:21273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_short=$ac_size else @@ -21292,13 +21730,13 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:21296: checking size of int" >&5 +echo "configure:21734: checking size of int" >&5 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -21308,7 +21746,7 @@ int main() { switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:21312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_int=$ac_size else @@ -21331,13 +21769,13 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:21335: checking size of long" >&5 +echo "configure:21773: checking size of long" >&5 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -21347,7 +21785,7 @@ int main() { switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:21351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:21789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long=$ac_size else @@ -21398,7 +21836,7 @@ EOF echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:21402: checking for 8-bit clean memcmp" >&5 +echo "configure:21840: checking for 8-bit clean memcmp" >&5 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -21406,7 +21844,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:21858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -21434,12 +21872,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:21438: checking for strftime" >&5 +echo "configure:21876: checking for strftime" >&5 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:21905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -21485,7 +21923,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:21489: checking for strftime in -lintl" >&5 +echo "configure:21927: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -21493,7 +21931,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:21946: \"$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 @@ -21532,12 +21970,12 @@ fi echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6 -echo "configure:21536: checking for inet_aton()" >&5 +echo "configure:21974: checking for inet_aton()" >&5 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_func_inet_aton=yes else @@ -21581,12 +22019,12 @@ EOF echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6 -echo "configure:21585: checking for _spawnlp" >&5 +echo "configure:22023: checking for _spawnlp" >&5 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__spawnlp=yes" else @@ -21634,12 +22072,12 @@ fi echo $ac_n "checking for _snprintf""... $ac_c" 1>&6 -echo "configure:21638: checking for _snprintf" >&5 +echo "configure:22076: checking for _snprintf" >&5 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__snprintf=yes" else @@ -21689,12 +22127,12 @@ fi echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6 -echo "configure:21693: checking for _vsnprintf" >&5 +echo "configure:22131: checking for _vsnprintf" >&5 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__vsnprintf=yes" else @@ -21744,12 +22182,12 @@ fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:21748: checking for vprintf" >&5 +echo "configure:22186: checking for vprintf" >&5 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -21797,12 +22235,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:21801: checking for _doprnt" >&5 +echo "configure:22239: checking for _doprnt" >&5 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -21855,12 +22293,12 @@ if test $ac_cv_func_vprintf = yes ; then for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:21859: checking for $ac_func" >&5 +echo "configure:22297: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -21967,12 +22405,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:21971: checking for $ac_func" >&5 +echo "configure:22409: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -22024,12 +22462,12 @@ done for ac_func in getopt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:22028: checking for $ac_func" >&5 +echo "configure:22466: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -22100,13 +22538,13 @@ fi # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:22104: checking declaration of sys_errlist" >&5 +echo "configure:22542: checking declaration of sys_errlist" >&5 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -22119,7 +22557,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:22123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:22561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes ol_cv_have_sys_errlist=yes @@ -22142,20 +22580,20 @@ EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:22146: checking existence of sys_errlist" >&5 +echo "configure:22584: checking existence of sys_errlist" >&5 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:22159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:22597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index 735dd66e96..e780b00902 100644 --- a/configure.in +++ b/configure.in @@ -1361,9 +1361,12 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ if test $ac_cv_header_pthread_h = yes ; then OL_POSIX_THREAD_VERSION - if test $ol_cv_pthread_version != 0 ; then - AC_DEFINE_UNQUOTED(HAVE_PTHREADS,$ol_cv_pthread_version, - [define to pthreads API spec revision]) + if test $ol_cv_pthread_version = final ; then + AC_DEFINE(HAVE_PTHREADS_FINAL,1, + [define if pthreads API compatible with final spec]) + elif test $ol_cv_pthread_version = draft4 ; then + AC_DEFINE(HAVE_PTHREADS_D4,1, + [define if pthreads API compatible with draft4 spec]) else AC_MSG_ERROR([unknown pthread version]) fi @@ -1458,6 +1461,9 @@ dnl [ol_cv_pthread_lpthread_lexc]) OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads]) if test $ol_link_threads != no ; then + AC_DEFINE(HAVE_PTHREADS,1, + [define if you have POSIX Threads]) + LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads" dnl save flags @@ -1606,7 +1612,7 @@ int main(argc, argv) #endif #endif -#if HAVE_PTHREADS < 6 +#if HAVE_PTHREADS_D4 pthread_create(&t, pthread_attr_default, task, NULL); #else pthread_create(&t, NULL, task, NULL); diff --git a/include/portable.h.in b/include/portable.h.in index f0ccb4da61..7d31df9aea 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -710,12 +710,18 @@ /* if you have NT Event Log */ #undef HAVE_NT_EVENT_LOG -/* define to pthreads API spec revision */ -#undef HAVE_PTHREADS +/* define if pthreads API compatible with final spec */ +#undef HAVE_PTHREADS_FINAL + +/* define if pthreads API compatible with draft4 spec */ +#undef HAVE_PTHREADS_D4 /* if you have LinuxThreads */ #undef HAVE_LINUX_THREADS +/* define if you have POSIX Threads */ +#undef HAVE_PTHREADS + /* Define if you have the sched_yield function. */ #undef HAVE_SCHED_YIELD diff --git a/libraries/libldap_r/thr_posix.c b/libraries/libldap_r/thr_posix.c index a328c1f33e..fef18fe9ca 100644 --- a/libraries/libldap_r/thr_posix.c +++ b/libraries/libldap_r/thr_posix.c @@ -21,7 +21,7 @@ #include "ldap_pvt_thread.h" -#if HAVE_PTHREADS < 6 +#if HAVE_PTHREADS_D4 # define LDAP_INT_THREAD_ATTR_DEFAULT pthread_attr_default # define LDAP_INT_THREAD_CONDATTR_DEFAULT pthread_condattr_default # define LDAP_INT_THREAD_MUTEXATTR_DEFAULT pthread_mutexattr_default @@ -76,22 +76,6 @@ ldap_pvt_thread_get_concurrency(void) } #endif -/* detachstate appeared in Draft 6, but without manifest constants. - * in Draft 7 they were called PTHREAD_CREATE_UNDETACHED and ...DETACHED. - * in Draft 8 on, ...UNDETACHED became ...JOINABLE. - */ -#ifndef PTHREAD_CREATE_JOINABLE -#ifdef PTHREAD_CREATE_UNDETACHED -#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED -#else -#define PTHREAD_CREATE_JOINABLE 0 -#endif -#endif - -#ifndef PTHREAD_CREATE_DETACHED -#define PTHREAD_CREATE_DETACHED 1 -#endif - int ldap_pvt_thread_create( ldap_pvt_thread_t * thread, int detach, @@ -99,13 +83,26 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, void *arg) { int rtn; +#if defined( HAVE_PTHREADS_FINAL ) pthread_attr_t attr; - -/* Always create the thread attrs, so we can set stacksize if we need to */ -#if HAVE_PTHREADS > 5 pthread_attr_init(&attr); + +#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED ) + if (!detach) { +#if defined( PTHREAD_CREATE_JOINABLE ) + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); #else - pthread_attr_create(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED); +#endif +#ifdef PTHREAD_CREATE_DETACHED + } else { + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#elif HAVE_PTHREADS_OS390 + } else { + int st = __DETACHED; + pthread_attr_setdetachstate(&attr, &st); +#endif + } #endif #if defined(LDAP_PVT_THREAD_STACK_SIZE) && LDAP_PVT_THREAD_STACK_SIZE > 0 @@ -113,27 +110,31 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, pthread_attr_setstacksize( &attr, LDAP_PVT_THREAD_STACK_SIZE ); #endif -#if HAVE_PTHREADS > 5 - detach = detach ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE; -#if HAVE_PTHREADS == 6 - pthread_attr_setdetachstate(&attr, &detach); + rtn = pthread_create( thread, &attr, start_routine, arg ); +#ifdef HAVE_PTHREADS_OS390 + if ( rtn == -1 ) rtn = errno; +#endif + +#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) + if( detach ) { +#ifdef HAVE_PTHREADS_OS390 + (void) pthread_detach( thread ); #else - pthread_attr_setdetachstate(&attr, detach); + (void) pthread_detach( *thread ); #endif + } #endif - rtn = pthread_create( thread, &attr, start_routine, arg ); -#if HAVE_PTHREADS > 5 pthread_attr_destroy(&attr); + #else - pthread_attr_delete(&attr); + rtn = pthread_create( thread, LDAP_INT_THREAD_ATTR_DEFAULT, + start_routine, arg ); + if( detach ) { pthread_detach( thread ); } #endif -#if HAVE_PTHREADS < 7 - if ( rtn < 0 ) rtn = errno; -#endif return rtn; } @@ -146,14 +147,15 @@ ldap_pvt_thread_exit( void *retval ) int ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return ) { -#if HAVE_PTHREADS < 7 +#if !defined( HAVE_PTHREADS_FINAL ) void *dummy; - if (thread_return==NULL) thread_return=&dummy; - - if ( pthread_join( thread, thread_return ) < 0 ) return errno; - return 0; +#endif +#ifdef HAVE_PTHREADS_OS390 + int st = pthread_join( thread, thread_return ); + if ( st == -1 ) st = errno; + return st; #else return pthread_join( thread, thread_return ); #endif @@ -162,11 +164,14 @@ ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return ) int ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo ) { -#if HAVE_PTHREADS > 6 +#ifdef HAVE_PTHREAD_KILL +#ifdef HAVE_PTHREADS_OS390 + int st = pthread_kill( thread, signo ); + if ( st == -1 ) st = errno; + return st; +#else return pthread_kill( thread, signo ); -#elif HAVE_PTHREADS > 4 - if ( pthread_kill( thread, signo ) < 0 ) return errno; - return 0; +#endif #else /* pthread package with DCE */ if (kill( getpid(), signo )<0) @@ -178,136 +183,88 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo ) int ldap_pvt_thread_yield( void ) { -#if HAVE_PTHREADS == 10 +#ifdef _POSIX_THREAD_IS_GNU_PTH + sched_yield(); + return 0; + +#elif HAVE_SCHED_YIELD return sched_yield(); -#elif defined(_POSIX_THREAD_IS_GNU_PTH) - sched_yield(); +#elif HAVE_PTHREAD_YIELD +#if HAVE_PTHREADS_OS390 + pthread_yield(NULL); +#else + pthread_yield(); +#endif return 0; #elif HAVE_THR_YIELD return thr_yield(); -#elif HAVE_PTHREADS == 6 - pthread_yield(NULL); - return 0; #else - pthread_yield(); return 0; -#endif +#endif } int ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond ) { -#if HAVE_PTHREADS < 7 - if ( pthread_cond_init( cond, LDAP_INT_THREAD_CONDATTR_DEFAULT ) < 0 ) - return errno; - return 0; -#else return pthread_cond_init( cond, LDAP_INT_THREAD_CONDATTR_DEFAULT ); -#endif } int ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond ) { -#if HAVE_PTHREADS < 7 - if ( pthread_cond_destroy( cond ) < 0 ) return errno; - return 0; -#else return pthread_cond_destroy( cond ); -#endif } int ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond ) { -#if HAVE_PTHREADS < 7 - if ( pthread_cond_signal( cond ) < 0 ) return errno; - return 0; -#else return pthread_cond_signal( cond ); -#endif } int ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond ) { -#if HAVE_PTHREADS < 7 - if ( pthread_cond_broadcast( cond ) < 0 ) return errno; - return 0; -#else return pthread_cond_broadcast( cond ); -#endif } int ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, ldap_pvt_thread_mutex_t *mutex ) { -#if HAVE_PTHREADS < 7 - if ( pthread_cond_wait( cond, mutex ) < 0 ) return errno; - return 0; -#else return pthread_cond_wait( cond, mutex ); -#endif } int ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex ) { -#if HAVE_PTHREADS < 7 - if ( pthread_mutex_init( mutex, LDAP_INT_THREAD_MUTEXATTR_DEFAULT )<0) - return errno; - return 0; -#else return pthread_mutex_init( mutex, LDAP_INT_THREAD_MUTEXATTR_DEFAULT ); -#endif } int ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex ) { -#if HAVE_PTHREADS < 7 - if ( pthread_mutex_destroy( mutex ) < 0 ) return errno; - return 0; -#else return pthread_mutex_destroy( mutex ); -#endif } int ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex ) { -#if HAVE_PTHREADS < 7 - if ( pthread_mutex_lock( mutex ) < 0 ) return errno; - return 0; -#else return pthread_mutex_lock( mutex ); -#endif } int ldap_pvt_thread_mutex_trylock( ldap_pvt_thread_mutex_t *mutex ) { -#if HAVE_PTHREADS < 7 - if ( pthread_mutex_trylock( mutex ) < 0 ) return errno; - return 0; -#else return pthread_mutex_trylock( mutex ); -#endif } int ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex ) { -#if HAVE_PTHREADS < 7 - if ( pthread_mutex_unlock( mutex ) < 0 ) return errno; - return 0; -#else return pthread_mutex_unlock( mutex ); -#endif } #ifdef LDAP_THREAD_HAVE_RDWR @@ -315,83 +272,43 @@ ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex ) int ldap_pvt_thread_rdwr_init( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_init( rw, NULL ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_init( rw, NULL ); -#endif } int ldap_pvt_thread_rdwr_destroy( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_destroy( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_destroy( rw ); -#endif } int ldap_pvt_thread_rdwr_rlock( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_rdlock( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_rdlock( rw ); -#endif } int ldap_pvt_thread_rdwr_rtrylock( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_tryrdlock( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_tryrdlock( rw ); -#endif } int ldap_pvt_thread_rdwr_runlock( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_unlock( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_unlock( rw ); -#endif } int ldap_pvt_thread_rdwr_wlock( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_wrlock( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_wrlock( rw ); -#endif } int ldap_pvt_thread_rdwr_wtrylock( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_trywrlock( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_trywrlock( rw ); -#endif } int ldap_pvt_thread_rdwr_wunlock( ldap_pvt_thread_rdwr_t *rw ) { -#if HAVE_PTHREADS < 7 - if ( pthread_rwlock_unlock( rw ) < 0 ) return errno; - return 0; -#else return pthread_rwlock_unlock( rw ); -#endif } #endif /* HAVE_PTHREAD_RDLOCK_DESTROY */ -- 2.39.5