+[
+ AC_REQUIRE([gl_PTHREAD_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([pthread.h])
+ if test $ac_cv_header_pthread_h = yes; then
+ HAVE_PTHREAD_H=1
+ else
+ HAVE_PTHREAD_H=0
+ fi
+
+ AC_CHECK_TYPES([pthread_t, pthread_spinlock_t], [], [],
+ [AC_INCLUDES_DEFAULT[
+ #if HAVE_PTHREAD_H
+ #include <pthread.h>
+ #endif]])
+ if test $ac_cv_type_pthread_t != yes; then
+ HAVE_PTHREAD_T=0
+ fi
+ if test $ac_cv_type_pthread_spinlock_t != yes; then
+ HAVE_PTHREAD_SPINLOCK_T=0
+ fi
+
+ if test $ac_cv_header_pthread_h != yes ||
+ test $ac_cv_type_pthread_t != yes ||
+ test $ac_cv_type_pthread_spinlock_t != yes; then
+ PTHREAD_H='pthread.h'
+ else
+ PTHREAD_H=
+ fi
+ AC_SUBST([PTHREAD_H])
+ AM_CONDITIONAL([GL_GENERATE_PTHREAD_H], [test -n "$PTHREAD_H"])