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"
|
2010-08-19 06:01:43 +00:00
|
|
|
case "$host_os" in
|
|
|
|
*qnx*) dnl qnx have all pthread* functions in the libc.
|
|
|
|
;;
|
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)
|