~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/plugin.ac

  • Committer: Stewart Smith
  • Date: 2009-06-16 00:45:15 UTC
  • mto: (1119.2.6 merge)
  • mto: This revision was merged to the branch mainline in revision 1124.
  • Revision ID: stewart@flamingspork.com-20090616004515-bgr8e62psvn2820l
make snowman test not leave tables behind after running

Show diffs side-by-side

added added

removed removed

Lines of Context:
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., 51 Franklin
14
 
# St, Fifth Floor, Boston, MA 02110-1301 USA
15
 
#
16
 
 
17
 
AC_DEFUN([AC_INNODB_ACTIONS],[
18
 
  PANDORA_REQUIRE_FLEX
19
 
  PANDORA_HAVE_LIBAIO
20
 
 
21
 
  AC_REQUIRE([AC_FUNC_MMAP])
22
 
 
23
 
  AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
24
 
  AC_SUBST(innodb_system_libs)
25
 
  AC_CHECK_HEADERS(aio.h sched.h)
26
 
  AC_CHECK_SIZEOF(int, 4)
27
 
  AC_CHECK_SIZEOF(long, 4)
28
 
  AC_CHECK_SIZEOF(void*, 4)
29
 
  AC_CHECK_FUNCS(sched_yield fdatasync localtime_r pread)
30
 
  AC_CHECK_FUNCS([uname munmap memchr getpagesize bzero])
31
 
  AC_C_BIGENDIAN
32
 
  case "$target_os" in
33
 
         lin*)
34
 
           AM_CFLAGS="$AM_CFLAGS -DUNIV_LINUX";;
35
 
         hpux10*)
36
 
           AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
37
 
         hp*)
38
 
           AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
39
 
         aix*)
40
 
           AM_CFLAGS="$AM_CFLAGS -DUNIV_AIX";;
41
 
         irix*|osf*|sysv5uw7*|openbsd*)
42
 
           AM_CFLAGS="$AM_CFLAGS -DUNIV_MUST_NOT_INLINE";;
43
 
         *solaris*|*SunOS*)
44
 
                # Begin Solaris atomic function checks
45
 
                AC_CHECK_FUNCS([atomic_cas_ulong atomic_cas_32 \
46
 
                               atomic_cas_64 atomic_add_long],
47
 
                              [plugin_innodb_have_solaris_atomics=yes],
48
 
                              [plugin_innodb_have_solaris_atomics=no])
49
 
 
50
 
                AS_IF([test "${plugin_innodb_have_solaris_atomics}" = "yes"],[
51
 
                        AC_DEFINE([HAVE_SOLARIS_ATOMICS],
52
 
                                  [1],
53
 
                                  [Define to 1 if Solaris supports \
54
 
                                   atomic functions.])
55
 
                ])
56
 
                ### End Solaris atomic function checks
57
 
           AM_CFLAGS="$AM_CFLAGS -DUNIV_SOLARIS";;
58
 
  esac
59
 
  INNODB_DYNAMIC_CFLAGS="-DPANDORA_DYNAMIC_PLUGIN"
60
 
  case "$target_cpu" in
61
 
        x86_64)
62
 
                # The AMD64 ABI forbids absolute addresses in shared libraries
63
 
                ;;
64
 
        *86)
65
 
                # Use absolute addresses on IA-32
66
 
                INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
67
 
                ;;
68
 
  esac
69
 
  AC_SUBST(INNODB_DYNAMIC_CFLAGS)
70
 
 
71
 
  AC_CACHE_CHECK([whether pthread_t can be used by GCC atomic builtins],
72
 
    [ac_cv_plugin_innodb_have_gcc_atomic],[
73
 
    AC_RUN_IFELSE([
74
 
      AC_LANG_PROGRAM([[
75
 
      #include <pthread.h>
76
 
      #include <string.h>
77
 
      ]],[[
78
 
        pthread_t       x1;
79
 
        pthread_t       x2;
80
 
        pthread_t       x3;
81
 
 
82
 
        memset(&x1, 0x0, sizeof(x1));
83
 
        memset(&x2, 0x0, sizeof(x2));
84
 
        memset(&x3, 0x0, sizeof(x3));
85
 
 
86
 
        __sync_bool_compare_and_swap(&x1, x2, x3);
87
 
      ]])],
88
 
      [ac_cv_plugin_innodb_have_gcc_atomic=yes],
89
 
      [ac_cv_plugin_innodb_have_gcc_atomic=no])
90
 
    ])
91
 
  AS_IF([test "${ac_cv_plugin_innodb_have_gcc_atomic}" = "yes"],[
92
 
      AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
93
 
                [pthread_t can be used by GCC atomic builtins])
94
 
  ])
95
 
 
96
 
  AC_CACHE_CHECK(
97
 
    [whether __attribute__ visibility "hidden" is supported],
98
 
    [ac_cv_can_use_hidden_],[
99
 
      AC_LANG_PUSH(C++)
100
 
      dnl Must be done once we turn on warnings and such
101
 
      save_CXXFLAGS="${CXXFLAGS}"
102
 
      CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
103
 
      AC_LINK_IFELSE([
104
 
        AC_LANG_PROGRAM(
105
 
          [[
106
 
__attribute__((visibility ("hidden")))
107
 
void testme() {  }
108
 
          ]],[[testme()]]
109
 
        )],
110
 
        [ac_cv_can_use_hidden_=yes],
111
 
        [ac_cv_can_use_hidden_=no])
112
 
      CXXFLAGS="${save_CXXFLAGS}"
113
 
      AC_LANG_POP()])
114
 
  AS_IF([test "$ac_cv_can_use_hidden_" = "yes"],[
115
 
    AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
116
 
    [Define to 1 if you have support for __attribute__((visibility("hidden")))])
117
 
  ])
118
 
 
119
 
  # Try using solaris atomics on SunOS if GCC atomics are not available
120
 
  AS_IF([test "${ac_cv_plugin_innodb_have_gcc_atomic}" = "yes"],[
121
 
      AC_MSG_NOTICE([no need to check pthread_t size])
122
 
    ],[
123
 
    AS_IF([test "${ac_cv_plugin_innodb_have_solaris_atomics}" = "yes"],[
124
 
      AC_CACHE_CHECK([checking if pthread_t size is integral],
125
 
        [ac_cv_plugin_innodb_pthread_integral],[
126
 
          AC_COMPILE_IFELSE([
127
 
            AC_LANG_PROGRAM([[
128
 
              #include <pthread.h>
129
 
            ]],[[
130
 
                pthread_t x = 0;
131
 
            ]])],[
132
 
              ac_cv_plugin_innodb_pthread_integral=yes
133
 
            ],[
134
 
              ac_cv_plugin_innodb_pthread_integral=no
135
 
            ])
136
 
        ])
137
 
      AS_IF([test "${ac_cv_plugin_innodb_pthread_integral}" = "yes"],[        
138
 
        AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
139
 
                [pthread_t can be used by solaris atomics])
140
 
      ])
141
 
      # size of pthread_t is needed for typed solaris atomics
142
 
      AC_CHECK_SIZEOF([pthread_t], [], [
143
 
#include <pthread.h>
144
 
        ])
145
 
    ])
146
 
  ])
147
 
 
148
 
  # Check for x86 PAUSE instruction
149
 
  AC_CACHE_CHECK([for x86 PAUSE instruction],[ac_cv_plugin_innodb_has_pause],[
150
 
  # We have to actually try running the test program, because of a bug
151
 
  # in Solaris on x86_64, where it wrongly reports that PAUSE is not
152
 
  # supported when trying to run an application. See
153
 
  # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
154
 
  # We use ib_ prefix to avoid collisoins if this code is added to
155
 
  # mysql's configure.in.
156
 
  AC_RUN_IFELSE([AC_LANG_PROGRAM([[]],[[
157
 
        __asm__ __volatile__ ("pause");
158
 
    ]])],[
159
 
      ac_cv_plugin_innodb_has_pause=yes
160
 
    ],[
161
 
      ac_cv_plugin_innodb_has_pause=no
162
 
    ])
163
 
  ])
164
 
  AS_IF([test "${ac_cv_plugin_innodb_has_pause}" = "yes"],[
165
 
    AC_DEFINE([IB_HAVE_PAUSE_INSTRUCTION], [1],
166
 
              [Does x86 PAUSE instruction exist])
167
 
  ])
168
 
 
169
 
])
170
 
 
171
 
AC_INNODB_ACTIONS
172
 
# vim: set ft=config: