+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:7420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_kthread=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_kthread=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7432 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:7493: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_kthread=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
+
+ if test $ol_cv_pthread_kthread = yes ; then
+ ol_link_pthreads="-kthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthread (ol_cv_pthread_pthread)
+if test "$ol_link_threads" = no ; then
+ # try -pthread
+ echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
+echo "configure:7523: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthread $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 7534 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:7590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_pthread=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_pthread=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7602 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:7663: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_pthread=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
+
+ if test $ol_cv_pthread_pthread = yes ; then
+ ol_link_pthreads="-pthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
+if test "$ol_link_threads" = no ; then
+ # try -pthreads
+ echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
+echo "configure:7693: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 7704 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:7760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_pthreads=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_pthreads=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7772 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:7833: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_pthreads=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
+
+ if test $ol_cv_pthread_pthreads = yes ; then
+ ol_link_pthreads="-pthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
+if test "$ol_link_threads" = no ; then
+ # try -mthreads
+ echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
+echo "configure:7863: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-mthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 7874 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:7930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_mthreads=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_mthreads=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7942 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:8003: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_mthreads=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
+
+ if test $ol_cv_pthread_mthreads = yes ; then
+ ol_link_pthreads="-mthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -thread (ol_cv_pthread_thread)
+if test "$ol_link_threads" = no ; then
+ # try -thread
+ echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
+echo "configure:8033: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8044 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:8100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_thread=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_thread=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8112 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:8173: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_thread=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_thread" 1>&6
+
+ if test $ol_cv_pthread_thread = yes ; then
+ ol_link_pthreads="-thread"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
+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:8204: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8215 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:8271: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8283 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:8344: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
+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:8374: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8385 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:8441: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8453 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:8514: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
+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:8545: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -Wl,-woff,85 $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8556 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:8612: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8624 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:8685: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
+
+ if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
+ ol_link_pthreads="-lpthread -Wl,-woff,85"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread
+ echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
+echo "configure:8716: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8727 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:8783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_lpthread=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_lpthread=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8795 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:8856: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_lpthread=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
+
+ if test $ol_cv_pthread_lpthread = yes ; then
+ ol_link_pthreads="-lpthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
+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:8886: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8897 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:8953: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_lc_r=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8965 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:9026: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_lc_r=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
+
+ if test $ol_cv_pthread_lc_r = yes ; then
+ ol_link_pthreads="-lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -threads (ol_cv_pthread_threads)
+if test "$ol_link_threads" = no ; then
+ # try -threads
+ echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
+echo "configure:9057: 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
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-threads $LIBS"
+
+ if test "$cross_compiling" = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 9068 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main() {
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+; return 0; }
+EOF
+if { (eval echo configure:9124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_pthread_threads=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_pthread_threads=no
+fi
+rm -f conftest*
+else
+ cat > conftest.$ac_ext <<EOF
+#line 9136 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+ pthread_t t;
+ int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
+#if HAVE_PTHREADS_D4
+#define ATTR pthread_attr_default
+#else
+#define ATTR NULL
+#endif
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
+ if( status ) exit( status );
+
+ /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+ status = pthread_detach( &t );
+#else
+ status = pthread_detach( t );
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ exit( status );
+
+}
+
+EOF
+if { (eval echo configure:9197: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_threads=no
+fi
+rm -fr conftest*
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_threads" 1>&6
+
+ if test $ol_cv_pthread_threads = yes ; then
+ ol_link_pthreads="-threads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+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:9228: 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