diff --git a/.gitignore b/.gitignore index d1d0e009f9b4..8a96be4c6e44 100644 --- a/.gitignore +++ b/.gitignore @@ -548,55 +548,6 @@ extra/resolve_stack_dump extra/resolveip extra/sql_state.h extra/tztime.cc -extra/yassl/src/.deps/buffer.Plo -extra/yassl/src/.deps/cert_wrapper.Plo -extra/yassl/src/.deps/crypto_wrapper.Plo -extra/yassl/src/.deps/handshake.Plo -extra/yassl/src/.deps/lock.Plo -extra/yassl/src/.deps/log.Plo -extra/yassl/src/.deps/socket_wrapper.Plo -extra/yassl/src/.deps/ssl.Plo -extra/yassl/src/.deps/template_instnt.Plo -extra/yassl/src/.deps/timer.Plo -extra/yassl/src/.deps/yassl_error.Plo -extra/yassl/src/.deps/yassl_imp.Plo -extra/yassl/src/.deps/yassl_int.Plo -extra/yassl/taocrypt/benchmark/.deps/benchmark-benchmark.Po -extra/yassl/taocrypt/benchmark/benchmark -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aes.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aestables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-algebra.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-arc4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-asn.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-bftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-blowfish.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-coding.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-des.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dh.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-file.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-hash.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-integer.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md2.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md5.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-misc.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-random.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-ripemd.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-rsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-sha.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-template_instnt.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-tftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-twofish.Plo -extra/yassl/taocrypt/test/.deps/test-test.Po -extra/yassl/taocrypt/test/test -extra/yassl/testsuite/.deps/testsuite-client.Po -extra/yassl/testsuite/.deps/testsuite-echoclient.Po -extra/yassl/testsuite/.deps/testsuite-echoserver.Po -extra/yassl/testsuite/.deps/testsuite-server.Po -extra/yassl/testsuite/.deps/testsuite-test.Po -extra/yassl/testsuite/.deps/testsuite-testsuite.Po -extra/yassl/testsuite/testsuite fcns.c fcns.h gdbinit diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index ac66613e6855..24375587d1d3 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -1,16 +1,22 @@ #!/bin/sh -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2023, Oracle and/or its affiliates. # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. # # 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 -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free @@ -100,11 +106,8 @@ path=`dirname $0` export AM_MAKEFLAGS AM_MAKEFLAGS="-j 6" -# SSL library to use.--with-ssl will select our bundled yaSSL -# implementation of SSL. To use openSSl you will nee too point out -# the location of openSSL headers and lbs on your system. -# Ex --with-ssl=/usr -SSL_LIBRARY=--with-ssl +# SSL library to use. +SSL_LIBRARY=--with-ssl=system if [ "x$warning_mode" = "xpedantic" ]; then warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE" @@ -232,11 +235,9 @@ fi # The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the # code with profiling information used by gcov. -# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl. # The -DHAVE_gcov enables code to write out coverage info even when crashing. gcov_compile_flags="-fprofile-arcs -ftest-coverage" -gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM" gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov" # GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh index 1d7cf5561ad8..6af8591451bd 100755 --- a/BUILD/autorun.sh +++ b/BUILD/autorun.sh @@ -1,16 +1,22 @@ #!/bin/sh -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2023, Oracle and/or its affiliates. # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. # # 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 -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free diff --git a/BUILD/cmake_configure.sh b/BUILD/cmake_configure.sh index 668d6a81b5c2..b23e864935a9 100644 --- a/BUILD/cmake_configure.sh +++ b/BUILD/cmake_configure.sh @@ -1,16 +1,22 @@ #!/bin/sh -# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2023, Oracle and/or its affiliates. # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. # # 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 -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 4adb92f6f1c9..2ecc41fa2fc8 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -1,15 +1,22 @@ #!/bin/sh -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2023, Oracle and/or its affiliates. # # 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. +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. # # 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. +# GNU General Public License, version 2.0, 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 diff --git a/BUILD/compile-pentium b/BUILD/compile-pentium index 07a3faa5cb5b..7a823ecb3b72 100755 --- a/BUILD/compile-pentium +++ b/BUILD/compile-pentium @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 Street, Fifth Floor, Boston, MA 02110-1301, USA diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug index 707f727479e2..76815280909e 100755 --- a/BUILD/compile-pentium-debug +++ b/BUILD/compile-pentium-debug @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 4dc468eb468f..f0c999b19086 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb index 1001c0648a43..d7b88ea51fe0 100755 --- a/BUILD/compile-pentium-debug-max-no-ndb +++ b/BUILD/compile-pentium-debug-max-no-ndb @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2001, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 Street, Fifth Floor, Boston, MA 02110-1301, USA diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov index 40d08287b6b9..0bf5783fe0b3 100755 --- a/BUILD/compile-pentium-gcov +++ b/BUILD/compile-pentium-gcov @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 Street, Fifth Floor, Boston, MA 02110-1301, USA diff --git a/BUILD/compile-pentium-gprof b/BUILD/compile-pentium-gprof index 0ff56002fd6f..e3cd5c0c00fb 100755 --- a/BUILD/compile-pentium-gprof +++ b/BUILD/compile-pentium-gprof @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 Street, Fifth Floor, Boston, MA 02110-1301, USA diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index 4601dad68a54..dbd7ca7fe205 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -1,16 +1,23 @@ #! /bin/sh -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 diff --git a/BUILD/compile-pentium-valgrind-max-no-ndb b/BUILD/compile-pentium-valgrind-max-no-ndb index af385328898c..682106343cf3 100755 --- a/BUILD/compile-pentium-valgrind-max-no-ndb +++ b/BUILD/compile-pentium-valgrind-max-no-ndb @@ -1,16 +1,22 @@ #! /bin/sh -# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2023, Oracle and/or its affiliates. # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. # # 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 -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free diff --git a/BUILD/compile-pentium64 b/BUILD/compile-pentium64 index e62ae2298409..6bcddc4d224f 100755 --- a/BUILD/compile-pentium64 +++ b/BUILD/compile-pentium64 @@ -1,16 +1,22 @@ #! /bin/sh -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2023, Oracle and/or its affiliates. # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. # # 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 -# Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free diff --git a/CMakeLists.txt b/CMakeLists.txt index 151af7f435a5..e7a898b74264 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,29 @@ -# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2023, Oracle and/or its affiliates. # # 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. -# +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# # 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. -# +# GNU General Public License, version 2.0, 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 IF(WIN32) # CMake 2.8.12 is needed for Visual Studio 2013 - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) + # CMake 3.1.0 is needed for $ + CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) ELSE() # There's a bug in unzipping prior to 2.8.2 # Debian 7 has the oldest cmake we need to support @@ -33,16 +41,27 @@ IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR CMAKE_POLICY(SET CMP0022 OLD) ENDIF() -# We use the LOCATION target property (CMP0026) -# and get_target_property() for non-existent targets (CMP0045) +# We use get_target_property() for non-existent targets (CMP0045) # and INSTALL_NAME_DIR (CMP0042) IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR CMAKE_VERSION VERSION_GREATER "3.0.0") - CMAKE_POLICY(SET CMP0026 OLD) CMAKE_POLICY(SET CMP0045 OLD) CMAKE_POLICY(SET CMP0042 OLD) ENDIF() +# In CMake 3.12 and above, the +# +# * ``check_include_file`` macro in the ``CheckIncludeFile`` module, the +# * ``check_include_file_cxx`` macro in the +# ``CheckIncludeFileCXX`` module, and the +# * ``check_include_files`` macro in the ``CheckIncludeFiles`` module +# +# now prefer to link the check executable to the libraries listed in the +# ``CMAKE_REQUIRED_LIBRARIES`` variable. +IF(POLICY CMP0075) + CMAKE_POLICY(SET CMP0075 OLD) +ENDIF() + MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") # Will set GIT_EXECUTABLE and GIT_FOUND @@ -126,12 +145,41 @@ ENDIF() PROJECT(${MYSQL_PROJECT_NAME}) +MACRO(REPORT_CXX_FLAGS) + MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") + FOREACH(BUILD_TYPE "" _DEBUG _RELWITHDEBINFO _RELEASE _MINSIZEREL) + SET(flag "CMAKE_CXX_FLAGS${BUILD_TYPE}") + MESSAGE(STATUS "${flag}: ${${flag}}") + ENDFOREACH() +ENDMACRO() + +# STRING(APPEND ...) from cmake VERSION 3.4 +MACRO(STRING_APPEND STRING_VAR INPUT) + SET(${STRING_VAR} "${${STRING_VAR}}${INPUT}") +ENDMACRO() + +MACRO(STRING_PREPEND STRING_VAR INPUT) + SET(${STRING_VAR} "${INPUT}${${STRING_VAR}}") +ENDMACRO() + SET(BUILD_IS_SINGLE_CONFIG TRUE) MESSAGE(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}") IF(CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR STREQUAL "Xcode") SET(BUILD_IS_SINGLE_CONFIG FALSE) ENDIF() +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(MY_COMPILER_IS_CLANG 1) +ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + SET(MY_COMPILER_IS_GNU 1) +ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") + SET(MY_COMPILER_IS_SUNPRO 1) +ENDIF() + +IF(MY_COMPILER_IS_CLANG OR MY_COMPILER_IS_GNU) + SET(MY_COMPILER_IS_GNU_OR_CLANG 1) +ENDIF() + # Maintainer mode is default on only for debug builds using GCC/G++ IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG) IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX) @@ -190,6 +238,10 @@ ENDIF() INCLUDE(CheckTypeSize) CHECK_TYPE_SIZE("void *" SIZEOF_VOIDP) MESSAGE(STATUS "SIZEOF_VOIDP ${SIZEOF_VOIDP}") +# On some platforms, cmake may think that CMAKE_SIZEOF_VOID_P == 4 +# even if we have configured for 64bit build.... +SET(CMAKE_SIZEOF_VOID_P ${SIZEOF_VOIDP}) + IF(WITH_DEFAULT_COMPILER_OPTIONS) INCLUDE(${CMAKE_SOURCE_DIR}/cmake/build_configurations/compiler_options.cmake) ENDIF() @@ -197,13 +249,19 @@ IF(WITH_DEFAULT_FEATURE_SET) INCLUDE(${CMAKE_SOURCE_DIR}/cmake/build_configurations/feature_set.cmake) ENDIF() +INCLUDE(CMakePushCheckState) + # Add macros INCLUDE(character_sets) +INCLUDE(compile_flags) INCLUDE(cpu_info) INCLUDE(zlib) INCLUDE(lz4) INCLUDE(libevent) INCLUDE(ssl) +INCLUDE(sasl) +INCLUDE(ldap) +INCLUDE(rpc) INCLUDE(readline) INCLUDE(protobuf) INCLUDE(mysql_version) @@ -239,6 +297,9 @@ ENDIF() IF(NOT WITHOUT_SERVER) OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) ENDIF() +OPTION(WITH_AUTHENTICATION_LDAP + "Report error if the LDAP authentication plugin cannot be built." OFF) + OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" OFF) MARK_AS_ADVANCED(WITHOUT_SERVER DISABLE_SHARED FORCE_UNSUPPORTED_COMPILER) @@ -279,20 +340,53 @@ MACRO (MY_CHECK_CXX_COMPILER_FLAG FLAG RESULT) SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") ENDMACRO() +# Check whether a specific warning option is supported. +# Intended use is primarily to silence warnings from third-party code. +# If *our* code has warnings with gcc[56789] or clang[345678] the +# code should be fixed, rather than silencing the compiler warnings. +# +# Returns the corresponding "-Wno-