2010-08-19 06:01:43 +00:00
|
|
|
if test "x$ac_cv_header_pthread_h" = "xyes"; then
|
2010-12-23 02:36:58 +00:00
|
|
|
save_LIBS="$LIBS"
|
2012-08-19 04:40:42 +00:00
|
|
|
HAVE_PTHREAD=yes
|
2012-08-18 12:51:04 +00:00
|
|
|
case "$host_vendor-$host_os" in
|
2012-02-05 05:29:00 +00:00
|
|
|
*android*) dnl android has all pthread* functions in the libc.
|
|
|
|
;;
|
2012-08-19 04:40:42 +00:00
|
|
|
*ps3*) dnl ps3toolchain doesn't have a working pthread yet
|
|
|
|
HAVE_PTHREAD=no
|
2012-08-18 12:51:04 +00:00
|
|
|
;;
|
2012-02-05 05:29:00 +00:00
|
|
|
*qnx*) dnl qnx has all pthread* functions in the libc.
|
2010-08-19 06:01:43 +00:00
|
|
|
;;
|
2011-06-04 15:08:56 +00:00
|
|
|
*openbsd*)
|
|
|
|
LIBS="$LIBS -pthread"
|
2021-11-20 03:13:46 +00:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_attr_t type;
|
|
|
|
pthread_attr_setstacksize(&type, 0x100000);]])],[PTHREAD_LDFLAGS=-pthread],[PTHREAD_LDFLAGS=-lpthread
|
|
|
|
])
|
2011-06-04 15:08:56 +00:00
|
|
|
;;
|
2010-12-23 02:36:58 +00:00
|
|
|
*) LIBS="$LIBS -lpthread"
|
2021-11-20 03:13:46 +00:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_attr_t type;
|
|
|
|
pthread_attr_setstacksize(&type, 0x100000);]])],[PTHREAD_LDFLAGS=-lpthread],[PTHREAD_LDFLAGS=-pthread
|
|
|
|
])
|
2010-08-19 06:01:43 +00:00
|
|
|
;;
|
|
|
|
esac
|
2010-12-23 02:36:58 +00:00
|
|
|
LIBS="$save_LIBS"
|
2010-08-19 06:01:43 +00:00
|
|
|
PTHREAD_CFLAGS=-D_REENTRANT
|
|
|
|
fi
|
2012-08-19 04:40:42 +00:00
|
|
|
if test "x$HAVE_PTHREAD" = "xyes"; then
|
|
|
|
AC_DEFINE(HAVE_PTHREAD, 1, [Define if you have working pthread])
|
|
|
|
fi
|
2010-08-19 06:01:43 +00:00
|
|
|
AC_SUBST(PTHREAD_LDFLAGS)
|
|
|
|
AC_SUBST(PTHREAD_CFLAGS)
|