~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to config/ac-macros/ha_ndbcluster.m4

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl ---------------------------------------------------------------------------
 
2
dnl Macro: MYSQL_CHECK_NDBCLUSTER
 
3
dnl ---------------------------------------------------------------------------
 
4
 
 
5
NDB_VERSION_MAJOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f1`
 
6
NDB_VERSION_MINOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f2`
 
7
NDB_VERSION_BUILD=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f3`
 
8
NDB_VERSION_STATUS=`echo $VERSION | sed 's/^[[-.0-9]]*//'`
 
9
TEST_NDBCLUSTER=""
 
10
 
 
11
dnl for build ndb docs
 
12
 
 
13
AC_PATH_PROG(DOXYGEN, doxygen, no)
 
14
AC_PATH_PROG(PDFLATEX, pdflatex, no)
 
15
AC_PATH_PROG(MAKEINDEX, makeindex, no)
 
16
 
 
17
AC_SUBST(DOXYGEN)
 
18
AC_SUBST(PDFLATEX)
 
19
AC_SUBST(MAKEINDEX)
 
20
 
 
21
 
 
22
AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
 
23
  AC_ARG_WITH([ndb-sci],
 
24
              AC_HELP_STRING([--with-ndb-sci=DIR],
 
25
                             [Provide MySQL with a custom location of
 
26
                             sci library. Given DIR, sci library is 
 
27
                             assumed to be in $DIR/lib and header files
 
28
                             in $DIR/include.]),
 
29
              [mysql_sci_dir=${withval}],
 
30
              [mysql_sci_dir=""])
 
31
 
 
32
  case "$mysql_sci_dir" in
 
33
    "no" )
 
34
      have_ndb_sci=no
 
35
      AC_MSG_RESULT([-- not including sci transporter])
 
36
      ;;
 
37
    * )
 
38
      if test -f "$mysql_sci_dir/lib/libsisci.a" -a \ 
 
39
              -f "$mysql_sci_dir/include/sisci_api.h"; then
 
40
        NDB_SCI_INCLUDES="-I$mysql_sci_dir/include"
 
41
        NDB_SCI_LIBS="$mysql_sci_dir/lib/libsisci.a"
 
42
        AC_MSG_RESULT([-- including sci transporter])
 
43
        AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
 
44
                  [Including Ndb Cluster DB sci transporter])
 
45
        AC_SUBST(NDB_SCI_INCLUDES)
 
46
        AC_SUBST(NDB_SCI_LIBS)
 
47
        have_ndb_sci="yes"
 
48
        AC_MSG_RESULT([found sci transporter in $mysql_sci_dir/{include, lib}])
 
49
      else
 
50
        AC_MSG_RESULT([could not find sci transporter in $mysql_sci_dir/{include, lib}])
 
51
      fi
 
52
      ;;
 
53
  esac
 
54
 
 
55
  AC_ARG_WITH([ndb-test],
 
56
              [
 
57
  --with-ndb-test       Include the NDB Cluster ndbapi test programs],
 
58
              [ndb_test="$withval"],
 
59
              [ndb_test=no])
 
60
  AC_ARG_WITH([ndb-docs],
 
61
              [
 
62
  --with-ndb-docs       Include the NDB Cluster ndbapi and mgmapi documentation],
 
63
              [ndb_docs="$withval"],
 
64
              [ndb_docs=no])
 
65
  AC_ARG_WITH([ndb-port],
 
66
              [
 
67
  --with-ndb-port       Port for NDB Cluster management server],
 
68
              [ndb_port="$withval"],
 
69
              [ndb_port="default"])
 
70
  AC_ARG_WITH([ndb-port-base],
 
71
              [
 
72
  --with-ndb-port-base  Base port for NDB Cluster transporters],
 
73
              [ndb_port_base="$withval"],
 
74
              [ndb_port_base="default"])
 
75
  AC_ARG_WITH([ndb-debug],
 
76
              [
 
77
  --without-ndb-debug   Disable special ndb debug features],
 
78
              [ndb_debug="$withval"],
 
79
              [ndb_debug="default"])
 
80
  AC_ARG_WITH([ndb-ccflags],
 
81
              AC_HELP_STRING([--with-ndb-ccflags=CFLAGS],
 
82
                           [Extra CFLAGS for ndb compile]),
 
83
              [ndb_ccflags=${withval}],
 
84
              [ndb_ccflags=""])
 
85
  AC_ARG_WITH([ndb-binlog],
 
86
              [
 
87
  --without-ndb-binlog       Disable ndb binlog],
 
88
              [ndb_binlog="$withval"],
 
89
              [ndb_binlog="default"])
 
90
 
 
91
  case "$ndb_ccflags" in
 
92
    "yes")
 
93
        AC_MSG_RESULT([The --ndb-ccflags option requires a parameter (passed to CC for ndb compilation)])
 
94
        ;;
 
95
    *)
 
96
        ndb_cxxflags_fix="$ndb_cxxflags_fix $ndb_ccflags"
 
97
    ;;
 
98
  esac
 
99
 
 
100
  AC_MSG_CHECKING([for NDB Cluster options])
 
101
  AC_MSG_RESULT([])
 
102
                                                                                
 
103
  have_ndb_test=no
 
104
  case "$ndb_test" in
 
105
    yes )
 
106
      AC_MSG_RESULT([-- including ndbapi test programs])
 
107
      have_ndb_test="yes"
 
108
      ;;
 
109
    * )
 
110
      AC_MSG_RESULT([-- not including ndbapi test programs])
 
111
      ;;
 
112
  esac
 
113
 
 
114
  have_ndb_docs=no
 
115
  case "$ndb_docs" in
 
116
    yes )
 
117
      AC_MSG_RESULT([-- including ndbapi and mgmapi documentation])
 
118
      have_ndb_docs="yes"
 
119
      ;;
 
120
    * )
 
121
      AC_MSG_RESULT([-- not including ndbapi and mgmapi documentation])
 
122
      ;;
 
123
  esac
 
124
 
 
125
  case "$ndb_debug" in
 
126
    yes )
 
127
      AC_MSG_RESULT([-- including ndb extra debug options])
 
128
      have_ndb_debug="yes"
 
129
      ;;
 
130
    full )
 
131
      AC_MSG_RESULT([-- including ndb extra extra debug options])
 
132
      have_ndb_debug="full"
 
133
      ;;
 
134
    no )
 
135
      AC_MSG_RESULT([-- not including ndb extra debug options])
 
136
      have_ndb_debug="no"
 
137
      ;;
 
138
    * )
 
139
      have_ndb_debug="default"
 
140
      ;;
 
141
  esac
 
142
 
 
143
  AC_MSG_RESULT([done.])
 
144
])
 
145
 
 
146
AC_DEFUN([NDBCLUSTER_WORKAROUNDS], [
 
147
 
 
148
  #workaround for Sun Forte/x86 see BUG#4681
 
149
  case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
 
150
    *solaris*-i?86-no)
 
151
      CFLAGS="$CFLAGS -DBIG_TABLES"
 
152
      CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
 
153
      ;;
 
154
    *)
 
155
      ;;
 
156
  esac
 
157
 
 
158
  # workaround for Sun Forte compile problem for ndb
 
159
  case $SYSTEM_TYPE-$ac_cv_prog_gcc in
 
160
    *solaris*-no)
 
161
      ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static"
 
162
      ;;
 
163
    *)
 
164
      ;;
 
165
  esac
 
166
 
 
167
  # ndb fail for whatever strange reason to link Sun Forte/x86
 
168
  # unless using incremental linker
 
169
  case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
 
170
    *solaris*-i?86-no-yes)
 
171
      CXXFLAGS="$CXXFLAGS -xildon"
 
172
      ;;
 
173
    *)
 
174
      ;;
 
175
  esac
 
176
])
 
177
 
 
178
AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
 
179
 
 
180
  AC_MSG_RESULT([Using NDB Cluster])
 
181
  with_partition="yes"
 
182
  ndb_cxxflags_fix=""
 
183
  TEST_NDBCLUSTER="--ndbcluster"
 
184
 
 
185
  ndbcluster_includes="-I\$(top_builddir)/storage/ndb/include -I\$(top_srcdir)/storage/ndb/include -I\$(top_srcdir)/storage/ndb/include/ndbapi -I\$(top_srcdir)/storage/ndb/include/mgmapi"
 
186
  ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a"
 
187
  ndbcluster_system_libs=""
 
188
  ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la"
 
189
 
 
190
  MYSQL_CHECK_NDB_OPTIONS
 
191
  NDBCLUSTER_WORKAROUNDS
 
192
 
 
193
  MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
 
194
 
 
195
  if test "$have_ndb_debug" = "default"
 
196
  then
 
197
    have_ndb_debug=$with_debug
 
198
  fi
 
199
 
 
200
  if test "$have_ndb_debug" = "yes"
 
201
  then
 
202
    # Medium debug.
 
203
    NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
 
204
  elif test "$have_ndb_debug" = "full"
 
205
  then
 
206
    NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
 
207
  else
 
208
    # no extra ndb debug but still do asserts if debug version
 
209
    if test "$with_debug" = "yes" -o "$with_debug" = "full"
 
210
    then
 
211
      NDB_DEFS=""
 
212
    else
 
213
      NDB_DEFS="-DNDEBUG"
 
214
    fi
 
215
  fi
 
216
 
 
217
  if test X"$ndb_port" = Xdefault
 
218
  then
 
219
    ndb_port="1186"
 
220
  fi
 
221
  
 
222
  have_ndb_binlog="no"
 
223
  if test X"$ndb_binlog" = Xdefault ||
 
224
     test X"$ndb_binlog" = Xyes
 
225
  then
 
226
    have_ndb_binlog="yes"
 
227
  fi
 
228
 
 
229
  if test X"$have_ndb_binlog" = Xyes
 
230
  then
 
231
    AC_DEFINE([WITH_NDB_BINLOG], [1],
 
232
              [Including Ndb Cluster Binlog])
 
233
    AC_MSG_RESULT([Including Ndb Cluster Binlog])
 
234
  else
 
235
    AC_MSG_RESULT([Not including Ndb Cluster Binlog])
 
236
  fi
 
237
 
 
238
  ndb_transporter_opt_objs=""
 
239
  if test "$ac_cv_func_shmget" = "yes" &&
 
240
     test "$ac_cv_func_shmat" = "yes" &&
 
241
     test "$ac_cv_func_shmdt" = "yes" &&
 
242
     test "$ac_cv_func_shmctl" = "yes" &&
 
243
     test "$ac_cv_func_sigaction" = "yes" &&
 
244
     test "$ac_cv_func_sigemptyset" = "yes" &&
 
245
     test "$ac_cv_func_sigaddset" = "yes" &&
 
246
     test "$ac_cv_func_pthread_sigmask" = "yes"
 
247
  then
 
248
     AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
 
249
               [Including Ndb Cluster DB shared memory transporter])
 
250
     AC_MSG_RESULT([Including ndb shared memory transporter])
 
251
     ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
 
252
  else
 
253
     AC_MSG_RESULT([Not including ndb shared memory transporter])
 
254
  fi
 
255
  
 
256
  if test X"$have_ndb_sci" = Xyes
 
257
  then
 
258
    ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
 
259
  fi
 
260
  
 
261
  ndb_opt_subdirs=
 
262
  ndb_bin_am_ldflags="-static"
 
263
  if test X"$have_ndb_test" = Xyes
 
264
  then
 
265
    ndb_opt_subdirs="test"
 
266
    ndb_bin_am_ldflags=""
 
267
  fi
 
268
 
 
269
  if test X"$have_ndb_docs" = Xyes
 
270
  then
 
271
    ndb_opt_subdirs="$ndb_opt_subdirs docs"
 
272
    ndb_bin_am_ldflags=""
 
273
  fi
 
274
 
 
275
  # building dynamic breaks on AIX. (If you want to try it and get unresolved
 
276
  # __vec__delete2 and some such, try linking against libhC.)
 
277
  case "$host_os" in
 
278
    aix3.* | aix4.0.* | aix4.1.*) ;;
 
279
    *) ndb_bin_am_ldflags="-static";;
 
280
  esac
 
281
 
 
282
  # libndbclient versioning when linked with GNU ld.
 
283
  if $LD --version 2>/dev/null|grep GNU >/dev/null 2>&1 ; then
 
284
    NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
 
285
    AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
 
286
  fi
 
287
  AC_SUBST(NDB_LD_VERSION_SCRIPT)
 
288
 
 
289
  AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION)
 
290
  AC_SUBST(NDB_SHARED_LIB_VERSION)
 
291
 
 
292
 
 
293
  AC_SUBST(NDB_VERSION_MAJOR)
 
294
  AC_SUBST(NDB_VERSION_MINOR)
 
295
  AC_SUBST(NDB_VERSION_BUILD)
 
296
  AC_SUBST(NDB_VERSION_STATUS)
 
297
  AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR],
 
298
                     [NDB major version])
 
299
  AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR],
 
300
                     [NDB minor version])
 
301
  AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD],
 
302
                     [NDB build version])
 
303
  AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"],
 
304
                     [NDB status version])
 
305
 
 
306
  AC_SUBST(ndbcluster_includes)
 
307
  AC_SUBST(ndbcluster_libs)
 
308
  AC_SUBST(ndbcluster_system_libs)
 
309
  AC_SUBST(ndb_mgmclient_libs)
 
310
  AC_SUBST(NDB_SCI_LIBS)
 
311
 
 
312
  AC_SUBST(ndb_transporter_opt_objs)
 
313
  AC_SUBST(ndb_port)
 
314
  AC_SUBST(ndb_bin_am_ldflags)
 
315
  AC_SUBST(ndb_opt_subdirs)
 
316
 
 
317
  AC_SUBST(NDB_DEFS)
 
318
  AC_SUBST(ndb_cxxflags_fix)
 
319
 
 
320
  NDB_SIZEOF_CHARP="$ac_cv_sizeof_charp"
 
321
  NDB_SIZEOF_CHAR="$ac_cv_sizeof_char"
 
322
  NDB_SIZEOF_SHORT="$ac_cv_sizeof_short"
 
323
  NDB_SIZEOF_INT="$ac_cv_sizeof_int"
 
324
  NDB_SIZEOF_LONG="$ac_cv_sizeof_long"
 
325
  NDB_SIZEOF_LONG_LONG="$ac_cv_sizeof_long_long"
 
326
  AC_SUBST([NDB_SIZEOF_CHARP])
 
327
  AC_SUBST([NDB_SIZEOF_CHAR])
 
328
  AC_SUBST([NDB_SIZEOF_SHORT])
 
329
  AC_SUBST([NDB_SIZEOF_INT])
 
330
  AC_SUBST([NDB_SIZEOF_LONG])
 
331
  AC_SUBST([NDB_SIZEOF_LONG_LONG])
 
332
 
 
333
  AC_CONFIG_FILES([
 
334
   storage/ndb/include/ndb_version.h
 
335
   storage/ndb/include/ndb_global.h
 
336
   storage/ndb/include/ndb_types.h
 
337
  ])
 
338
])
 
339
 
 
340
AC_SUBST(TEST_NDBCLUSTER)                                                                                
 
341
dnl ---------------------------------------------------------------------------
 
342
dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
 
343
dnl ---------------------------------------------------------------------------