- if test $ol_link_threads = no ; then
- dnl try -mt
- AC_CACHE_CHECK([for pthread_create with -mt],
- [ol_cv_thread_flag], [
- dnl save the flags
- save_LIBS="$LIBS"
- LIBS="-mt $LIBS"
- AC_TRY_LINK([char pthread_create();],
- [pthread_create();],
- [ol_cv_thread_flag=yes], [ol_cv_thread_flag=no])
- dnl restore the LIBS
- LIBS="$save_LIBS"
- ])
-
- if test $ol_cv_thread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -mt"
- ol_link_threads=posix
- fi
- fi
-
- if test $ol_link_threads = no ; then
- dnl try -kthread
- AC_CACHE_CHECK([for pthread_create with -kthread],
- [ol_cv_kthread_flag], [
- dnl save the flags
- save_LIBS="$LIBS"
- LIBS="-kthread $LIBS"
- AC_TRY_LINK([#include <pthread.h>],[
-#if HAVE_PTHREADS_D4
- pthread_create(NULL,pthread_attr_default,NULL,NULL);
-#else
- pthread_t t;
- pthread_create(&t,NULL,NULL,NULL);
- pthread_detach(t);
-#endif
-],
- [ol_cv_kthread_flag=yes], [ol_cv_kthread_flag=no])
- dnl restore the LIBS
- LIBS="$save_LIBS"
- ])
-
- if test $ol_cv_kthread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
- ol_link_threads=posix
- fi
- fi
-
- if test $ol_link_threads = no ; then
- dnl try -pthread
- AC_CACHE_CHECK([for pthread_create with -pthread],
- [ol_cv_pthread_flag], [
- dnl save the flags
- save_LIBS="$LIBS"
- LIBS="-pthread $LIBS"
- AC_TRY_LINK([#include <pthread.h>],[
-#if HAVE_PTHREADS_D4
- pthread_create(NULL,pthread_attr_default,NULL,NULL);
-#else
- pthread_create(NULL,NULL,NULL,NULL);
-#endif
-],
- [ol_cv_pthread_flag=yes], [ol_cv_pthread_flag=no])
- dnl restore the LIBS
- LIBS="$save_LIBS"
- ])
-
- if test $ol_cv_pthread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
- ol_link_threads=posix
- fi
- fi
-
- if test $ol_link_threads = no ; then
- dnl try -pthreads
- AC_CACHE_CHECK([for pthread_create with -pthreads],
- [ol_cv_pthreads_flag], [
- dnl save the flags
- save_LIBS="$LIBS"
- LIBS="-pthreads $LIBS"
- AC_TRY_LINK([#include <pthread.h>],[
-#if HAVE_PTHREADS_D4
- pthread_create(NULL,pthread_attr_default,NULL,NULL);
-#else
- pthread_create(NULL,NULL,NULL,NULL);
-#endif
-],
- [ol_cv_pthreads_flag=yes], [ol_cv_pthreads_flag=no])
- dnl restore the LIBS
- LIBS="$save_LIBS"
- ])
-
- if test $ol_cv_pthreads_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
- ol_link_threads=posix
- fi
- fi
-
- if test $ol_link_threads = no ; then
- dnl try -thread
- AC_CACHE_CHECK([for pthread_create with -thread],
- [ol_cv_thread_flag], [
- dnl save the flags
- save_LIBS="$LIBS"
- LIBS="-thread $LIBS"
- AC_TRY_LINK([char pthread_create();],
- [pthread_create();],
- [ol_cv_thread_flag=yes], [ol_cv_thread_flag=no])
- dnl restore the LIBS
- LIBS="$save_LIBS"
- ])