acinclude.m4 592 B

123456789101112131415
  1. dnl This test is taken from libgfortran
  2. dnl Check whether the target supports __sync_*_compare_and_swap.
  3. AC_DEFUN([STARPU_CHECK_SYNC_BUILTINS], [
  4. AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
  5. ac_cv_have_sync_builtins, [
  6. AC_LINK_IFELSE([AC_LANG_PROGRAM([int foo, bar;],
  7. [bar = __sync_val_compare_and_swap(&foo, 0, 1);])],
  8. [ac_cv_have_sync_builtins=yes],
  9. [ac_cv_have_sync_builtins=no])])
  10. if test $ac_cv_have_sync_builtins = yes; then
  11. AC_DEFINE(HAVE_SYNC_BUILTINS, 1,
  12. [Define to 1 if the target supports __sync_*_compare_and_swap])
  13. fi])