summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-11-25 01:50:10 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-11-25 01:50:10 +0100
commit9ce3dae667a61491807a2b11c1df26e32bd8e026 (patch)
tree3e8610a140fd90a32965b4a7851c798a353fa14f /configure.in
parent7377c50cb4f5b5dcb356a71787b53840d2c6ef3c (diff)
parent23159440504311372b2c081c1b5f2cb2f7d98ef3 (diff)
downloadmariadb-git-9ce3dae667a61491807a2b11c1df26e32bd8e026.tar.gz
merge
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in92
1 files changed, 51 insertions, 41 deletions
diff --git a/configure.in b/configure.in
index daa17bda0cf..db64c373a68 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.])
@@ -2104,7 +2114,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
pthread_setprio_np pthread_setschedparam 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)