2
# Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
4
# This program is free software; you can redistribute it and/or modify it under
5
# the terms of the GNU General Public License as published by the Free Software
6
# Foundation; version 2 of the License.
8
# This program is distributed in the hope that it will be useful, but WITHOUT
9
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
# You should have received a copy of the GNU General Public License along with
13
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
14
# Place, Suite 330, Boston, MA 02111-1307 USA
17
MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
1
DRIZZLE_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
18
2
[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)
3
DRIZZLE_PLUGIN_DIRECTORY(innobase, [storage/innobase])
4
DRIZZLE_PLUGIN_STATIC(innobase, [libinnobase.la])
5
DRIZZLE_PLUGIN_DYNAMIC(innobase, [libinnobase.la])
6
DRIZZLE_PLUGIN_MANDATORY(innobase) dnl Default
7
DRIZZLE_PLUGIN_ACTIONS(innobase, [
10
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
11
AC_SUBST(innodb_system_libs)
12
AC_CHECK_HEADERS(aio.h sched.h)
24
13
AC_CHECK_SIZEOF(int, 4)
25
14
AC_CHECK_SIZEOF(long, 4)
26
15
AC_CHECK_SIZEOF(void*, 4)
27
AC_CHECK_FUNCS(sched_yield fdatasync localtime_r)
16
AC_CHECK_FUNCS(sched_yield)
17
AC_CHECK_FUNCS(fdatasync)
18
AC_CHECK_FUNCS(localtime_r)
19
AC_CHECK_FUNCS([uname munmap memchr getpagesize bzero])
29
21
case "$target_os" in
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";;
53
INNODB_DYNAMIC_CFLAGS="-DPANDORA_DYNAMIC_PLUGIN"
56
# The AMD64 ABI forbids absolute addresses in shared libraries
59
# Use absolute addresses on IA-32
60
INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
63
AC_SUBST(INNODB_DYNAMIC_CFLAGS)
64
AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
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));
79
__sync_bool_compare_and_swap(&x1, x2, x3);
85
AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
86
[pthread_t can be used by GCC atomic builtins])
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])
153
dnl Must be done once we turn on warnings and such
155
[whether __attribute__ visibility "hidden" is supported],
156
[ac_cv_can_use_hidden_],[
158
save_CXXFLAGS="${CXXFLAGS}"
159
CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
163
__attribute__((visibility ("hidden")))
167
[ac_cv_can_use_hidden_=yes],
168
[ac_cv_can_use_hidden_=no])
169
CXXFLAGS="${save_CXXFLAGS}"
171
AS_IF([test "$ac_cv_can_use_hidden_" = "yes"],[
172
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
173
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
23
CFLAGS="$CFLAGS -DUNIV_LINUX";;
25
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
27
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
29
CFLAGS="$CFLAGS -DUNIV_AIX";;
31
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
33
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
35
CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
37
# Problem when linking on SCO
38
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
40
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
178
# vim: set ft=config: