From af214790e552310a254ee212df29e8d83f0427a1 Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 7 Mar 2013 15:12:57 +0100 Subject: fix a couple of compilation errors and warnings * fix compilation via cmake * fix minor compiler warnings * add --enable-fast-mutexes to compile with fast mutexes support. the plugin will crash if server and plugin do not match! --- configure.ac | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7e6764d..86fda3a 100644 --- a/configure.ac +++ b/configure.ac @@ -11,26 +11,42 @@ AC_CONFIG_SRCDIR([src/table_sizes.cc]) AC_CONFIG_HEADER([src/config.h]) AC_DEFUN([CHECK_DEBUG], [ - debug_default="no" - AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging - [default=no]],, enable_debug=$debug_default) + AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], [turn on debugging, default: no])) + AC_MSG_CHECKING(whether to enable debugging) + AS_IF([test "x$enable_debug" = "xyes"], + [ + CPPFLAGS="$CPPFLAGS -g -D_DEBUG" + AC_MSG_RESULT(yes) + ], + [ + CPPFLAGS="$CPPFLAGS -g -O2 -DDBUG_OFF" + AC_MSG_RESULT(no) + ] + ) +]) - if test "x$enable_debug" = "xyes" - then - CPPFLAGS="$CPPFLAGS -g -D_DEBUG" - AC_MSG_RESULT(yes) - else - CPPFLAGS="$CPPFLAGS -g -O2 -DDBUG_OFF" - AC_MSG_RESULT(no) - fi +AC_DEFUN([CHECK_FAST_MUTEXES], [ + AC_ARG_ENABLE([fast-mutexes], + AS_HELP_STRING([--enable-fast-mutexes], [compile with fast mutexes, default: no])) + + AC_MSG_CHECKING(whether to compile with fast mutexes) + AS_IF([test "x$enable_fast_mutexes" = "xyes"], + [ + CPPFLAGS="$CPPFLAGS -DMY_PTHREAD_FASTMUTEX=1" + AC_MSG_RESULT(yes) + ], + [ AC_MSG_RESULT(no) ] + ) ]) + dnl Run tests using C++ compiler dnl AC_LANG(C++) -#check debug CHECK_DEBUG +CHECK_FAST_MUTEXES #check for mysql src MYSQL_SRC_TEST -- cgit v1.2.3