OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [config/] [tls.m4] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
dnl Check whether the target supports TLS.
2
AC_DEFUN([GCC_CHECK_TLS], [
3
  GCC_ENABLE(tls, yes, [Use thread-local storage])
4
  AC_CACHE_CHECK([whether the target supports thread-local storage],
5
                 have_tls, [
6
    AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
7
      [dnl If the test case passed with dynamic linking, try again with
8
      dnl static linking.  This fails at least with some older Red Hat
9
      dnl releases.
10
      save_LDFLAGS="$LDFLAGS"
11
      LDFLAGS="-static $LDFLAGS"
12
      AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
13
                    [have_tls=yes], [have_tls=no], [])
14
      LDFLAGS="$save_LDFLAGS"],
15
      [have_tls=no],
16
      [AC_COMPILE_IFELSE([__thread int foo;], [have_tls=yes], [have_tls=no])]
17
    )])
18
  if test "$enable_tls $have_tls" = "yes yes"; then
19
    AC_DEFINE(HAVE_TLS, 1,
20
              [Define to 1 if the target supports thread-local storage.])
21
  fi])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.