summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2006-05-31 18:44:09 +0200
committerunknown <serg@serg.mylan>2006-05-31 18:44:09 +0200
commit8b4581778036c95072438630884ad810b512815a (patch)
tree363277285d9756e50642fa9f691b934925d856f0 /configure.in
parenteb67ecef898433461ac9251541188fd9e1e945d4 (diff)
downloadmariadb-git-8b4581778036c95072438630884ad810b512815a.tar.gz
WL#2595 - atomic operations
BitKeeper/etc/ignore: Added mysys/test_atomic to the ignore list
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in56
1 files changed, 14 insertions, 42 deletions
diff --git a/configure.in b/configure.in
index 0f0649fd3bc..1e332e390e1 100644
--- a/configure.in
+++ b/configure.in
@@ -778,48 +778,6 @@ struct request_info *req;
AC_SUBST(WRAPLIBS)
if test "$TARGET_LINUX" = "true"; then
- AC_MSG_CHECKING([for atomic operations])
-
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- atom_ops=
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_add(5, &v);
- return atomic_read(&v) == 28 ? 0 : -1;
-}
- ],
- [AC_DEFINE([HAVE_ATOMIC_ADD], [1],
- [atomic_add() from <asm/atomic.h> (Linux only)])
- atom_ops="${atom_ops}atomic_add "],
- )
- AC_TRY_RUN([
-#include <asm/atomic.h>
-int main()
-{
- atomic_t v;
-
- atomic_set(&v, 23);
- atomic_sub(5, &v);
- return atomic_read(&v) == 18 ? 0 : -1;
-}
- ],
- [AC_DEFINE([HAVE_ATOMIC_SUB], [1],
- [atomic_sub() from <asm/atomic.h> (Linux only)])
- atom_ops="${atom_ops}atomic_sub "],
- )
-
- if test -z "$atom_ops"; then atom_ops="no"; fi
- AC_MSG_RESULT($atom_ops)
-
- AC_LANG_RESTORE
-
AC_ARG_WITH(pstack,
[ --with-pstack Use the pstack backtrace library],
[ USE_PSTACK=$withval ],
@@ -1631,6 +1589,20 @@ then
fi
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])
+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
+
# Force static compilation to avoid linking problems/get more speed
AC_ARG_WITH(mysqld-ldflags,
[ --with-mysqld-ldflags Extra linking arguments for mysqld],