~drizzle-trunk/drizzle/development

641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
1
#
2
# Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
3
# 
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.
7
# 
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.
11
# 
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
15
#
16
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
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,  [
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
23
  AC_CHECK_HEADERS(sched.h)
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
24
  AC_CHECK_SIZEOF(int, 4)
25
  AC_CHECK_SIZEOF(long, 4)
26
  AC_CHECK_SIZEOF(void*, 4)
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
27
  AC_CHECK_FUNCS(sched_yield fdatasync localtime_r)
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
28
  AC_C_BIGENDIAN
29
  case "$target_os" in
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
30
	lin*)
31
		CFLAGS="$CFLAGS -DUNIV_LINUX";;
32
	hpux10*)
33
		CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
34
	hp*)
35
		CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
36
	aix*)
37
		CFLAGS="$CFLAGS -DUNIV_AIX";;
38
	irix*|osf*|sysv5uw7*|openbsd*)
39
		CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
40
	*solaris*|*SunOS*)
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
41
		# Begin Solaris atomic function checks
42
		AC_CHECK_FUNCS(atomic_cas_ulong atomic_cas_32 \
43
			       atomic_cas_64 atomic_add_long,
44
			AC_DEFINE(
45
				[HAVE_SOLARIS_ATOMICS],
46
				[1],
47
				[Define to 1 if Solaris supports \
48
				 atomic functions.]))
49
		### End Solaris atomic function checks
50
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
51
		CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
52
  esac
1093.9.13 by Monty Taylor
pandora-build v0.42 - Started splitting out plugin system into pandora-build
53
  INNODB_DYNAMIC_CFLAGS="-DPANDORA_DYNAMIC_PLUGIN"
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
54
  case "$target_cpu" in
55
	x86_64)
56
		# The AMD64 ABI forbids absolute addresses in shared libraries
57
		;;
58
	*86)
59
		# Use absolute addresses on IA-32
60
		INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
61
		;;
62
  esac
63
  AC_SUBST(INNODB_DYNAMIC_CFLAGS)
64
  AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
65
  AC_TRY_RUN(
66
    [
67
      #include <pthread.h>
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
68
      #include <string.h>
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
69
70
      int main(int argc, char** argv) {
71
        pthread_t       x1;
72
        pthread_t       x2;
73
        pthread_t       x3;
74
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
75
	memset(&x1, 0x0, sizeof(x1));
76
	memset(&x2, 0x0, sizeof(x2));
77
	memset(&x3, 0x0, sizeof(x3));
78
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
79
        __sync_bool_compare_and_swap(&x1, x2, x3);
80
81
        return(0);
82
      }
83
    ],
84
    [
85
      AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
86
                [pthread_t can be used by GCC atomic builtins])
87
      AC_MSG_RESULT(yes)
88
    ],
89
    [
90
      AC_MSG_RESULT(no)
91
    ]
92
    )
1093.9.12 by Monty Taylor
Moved InnoDB specific code to InnoDB.
93
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
94
  # Try using solaris atomics on SunOS if GCC atomics are not available
95
  AC_CHECK_DECLS(
96
    [HAVE_ATOMIC_PTHREAD_T],
97
    [
98
      AC_MSG_NOTICE(no need to check pthread_t size)
99
    ],
100
    [
101
      AC_CHECK_DECLS(
102
        [HAVE_SOLARIS_ATOMICS],
103
        [
104
          AC_MSG_CHECKING(checking if pthread_t size is integral)
105
          AC_TRY_RUN(
106
            [
107
              #include <pthread.h>
108
              int main()
109
              {
110
                pthread_t x = 0;
111
                return(0);
112
              }
113
            ],
114
            [
115
              AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
116
                [pthread_t can be used by solaris atomics])
117
              AC_MSG_RESULT(yes)
118
              # size of pthread_t is needed for typed solaris atomics
119
              AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>])
120
            ],
121
            [
122
              AC_MSG_RESULT(no)
123
            ])
124
        ])
125
    ])
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.
134
  AC_TRY_RUN(
135
    [
136
      int main() {
137
        __asm__ __volatile__ ("pause");
138
        return(0);
139
      }
140
    ],
141
    [
142
      AC_DEFINE([IB_HAVE_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
143
      AC_MSG_RESULT(yes)
144
    ],
145
    [
146
      AC_MSG_RESULT(no)
147
    ],
148
    [
149
      AC_MSG_RESULT(no)
150
    ]
151
  )
1114.1.5 by Monty Taylor
Merged up with trunk.
152
1093.9.12 by Monty Taylor
Moved InnoDB specific code to InnoDB.
153
dnl Must be done once we turn on warnings and such
154
AC_CACHE_CHECK(
155
  [whether __attribute__ visibility "hidden" is supported],
156
  [ac_cv_can_use_hidden_],[
157
    AC_LANG_PUSH(C++)
158
    save_CXXFLAGS="${CXXFLAGS}"
159
    CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
160
    AC_LINK_IFELSE([
161
      AC_LANG_PROGRAM(
162
        [[
163
__attribute__((visibility ("hidden")))
164
void testme() {  }
165
        ]],[[testme()]]
166
      )],  
167
      [ac_cv_can_use_hidden_=yes],
168
      [ac_cv_can_use_hidden_=no])
169
    CXXFLAGS="${save_CXXFLAGS}"
170
    AC_LANG_POP()])
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")))])
174
])
175
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
176
  ])
177
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
178
# vim: set ft=config: