Commit 41dc186a authored by Jan Lindström's avatar Jan Lindström

MDEV-6633: Remove magic dependencies for InnoDB compression methods

Added options for each compression type that can be disabled i.e.
bzip2, lz4, lzma and lzo.
parent bfe703a4
...@@ -12,14 +12,22 @@ ...@@ -12,14 +12,22 @@
# this program; if not, write to the Free Software Foundation, Inc., # this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO (MYSQL_CHECK_BZIP2) SET(WITH_INNODB_BZIP2 AUTO CACHE STRING
"Build with bzip2. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
CHECK_INCLUDE_FILES(bzlib.h HAVE_BZLIB2_H) MACRO (MYSQL_CHECK_BZIP2)
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffCompress "" HAVE_BZLIB2_COMPRESS) IF (WITH_INNODB_BZIP2 STREQUAL "ON" OR WITH_INNODB_BZIP2 STREQUAL "AUTO")
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS) 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) IF (HAVE_BZLIB2_COMPRESS AND HAVE_BZLIB2_DECOMPRESS AND HAVE_BZLIB2_H)
ADD_DEFINITIONS(-DHAVE_BZIP2=1) ADD_DEFINITIONS(-DHAVE_BZIP2=1)
LINK_LIBRARIES(bz2) LINK_LIBRARIES(bz2)
ENDIF() ELSE()
IF (WITH_INNODB_BZIP2 STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required bzip2 library is not found")
ENDIF()
ENDIF()
ENDIF()
ENDMACRO() ENDMACRO()
...@@ -12,24 +12,37 @@ ...@@ -12,24 +12,37 @@
# this program; if not, write to the Free Software Foundation, Inc., # this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO (MYSQL_CHECK_LZ4) SET(WITH_INNODB_LZ4 AUTO CACHE STRING
"Build with lz4. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H) MACRO (MYSQL_CHECK_LZ4)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB) 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)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H) IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1) ADD_DEFINITIONS(-DHAVE_LZ4=1)
LINK_LIBRARIES(lz4) LINK_LIBRARIES(lz4)
ENDIF() ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lz4 library is not found")
ENDIF()
ENDIF()
ENDIF()
ENDMACRO() ENDMACRO()
MACRO (MYSQL_CHECK_LZ4_STATIC) 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_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB) CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB)
IF(HAVE_LZ4_LIB AND HAVE_LZ4_H) IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1) ADD_DEFINITIONS(-DHAVE_LZ4=1)
LINK_LIBRARIES(liblz4.a) LINK_LIBRARIES(liblz4.a)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lz4 library is not found")
ENDIF()
ENDIF()
ENDIF() ENDIF()
ENDMACRO() ENDMACRO()
\ No newline at end of file
...@@ -12,14 +12,22 @@ ...@@ -12,14 +12,22 @@
# this program; if not, write to the Free Software Foundation, Inc., # this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO (MYSQL_CHECK_LZMA) SET(WITH_INNODB_LZMA AUTO CACHE STRING
"Build with lzma. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
CHECK_INCLUDE_FILES(lzma.h HAVE_LZMA_H) MACRO (MYSQL_CHECK_LZMA)
CHECK_LIBRARY_EXISTS(lzma lzma_stream_buffer_decode "" HAVE_LZMA_DECODE) IF (WITH_INNODB_LZMA STREQUAL "ON" OR WITH_INNODB_LZMA STREQUAL "AUTO")
CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE) 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) IF (HAVE_LZMA_DECODE AND HAVE_LZMA_ENCODE AND HAVE_LZMA_H)
ADD_DEFINITIONS(-DHAVE_LZMA=1) ADD_DEFINITIONS(-DHAVE_LZMA=1)
LINK_LIBRARIES(lzma) LINK_LIBRARIES(lzma)
ENDIF() ELSE()
IF (WITH_INNODB_LZMA STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lzma library is not found")
ENDIF()
ENDIF()
ENDIF()
ENDMACRO() ENDMACRO()
...@@ -12,24 +12,37 @@ ...@@ -12,24 +12,37 @@
# this program; if not, write to the Free Software Foundation, Inc., # this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO (MYSQL_CHECK_LZO_STATIC) SET(WITH_INNODB_LZO AUTO CACHE STRING
"Build with lzo. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) MACRO (MYSQL_CHECK_LZO_STATIC)
CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB) 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) IF(HAVE_LZO_LIB AND HAVE_LZO_H)
ADD_DEFINITIONS(-DHAVE_LZO=1) ADD_DEFINITIONS(-DHAVE_LZO=1)
LINK_LIBRARIES(liblzo2.a) LINK_LIBRARIES(liblzo2.a)
ENDIF() ELSE()
IF (WITH_INNODB_LZO STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lzo library is not found")
ENDIF()
ENDIF()
ENDIF()
ENDMACRO() ENDMACRO()
MACRO (MYSQL_CHECK_LZO) 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)
CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H)
CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB) ADD_DEFINITIONS(-DHAVE_LZO=1)
LINK_LIBRARIES(lzo2)
IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H) ELSE()
ADD_DEFINITIONS(-DHAVE_LZO=1) IF (WITH_INNODB_LZO STREQUAL "ON")
LINK_LIBRARIES(lzo2) MESSAGE(FATAL_ERROR "Required lzo library is not found")
ENDIF() ENDIF()
ENDIF()
ENDIF()
ENDMACRO() ENDMACRO()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment