1 dnl configure fragment for new libpthread implementation.
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
4 dnl Iff <unwind.h> is available, make sure it is the right one and it
5 dnl contains struct _Unwind_Exception.
7 for forced unwind support, libc_cv_forced_unwind, [dnl
8 old_CPPFLAGS="$CPPFLAGS"
9 # Without inhibit_libc #define'd, GCC's unwind.h (at least for ia64)
10 # will try to include <stdlib.h>, which doesn't exist yet if we're
11 # building libc in a bare environment.
12 CPPFLAGS="$CPPFLAGS -Dinhibit_libc=1"
13 AC_TRY_COMPILE([#include <unwind.h>], [
14 struct _Unwind_Exception exc;
15 struct _Unwind_Context *context;
16 _Unwind_GetCFA (context)],
17 libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)
18 CPPFLAGS="$old_CPPFLAGS"])
19 if test $libc_cv_forced_unwind = yes; then
20 AC_DEFINE(HAVE_FORCED_UNWIND)
21 dnl Check for C cleanup handling.
23 CFLAGS="$CFLAGS -Werror -fexceptions"
24 AC_CACHE_CHECK([for C cleanup handling], libc_cv_c_cleanup, [dnl
26 extern void some_function (void);
27 void cl (void *a) { }], [
28 int a __attribute__ ((cleanup (cl)));
30 libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
32 if test $libc_cv_c_cleanup = no; then
33 AC_MSG_ERROR([the compiler must support C cleanup handling])
36 AC_MSG_ERROR(forced unwind support is required)