From 6467bcca6067592cb41f789ade920e4af6b71476 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 15 Sep 2010 17:29:57 +0200 Subject: [PATCH] oqgraph and sphinx on windows --- mysql-test/suite/oqgraph/suite.opt | 2 +- mysql-test/suite/oqgraph/suite.pm | 2 +- .../{CMakeFiles.txt => CMakeLists.txt} | 27 ++++++++++++++----- storage/oqgraph/Makefile.am | 18 ++++++------- storage/oqgraph/graphcore.cc | 4 +-- storage/oqgraph/plug.in | 2 +- storage/pbxt/CMakeLists.txt | 3 +++ storage/sphinx/CMakeLists.txt | 7 ++--- 8 files changed, 42 insertions(+), 23 deletions(-) rename storage/oqgraph/{CMakeFiles.txt => CMakeLists.txt} (51%) diff --git a/mysql-test/suite/oqgraph/suite.opt b/mysql-test/suite/oqgraph/suite.opt index 2d93fbd24d6..bc7ccfc1414 100644 --- a/mysql-test/suite/oqgraph/suite.opt +++ b/mysql-test/suite/oqgraph/suite.opt @@ -1 +1 @@ ---plugin-load=$OQGRAPH_ENGINE_SO +--plugin-load=$HA_OQGRAPH_SO diff --git a/mysql-test/suite/oqgraph/suite.pm b/mysql-test/suite/oqgraph/suite.pm index faef9412e53..5066d4e9f8a 100644 --- a/mysql-test/suite/oqgraph/suite.pm +++ b/mysql-test/suite/oqgraph/suite.pm @@ -2,7 +2,7 @@ package My::Suite::OQGraph; @ISA = qw(My::Suite); -return "No OQGraph" unless $ENV{OQGRAPH_ENGINE_SO}; +return "No OQGraph" unless $ENV{HA_OQGRAPH_SO}; bless { }; diff --git a/storage/oqgraph/CMakeFiles.txt b/storage/oqgraph/CMakeLists.txt similarity index 51% rename from storage/oqgraph/CMakeFiles.txt rename to storage/oqgraph/CMakeLists.txt index b039c1ddb44..d81dbe323b6 100644 --- a/storage/oqgraph/CMakeFiles.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -13,10 +13,25 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +INCLUDE (CheckCXXSourceCompiles) +CHECK_CXX_SOURCE_COMPILES( +"#include +#if BOOST_VERSION >= 104000 +#else +#error oops +#endif +int main() { return 0; }" BOOST_OK) + +IF(BOOST_OK) + INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") + + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OQGRAPH /EHsc") + + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/extra/yassl/include) + + SET(OQGRAPH_SOURCES ha_oqgraph.cc graphcore.cc) + MYSQL_STORAGE_ENGINE(OQGRAPH) +ENDIF() -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql - ${CMAKE_SOURCE_DIR}/regex - ${CMAKE_SOURCE_DIR}/extra/yassl/include) -ADD_LIBRARY(oqgraph ha_oqgraph.cc) diff --git a/storage/oqgraph/Makefile.am b/storage/oqgraph/Makefile.am index 56eea4cb87a..e99e134db02 100644 --- a/storage/oqgraph/Makefile.am +++ b/storage/oqgraph/Makefile.am @@ -47,11 +47,11 @@ BOOST_CXXFLAGS+= -funroll-loops -fno-trapping-math EXTRA_DIST = ha_oqgraph.h ha_oqgraph.cc graphcore.cc \ graphcore-graph.h graphcore-types.h graphcore.h \ - CMakeFiles.txt plug.in oqgraph_probes.d + CMakeLists.txt plug.in oqgraph_probes.d # DTRACE = @DTRACE@ # DTRACEFLAGS = @DTRACEFLAGS@ -# DTRACEFILES = .libs/liboqgraph_engine_la-ha_oqgraph.o +# DTRACEFILES = .libs/libha_oqgraph_la-ha_oqgraph.o ORIG_CXXFLAGS = @CXXFLAGS@ CXXFLAGS= @@ -71,18 +71,18 @@ else INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/regex -I$(top_srcdir)/sql -I$(srcdir) -DHAVE_OQGRAPH endif !BUILD_OQGRAPH_STANDALONE -EXTRA_LTLIBRARIES = oqgraph_engine.la +EXTRA_LTLIBRARIES = ha_oqgraph.la mysqlplugin_LTLIBRARIES = @plugin_oqgraph_shared_target@ -oqgraph_engine_la_SOURCES = ha_oqgraph.cc -oqgraph_engine_la_LIBADD = libgraphcore.la +ha_oqgraph_la_SOURCES = ha_oqgraph.cc +ha_oqgraph_la_LIBADD = libgraphcore.la # if HAVE_DTRACE -# oqgraph_engine_la_LIBADD += oqgraph_probes.o +# ha_oqgraph_la_LIBADD += oqgraph_probes.o # endif -oqgraph_engine_la_LDFLAGS = -module -rpath $(mysqlplugindir) -oqgraph_engine_la_CFLAGS = $(ORIG_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -oqgraph_engine_la_CXXFLAGS = $(ORIG_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN +ha_oqgraph_la_LDFLAGS = -shared -module -rpath $(mysqlplugindir) +ha_oqgraph_la_CFLAGS = $(ORIG_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +ha_oqgraph_la_CXXFLAGS = $(ORIG_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN # oqgraph_probes.h: oqgraph_probes.d # $(DTRACE) $(DTRACEFLAGS) -h -s oqgraph_probes.d diff --git a/storage/oqgraph/graphcore.cc b/storage/oqgraph/graphcore.cc index 9f479425eeb..0b856ac253f 100644 --- a/storage/oqgraph/graphcore.cc +++ b/storage/oqgraph/graphcore.cc @@ -24,7 +24,7 @@ ====================================================================== */ -#include +#include #define BOOST_ALL_NO_LIB 1 @@ -997,7 +997,7 @@ int stack_cursor::fetch_row(const row &row_info, row &result, const reference &ref) { last= ref; - if (optional v= last.vertex()) + if (last.vertex()) { optional seq; optional w; diff --git a/storage/oqgraph/plug.in b/storage/oqgraph/plug.in index 405afed1f18..38c8310a915 100644 --- a/storage/oqgraph/plug.in +++ b/storage/oqgraph/plug.in @@ -1,6 +1,6 @@ MYSQL_STORAGE_ENGINE(oqgraph,,[Graph Storage Engine], [Open Query Graph Computation Engine], []) -MYSQL_PLUGIN_DYNAMIC(oqgraph, [oqgraph_engine.la]) +MYSQL_PLUGIN_DYNAMIC(oqgraph, [ha_oqgraph.la]) MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(oqgraph, [ha_oqgraph.cc]) MYSQL_PLUGIN_ACTIONS(oqgraph,[ AC_LANG_PUSH([C++]) diff --git a/storage/pbxt/CMakeLists.txt b/storage/pbxt/CMakeLists.txt index a05b1f97083..6da0717043c 100644 --- a/storage/pbxt/CMakeLists.txt +++ b/storage/pbxt/CMakeLists.txt @@ -22,6 +22,8 @@ # # This file is used to make the Windows version +INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMYSQL_SERVER") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMYSQL_SERVER") @@ -101,3 +103,4 @@ src/xt_defs.h src/xt_errno.h) MYSQL_STORAGE_ENGINE(PBXT) + diff --git a/storage/sphinx/CMakeLists.txt b/storage/sphinx/CMakeLists.txt index 2bc04eefc44..1a46f50f4a7 100644 --- a/storage/sphinx/CMakeLists.txt +++ b/storage/sphinx/CMakeLists.txt @@ -1,5 +1,5 @@ -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") + ADD_DEFINITIONS(-DMYSQL_SERVER) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include @@ -8,4 +8,5 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/regex) SET(SPHINX_SOURCES ha_sphinx.cc) -ADD_LIBRARY(sphinx ha_sphinx.cc) +SET(SPHINX_LIBS ws2_32.lib) +MYSQL_STORAGE_ENGINE(SPHINX)