~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/plugin.ac

  • Committer: Brian Aker
  • Date: 2009-07-16 22:37:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1100.
  • Revision ID: brian@gaz-20090716223701-vbbbo8dmgd2ljqqo
Refactor TableShare has to be behind class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# Place, Suite 330, Boston, MA 02111-1307 USA
15
15
#
16
16
 
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)
 
17
AC_DEFUN([AC_INNODB_ACTIONS],[
 
18
  AC_REQUIRE([AC_PROG_LEX])
 
19
  AC_REQUIRE([AC_FUNC_MMAP])
 
20
 
 
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)
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])
28
29
  AC_C_BIGENDIAN
29
30
  case "$target_os" in
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*)
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
 
 
51
 
                CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
 
31
         lin*)
 
32
           CFLAGS="$CFLAGS -DUNIV_LINUX";;
 
33
         hpux10*)
 
34
           CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
 
35
         hp*)
 
36
           CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
 
37
         aix*)
 
38
           CFLAGS="$CFLAGS -DUNIV_AIX";;
 
39
         irix*|osf*|sysv5uw7*|openbsd*)
 
40
           CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
 
41
         *solaris*|*SunOS*)
 
42
           CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
52
43
  esac
53
 
  INNODB_DYNAMIC_CFLAGS="-DPANDORA_DYNAMIC_PLUGIN"
 
44
  INNODB_DYNAMIC_CFLAGS="-DDRIZZLE_DYNAMIC_PLUGIN"
54
45
  case "$target_cpu" in
55
46
        x86_64)
56
47
                # The AMD64 ABI forbids absolute addresses in shared libraries
65
56
  AC_TRY_RUN(
66
57
    [
67
58
      #include <pthread.h>
68
 
      #include <string.h>
69
59
 
70
60
      int main(int argc, char** argv) {
71
61
        pthread_t       x1;
72
62
        pthread_t       x2;
73
63
        pthread_t       x3;
74
64
 
75
 
        memset(&x1, 0x0, sizeof(x1));
76
 
        memset(&x2, 0x0, sizeof(x2));
77
 
        memset(&x3, 0x0, sizeof(x3));
78
 
 
79
65
        __sync_bool_compare_and_swap(&x1, x2, x3);
80
66
 
81
67
        return(0);
90
76
      AC_MSG_RESULT(no)
91
77
    ]
92
78
    )
93
 
 
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
 
  )
152
 
 
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
 
 
176
79
  ])
177
80
 
 
81
AC_INNODB_ACTIONS
178
82
# vim: set ft=config: