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-18 12:51:04 +00:00
|
|
|
echo $host_vendor-$host_os
|
|
|
|
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-18 12:51:04 +00:00
|
|
|
*ps3*) dnl qnx has all pthread* functions in the libc.
|
|
|
|
;;
|
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"
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[#include <pthread.h>],
|
|
|
|
[pthread_attr_t type;
|
|
|
|
pthread_attr_setstacksize(&type, 0x100000);],
|
|
|
|
[PTHREAD_LDFLAGS=-pthread],
|
|
|
|
[PTHREAD_LDFLAGS=-lpthread]
|
|
|
|
)
|
|
|
|
;;
|
2010-12-23 02:36:58 +00:00
|
|
|
*) LIBS="$LIBS -lpthread"
|
2010-08-19 06:01:43 +00:00
|
|
|
AC_TRY_LINK(
|
|
|
|
[#include <pthread.h>],
|
|
|
|
[pthread_attr_t type;
|
|
|
|
pthread_attr_setstacksize(&type, 0x100000);],
|
|
|
|
[PTHREAD_LDFLAGS=-lpthread],
|
|
|
|
[PTHREAD_LDFLAGS=-pthread]
|
|
|
|
)
|
|
|
|
;;
|
|
|
|
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
|
|
|
|
AC_SUBST(PTHREAD_LDFLAGS)
|
|
|
|
AC_SUBST(PTHREAD_CFLAGS)
|