1
dnl ---------------------------------------------------------------------------
2
dnl Macro: MYSQL_CHECK_NDBCLUSTER
3
dnl ---------------------------------------------------------------------------
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]]*//'`
11
dnl for build ndb docs
13
AC_PATH_PROG(DOXYGEN, doxygen, no)
14
AC_PATH_PROG(PDFLATEX, pdflatex, no)
15
AC_PATH_PROG(MAKEINDEX, makeindex, no)
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
29
[mysql_sci_dir=${withval}],
32
case "$mysql_sci_dir" in
35
AC_MSG_RESULT([-- not including sci transporter])
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)
48
AC_MSG_RESULT([found sci transporter in $mysql_sci_dir/{include, lib}])
50
AC_MSG_RESULT([could not find sci transporter in $mysql_sci_dir/{include, lib}])
55
AC_ARG_WITH([ndb-test],
57
--with-ndb-test Include the NDB Cluster ndbapi test programs],
58
[ndb_test="$withval"],
60
AC_ARG_WITH([ndb-docs],
62
--with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
63
[ndb_docs="$withval"],
65
AC_ARG_WITH([ndb-port],
67
--with-ndb-port Port for NDB Cluster management server],
68
[ndb_port="$withval"],
70
AC_ARG_WITH([ndb-port-base],
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],
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}],
85
AC_ARG_WITH([ndb-binlog],
87
--without-ndb-binlog Disable ndb binlog],
88
[ndb_binlog="$withval"],
89
[ndb_binlog="default"])
91
case "$ndb_ccflags" in
93
AC_MSG_RESULT([The --ndb-ccflags option requires a parameter (passed to CC for ndb compilation)])
96
ndb_cxxflags_fix="$ndb_cxxflags_fix $ndb_ccflags"
100
AC_MSG_CHECKING([for NDB Cluster options])
106
AC_MSG_RESULT([-- including ndbapi test programs])
110
AC_MSG_RESULT([-- not including ndbapi test programs])
117
AC_MSG_RESULT([-- including ndbapi and mgmapi documentation])
121
AC_MSG_RESULT([-- not including ndbapi and mgmapi documentation])
127
AC_MSG_RESULT([-- including ndb extra debug options])
131
AC_MSG_RESULT([-- including ndb extra extra debug options])
132
have_ndb_debug="full"
135
AC_MSG_RESULT([-- not including ndb extra debug options])
139
have_ndb_debug="default"
143
AC_MSG_RESULT([done.])
146
AC_DEFUN([NDBCLUSTER_WORKAROUNDS], [
148
#workaround for Sun Forte/x86 see BUG#4681
149
case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
151
CFLAGS="$CFLAGS -DBIG_TABLES"
152
CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
158
# workaround for Sun Forte compile problem for ndb
159
case $SYSTEM_TYPE-$ac_cv_prog_gcc in
161
ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static"
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"
178
AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
180
AC_MSG_RESULT([Using NDB Cluster])
183
TEST_NDBCLUSTER="--ndbcluster"
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"
190
MYSQL_CHECK_NDB_OPTIONS
191
NDBCLUSTER_WORKAROUNDS
193
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
195
if test "$have_ndb_debug" = "default"
197
have_ndb_debug=$with_debug
200
if test "$have_ndb_debug" = "yes"
203
NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
204
elif test "$have_ndb_debug" = "full"
206
NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
208
# no extra ndb debug but still do asserts if debug version
209
if test "$with_debug" = "yes" -o "$with_debug" = "full"
217
if test X"$ndb_port" = Xdefault
223
if test X"$ndb_binlog" = Xdefault ||
224
test X"$ndb_binlog" = Xyes
226
have_ndb_binlog="yes"
229
if test X"$have_ndb_binlog" = Xyes
231
AC_DEFINE([WITH_NDB_BINLOG], [1],
232
[Including Ndb Cluster Binlog])
233
AC_MSG_RESULT([Including Ndb Cluster Binlog])
235
AC_MSG_RESULT([Not including Ndb Cluster Binlog])
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"
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"
253
AC_MSG_RESULT([Not including ndb shared memory transporter])
256
if test X"$have_ndb_sci" = Xyes
258
ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
262
ndb_bin_am_ldflags="-static"
263
if test X"$have_ndb_test" = Xyes
265
ndb_opt_subdirs="test"
266
ndb_bin_am_ldflags=""
269
if test X"$have_ndb_docs" = Xyes
271
ndb_opt_subdirs="$ndb_opt_subdirs docs"
272
ndb_bin_am_ldflags=""
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.)
278
aix3.* | aix4.0.* | aix4.1.*) ;;
279
*) ndb_bin_am_ldflags="-static";;
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)
287
AC_SUBST(NDB_LD_VERSION_SCRIPT)
289
AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION)
290
AC_SUBST(NDB_SHARED_LIB_VERSION)
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],
299
AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR],
301
AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD],
303
AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"],
304
[NDB status version])
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)
312
AC_SUBST(ndb_transporter_opt_objs)
314
AC_SUBST(ndb_bin_am_ldflags)
315
AC_SUBST(ndb_opt_subdirs)
318
AC_SUBST(ndb_cxxflags_fix)
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])
334
storage/ndb/include/ndb_version.h
335
storage/ndb/include/ndb_global.h
336
storage/ndb/include/ndb_types.h
340
AC_SUBST(TEST_NDBCLUSTER)
341
dnl ---------------------------------------------------------------------------
342
dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
343
dnl ---------------------------------------------------------------------------