2.9
[glibc/nacl-glibc.git] / nptl / sysdeps / pthread / configure.in
blob17f18f0fbf8863e78b2b044ad5ff5eff68632f18
1 dnl configure fragment for new libpthread implementation.
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
4 if test "x$libc_cv_gcc___thread" != xyes; then
5   AC_MSG_ERROR(compiler support for __thread is required)
6 fi
8 if test "x${libc_cv_visibility_attribute}" != xyes ||
9    test "x${libc_cv_broken_visibility_attribute}" != xno; then
10   AC_MSG_ERROR(working compiler support for visibility attribute is required)
13 if test "x$libc_cv_asm_cfi_directives" != xyes; then
14   dnl We need this only for some architectures.
15   case "$base_machine" in
16     i386 | x86_64 | powerpc | s390)
17       AC_MSG_ERROR(CFI directive support in assembler is required) ;;
18     *) ;;
19   esac
22 dnl Iff <unwind.h> is available, make sure it is the right one and it
23 dnl contains struct _Unwind_Exception.
24 AC_CACHE_CHECK(dnl
25 for forced unwind support, libc_cv_forced_unwind, [dnl
26 AC_TRY_LINK([#include <unwind.h>], [
27 struct _Unwind_Exception exc;
28 struct _Unwind_Context *context;
29 _Unwind_GetCFA (context)],
30 libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
31 if test $libc_cv_forced_unwind = yes; then
32   AC_DEFINE(HAVE_FORCED_UNWIND)
33 dnl Check for C cleanup handling.
34   old_CFLAGS="$CFLAGS"
35   CFLAGS="$CFLAGS -Werror -fexceptions"
36   AC_CACHE_CHECK([for C cleanup handling], libc_cv_c_cleanup, [dnl
37   AC_TRY_LINK([
38 #include <stdio.h>
39 void cl (void *a) { }], [
40   int a __attribute__ ((cleanup (cl)));
41   puts ("test")],
42 libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
43   CFLAGS="$old_CFLAGS"
44   if test $libc_cv_c_cleanup = no; then
45     AC_MSG_ERROR([the compiler must support C cleanup handling])
46   fi
47 else
48   AC_MSG_ERROR(forced unwind support is required)