14
14
# Place, Suite 330, Boston, MA 02111-1307 USA
17
AC_DEFUN([AC_INNODB_ACTIONS],[
18
AC_REQUIRE([AC_PROG_LEX])
19
AC_REQUIRE([AC_FUNC_MMAP])
21
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
22
AC_SUBST(innodb_system_libs)
23
AC_CHECK_HEADERS(aio.h sched.h)
17
MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
18
[Transactional Tables using InnoDB], [max,max-no-ndb])
19
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
20
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
21
MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
22
MYSQL_PLUGIN_ACTIONS(innobase, [
23
AC_CHECK_HEADERS(sched.h)
24
24
AC_CHECK_SIZEOF(int, 4)
25
25
AC_CHECK_SIZEOF(long, 4)
26
26
AC_CHECK_SIZEOF(void*, 4)
27
27
AC_CHECK_FUNCS(sched_yield fdatasync localtime_r)
28
AC_CHECK_FUNCS([uname munmap memchr getpagesize bzero])
30
29
case "$target_os" in
32
AM_CFLAGS="$AM_CFLAGS -DUNIV_LINUX";;
34
AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
36
AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
38
AM_CFLAGS="$AM_CFLAGS -DUNIV_AIX";;
39
irix*|osf*|sysv5uw7*|openbsd*)
40
AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE";;
42
AM_CFLAGS="$AM_CFLAGS -DUNIV_SOLARIS";;
31
CFLAGS="$CFLAGS -DUNIV_LINUX";;
33
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
35
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
37
CFLAGS="$CFLAGS -DUNIV_AIX";;
38
irix*|osf*|sysv5uw7*|openbsd*)
39
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
41
# Begin Solaris atomic function checks
42
AC_CHECK_FUNCS(atomic_cas_ulong atomic_cas_32 \
43
atomic_cas_64 atomic_add_long,
45
[HAVE_SOLARIS_ATOMICS],
47
[Define to 1 if Solaris supports \
49
### End Solaris atomic function checks
51
CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
44
53
INNODB_DYNAMIC_CFLAGS="-DPANDORA_DYNAMIC_PLUGIN"
45
54
case "$target_cpu" in
58
67
#include <pthread.h>
60
70
int main(int argc, char** argv) {
75
memset(&x1, 0x0, sizeof(x1));
76
memset(&x2, 0x0, sizeof(x2));
77
memset(&x3, 0x0, sizeof(x3));
65
79
__sync_bool_compare_and_swap(&x1, x2, x3);
94
# Try using solaris atomics on SunOS if GCC atomics are not available
96
[HAVE_ATOMIC_PTHREAD_T],
98
AC_MSG_NOTICE(no need to check pthread_t size)
102
[HAVE_SOLARIS_ATOMICS],
104
AC_MSG_CHECKING(checking if pthread_t size is integral)
115
AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
116
[pthread_t can be used by solaris atomics])
118
# size of pthread_t is needed for typed solaris atomics
119
AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>])
126
# Check for x86 PAUSE instruction
127
AC_MSG_CHECKING(for x86 PAUSE instruction)
128
# We have to actually try running the test program, because of a bug
129
# in Solaris on x86_64, where it wrongly reports that PAUSE is not
130
# supported when trying to run an application. See
131
# http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
132
# We use ib_ prefix to avoid collisoins if this code is added to
133
# mysql's configure.in.
137
__asm__ __volatile__ ("pause");
142
AC_DEFINE([IB_HAVE_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
80
153
dnl Must be done once we turn on warnings and such
82
155
[whether __attribute__ visibility "hidden" is supported],