configure.in
changeset 5004 0c72ae7b7cb2
parent 5003 3a95a2b93eb3
child 5029 5d7d48157be7
     1.1 --- a/configure.in	Sat Jan 15 12:41:59 2011 -0800
     1.2 +++ b/configure.in	Sun Jan 16 15:16:39 2011 -0800
     1.3 @@ -181,7 +181,7 @@
     1.4          DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
     1.5      fi
     1.6  fi
     1.7 -    
     1.8 +
     1.9  dnl See whether we are allowed to use the system C library
    1.10  AC_ARG_ENABLE(libc,
    1.11  AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
    1.12 @@ -285,6 +285,32 @@
    1.13      AC_DEFINE(uintptr_t, unsigned long)
    1.14  fi
    1.15  
    1.16 +dnl See whether we can use gcc atomic operations on this architecture
    1.17 +AC_ARG_ENABLE(gcc-atomics,
    1.18 +AC_HELP_STRING([--enable-gcc-atomics],
    1.19 +               [Use gcc builtin atomics [[default=yes]]]),
    1.20 +              , enable_gcc_atomics=yes)
    1.21 +if test x$enable_gcc_atomics = xyes; then
    1.22 +    have_gcc_atomics=no
    1.23 +    AC_MSG_CHECKING(for GCC builtin atomic operations)
    1.24 +    AC_TRY_LINK([
    1.25 +    ],[
    1.26 +    int a;
    1.27 +    void *x, *y, *z;
    1.28 +    __sync_lock_test_and_set(&a, 4);
    1.29 +    __sync_fetch_and_add(&a, 1);
    1.30 +    __sync_bool_compare_and_swap(&a, 5, 10);
    1.31 +    __sync_bool_compare_and_swap(&x, y, z);
    1.32 +    ],[
    1.33 +    have_gcc_atomics=yes
    1.34 +    ])
    1.35 +    AC_MSG_RESULT($have_gcc_atomics)
    1.36 +
    1.37 +    if test x$have_gcc_mmd_mt = xyes; then
    1.38 +        AC_DEFINE(HAVE_GCC_ATOMICS)
    1.39 +    fi
    1.40 +fi
    1.41 +
    1.42  # Standard C sources
    1.43  SOURCES="$SOURCES $srcdir/src/*.c"
    1.44  SOURCES="$SOURCES $srcdir/src/audio/*.c"