diff options
author | WeiY <wei.a.yang@gmail.com> | 2013-07-15 23:31:13 +0800 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-17 13:07:33 +0200 |
commit | 2e7f57986576cf19b20f0fa8a9e8edd810215c73 (patch) | |
tree | a9090f44c914871b4c9a6958ec7df51e4adad46d /cpukit/aclocal | |
parent | 5186b55180b5404ecd1ad1ed70e73fb70ed15f27 (diff) |
stdatomic.h support check when configure
Diffstat (limited to 'cpukit/aclocal')
-rw-r--r-- | cpukit/aclocal/check-atomic.m4 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cpukit/aclocal/check-atomic.m4 b/cpukit/aclocal/check-atomic.m4 index 97943eb768..00149f8a12 100644 --- a/cpukit/aclocal/check-atomic.m4 +++ b/cpukit/aclocal/check-atomic.m4 @@ -5,9 +5,13 @@ AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl AC_CACHE_CHECK([whether CPU supports atomic operations], [rtems_cv_ATOMIC],[ - AS_IF( - [test -f "${srcdir}/score/cpu/$RTEMS_CPU/rtems/score/cpuatomic.h"], - [rtems_cv_ATOMIC="yes"], - [rtems_cv_ATOMIC="no"]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include <stdatomic.h>]], + [[atomic_uint_fast32_t t; atomic_init(&t, 0); + atomic_store( &t, 1 ); + atomic_exchange( &t, 2 ); + atomic_fetch_add( &t, 3 );]])], + [rtems_cv_ATOMIC="yes"], + [rtems_cv_ATOMIC="no"]) ]) ]) |