[Groonga-mysql-commit] mroonga/mroonga [master] add --disable-fast-mutexes option to force fast mutex disablesd.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 10月 23日 (日) 16:32:10 JST


Kouhei Sutou	2011-10-23 07:32:10 +0000 (Sun, 23 Oct 2011)

  New Revision: 7b6d286156c7c4bd94cb533e78429ab8b01b8a8d

  Log:
    add --disable-fast-mutexes option to force fast mutex disablesd.

  Added files:
    mrn_mysql.h
  Modified files:
    Makefile.am
    configure.ac
    ha_mroonga.cc
    mrn_table.cc

  Modified: Makefile.am (+1 -1)
===================================================================
--- Makefile.am    2011-10-23 07:08:31 +0000 (f372440)
+++ Makefile.am    2011-10-23 07:32:10 +0000 (3b8cc86)
@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = 1.9.7
 AM_CPPFLAGS = $(MYSQL_INC) $(GROONGA_CFLAGS) $(MECAB_INCLUDES) $(MYSQL_VERSION_CFLAGS)
 ACLOCAL_AMFLAGS = $$ACLOCAL_ARGS
 
-noinst_HEADERS = mrn_sys.h ha_mroonga.h mrn_table.h mrn_err.h
+noinst_HEADERS = mrn_sys.h ha_mroonga.h mrn_table.h mrn_err.h mrn_mysql.h
 
 plugin_LTLIBRARIES     = ha_groonga.la
 ha_groonga_la_LDFLAGS  = -module $(GROONGA_LIBS) $(MECAB_LIBS)

  Modified: configure.ac (+11 -0)
===================================================================
--- configure.ac    2011-10-23 07:08:31 +0000 (d6846fc)
+++ configure.ac    2011-10-23 07:32:10 +0000 (7019462)
@@ -187,6 +187,17 @@ if test x"$default_parser" != x"no"; then
 		     "specified default fulltext parser")
 fi
 
+AC_ARG_ENABLE(fast_mutexes,
+    [AC_HELP_STRING([--disable-fast-mutexes],
+                    [Force disable fast mutex.
+                     [default: use mysql_config output]])],
+    [enable_fast_mutexes=$enableval],
+    [enable_fast_mutexes=auto])
+if test "$enable_fast_mutexes" = "no"; then
+   AC_DEFINE(FORCE_FAST_MUTEX_DISABLED, [1],
+             [Define to 1 if force fast mutext disabled])
+fi
+
 # check Cutter with GLib support if available
 REQUIRED_MINIMUM_CUTTER_VERSION=1.1.3
 m4_ifdef([AC_CHECK_GCUTTER], [

  Modified: ha_mroonga.cc (+3 -22)
===================================================================
--- ha_mroonga.cc    2011-10-23 07:08:31 +0000 (06990c5)
+++ ha_mroonga.cc    2011-10-23 07:32:10 +0000 (cb27c12)
@@ -19,37 +19,18 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-/* We need to undefine them because my_config.h defines them. :< */
-#  undef VERSION
-#  undef PACKAGE
-#  undef PACKAGE_BUGREPORT
-#  undef PACKAGE_NAME
-#  undef PACKAGE_STRING
-#  undef PACKAGE_TARNAME
-#  undef PACKAGE_VERSION
-#endif
+#include "mrn_mysql.h"
 
 #ifdef USE_PRAGMA_IMPLEMENTATION
 #pragma implementation
 #endif
 
-#define MYSQL_SERVER 1
-#include "mysql_version.h"
-
-#if MYSQL_VERSION_ID < 50500
-#  include <mysql_priv.h>
-#  include <mysql/plugin.h>
-#else
-#  include <sql_priv.h>
-#  include <sql_class.h>
-#  include <probes_mysql.h>
+#if MYSQL_VERSION_ID >= 50500
 #  include <sql_plugin.h>
 #  include <sql_show.h>
-#  include <sql_partition.h>
 #  include <key.h>
 #endif
+
 #include <sql_select.h>
 #include <ft_global.h>
 #include <spatial.h>

  Added: mrn_mysql.h (+54 -0) 100644
===================================================================
--- /dev/null
+++ mrn_mysql.h    2011-10-23 07:32:10 +0000 (2b5d98e)
@@ -0,0 +1,54 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+  Copyright(C) 2011 Kouhei Sutou <kou****@clear*****>
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#ifndef _mrn_mysql_h
+#define _mrn_mysql_h
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+/* We need to undefine them because my_config.h defines them. :< */
+#  undef VERSION
+#  undef PACKAGE
+#  undef PACKAGE_BUGREPORT
+#  undef PACKAGE_NAME
+#  undef PACKAGE_STRING
+#  undef PACKAGE_TARNAME
+#  undef PACKAGE_VERSION
+#endif
+
+#ifdef FORCE_FAST_MUTEX_DISABLED
+#  ifdef MY_PTHREAD_FASTMUTEX
+#    undef MY_PTHREAD_FASTMUTEX
+#  endif
+#endif
+
+#define MYSQL_SERVER 1
+#include "mysql_version.h"
+
+#if MYSQL_VERSION_ID < 50500
+#  include <mysql_priv.h>
+#  include <mysql/plugin.h>
+#else
+#  include <sql_priv.h>
+#  include <sql_class.h>
+#  include <probes_mysql.h>
+#  include <sql_partition.h>
+#endif
+
+#endif /* _mrn_mysql_h */

  Modified: mrn_table.cc (+2 -22)
===================================================================
--- mrn_table.cc    2011-10-23 07:08:31 +0000 (412779a)
+++ mrn_table.cc    2011-10-23 07:32:10 +0000 (60a8ccf)
@@ -18,29 +18,9 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-/* We need to undefine them because my_config.h defines them. :< */
-#  undef VERSION
-#  undef PACKAGE
-#  undef PACKAGE_BUGREPORT
-#  undef PACKAGE_NAME
-#  undef PACKAGE_STRING
-#  undef PACKAGE_TARNAME
-#  undef PACKAGE_VERSION
-#endif
-
-#define MYSQL_SERVER 1
-#include "mysql_version.h"
+#include "mrn_mysql.h"
 
-#if MYSQL_VERSION_ID < 50500
-#  include <mysql_priv.h>
-#  include <mysql/plugin.h>
-#else
-#  include <sql_priv.h>
-#  include <sql_class.h>
-#  include <probes_mysql.h>
-#  include <sql_partition.h>
+#if MYSQL_VERSION_ID >= 50500
 #  include <sql_servers.h>
 #  include <sql_base.h>
 #endif




Groonga-mysql-commit メーリングリストの案内
Back to archive index