diff options
Diffstat (limited to 'cmake')
54 files changed, 216 insertions, 162 deletions
diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake index 02124ae7ba1..805322229c4 100644 --- a/cmake/abi_check.cmake +++ b/cmake/abi_check.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # # Headers which need to be checked for abi/api compatibility are in diff --git a/cmake/bison.cmake b/cmake/bison.cmake index 0892a213d04..24adcb788d9 100644 --- a/cmake/bison.cmake +++ b/cmake/bison.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") # On Solaris, /opt/csw often contains a newer bison diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 04860a40dbb..2a8461bf370 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This file includes build settings used for MySQL release @@ -83,15 +83,14 @@ IF(FEATURE_SET) ENDIF() ENDIF() -OPTION(ENABLED_LOCAL_INFILE "" ON) SET(WITH_INNODB_SNAPPY OFF CACHE STRING "") IF(WIN32) SET(WITH_LIBARCHIVE STATIC CACHE STRING "") ELSEIF(RPM) SET(WITH_SSL system CACHE STRING "") SET(WITH_ZLIB system CACHE STRING "") - SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "") - SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "") + SET(CHECKMODULE /usr/bin/checkmodule CACHE FILEPATH "") + SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "") SET(WITH_LIBARCHIVE ON CACHE STRING "") ELSEIF(DEB) SET(WITH_SSL system CACHE STRING "") @@ -119,6 +118,7 @@ ENDIF() IF(UNIX) SET(WITH_EXTRA_CHARSETS all CACHE STRING "") + SET(PLUGIN_AUTH_PAM YES) IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") IF(NOT IGNORE_AIO_CHECK) diff --git a/cmake/build_depends.cmake b/cmake/build_depends.cmake new file mode 100644 index 00000000000..0d17c22cf98 --- /dev/null +++ b/cmake/build_depends.cmake @@ -0,0 +1,39 @@ +IF(RPM) + MACRO(FIND_DEP V) + SET(out ${V}_DEP) + IF (NOT DEFINED ${out}) + IF(EXISTS ${${V}} AND NOT IS_DIRECTORY ${${V}}) + EXECUTE_PROCESS(COMMAND ${ARGN} RESULT_VARIABLE res OUTPUT_VARIABLE O OUTPUT_STRIP_TRAILING_WHITESPACE) + ELSE() + SET(res 1) + ENDIF() + IF (res) + SET(O) + ELSE() + MESSAGE(STATUS "Need ${O} for ${${V}}") + ENDIF() + SET(${out} ${O} CACHE INTERNAL "Package that contains ${${V}}" FORCE) + ENDIF() + ENDMACRO() + + GET_CMAKE_PROPERTY(ALL_VARS CACHE_VARIABLES) + FOREACH (V ${ALL_VARS}) + GET_PROPERTY(H CACHE ${V} PROPERTY HELPSTRING) + IF (H MATCHES "^Have library [^/]" AND ${V}) + STRING(REGEX REPLACE "^Have library " "" L ${H}) + SET(V ${L}_LIBRARY) + FIND_LIBRARY(${V} ${L}) + ENDIF() + GET_PROPERTY(T CACHE ${V} PROPERTY TYPE) + IF ((T STREQUAL FILEPATH OR V MATCHES "^CMAKE_COMMAND$") AND ${V} MATCHES "^/") + IF (RPM) + FIND_DEP(${V} rpm -q --qf "%{NAME}" -f ${${V}}) + ELSE() # must be DEB + MESSAGE(FATAL_ERROR "Not implemented") + ENDIF () + SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP}) + ENDIF() + ENDFOREACH() + LIST(REMOVE_DUPLICATES BUILD_DEPS) + STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}") +ENDIF(RPM) diff --git a/cmake/bzip2.cmake b/cmake/bzip2.cmake index 0c15853d0b9..26fd703120e 100644 --- a/cmake/bzip2.cmake +++ b/cmake/bzip2.cmake @@ -10,7 +10,7 @@ # # 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 +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA SET(WITH_INNODB_BZIP2 AUTO CACHE STRING "Build with bzip2. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") diff --git a/cmake/cat.cmake b/cmake/cat.cmake index 1ffe2ecfa1d..3a76b20da99 100644 --- a/cmake/cat.cmake +++ b/cmake/cat.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Concatenate files # diff --git a/cmake/character_sets.cmake b/cmake/character_sets.cmake index 1c93441cbb1..37de79758b3 100644 --- a/cmake/character_sets.cmake +++ b/cmake/character_sets.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Charsets and collations IF(NOT DEFAULT_CHARSET) diff --git a/cmake/check_compiler_flag.cmake b/cmake/check_compiler_flag.cmake index 673361ab8fe..547325e4fa2 100644 --- a/cmake/check_compiler_flag.cmake +++ b/cmake/check_compiler_flag.cmake @@ -13,7 +13,8 @@ SET(fail_patterns FAIL_REGEX "warning:.*redefined" FAIL_REGEX "[Ww]arning: [Oo]ption" ) - +#The regex patterns above are not localized, thus LANG=C +SET(ENV{LANG} C) MACRO (MY_CHECK_C_COMPILER_FLAG flag) STRING(REGEX REPLACE "[-,= +]" "_" result "HAVE_C_${flag}") SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") diff --git a/cmake/check_minimal_version.cmake b/cmake/check_minimal_version.cmake index d96c6a93418..5bef555b32d 100644 --- a/cmake/check_minimal_version.cmake +++ b/cmake/check_minimal_version.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This is a helper script is used to check for the minimal required version # It helps to decide whether to use autoconf based configure or cmake's diff --git a/cmake/cmake_parse_arguments.cmake b/cmake/cmake_parse_arguments.cmake index 487fe2bacd9..800fef6e728 100644 --- a/cmake/cmake_parse_arguments.cmake +++ b/cmake/cmake_parse_arguments.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Handy macro to parse macro arguments MACRO(MYSQL_PARSE_ARGUMENTS prefix arg_names option_names) diff --git a/cmake/compile_flags.cmake b/cmake/compile_flags.cmake index b39bf7b79d6..a87846e9915 100644 --- a/cmake/compile_flags.cmake +++ b/cmake/compile_flags.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA ## ADD_COMPILE_FLAGS(<source files> COMPILE_FLAGS <flags>) diff --git a/cmake/configure.pl b/cmake/configure.pl index 68baf436c1c..70122664ad4 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -13,7 +13,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA use strict; use Cwd 'abs_path'; diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index e80fb199f03..ae9e3b904b3 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -37,7 +37,8 @@ IF(CMAKE_VERSION VERSION_LESS "3.6.0") SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}") ELSE() SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT") - SET(CPACK_RPM_DEBUGINFO_PACKAGE ON) + OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON) + MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE) ENDIF() SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}") @@ -67,6 +68,14 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE " %define _bindir ${INSTALL_BINDIRABS} %define _sbindir ${INSTALL_SBINDIRABS} %define _sysconfdir ${INSTALL_SYSCONFDIR} + +%{?filter_setup: +%filter_provides_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$ +%filter_requires_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$ +%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d +%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d +%filter_setup +} ") # this creative hack is described here: http://www.cmake.org/pipermail/cmake/2012-January/048416.html @@ -83,12 +92,15 @@ SET(ignored "%ignore /etc" "%ignore /etc/init.d" "%ignore /etc/logrotate.d" + "%ignore /etc/systemd" + "%ignore /etc/systemd/system" "%ignore ${CMAKE_INSTALL_PREFIX}" "%ignore ${CMAKE_INSTALL_PREFIX}/bin" "%ignore ${CMAKE_INSTALL_PREFIX}/include" "%ignore ${CMAKE_INSTALL_PREFIX}/lib" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system" + "%ignore ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d" "%ignore ${CMAKE_INSTALL_PREFIX}/lib64" "%ignore ${CMAKE_INSTALL_PREFIX}/sbin" "%ignore ${CMAKE_INSTALL_PREFIX}/share" @@ -222,36 +234,6 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7") SET(CPACK_RPM_common_PACKAGE_CONFLICTS "mariadb-libs < 1:%{version}-%{release}") ENDIF() -# workaround for lots of perl dependencies added by rpmbuild -SETA(CPACK_RPM_test_PACKAGE_PROVIDES - "perl(lib::mtr_gcov.pl)" - "perl(lib::mtr_gprof.pl)" - "perl(lib::mtr_io.pl)" - "perl(lib::mtr_misc.pl)" - "perl(lib::mtr_process.pl)" - "perl(lib::v1/mtr_cases.pl)" - "perl(lib::v1/mtr_gcov.pl)" - "perl(lib::v1/mtr_gprof.pl)" - "perl(lib::v1/mtr_im.pl)" - "perl(lib::v1/mtr_io.pl)" - "perl(lib::v1/mtr_match.pl)" - "perl(lib::v1/mtr_misc.pl)" - "perl(lib::v1/mtr_process.pl)" - "perl(lib::v1/mtr_report.pl)" - "perl(lib::v1/mtr_stress.pl)" - "perl(lib::v1/mtr_timer.pl)" - "perl(lib::v1/mtr_unique.pl)" - "perl(mtr_cases)" - "perl(mtr_io.pl)" - "perl(mtr_match)" - "perl(mtr_misc.pl)" - "perl(mtr_gcov.pl)" - "perl(mtr_gprof.pl)" - "perl(mtr_process.pl)" - "perl(mtr_report)" - "perl(mtr_results)" - "perl(mtr_unique)") - # If we want to build build MariaDB-shared-compat, # extract compat libraries from MariaDB-shared-5.3 rpm FILE(GLOB compat_rpm RELATIVE ${CMAKE_SOURCE_DIR} @@ -281,5 +263,24 @@ ENDIF(compat_rpm) SET(CPACK_RPM_compat_PACKAGE_PROVIDES "mysql-libs = 5.3.5") # exact version doesn't matter as long as it greater than 5.1 SET(CPACK_RPM_compat_PACKAGE_OBSOLETES "mysql-libs < 5.3.5") -ENDIF(RPM) +################ +IF(CMAKE_VERSION VERSION_GREATER "3.9.99") + +SET(CPACK_SOURCE_GENERATOR "RPM") +SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS + "-DBUILD_CONFIG=mysql_release" + "-DRPM=${RPM}" + "-DCPACK_RPM_BUILD_SOURCE_DIRS_PREFIX=/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}" + ) +MACRO(ADDIF var) + IF(DEFINED ${var}) + SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-D${var}=${${var}}") + ENDIF() +ENDMACRO() + +ADDIF(BUILD_CONFIG) +ADDIF(WITH_SSL) + +ENDIF() +ENDIF(RPM) diff --git a/cmake/cpack_source_ignore_files.cmake b/cmake/cpack_source_ignore_files.cmake index 0654fa38388..65abf9e8a9d 100644 --- a/cmake/cpack_source_ignore_files.cmake +++ b/cmake/cpack_source_ignore_files.cmake @@ -11,22 +11,23 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA SET(CPACK_SOURCE_IGNORE_FILES \\\\.git/ -\\\\.gitignore -CMakeCache\\\\.txt -cmake_dist\\\\.cmake -CPackSourceConfig\\\\.cmake -CPackConfig.cmake -/cmake_install\\\\.cmake -/CTestTestfile\\\\.cmake +\\\\.gitignore$ +\\\\.gitattributes$ +CMakeCache\\\\.txt$ +cmake_dist\\\\.cmake$ +CPackSourceConfig\\\\.cmake$ +CPackConfig.cmake$ +/cmake_install\\\\.cmake$ +/CTestTestfile\\\\.cmake$ /CMakeFiles/ /version_resources/ /_CPack_Packages/ -$\\\\.gz -$\\\\.zip +\\\\.gz$ +\\\\.zip$ /CMakeFiles/ /version_resources/ /_CPack_Packages/ @@ -50,5 +51,6 @@ include/config\\\\.h$ include/my_config\\\\.h$ /autom4te\\\\.cache/ errmsg\\\\.sys$ +\\\\.rpm$ # ) diff --git a/cmake/cpu_info.cmake b/cmake/cpu_info.cmake index 1772510e72b..f3ddd33df3a 100644 --- a/cmake/cpu_info.cmake +++ b/cmake/cpu_info.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Symbols with information about the CPU. diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in index c77e28d882c..4847d5ef35d 100644 --- a/cmake/create_initial_db.cmake.in +++ b/cmake/create_initial_db.cmake.in @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This script creates initial database for packaging on Windows SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@") diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake index c0ffce353f3..43d8b15a7ab 100644 --- a/cmake/do_abi_check.cmake +++ b/cmake/do_abi_check.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # # Rules for checking that the abi/api has not changed. diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake index d7ab0f31991..4e0f7501045 100644 --- a/cmake/dtrace.cmake +++ b/cmake/dtrace.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 4) @@ -46,6 +46,10 @@ MACRO(CHECK_DTRACE) AND NOT CMAKE_SYSTEM_NAME MATCHES "SunOS") SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace") ENDIF() + # On GNU/Hurd, dtrace is not supported + IF(DTRACE AND CMAKE_SYSTEM_NAME MATCHES "GNU") + SET(ENABLE_DTRACE OFF CACHE BOOL "Disable dtrace") + ENDIF() SET(HAVE_DTRACE ${ENABLE_DTRACE}) IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") IF(CMAKE_SIZEOF_VOID_P EQUAL 4) diff --git a/cmake/dtrace_prelink.cmake b/cmake/dtrace_prelink.cmake index 0efc2bb64bb..f2e678f06d5 100644 --- a/cmake/dtrace_prelink.cmake +++ b/cmake/dtrace_prelink.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Generates an ELF object file with dtrace entry points. # This object that must to be linked with together with diff --git a/cmake/info_bin.cmake b/cmake/info_bin.cmake index 9cec3de0e0f..d59b512bcec 100644 --- a/cmake/info_bin.cmake +++ b/cmake/info_bin.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # The sole purpose of this cmake control file is to create the "INFO_BIN" file. diff --git a/cmake/info_macros.cmake.in b/cmake/info_macros.cmake.in index 89b04666c96..89ca1ec79dc 100644 --- a/cmake/info_macros.cmake.in +++ b/cmake/info_macros.cmake.in @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Handle/create the "INFO_*" files describing a MariaDB (server) binary. diff --git a/cmake/info_src.cmake b/cmake/info_src.cmake index ce9873cc9d0..df6249f111e 100644 --- a/cmake/info_src.cmake +++ b/cmake/info_src.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # The sole purpose of this cmake control file is to create the "INFO_SRC" file. diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 5484691e94a..e4d317e979c 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # The purpose of this file is to set the default installation layout. # diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 121825f8f3c..0c05b06208f 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) @@ -114,7 +114,12 @@ FUNCTION(INSTALL_SCRIPT) SET(COMP) ENDIF() + IF (COMP MATCHES ${SKIP_COMPONENTS}) + RETURN() + ENDIF() + INSTALL(PROGRAMS ${script} DESTINATION ${ARG_DESTINATION} ${COMP}) + INSTALL_MANPAGE(${script}) ENDFUNCTION() @@ -131,6 +136,10 @@ FUNCTION(INSTALL_DOCUMENTATION) SET(destination ${INSTALL_DOCDIR}) ENDIF() + IF (ARG_COMPONENT MATCHES ${SKIP_COMPONENTS}) + RETURN() + ENDIF() + STRING(TOUPPER ${ARG_COMPONENT} COMPUP) IF(CPACK_COMPONENT_${COMPUP}_GROUP) SET(group ${CPACK_COMPONENT_${COMPUP}_GROUP}) diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 2e65e8b5ba3..00d2def5877 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This file exports macros that emulate some functionality found in GNU libtool @@ -136,6 +136,10 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c) ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE}) SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) + IF(NOT _SKIP_PIC) + SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS + "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ENDIF() SET(OSLIBS) FOREACH(LIB ${LIBS_TO_MERGE}) @@ -240,11 +244,11 @@ MACRO(MERGE_LIBRARIES) # check for non-PIC libraries IF(NOT _SKIP_PIC) FOREACH(LIB ${LIBS}) - GET_TARGET_PROPERTY(${LIB} TYPE LIBTYPE) - IF(LIBTYPE STREQUAL "STATIC_LIBRARY") - GET_TARGET_PROPERTY(LIB COMPILE_FLAGS LIB_COMPILE_FLAGS) + GET_TARGET_PROPERTY(LTYPE ${LIB} TYPE) + IF(LTYPE STREQUAL "STATIC_LIBRARY") + GET_TARGET_PROPERTY(LIB_COMPILE_FLAGS ${LIB} COMPILE_FLAGS) STRING(REPLACE "${CMAKE_SHARED_LIBRARY_C_FLAGS}" - "<PIC_FLAG>" LIB_COMPILE_FLAGS ${LIB_COMPILE_FLAG}) + "<PIC_FLAG>" LIB_COMPILE_FLAGS "${LIB_COMPILE_FLAGS}") IF(NOT LIB_COMPILE_FLAGS MATCHES "<PIC_FLAG>") MESSAGE(FATAL_ERROR "Attempted to link non-PIC static library ${LIB} to shared library ${TARGET}\n" diff --git a/cmake/lz4.cmake b/cmake/lz4.cmake index ec0e2aa85df..098bf54f64a 100644 --- a/cmake/lz4.cmake +++ b/cmake/lz4.cmake @@ -10,7 +10,7 @@ # # 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 +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA SET(WITH_INNODB_LZ4 AUTO CACHE STRING "Build with lz4. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") diff --git a/cmake/lzma.cmake b/cmake/lzma.cmake index 12a28a17a43..93de0a2934d 100644 --- a/cmake/lzma.cmake +++ b/cmake/lzma.cmake @@ -10,7 +10,7 @@ # # 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 +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA SET(WITH_INNODB_LZMA AUTO CACHE STRING "Build with lzma. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") diff --git a/cmake/lzo.cmake b/cmake/lzo.cmake index 07cba011c06..236eac2d1e5 100644 --- a/cmake/lzo.cmake +++ b/cmake/lzo.cmake @@ -10,7 +10,7 @@ # # 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 +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA SET(WITH_INNODB_LZO AUTO CACHE STRING "Build with lzo. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 4e902d7fed8..8c2deeb8e40 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Common warning flags for GCC, G++, Clang and Clang++ SET(MY_WARNING_FLAGS @@ -28,10 +28,15 @@ SET(MY_WARNING_FLAGS -Woverloaded-virtual -Wvla -Wwrite-strings + -Werror ) -IF(MYSQL_MAINTAINER_MODE MATCHES "ON") - SET(WHERE) +IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0") + SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=maybe-uninitialized) +ENDIF() + +IF(MYSQL_MAINTAINER_MODE MATCHES "OFF") + RETURN() ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO") SET(WHERE DEBUG) ENDIF() diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in index f35d16834b6..d9153604a46 100644 --- a/cmake/make_dist.cmake.in +++ b/cmake/make_dist.cmake.in @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Make source distribution # If bzr is present, run bzr export. diff --git a/cmake/merge_archives_unix.cmake.in b/cmake/merge_archives_unix.cmake.in index d05336d6c91..7bb5f54f411 100644 --- a/cmake/merge_archives_unix.cmake.in +++ b/cmake/merge_archives_unix.cmake.in @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This script merges many static libraries into # one big library on Unix. diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index 45575bdd536..12635f2b582 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Add executable plus some additional MySQL specific stuff # Usage (same as for standard CMake's ADD_EXECUTABLE) @@ -59,6 +59,9 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) ELSE() SET(COMP COMPONENT Client) ENDIF() + IF (COMP MATCHES ${SKIP_COMPONENTS}) + RETURN() + ENDIF() MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) ENDIF() ENDFUNCTION() diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 1802b1a2678..ca8dafaa465 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # # Global constants, only to be changed between major releases. diff --git a/cmake/os/AIX.cmake b/cmake/os/AIX.cmake index c86392f8bc4..12ddf30d440 100644 --- a/cmake/os/AIX.cmake +++ b/cmake/os/AIX.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA #Enable 64 bit file offsets diff --git a/cmake/os/Cygwin.cmake b/cmake/os/Cygwin.cmake index 9c29277c626..a54241654a6 100644 --- a/cmake/os/Cygwin.cmake +++ b/cmake/os/Cygwin.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Cygwin is not Windows SET(WIN32 0)
\ No newline at end of file diff --git a/cmake/os/Darwin.cmake b/cmake/os/Darwin.cmake index 4ac72070e8b..21e18360dfe 100644 --- a/cmake/os/Darwin.cmake +++ b/cmake/os/Darwin.cmake @@ -11,6 +11,6 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This file includes OSX specific options and quirks, related to system checks diff --git a/cmake/os/FreeBSD.cmake b/cmake/os/FreeBSD.cmake index ffb89c81206..b9c335e4ddf 100644 --- a/cmake/os/FreeBSD.cmake +++ b/cmake/os/FreeBSD.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This file includes FreeBSD specific options and quirks, related to system checks diff --git a/cmake/os/HP-UX.cmake b/cmake/os/HP-UX.cmake index 4cadddc7b18..5bbc799427e 100644 --- a/cmake/os/HP-UX.cmake +++ b/cmake/os/HP-UX.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA INCLUDE(CheckCXXSourceCompiles) # Enable 64 bit file offsets diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake index b0680d92a1b..80650539c25 100644 --- a/cmake/os/Linux.cmake +++ b/cmake/os/Linux.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This file includes Linux specific options and quirks, related to system checks @@ -26,16 +26,16 @@ SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE=1) # Fix CMake (< 2.8) flags. -rdynamic exports too many symbols. FOREACH(LANG C CXX) - STRING(REPLACE "-rdynamic" "" + STRING(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS - ${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS} + "${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}" ) ENDFOREACH() # Ensure we have clean build for shared libraries # without unresolved symbols # Not supported with AddressSanitizer -IF(NOT WITH_ASAN) +IF(NOT WITH_ASAN AND NOT WITH_UBSAN) SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") ENDIF() diff --git a/cmake/os/OS400.cmake b/cmake/os/OS400.cmake index 502eeccc30a..5a9b2aba64d 100644 --- a/cmake/os/OS400.cmake +++ b/cmake/os/OS400.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA GET_FILENAME_COMPONENT(_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) INCLUDE(${_SCRIPT_DIR}/AIX.cmake)
\ No newline at end of file diff --git a/cmake/os/SunOS.cmake b/cmake/os/SunOS.cmake index d5a4b5c96b0..4a77b53fb31 100644 --- a/cmake/os/SunOS.cmake +++ b/cmake/os/SunOS.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA INCLUDE(CheckSymbolExists) INCLUDE(CheckCSourceRuns) diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 5b45c144b67..2e7577ec5e9 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # This file includes Windows specific hacks, mostly around compiler flags @@ -50,7 +50,7 @@ IF(CMAKE_C_COMPILER MATCHES "icl") ENDIF() ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE) -ADD_DEFINITIONS(-D_WIN32_WINNT=0x0600) +ADD_DEFINITIONS(-D_WIN32_WINNT=0x0A00) # We do not want the windows.h macros min/max ADD_DEFINITIONS(-DNOMINMAX) # Speed up build process excluding unused header files @@ -127,9 +127,8 @@ IF(MSVC) ENDIF() # Always link with socket library -LINK_LIBRARIES(ws2_32) -# ..also for tests -SET(CMAKE_REQUIRED_LIBRARIES ws2_32) +STRING(APPEND CMAKE_C_STANDARD_LIBRARIES " ws2_32.lib") +STRING(APPEND CMAKE_CXX_STANDARD_LIBRARIES " ws2_32.lib") # System checks SET(SIGNAL_WITH_VIO_CLOSE 1) # Something that runtime team needs diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 07a8085a411..a4d46df2af6 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Avoid system checks on Windows by pre-caching results. Most of the system checks # are not relevant for Windows anyway and it takes lot more time to run them, diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake index 4930a6bf40a..8acf52f1bb3 100644 --- a/cmake/package_name.cmake +++ b/cmake/package_name.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Produce meaningful package name for the binary package # The logic is rather involved with special cases for different OSes @@ -77,6 +77,9 @@ IF(NOT VERSION) SET(DEFAULT_MACHINE "i386") ENDIF() ENDIF() + ELSEIF(CMAKE_SYSTEM_NAME MATCHES "GNU") + SET(DEFAULT_PLATFORM "GNU") + SET(DEFAULT_MACHINE "i386") ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") IF(CMAKE_OSX_DEPLOYMENT_TARGET) SET(DEFAULT_PLATFORM "osx${CMAKE_OSX_DEPLOYMENT_TARGET}") diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 591c448a793..c9c18f7c079 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -1,4 +1,5 @@ -# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. +# Copyright (c) 2011, 2018, MariaDB Corporation # # 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 @@ -11,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) @@ -208,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN) ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") TARGET_LINK_LIBRARIES (${target} mysqld) ENDIF() - ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT WITH_ASAN AND NOT WITH_UBSAN) TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined") ENDIF() @@ -235,9 +236,6 @@ MACRO(MYSQL_ADD_PLUGIN) IF (NOT ARG_CLIENT) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE) ENDIF() - # workarounds for cmake issues #13248 and #12864: - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE) IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") diff --git a/cmake/readline.cmake b/cmake/readline.cmake index d03fe503882..082dd04cf4a 100644 --- a/cmake/readline.cmake +++ b/cmake/readline.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA INCLUDE(CheckCXXSourceCompiles) @@ -157,7 +157,7 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE) SET(USE_NEW_READLINE_INTERFACE 1) ELSE() IF(NOT_FOR_DISTRIBUTION) - SET(NON_DISTRIBUTABLE_WARNING 1) + SET(NON_DISTRIBUTABLE_WARNING "GPLv3") SET(USE_NEW_READLINE_INTERFACE 1) ELSE() SET(USE_NEW_READLINE_INTERFACE 0) diff --git a/cmake/snappy.cmake b/cmake/snappy.cmake index cb0839a3480..2810472cef6 100644 --- a/cmake/snappy.cmake +++ b/cmake/snappy.cmake @@ -10,7 +10,7 @@ # # 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 +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA SET(WITH_INNODB_SNAPPY AUTO CACHE STRING "Build with snappy. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'") diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index 18728c733db..fef78600de2 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # We support different versions of SSL: # - "bundled" uses source code in <source dir>/extra/yassl @@ -161,13 +161,7 @@ MACRO (MYSQL_CHECK_SSL) LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) ENDIF() - INCLUDE(CheckSymbolExists) - SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) - CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h" - HAVE_SHA512_DIGEST_LENGTH) - SET(CMAKE_REQUIRED_INCLUDES) - IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND - CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH) + IF (OPENSSL_INCLUDE_DIR) # Verify version number. Version information looks like: # #define OPENSSL_VERSION_NUMBER 0x1000103fL # Encoded as MNNFFPPS: major minor fix patch status @@ -176,12 +170,29 @@ MACRO (MYSQL_CHECK_SSL) REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" ) STRING(REGEX REPLACE - "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" + "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9][0-9][0-9]).*$" "\\1" OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}" ) MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}") - ENDIF() - IF(TRUE) #OPENSSL_MAJOR_VERSION GREATER 0) + ENDIF() + + INCLUDE(CheckSymbolExists) + INCLUDE(CheckCSourceCompiles) + SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) + CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h" + HAVE_SHA512_DIGEST_LENGTH) + CHECK_C_SOURCE_COMPILES(" + #include <openssl/dh.h> + int main() + { + DH dh; + return sizeof(dh.version); + }" OLD_OPENSSL_API) + SET(CMAKE_REQUIRED_INCLUDES) + IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND + OLD_OPENSSL_API AND + CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH) + SET(SSL_SOURCES "") SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY}) IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") @@ -208,12 +219,12 @@ MACRO (MYSQL_CHECK_SSL) HAVE_EncryptAes128Gcm) ELSE() IF(WITH_SSL STREQUAL "system") - MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support") + MESSAGE(FATAL_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support") ENDIF() MYSQL_USE_BUNDLED_SSL() ENDIF() ELSE() - MESSAGE(SEND_ERROR + MESSAGE(FATAL_ERROR "Wrong option for WITH_SSL. Valid values are: ${WITH_SSL_DOC}") ENDIF() ENDMACRO() diff --git a/cmake/stack_direction.c b/cmake/stack_direction.c index d75bbbfa035..1f7a5d0b135 100644 --- a/cmake/stack_direction.c +++ b/cmake/stack_direction.c @@ -13,7 +13,7 @@ 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 */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ /* Check stack direction (0-down, 1-up) */ int f(int *a) diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 692d4df9f26..23eb467f9b6 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA INCLUDE(FindPkgConfig) # http://www.cmake.org/cmake/help/v3.0/module/FindPkgConfig.html @@ -27,34 +27,22 @@ MACRO(CHECK_SYSTEMD) pkg_search_module(LIBSYSTEMD libsystemd libsystemd-daemon) ENDIF() IF(HAVE_DLOPEN) - SET(LIBSYSTEMD ${LIBSYSTEMD_LIBRARIES}) - #SET(CMAKE_REQUIRED_FLAGS ${LIBSYSTEMD_CFLAGS}) - SET(MYSQLD_LINK_FLAGS "${MYSQLD_LINK_FLAGS} ${LIBSYSTEMD_LDFLAGS}") + SET(LIBSYSTEMD ${LIBSYSTEMD_LDFLAGS} ${LIBSYSTEMD_LIBRARIES}) ELSE() - SET(LIBSYSTEMD ${LIBSYSTEMD_STATIC_LIBRARIES}) - #SET(CMAKE_REQUIRED_FLAGS ${LIBSYSTEMD_STATIC_CFLAGS}) - SET(MYSQLD_LINK_FLAGS "${MYSQLD_LINK_FLAGS} ${LIBSYSTEMD_STATIC_LDFLAGS}") + SET(LIBSYSTEMD ${LIBSYSTEMD_STATIC_LDFLAGS} ${LIBSYSTEMD_STATIC_LIBRARIES}) ENDIF() ELSE() SET(LIBSYSTEMD systemd) ENDIF() SET(CMAKE_REQUIRED_LIBRARIES ${LIBSYSTEMD}) - CHECK_C_SOURCE_COMPILES( - " - #include <systemd/sd-daemon.h> - int main() - { - sd_listen_fds(0); - }" - HAVE_SYSTEMD) + CHECK_LIBRARY_EXISTS(systemd sd_listen_fds "" HAVE_SYSTEMD_SD_LISTEN_FDS) CHECK_INCLUDE_FILES(systemd/sd-daemon.h HAVE_SYSTEMD_SD_DAEMON_H) - CHECK_FUNCTION_EXISTS(sd_listen_fds HAVE_SYSTEMD_SD_LISTEN_FDS) CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY) CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF) SET(CMAKE_REQUIRED_LIBRARIES) - IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS + IF(HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) - ADD_DEFINITIONS(-DHAVE_SYSTEMD) + SET(HAVE_SYSTEMD TRUE) SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert usr/bin/galera_new_cluster diff --git a/cmake/tags.cmake b/cmake/tags.cmake index 07c1411a1d6..309bfae9832 100644 --- a/cmake/tags.cmake +++ b/cmake/tags.cmake @@ -11,7 +11,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Generate tag files IF(UNIX) diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in index cd880b917e0..29b39353124 100644 --- a/cmake/versioninfo.rc.in +++ b/cmake/versioninfo.rc.in @@ -11,7 +11,7 @@ // // 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 +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA #include <windows.h> VS_VERSION_INFO VERSIONINFO diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake index b5dc8b9f157..a1e8fc39fca 100644 --- a/cmake/wsrep.cmake +++ b/cmake/wsrep.cmake @@ -12,7 +12,7 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # # Galera library does not compile with windows @@ -26,7 +26,7 @@ ENDIF() OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default}) # Set the patch version -SET(WSREP_PATCH_VERSION "21") +SET(WSREP_PATCH_VERSION "24") # Obtain wsrep API version FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake index 03d2c542ba4..628bbf15f67 100644 --- a/cmake/zlib.cmake +++ b/cmake/zlib.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. 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 @@ -11,18 +11,15 @@ # # 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 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA MACRO (MYSQL_USE_BUNDLED_ZLIB) - SET(ZLIB_LIBRARY zlib) - SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib) + SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_BINARY_DIR}/zlib) + SET(BUILD_BUNDLED_ZLIB 1) + SET(ZLIB_LIBRARY zlib CACHE INTERNAL "Bundled zlib library") SET(ZLIB_FOUND TRUE) SET(WITH_ZLIB "bundled" CACHE STRING "Use bundled zlib") ADD_SUBDIRECTORY(zlib) - GET_TARGET_PROPERTY(src zlib SOURCES) - FOREACH(file ${src}) - SET(ZLIB_SOURCES ${ZLIB_SOURCES} ${CMAKE_SOURCE_DIR}/zlib/${file}) - ENDFOREACH() ENDMACRO() # MYSQL_CHECK_ZLIB_WITH_COMPRESS @@ -37,16 +34,6 @@ ENDMACRO() MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS) - IF(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR - CMAKE_SYSTEM_NAME STREQUAL "AIX" OR - CMAKE_SYSTEM_NAME STREQUAL "Windows") - # Use bundled zlib on some platforms by default (system one is too - # old or not existent) - IF (NOT WITH_ZLIB) - SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform") - ENDIF() - ENDIF() - IF(WITH_ZLIB STREQUAL "bundled") MYSQL_USE_BUNDLED_ZLIB() ELSE() |