Commit 859b1ae4 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Detect pthread_detach using #include <pthread.h> (using AC_TRY_LINK)

instead of AC_CHECK_FUNCS() as symbol may be mangled.
parent 162f373c
This diff is collapsed.
......@@ -792,12 +792,26 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
fi
dnl Check functions for compatibility
AC_CHECK_FUNCS(pthread_kill pthread_detach)
AC_CHECK_FUNCS(pthread_kill)
if test $ac_cv_func_pthread_detach = no ; then
dnl Check for pthread_detach with <pthread.h> inclusion
dnl as it's symbol may have been mangled.
AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
[ol_cv_func_pthread_detach], [
dnl save the flags
AC_TRY_LINK([#include <pthread.h>],
[pthread_detach(NULL);],
[ol_cv_func_pthread_detach=yes],
[ol_cv_func_pthread_detach=no])
])
if test $ol_cv_func_pthread_detach = no ; then
AC_MSG_ERROR([could not locate pthread_detach()])
fi
AC_DEFINE(HAVE_PTHREAD_DETACH,1,
[define if you have pthread_detach function])
dnl Check for setconcurreny functions
AC_CHECK_FUNCS( \
pthread_setconcurrency \
......
......@@ -267,9 +267,6 @@
/* Define if you have the mkstemp function. */
#undef HAVE_MKSTEMP
/* Define if you have the pthread_detach function. */
#undef HAVE_PTHREAD_DETACH
/* Define if you have the pthread_getconcurrency function. */
#undef HAVE_PTHREAD_GETCONCURRENCY
......@@ -591,6 +588,9 @@
/* define if you have POSIX Threads */
#undef HAVE_PTHREADS
/* define if you have pthread_detach function */
#undef HAVE_PTHREAD_DETACH
/* define if you have Mach Cthreads */
#undef HAVE_MACH_CTHREADS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment