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 @@
# this program; if not, write to the Free Software Foundation, Inc.,
# 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)
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffCompress "" HAVE_BZLIB2_COMPRESS)
CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS)
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)
ENDIF()
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()
......@@ -12,24 +12,37 @@
# this program; if not, write to the Free Software Foundation, Inc.,
# 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)
CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB)
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)
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
LINK_LIBRARIES(lz4)
ENDIF()
IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
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)
CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
CHECK_LIBRARY_EXISTS(liblz4.a LZ4_compress_limitedOutput "" HAVE_LZ4_LIB)
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)
IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
LINK_LIBRARIES(liblz4.a)
IF(HAVE_LZ4_LIB AND HAVE_LZ4_H)
ADD_DEFINITIONS(-DHAVE_LZ4=1)
LINK_LIBRARIES(liblz4.a)
ELSE()
IF (WITH_INNODB_LZ4 STREQUAL "ON")
MESSAGE(FATAL_ERROR "Required lz4 library is not found")
ENDIF()
ENDIF()
ENDIF()
ENDMACRO()
\ No newline at end of file
......@@ -12,14 +12,22 @@
# this program; if not, write to the Free Software Foundation, Inc.,
# 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)
CHECK_LIBRARY_EXISTS(lzma lzma_stream_buffer_decode "" HAVE_LZMA_DECODE)
CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE)
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)
ENDIF()
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()
......@@ -12,24 +12,37 @@
# this program; if not, write to the Free Software Foundation, Inc.,
# 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)
CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB)
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)
ENDIF()
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)
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)
ENDIF()
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()
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