diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-11-24 22:39:05 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-11-24 22:39:05 +0300 |
commit | be0add42f53b23d8a5e279cb3041a3fc93e375a0 (patch) | |
tree | 26b4bf4fbbd861b160ce09babbffd07603bb8c11 /configure.in | |
parent | 932a2751a4aaed69b908432b02581a82e9b5a40e (diff) | |
parent | 23159440504311372b2c081c1b5f2cb2f7d98ef3 (diff) | |
download | mariadb-git-be0add42f53b23d8a5e279cb3041a3fc93e375a0.tar.gz |
Auto-merge from mysql-next-mr.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 92 |
1 files changed, 51 insertions, 41 deletions
diff --git a/configure.in b/configure.in index aeebb2c5796..361d117b2dc 100644 --- a/configure.in +++ b/configure.in @@ -1750,64 +1750,74 @@ then fi AC_ARG_WITH([atomic-ops], - AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up], - [Implement atomic operations using pthread rwlocks or atomic CPU - instructions for multi-processor (default) or uniprocessor - configuration]), , [with_atomic_ops=smp]) + AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up], + [Implement atomic operations using pthread rwlocks or atomic CPU + instructions for multi-processor or uniprocessor + configuration. By default gcc built-in sync functions are used, + if available and 'smp' configuration otherwise.])) case "$with_atomic_ops" in "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1], [Assume single-CPU mode, no concurrency]) ;; "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1], [Use pthread rwlocks for atomic ops]) ;; "smp") ;; + "") + ;; *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;; esac AC_CACHE_CHECK([whether the compiler provides atomic builtins], - [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([ - int main() - { - int foo= -10; int bar= 10; - if (!__sync_fetch_and_add(&foo, bar) || foo) - return -1; - bar= __sync_lock_test_and_set(&foo, bar); - if (bar || foo != 10) - return -1; - bar= __sync_val_compare_and_swap(&bar, foo, 15); - if (bar) - return -1; - return 0; - } -], [mysql_cv_gcc_atomic_builtins=yes], + [mysql_cv_gcc_atomic_builtins], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [ + ], + [[ + int foo= -10; int bar= 10; + if (!__sync_fetch_and_add(&foo, bar) || foo) + return -1; + bar= __sync_lock_test_and_set(&foo, bar); + if (bar || foo != 10) + return -1; + bar= __sync_val_compare_and_swap(&bar, foo, 15); + if (bar) + return -1; + return 0; + ]] + )], + [mysql_cv_gcc_atomic_builtins=yes], [mysql_cv_gcc_atomic_builtins=no], - [mysql_cv_gcc_atomic_builtins=no])]) - + [mysql_cv_gcc_atomic_builtins=no] +)]) if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, [Define to 1 if compiler provides atomic builtins.]) fi AC_CACHE_CHECK([whether the OS provides atomic_* functions like Solaris], - [mysql_cv_solaris_atomic], [AC_TRY_RUN([ -#include <atomic.h> -int -main() -{ - int foo = -10; int bar = 10; - if (atomic_add_int_nv((uint_t *)&foo, bar) || foo) - return -1; - bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar); - if (bar || foo != 10) - return -1; - bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15); - if (bar) - return -1; - return 0; -} -], [mysql_cv_solaris_atomic=yes], + [mysql_cv_solaris_atomic], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [ + #include <atomic.h> + ] + [[ + int foo = -10; int bar = 10; + if (atomic_add_int_nv((uint_t *)&foo, bar) || foo) + return -1; + bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar); + if (bar || foo != 10) + return -1; + bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15); + if (bar) + return -1; + return 0; + ]] + )], + [mysql_cv_solaris_atomic=yes], [mysql_cv_solaris_atomic=no], - [mysql_cv_solaris_atomic=no])]) - + [mysql_cv_solaris_atomic=no] +)]) if test "x$mysql_cv_solaris_atomic" = xyes; then AC_DEFINE(HAVE_SOLARIS_ATOMIC, 1, [Define to 1 if OS provides atomic_* functions like Solaris.]) @@ -2102,7 +2112,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ pthread_getsequence_np pthread_key_delete pthread_rwlock_rdlock pthread_sigmask \ readlink realpath rename rint rwlock_init setupterm \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ - sighold sigset sigthreadmask port_create sleep \ + sighold sigset sigthreadmask port_create sleep thr_yield \ snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \ strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \ posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd) |