diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-03-27 11:03:23 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-03-29 00:40:22 +0200 |
commit | 3a3b3d8ba8d8f32feb7cf6c2609639635ddb53b5 (patch) | |
tree | d3d1d04f802c7335c3f8a97fdd31440ffaac282b /storage/innobase | |
parent | 92aafebd2a02be4c40ad4beb5b28ca6889c99cb9 (diff) | |
download | mariadb-git-3a3b3d8ba8d8f32feb7cf6c2609639635ddb53b5.tar.gz |
cleanup: innodb files in cmake/
moved to storage/innobase/
also removed duplicate checks from storage/innobase/CMakeLists.txt
(they're all in storage/innobase/innodb.cmake)
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/CMakeLists.txt | 27 | ||||
-rw-r--r-- | storage/innobase/bzip2.cmake | 33 | ||||
-rw-r--r-- | storage/innobase/innodb.cmake | 23 | ||||
-rw-r--r-- | storage/innobase/lz4.cmake | 56 | ||||
-rw-r--r-- | storage/innobase/lzma.cmake | 33 | ||||
-rw-r--r-- | storage/innobase/lzo.cmake | 48 | ||||
-rw-r--r-- | storage/innobase/snappy.cmake | 32 |
7 files changed, 219 insertions, 33 deletions
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 80d84819f08..1ecf80bb92d 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -16,22 +16,7 @@ # This is the CMakeLists for InnoDB -INCLUDE(CheckFunctionExists) -INCLUDE(CheckCSourceCompiles) -INCLUDE(CheckCSourceRuns) -INCLUDE(lz4) -INCLUDE(lzo) -INCLUDE(lzma) -INCLUDE(bzip2) -INCLUDE(snappy) -INCLUDE(numa) -MYSQL_CHECK_LZ4() -MYSQL_CHECK_LZO() -MYSQL_CHECK_LZMA() -MYSQL_CHECK_BZIP2() -MYSQL_CHECK_SNAPPY() -MYSQL_CHECK_NUMA() INCLUDE(innodb.cmake) @@ -185,18 +170,6 @@ IF(WITH_INNOBASE_STORAGE_ENGINE) ADD_DEPENDENCIES(innobase GenError) ENDIF() -# Avoid generating Hardware Capabilities due to crc32 instructions -IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386") - INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) - MY_CHECK_CXX_COMPILER_FLAG("-Wa,-nH" HAVE_WA_NH) - IF(HAVE_WA_NH) - ADD_COMPILE_FLAGS( - ut/ut0crc32.cc - COMPILE_FLAGS "-Wa,-nH" - ) - ENDIF() -ENDIF() - # A GCC bug causes crash when compiling these files on ARM64 with -O1+ # Compile them with -O0 as a workaround. IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") diff --git a/storage/innobase/bzip2.cmake b/storage/innobase/bzip2.cmake new file mode 100644 index 00000000000..0c15853d0b9 --- /dev/null +++ b/storage/innobase/bzip2.cmake @@ -0,0 +1,33 @@ +# Copyright (C) 2014, SkySQL Ab. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(WITH_INNODB_BZIP2 AUTO CACHE STRING + "Build with bzip2. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") + +MACRO (MYSQL_CHECK_BZIP2) + IF (WITH_INNODB_BZIP2 STREQUAL "ON" OR WITH_INNODB_BZIP2 STREQUAL "AUTO") + CHECK_INCLUDE_FILES(bzlib.h HAVE_BZLIB2_H) + CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffCompress "" HAVE_BZLIB2_COMPRESS) + CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS) + + IF (HAVE_BZLIB2_COMPRESS AND HAVE_BZLIB2_DECOMPRESS AND HAVE_BZLIB2_H) + ADD_DEFINITIONS(-DHAVE_BZIP2=1) + LINK_LIBRARIES(bz2) + ELSE() + IF (WITH_INNODB_BZIP2 STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required bzip2 library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake index 880389edbf1..9d6ac0eb0e8 100644 --- a/storage/innobase/innodb.cmake +++ b/storage/innobase/innodb.cmake @@ -19,11 +19,11 @@ INCLUDE(CheckFunctionExists) INCLUDE(CheckCSourceCompiles) INCLUDE(CheckCSourceRuns) -INCLUDE(lz4) -INCLUDE(lzo) -INCLUDE(lzma) -INCLUDE(bzip2) -INCLUDE(snappy) +INCLUDE(lz4.cmake) +INCLUDE(lzo.cmake) +INCLUDE(lzma.cmake) +INCLUDE(bzip2.cmake) +INCLUDE(snappy.cmake) MYSQL_CHECK_LZ4() MYSQL_CHECK_LZO() @@ -240,6 +240,18 @@ IF (MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8) PROPERTIES COMPILE_FLAGS -Od) ENDIF() +# Avoid generating Hardware Capabilities due to crc32 instructions +IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386") + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + MY_CHECK_CXX_COMPILER_FLAG("-Wa,-nH" HAVE_WA_NH) + IF(HAVE_WA_NH) + ADD_COMPILE_FLAGS( + ut/ut0crc32.cc + COMPILE_FLAGS "-Wa,-nH" + ) + ENDIF() +ENDIF() + IF(MSVC) # Avoid "unreferenced label" warning in generated file GET_FILENAME_COMPONENT(_SRC_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) @@ -253,4 +265,3 @@ ENDIF() INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include ${CMAKE_SOURCE_DIR}/storage/innobase/handler ${CMAKE_SOURCE_DIR}/libbinlogevents/include ) - diff --git a/storage/innobase/lz4.cmake b/storage/innobase/lz4.cmake new file mode 100644 index 00000000000..075904589f0 --- /dev/null +++ b/storage/innobase/lz4.cmake @@ -0,0 +1,56 @@ +# Copyright (C) 2014, SkySQL Ab. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(WITH_INNODB_LZ4 AUTO CACHE STRING + "Build with lz4. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") + +MACRO (MYSQL_CHECK_LZ4) + IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO") + CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H) + CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB) + CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT) + + IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H) + ADD_DEFINITIONS(-DHAVE_LZ4=1) + IF (HAVE_LZ4_COMPRESS_DEFAULT) + ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1) + ENDIF() + LINK_LIBRARIES(lz4) + ELSE() + IF (WITH_INNODB_LZ4 STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required lz4 library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() + +MACRO (MYSQL_CHECK_LZ4_STATIC) + IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO") + CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H) + CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB) + CHECK_LIBRARY_EXISTS(liblz3.a LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT) + + IF(HAVE_LZ4_LIB AND HAVE_LZ4_H) + ADD_DEFINITIONS(-DHAVE_LZ4=1) + IF (HAVE_LZ4_COMPRESS_DEFAULT) + ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1) + ENDIF() + LINK_LIBRARIES(liblz4.a) + ELSE() + IF (WITH_INNODB_LZ4 STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required lz4 library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() diff --git a/storage/innobase/lzma.cmake b/storage/innobase/lzma.cmake new file mode 100644 index 00000000000..12a28a17a43 --- /dev/null +++ b/storage/innobase/lzma.cmake @@ -0,0 +1,33 @@ +# Copyright (C) 2014, SkySQL Ab. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(WITH_INNODB_LZMA AUTO CACHE STRING + "Build with lzma. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") + +MACRO (MYSQL_CHECK_LZMA) + IF (WITH_INNODB_LZMA STREQUAL "ON" OR WITH_INNODB_LZMA STREQUAL "AUTO") + CHECK_INCLUDE_FILES(lzma.h HAVE_LZMA_H) + CHECK_LIBRARY_EXISTS(lzma lzma_stream_buffer_decode "" HAVE_LZMA_DECODE) + CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE) + + IF (HAVE_LZMA_DECODE AND HAVE_LZMA_ENCODE AND HAVE_LZMA_H) + ADD_DEFINITIONS(-DHAVE_LZMA=1) + LINK_LIBRARIES(lzma) + ELSE() + IF (WITH_INNODB_LZMA STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required lzma library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() diff --git a/storage/innobase/lzo.cmake b/storage/innobase/lzo.cmake new file mode 100644 index 00000000000..07cba011c06 --- /dev/null +++ b/storage/innobase/lzo.cmake @@ -0,0 +1,48 @@ +# Copyright (C) 2014, SkySQL Ab. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(WITH_INNODB_LZO AUTO CACHE STRING + "Build with lzo. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") + +MACRO (MYSQL_CHECK_LZO_STATIC) + IF (WITH_INNODB_LZO STREQUAL "ON" OR WITH_INNODB_LZO STREQUAL "AUTO") + CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) + CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB) + + IF(HAVE_LZO_LIB AND HAVE_LZO_H) + ADD_DEFINITIONS(-DHAVE_LZO=1) + LINK_LIBRARIES(liblzo2.a) + ELSE() + IF (WITH_INNODB_LZO STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required lzo library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() + +MACRO (MYSQL_CHECK_LZO) + IF (WITH_INNODB_LZO STREQUAL "ON" OR WITH_INNODB_LZO STREQUAL "AUTO") + CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) + CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB) + + IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H) + ADD_DEFINITIONS(-DHAVE_LZO=1) + LINK_LIBRARIES(lzo2) + ELSE() + IF (WITH_INNODB_LZO STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required lzo library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() diff --git a/storage/innobase/snappy.cmake b/storage/innobase/snappy.cmake new file mode 100644 index 00000000000..cb0839a3480 --- /dev/null +++ b/storage/innobase/snappy.cmake @@ -0,0 +1,32 @@ +# Copyright (C) 2015, MariaDB Corporation. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +SET(WITH_INNODB_SNAPPY AUTO CACHE STRING + "Build with snappy. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") + +MACRO (MYSQL_CHECK_SNAPPY) + IF (WITH_INNODB_SNAPPY STREQUAL "ON" OR WITH_INNODB_SNAPPY STREQUAL "AUTO") + CHECK_INCLUDE_FILES(snappy-c.h HAVE_SNAPPY_H) + CHECK_LIBRARY_EXISTS(snappy snappy_uncompress "" HAVE_SNAPPY_SHARED_LIB) + + IF(HAVE_SNAPPY_SHARED_LIB AND HAVE_SNAPPY_H) + ADD_DEFINITIONS(-DHAVE_SNAPPY=1) + LINK_LIBRARIES(snappy) + ELSE() + IF (WITH_INNODB_SNAPPY STREQUAL "ON") + MESSAGE(FATAL_ERROR "Required snappy library is not found") + ENDIF() + ENDIF() + ENDIF() +ENDMACRO() |