diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2012-08-27 10:29:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-27 13:33:43 +0200 |
commit | 0983231c8382234cc08124d1ce9a3e200dd0da0e (patch) | |
tree | 4f98ce2b5eac09682097ec3771e59def99863ed8 /configure.in | |
parent | Modified the wording of the Save-on-Exit-Dialog (diff) | |
download | core-0983231c8382234cc08124d1ce9a3e200dd0da0e.tar.gz core-0983231c8382234cc08124d1ce9a3e200dd0da0e.zip |
fdo#53855: Detect GCC built-in atomic functions
Change-Id: I57a977d799df6bce6c854b38b441a0575218922b
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 1a23dff93565..b72029a1d3dc 100644 --- a/configure.in +++ b/configure.in @@ -5076,7 +5076,25 @@ if test "$GCC" = "yes"; then AC_MSG_RESULT([no]) fi - AC_MSG_CHECKING([whether $CC supports -std=gnu++0x without Language Defect 757]) + AC_MSG_CHECKING([whether $CC supports atomic functions]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ + int v = 0; + if (__sync_add_and_fetch(&v, 1) != 1 || + __sync_sub_and_fetch(&v, 1) != 0) + return 1; + __sync_synchronize(); + if (__sync_val_compare_and_swap(&v, 0, 1) != 0 || + v != 1) + return 1; + return 0; +]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[]) + if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([whether $CXX supports -std=gnu++0x without Language Defect 757]) save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS -std=gnu++0x" AC_LANG_PUSH([C++]) @@ -5122,6 +5140,7 @@ fi AC_SUBST(HAVE_CXX0X) AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE) AC_SUBST(HAVE_GCC_AVX) +AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC) dnl =================================================================== dnl system stl sanity tests |