mostang.com!davidm | 4ea5c42 | 2002-12-03 08:19:58 +0000 | [diff] [blame] | 1 | AC_DEFUN([LIBUNWIND___THREAD], |
| 2 | [dnl Check whether the compiler supports the __thread keyword. |
hp.com!davidm | d75c356 | 2003-09-24 21:51:53 +0000 | [diff] [blame] | 3 | if test "x$enable___thread" != xno; then |
mostang.com!davidm | 4ea5c42 | 2002-12-03 08:19:58 +0000 | [diff] [blame] | 4 | AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread, |
| 5 | [cat > conftest.c <<\EOF |
| 6 | __thread int a = 42; |
| 7 | EOF |
| 8 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then |
| 9 | libc_cv_gcc___thread=yes |
| 10 | else |
| 11 | libc_cv_gcc___thread=no |
| 12 | fi |
| 13 | rm -f conftest*]) |
| 14 | if test "$libc_cv_gcc___thread" = yes; then |
| 15 | AC_DEFINE(HAVE___THREAD, 1, |
| 16 | [Define to 1 if __thread keyword is supported by the C compiler.]) |
| 17 | fi |
| 18 | else |
| 19 | libc_cv_gcc___thread=no |
| 20 | fi]) |
hp.com!davidm | 64fa4c0 | 2003-11-24 21:37:22 +0000 | [diff] [blame] | 21 | |
| 22 | AC_DEFUN([CHECK_ATOMIC_OPS], |
| 23 | [dnl Check whether the system has the atomic_ops package installed. |
| 24 | AC_CHECK_HEADERS(atomic_ops.h) |
hp.com!davidm | 9ef9445 | 2004-11-16 22:03:04 +0000 | [diff] [blame] | 25 | # |
| 26 | # Don't link against libatomic_ops for now. We don't want libunwind |
| 27 | # to depend on libatomic_ops.so. Fortunately, none of the platforms |
| 28 | # we care about so far need libatomic_ops.a (everything is done via |
| 29 | # inline macros). |
| 30 | # |
| 31 | # AC_CHECK_LIB(atomic_ops, main) |
hp.com!davidm | 64fa4c0 | 2003-11-24 21:37:22 +0000 | [diff] [blame] | 32 | ]) |
Christopher Ferris | cc6cc08 | 2013-10-15 17:39:20 -0700 | [diff] [blame] | 33 | |
| 34 | # ANDROID support update. |
| 35 | AC_DEFUN([CHECK_ANDROID], |
| 36 | [dnl Check whether the system has __ANDROID__ defined. |
| 37 | if test "x$enable_conserve_stack" != xno; then |
| 38 | AC_CACHE_CHECK([for __ANDROID__], ac_cv_android, |
| 39 | [cat > conftest.c <<\EOF |
| 40 | #if !defined(__ANDROID__) |
| 41 | value = fail |
| 42 | #endif |
| 43 | EOF |
| 44 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then |
| 45 | ac_cv_android=yes |
| 46 | else |
| 47 | ac_cv_android=no |
| 48 | fi |
| 49 | rm -f conftest*]) |
| 50 | if test "$ac_cv_android" = yes; then |
| 51 | AC_DEFINE([CONSERVE_STACK], [], |
| 52 | [Allocate large structures rather than place them on the stack.]) |
| 53 | fi |
| 54 | else |
| 55 | ac_cv_android=no |
| 56 | fi]) |
| 57 | # End of ANDROID update. |