Skip to content

Commit

Permalink
merge 10.0-mroonga
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Golubchik committed Feb 19, 2015
2 parents 56114a4 + f5dabd7 commit da63713
Show file tree
Hide file tree
Showing 416 changed files with 46,277 additions and 7,137 deletions.
120 changes: 77 additions & 43 deletions storage/mroonga/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- indent-tabs-mode: nil -*-
#
# Copyright(C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
# Copyright(C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
# Copyright(C) 2013 Kentoku SHIBA
#
# This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -75,6 +75,28 @@ file(READ ${MRN_SOURCE_DIR}/version_in_hex MRN_VERSION_IN_HEX)
file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION)

if(MRN_GROONGA_BUNDLED)
option(MRN_GROONGA_EMBED
"Embed libgroonga"
ON)
if(MRN_GROONGA_EMBED)
set(GRN_EMBED ON)
endif()

set(MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR
"${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
option(MRN_GROONGA_NORMALIZER_MYSQL_EMBED
"Embed groonga-normalizer-mysql Groonga plugin"
ON)
if(EXISTS ${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR})
set(GROONGA_NORMALIZER_MYSQL_FOUND ON)
else()
set(GROONGA_NORMALIZER_MYSQL_FOUND OFF)
set(MRN_GROONGA_NORMALIZER_MYSQL_EMBED OFF)
endif()
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
endif()

add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
else()
file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
Expand All @@ -98,15 +120,21 @@ set(MRN_C_COMPILE_FLAGS "")
set(MRN_CXX_COMPILE_FLAGS "")

macro(mrn_check_cflag flag)
check_c_compiler_flag(${flag} "HAVE_C_${flag}")
if(HAVE_C_${flag})
string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
set(temporary_variable_name "CFLAG${temporary_variable_name}")
check_c_compiler_flag(${flag} ${temporary_variable_name})
if(${temporary_variable_name})
set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} ${flag}")
endif()
endmacro()

macro(mrn_check_cxxflag flag)
check_cxx_compiler_flag(${flag} "HAVE_CXX_${flag}")
if(HAVE_CXX_${flag})
string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag})
string(TOUPPER "${temporary_variable_name}" temporary_variable_name)
set(temporary_variable_name "CXXFLAG${temporary_variable_name}")
check_cxx_compiler_flag(${flag} ${temporary_variable_name})
if(${temporary_variable_name})
set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} ${flag}")
endif()
endmacro()
Expand All @@ -122,7 +150,7 @@ else()
set(MRN_RELATIVE_DIR_PREFIX "")
endif()

read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am MROONGA_SOURCES)
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am MRN_SOURCES)
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/lib/libmrn_no_mysql_sources.am
LIBMRN_NO_MYSQL_SOURCES)
string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}lib/\\1"
Expand Down Expand Up @@ -157,11 +185,18 @@ else()
set(MYSQL_REGEX_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/regex")
endif()

if(EXISTS "${MYSQL_SOURCE_DIR}/extra/rapidjson")
set(MYSQL_RAPIDJSON_INCLUDE_DIR "${MYSQL_SOURCE_DIR}/extra/rapidjson/include")
else()
set(MYSQL_RAPIDJSON_INCLUDE_DIR)
endif()

set(MYSQL_INCLUDE_DIRS
"${MYSQL_BUILD_DIR}/include"
"${MYSQL_SOURCE_DIR}/sql"
"${MYSQL_SOURCE_DIR}/include"
"${MYSQL_REGEX_INCLUDE_DIR}"
"${MYSQL_RAPIDJSON_INCLUDE_DIR}"
"${MYSQL_SOURCE_DIR}")

if(MRN_BUNDLED)
Expand Down Expand Up @@ -190,6 +225,12 @@ else()
set_mysql_config_value("--version" MYSQL_VERSION)
endif()

if(${MYSQL_VERSION} VERSION_LESS "5.5.0")
message(FATAL_ERROR
"Mroonga doesn't support MySQL < 5.5.0: <${MYSQL_VERSION}>")
return()
endif()

if(${MYSQL_VERSION} VERSION_GREATER "10.0.0" AND
${MYSQL_VERSION} VERSION_LESS "10.0.9")
message(FATAL_ERROR
Expand All @@ -201,10 +242,14 @@ if(MRN_GROONGA_BUNDLED)
set(GROONGA_INCLUDE_DIRS "${MRN_BUNDLED_GROONGA_DIR}/include")
set(GROONGA_LIBRARY_DIRS "${MRN_BUNDLED_GROONGA_DIR}/lib")
set(GROONGA_LIBRARIES "libgroonga")
if(EXISTS "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
set(GROONGA_NORMALIZER_MYSQL_FOUND TRUE)
else()
set(GROONGA_NORMALIZER_MYSQL_FOUND FALSE)

set(MRN_LIBRARY_DIRS ${GROONGA_LIBRARY_DIRS})
set(MRN_LIBRARIES ${GROONGA_LIBRARIES})
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
set(MRN_LIBRARY_DIRS
${MRN_LIBRARY_DIRS}
"${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR}/normalizers")
set(MRN_LIBRARIES ${MRN_LIBRARIES} mysql_normalizer)
endif()
else()
include(FindPkgConfig)
Expand All @@ -213,12 +258,6 @@ else()
"groonga-normalizer-mysql >= ${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}")
endif()

if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED)
read_file_list(${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql/normalizers/mysql_sources.am MRN_GRN_NORMALIZER_MYSQL_SOURCES)
string(REGEX REPLACE "([^;]+)" "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql/normalizers/\\1"
MRN_GRN_NORMALIZER_MYSQL_SOURCES "${MRN_GRN_NORMALIZER_MYSQL_SOURCES}")
endif()

include_directories(
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}"
Expand All @@ -235,28 +274,22 @@ else()
"${MYSQL_SERVICES_LIB_DIR}")
endif()
link_directories(
${GROONGA_LIBRARY_DIRS}
${MRN_LIBRARY_DIRS}
${MYSQL_LIBRARY_DIRS})

set(MRN_ALL_SOURCES
${MRN_SOURCES}
${MRN_UDF_SOURCES}
${LIBMRN_NO_MYSQL_SOURCES}
${LIBMRN_NEED_MYSQL_SOURCES})

if(MRN_BUNDLED)
if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED)
mysql_add_plugin(mroonga
"${MROONGA_SOURCES};${MRN_UDF_SOURCES};${MRN_GRN_NORMALIZER_MYSQL_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}"
STORAGE_ENGINE MODULE_ONLY
LINK_LIBRARIES ${GROONGA_LIBRARIES})
else()
mysql_add_plugin(mroonga
"${MROONGA_SOURCES};${MRN_UDF_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}"
STORAGE_ENGINE MODULE_ONLY
LINK_LIBRARIES ${GROONGA_LIBRARIES})
endif()
else()
mysql_add_plugin(mroonga
${MRN_ALL_SOURCES}
STORAGE_ENGINE MODULE_ONLY
LINK_LIBRARIES ${MRN_LIBRARIES})
else()
add_library(mroonga MODULE
${MROONGA_SOURCES}
${MRN_UDF_SOURCES}
${LIBMRN_NO_MYSQL_SOURCES}
${LIBMRN_NEED_MYSQL_SOURCES})
add_library(mroonga MODULE ${MRN_ALL_SOURCES})

set(MYSQL_LIBRARIES "mysqlservices")
target_link_libraries(mroonga ${GROONGA_LIBRARIES} ${MYSQL_LIBRARIES})
Expand Down Expand Up @@ -303,14 +336,14 @@ else()
mrn_check_cxxflag("-fno-rtti")
mrn_check_cxxflag("-felide-constructors")
endif()
set_source_files_properties(${MROONGA_SOURCES} PROPERTIES
set_source_files_properties(${MRN_SOURCES} PROPERTIES
COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}")
set_source_files_properties(${LIBMRN_NEED_MYSQL_SOURCES} PROPERTIES
COMPILE_FLAGS "${MYSQL_CFLAGS} ${MRN_CXX_COMPILE_FLAGS}")
set_source_files_properties(${MRN_UDF_SOURCES} PROPERTIES
COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}")
COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS}")
set_source_files_properties(${LIBMRN_NO_MYSQL_SOURCES} PROPERTIES
COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}")
COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS}")
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
set_target_properties(mroonga PROPERTIES
Expand All @@ -321,19 +354,20 @@ else()
endif()

if(GROONGA_NORMALIZER_MYSQL_FOUND)
set(WITH_GROONGA_NORMALIZER_MYSQL 1)
ADD_DEFINITIONS(-DWITH_GROONGA_NORMALIZER_MYSQL=1)
if(MRN_GROONGA_BUNDLED)
ADD_DEFINITIONS(-DGROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC=1)
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1")
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "MRN_GROONGA_NORMALIZER_MYSQL_EMBED")
else()
set(GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME \"normalizers/mysql\")
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"")
endif()
endif()

set(MRN_DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser")
ADD_DEFINITIONS(-DMRN_PARSER_DEFAULT="${MRN_DEFAULT_PARSER}")
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "MRN_PARSER_DEFAULT=\"${MRN_DEFAULT_PARSER}\"")

configure_file(
"${PROJECT_SOURCE_DIR}/mrn_version.h.in"
Expand Down
2 changes: 0 additions & 2 deletions storage/mroonga/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ update-latest-release: misc
misc/update-latest-release.rb \
$(PACKAGE) $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
$(VERSION) $(NEW_RELEASE_DATE) \
packages/rpm/fedora/mysql-mroonga.spec.in \
packages/rpm/fedora/mariadb-mroonga.spec.in \
packages/rpm/centos/mariadb-mroonga.spec.in \
packages/rpm/centos/mysql55-mroonga.spec.in \
packages/rpm/centos/mysql56-community-mroonga.spec.in \
Expand Down
51 changes: 51 additions & 0 deletions storage/mroonga/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "{build}"
clone_depth: 10
install:
- cd ..
- choco install curl 7zip.commandline
- curl -O http://mirror.jmu.edu/pub/mariadb/mariadb-10.0.16/source/mariadb-10.0.16.tar.gz
- 7z x mariadb-10.0.16.tar.gz
- 7z x mariadb-10.0.16.tar > nul
- cd mariadb-10.0.16
- rmdir /S /Q storage\mroonga\
- move ..\mroonga storage\mroonga
- git clone --quiet --depth 1 https://github.com/groonga/groonga.git ..\groonga
- rmdir /S /Q ..\groonga\test\
- mkdir storage\mroonga\vendor
- move ..\groonga storage\mroonga\vendor\groonga
- git clone --quiet --depth 1 https://github.com/groonga/groonga-normalizer-mysql.git storage\mroonga\vendor\groonga\vendor\plugins\groonga-normalizer-mysql
build_script:
- "echo # > win\\packaging\\CMakeLists.txt"
- cmake . -G "Visual Studio 12 Win64"
-DCMAKE_BUILD_TYPE=Debug
-DWITHOUT_ARCHIVE=ON
-DWITHOUT_BLACKHOLE=ON
-DWITHOUT_CASSANDRA=ON
-DWITHOUT_CONNECT=ON
-DWITHOUT_CSV=ON
-DWITHOUT_EXAMPLE=ON
-DWITHOUT_FEDERATED=ON
-DWITHOUT_FEDERATEDX=ON
-DWITHOUT_HEAP=ON
-DWITHOUT_INNOBASE=ON
-DWITHOUT_MYISAM=ON
-DWITHOUT_MYISAMMRG=ON
-DWITHOUT_OQGRAPH=ON
-DWITHOUT_PERFSCHEMA=OFF
-DWITHOUT_SEQUENCE=ON
-DWITHOUT_SPHINX=ON
-DWITHOUT_SPIDER=ON
-DWITHOUT_TEST_SQL_DISCOVERY=ON
-DWITHOUT_TOKUDB=ON
-DWITHOUT_XTRADB=ON
-DWITH_UNIT_TESTS=OFF
- cmake --build . --config Debug

notifications:
- provider: Email
to:
- groonga-mysql-commit@lists.sourceforge.jp
- kou@clear-code.com
on_build_status_changed: true

test: off
7 changes: 4 additions & 3 deletions storage/mroonga/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ AC_DEFUN([CONFIG_OPTION_MYSQL],[
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_build_dir/include"
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/sql"
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$ac_mysql_source_dir/include"
if test -d "$ac_mysql_source_dir/extra/rapidjson"; then
mysql_rapidjson_include_dir="$ac_mysql_source_dir/extra/rapidjson/include"
MYSQL_INCLUDES="$MYSQL_INCLUDES -I$mysql_rapidjson_include_dir"
fi
if test -d "$ac_mysql_source_dir/pcre"; then
mysql_regex_include_dir="$ac_mysql_source_dir/pcre"
else
Expand Down Expand Up @@ -461,7 +465,6 @@ AC_CONFIG_FILES([
packages/Makefile
packages/rpm/Makefile
packages/rpm/centos/Makefile
packages/rpm/fedora/Makefile
packages/yum/Makefile
packages/apt/Makefile
packages/source/Makefile
Expand All @@ -486,8 +489,6 @@ AC_OUTPUT([
packages/rpm/centos/mysql55-mroonga.spec
packages/rpm/centos/mysql56-community-mroonga.spec
packages/rpm/centos/mariadb-mroonga.spec
packages/rpm/fedora/mysql-mroonga.spec
packages/rpm/fedora/mariadb-mroonga.spec
packages/yum/env.sh
data/install.sql
])
Loading

0 comments on commit da63713

Please sign in to comment.