+
+ # Reasons for testing:
+ # pthread_getattr_np - "np" meaning "non portable" says it
+ # all; not present on MacOS X or Solaris 10
+ # pthread_get_stackaddr_np - "np" meaning "non portable" says it
+ # all; specific to MacOS X
+ # pthread_sigmask - not available on mingw
+ #
+ AC_CHECK_FUNCS(pthread_attr_getstack pthread_getattr_np pthread_get_stackaddr_np pthread_sigmask)
+
+ # On past versions of Solaris, believe 8 through 10 at least, you
+ # had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
+ # This is contrary to POSIX:
+ # http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
+ # Check here if this style is required.
+ #
+ # glibc (2.3.6 at least) works both with or without braces, so the
+ # test checks whether it works without.
+ #
+
+ if test "$GCC" = "yes"; then
+ # Since GCC only issues a warning for missing braces, so we need
+ # `-Werror' to catch it.
+ CFLAGS="-Werror -Wmissing-braces $CFLAGS"
+ fi
+
+ AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
+ guile_cv_need_braces_on_pthread_once_init,
+ [AC_COMPILE_IFELSE([#include <pthread.h>
+ pthread_once_t foo = PTHREAD_ONCE_INIT;],
+ [guile_cv_need_braces_on_pthread_once_init=no],
+ [guile_cv_need_braces_on_pthread_once_init=yes])])
+ if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
+ SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
+ fi
+
+ # Same problem with `PTHREAD_MUTEX_INITIALIZER', e.g., on IRIX
+ # 6.5.30m with GCC 3.3.
+ AC_CACHE_CHECK([whether PTHREAD_MUTEX_INITIALIZER needs braces],
+ guile_cv_need_braces_on_pthread_mutex_initializer,
+ [AC_COMPILE_IFELSE([#include <pthread.h>
+ pthread_mutex_t foo = PTHREAD_MUTEX_INITIALIZER;],
+ [guile_cv_need_braces_on_pthread_mutex_initializer=no],
+ [guile_cv_need_braces_on_pthread_mutex_initializer=yes])])
+ if test "$guile_cv_need_braces_on_pthread_mutex_initializer" = yes; then
+ SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER=1
+ fi
+