Commit | Line | Data |
---|---|---|
e85f4437 A |
1 | AC_DEFUN([DISPATCH_C_ATOMIC_BUILTINS], [ |
2 | # | |
3 | # This is a bit subtle: on i386 systems without at least -march=i486 defined, | |
4 | # certain built-in atomics fall back to depending on undefined symbols if | |
5 | # their return values are used. | |
6 | # | |
7 | AC_CACHE_CHECK([for gcc atomic builtins],[dispatch_cv_atomic], | |
8 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[ | |
9 | int i, x =0; | |
10 | i = __sync_add_and_fetch(&x,1); | |
11 | return x;]])],[dispatch_cv_atomic=yes], | |
12 | [saveCFLAGS="$CFLAGS" | |
13 | CFLAGS="$CFLAGS -march=i486" | |
14 | AC_LINK_IFELSE([AC_LANG_PROGRAM([],[[ | |
15 | int i, x =0; | |
16 | i = __sync_add_and_fetch(&x,1); | |
17 | return x;]])],[CFLAGS="$saveCFLAGS" | |
18 | dispatch_cv_atomic="-march=i486" | |
19 | ])])]) | |
20 | ||
21 | ]) |