diff options
author | unknown <knielsen@knielsen-hq.org> | 2009-11-13 22:26:08 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2009-11-13 22:26:08 +0100 |
commit | 898f6f48b79d1f2c334fb559225b2b0fade5ea93 (patch) | |
tree | 84df8eecd942b650f172cbd67050ee8984c0d52b /storage/xtradb/plug.in | |
parent | 275c0a7f96502b33f763fb9388dcc1c289e4792b (diff) | |
parent | 2bde0c5e6d31583e5197e3b513f572a693161f62 (diff) | |
download | mariadb-git-898f6f48b79d1f2c334fb559225b2b0fade5ea93.tar.gz |
Merge XtraDB 8 into MariaDB.
Diffstat (limited to 'storage/xtradb/plug.in')
-rw-r--r-- | storage/xtradb/plug.in | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in index 35c0ac750b0..ed9555bb512 100644 --- a/storage/xtradb/plug.in +++ b/storage/xtradb/plug.in @@ -40,6 +40,16 @@ MYSQL_PLUGIN_ACTIONS(innobase, [ irix*|osf*|sysv5uw7*|openbsd*) CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; *solaris*|*SunOS*) + # Begin Solaris atomic function checks + AC_CHECK_FUNCS(atomic_cas_ulong atomic_cas_32 \ + atomic_cas_64 atomic_add_long, + AC_DEFINE( + [HAVE_SOLARIS_ATOMICS], + [1], + [Define to 1 if Solaris supports \ + atomic functions.])) + ### End Solaris atomic function checks + CFLAGS="$CFLAGS -DUNIV_SOLARIS";; esac INNODB_DYNAMIC_CFLAGS="-DMYSQL_DYNAMIC_PLUGIN" @@ -57,12 +67,17 @@ MYSQL_PLUGIN_ACTIONS(innobase, [ AC_TRY_RUN( [ #include <pthread.h> + #include <string.h> int main(int argc, char** argv) { pthread_t x1; pthread_t x2; pthread_t x3; + memset(&x1, 0x0, sizeof(x1)); + memset(&x2, 0x0, sizeof(x2)); + memset(&x3, 0x0, sizeof(x3)); + __sync_bool_compare_and_swap(&x1, x2, x3); return(0); @@ -77,6 +92,65 @@ MYSQL_PLUGIN_ACTIONS(innobase, [ AC_MSG_RESULT(no) ] ) + + # Try using solaris atomics on SunOS if GCC atomics are not available + AC_CHECK_DECLS( + [HAVE_ATOMIC_PTHREAD_T], + [ + AC_MSG_NOTICE(no need to check pthread_t size) + ], + [ + AC_CHECK_DECLS( + [HAVE_SOLARIS_ATOMICS], + [ + AC_MSG_CHECKING(checking if pthread_t size is integral) + AC_TRY_RUN( + [ + #include <pthread.h> + int main() + { + pthread_t x = 0; + return(0); + } + ], + [ + AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1], + [pthread_t can be used by solaris atomics]) + AC_MSG_RESULT(yes) + # size of pthread_t is needed for typed solaris atomics + AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>]) + ], + [ + AC_MSG_RESULT(no) + ]) + ]) + ]) + # Check for x86 PAUSE instruction + AC_MSG_CHECKING(for x86 PAUSE instruction) + # We have to actually try running the test program, because of a bug + # in Solaris on x86_64, where it wrongly reports that PAUSE is not + # supported when trying to run an application. See + # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684 + # We use ib_ prefix to avoid collisoins if this code is added to + # mysql's configure.in. + AC_TRY_RUN( + [ + int main() { + __asm__ __volatile__ ("pause"); + return(0); + } + ], + [ + AC_DEFINE([IB_HAVE_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(no) + ] + ) ]) # vim: set ft=config: |