Commit 9e1b3af4 authored by Rasmus Johansson's avatar Rasmus Johansson Committed by Sergei Golubchik

MDEV-21303 Make executables MariaDB named

To change all executables to have a mariadb name I had to:
- Do name changes in every CMakeLists.txt that produces executables
- CREATE_MARIADB_SYMLINK was removed and GET_SYMLINK added by Wlad to reuse the function in other places also
- The scripts/CMakeLists.txt could make use of GET_SYMLINK instead of introducing redundant code, but I thought I'll leave that for next release
- A lot of changes to debian/.install and debian/.links files due to swapping of real executable and symlink. I did not however change the name of the manpages, so the real name is still mysql there and mariadb are symlinks.
- The Windows part needed a change now when we made the executables mariadb -named. MSI (and ZIP) do not support symlinks and to not break backward compatibility we had to include mysql named binaries also. Done by Wlad
parent 6fb59d52
......@@ -36,51 +36,49 @@ COPY_OPENSSL_DLLS(copy_openssl_client)
SET(CLIENT_LIB mariadbclient mysys)
ADD_DEFINITIONS(${SSL_DEFINES})
MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc
MYSQL_ADD_EXECUTABLE(mariadb completion_hash.cc mysql.cc readline.cc
${CMAKE_SOURCE_DIR}/sql/sql_string.cc)
TARGET_LINK_LIBRARIES(mysql ${CLIENT_LIB})
TARGET_LINK_LIBRARIES(mariadb ${CLIENT_LIB})
IF(UNIX)
TARGET_LINK_LIBRARIES(mysql ${MY_READLINE_LIBRARY})
SET_TARGET_PROPERTIES(mysql PROPERTIES ENABLE_EXPORTS TRUE)
TARGET_LINK_LIBRARIES(mariadb ${MY_READLINE_LIBRARY})
SET_TARGET_PROPERTIES(mariadb PROPERTIES ENABLE_EXPORTS TRUE)
ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc
${CMAKE_SOURCE_DIR}/sql/sql_string.cc
COMPONENT Test)
MYSQL_ADD_EXECUTABLE(mariadb-test mysqltest.cc ${CMAKE_SOURCE_DIR}/sql/sql_string.cc COMPONENT Test)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS ${PCRE2_DEBIAN_HACK}")
TARGET_LINK_LIBRARIES(mysqltest ${CLIENT_LIB} pcre2-posix pcre2-8)
SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)
TARGET_LINK_LIBRARIES(mariadb-test ${CLIENT_LIB} pcre2-posix pcre2-8)
SET_TARGET_PROPERTIES(mariadb-test PROPERTIES ENABLE_EXPORTS TRUE)
MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
TARGET_LINK_LIBRARIES(mysqlcheck ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mariadb-check mysqlcheck.c)
TARGET_LINK_LIBRARIES(mariadb-check ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
TARGET_LINK_LIBRARIES(mysqldump ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mariadb-dump mysqldump.c ../sql-common/my_user.c)
TARGET_LINK_LIBRARIES(mariadb-dump ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
MYSQL_ADD_EXECUTABLE(mariadb-import mysqlimport.c)
SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqlimport ${CLIENT_LIB})
TARGET_LINK_LIBRARIES(mariadb-import ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c COMPONENT Server)
TARGET_LINK_LIBRARIES(mysql_upgrade ${CLIENT_LIB})
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
MYSQL_ADD_EXECUTABLE(mariadb-upgrade mysql_upgrade.c COMPONENT Server)
TARGET_LINK_LIBRARIES(mariadb-upgrade ${CLIENT_LIB})
ADD_DEPENDENCIES(mariadb-upgrade GenFixPrivs)
MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
TARGET_LINK_LIBRARIES(mysqlshow ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mariadb-show mysqlshow.c)
TARGET_LINK_LIBRARIES(mariadb-show ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
TARGET_LINK_LIBRARIES(mysql_plugin ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mariadb-plugin mysql_plugin.c)
TARGET_LINK_LIBRARIES(mariadb-plugin ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB} mysys_ssl)
MYSQL_ADD_EXECUTABLE(mariadb-binlog mysqlbinlog.cc)
TARGET_LINK_LIBRARIES(mariadb-binlog ${CLIENT_LIB} mysys_ssl)
MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc ../sql/password.c)
TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB} mysys_ssl)
MYSQL_ADD_EXECUTABLE(mariadb-admin mysqladmin.cc ../sql/password.c)
TARGET_LINK_LIBRARIES(mariadb-admin ${CLIENT_LIB} mysys_ssl)
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
MYSQL_ADD_EXECUTABLE(mariadb-slap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqlslap ${CLIENT_LIB})
TARGET_LINK_LIBRARIES(mariadb-slap ${CLIENT_LIB})
MYSQL_ADD_EXECUTABLE(mariadb-conv mariadb-conv.cc
${CMAKE_SOURCE_DIR}/sql/sql_string.cc)
......@@ -95,11 +93,11 @@ ENDIF(WIN32)
ADD_EXECUTABLE(async_example async_example.c)
TARGET_LINK_LIBRARIES(async_example ${CLIENT_LIB})
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin async_example
SET_TARGET_PROPERTIES (mariadb-check mariadb-dump mariadb-import mariadb-upgrade mariadb-show mariadb-slap mariadb-plugin async_example
PROPERTIES HAS_CXX TRUE)
FOREACH(t mysql mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysql_plugin mysqlbinlog
mysqladmin mysqlslap async_example)
FOREACH(t mariadb mariadb-test mariadb-check mariadb-dump mariadb-import mariadb-upgrade mariadb-show mariadb-plugin mariadb-binlog
mariadb-admin mariadb-slap async_example)
ADD_DEPENDENCIES(${t} GenError ${CLIENT_LIB})
ENDFOREACH()
......
# Copyright (c) 2009, 2011, 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
# the Free Software Foundation; version 2 of the License.
......@@ -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-1335 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
INCLUDE(CMakeParseArguments)
......@@ -23,7 +23,7 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
""
${ARGN}
)
IF(NOT ARG_COMPONENT)
SET(ARG_COMPONENT DebugBinaries)
ENDIF()
......@@ -51,7 +51,7 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
ENDFUNCTION()
# Installs manpage for given file (either script or executable)
#
#
FUNCTION(INSTALL_MANPAGE file)
IF(NOT UNIX)
RETURN()
......@@ -64,7 +64,7 @@ FUNCTION(INSTALL_MANPAGE file)
${CMAKE_BINARY_DIR}/man/*${file}man.8*
)
IF(MYSQL_DOC_DIR)
SET(GLOB_EXPR
SET(GLOB_EXPR
${MYSQL_DOC_DIR}/man/*${file}man.1*
${MYSQL_DOC_DIR}/man/*${file}man.8*
${MYSQL_DOC_DIR}/man/*${file}.1*
......@@ -72,7 +72,7 @@ FUNCTION(INSTALL_MANPAGE file)
${GLOB_EXPR}
)
ENDIF()
FILE(GLOB_RECURSE MANPAGES ${GLOB_EXPR})
IF(MANPAGES)
......@@ -96,7 +96,7 @@ FUNCTION(INSTALL_SCRIPT)
""
${ARGN}
)
SET(script ${ARG_UNPARSED_ARGUMENTS})
IF(NOT ARG_DESTINATION)
SET(ARG_DESTINATION ${INSTALL_BINDIR})
......@@ -109,8 +109,6 @@ FUNCTION(INSTALL_SCRIPT)
INSTALL(PROGRAMS ${script} DESTINATION ${ARG_DESTINATION} COMPONENT ${COMP})
get_filename_component(dest "${script}" NAME)
CREATE_MARIADB_SYMLINK(${dest} ${ARG_DESTINATION} ${COMP})
INSTALL_MANPAGE(${dest})
ENDFUNCTION()
......@@ -148,7 +146,7 @@ FUNCTION(INSTALL_DOCUMENTATION)
ENDFUNCTION()
# Install symbolic link to CMake target.
# Install symbolic link to CMake target.
# the link is created in the current build directory
# and extension will be the same as for target file.
MACRO(INSTALL_SYMLINK linkname target destination component)
......@@ -157,19 +155,19 @@ IF(UNIX)
ADD_CUSTOM_COMMAND(
OUTPUT ${output}
COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${linkname}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
$<TARGET_FILE_NAME:${target}>
${linkname}
DEPENDS ${target}
)
ADD_CUSTOM_TARGET(symlink_${linkname}
ALL
DEPENDS ${output})
SET_TARGET_PROPERTIES(symlink_${linkname} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
IF(CMAKE_GENERATOR MATCHES "Xcode")
# For Xcode, replace project config with install config
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
ENDIF()
INSTALL(FILES ${output} DESTINATION ${destination} COMPONENT ${component})
......@@ -180,16 +178,16 @@ IF(WIN32)
OPTION(SIGNCODE "Sign executables and dlls with digital certificate" OFF)
MARK_AS_ADVANCED(SIGNCODE)
IF(SIGNCODE)
SET(SIGNTOOL_PARAMETERS
SET(SIGNTOOL_PARAMETERS
/a /t http://timestamp.verisign.com/scripts/timstamp.dll
CACHE STRING "parameters for signtool (list)")
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
PATHS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0A/bin"
"$ENV{ProgramFiles}/Windows Kits/8.0/bin/x86"
"$ENV{ProgramFiles}/Windows Kits/8.1/bin/x86"
)
IF(NOT SIGNTOOL_EXECUTABLE)
MESSAGE(FATAL_ERROR
MESSAGE(FATAL_ERROR
"signtool is not found. Signing executables not possible")
ENDIF()
MARK_AS_ADVANCED(SIGNTOOL_EXECUTABLE SIGNTOOL_PARAMETERS)
......@@ -207,7 +205,7 @@ FUNCTION(SIGN_TARGET target)
ENDIF()
# Mark executable for signing by creating empty *.signme file
# The actual signing happens in preinstall step
# (which traverses
# (which traverses
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E touch "$<TARGET_FILE:${target}>.signme"
)
......@@ -229,7 +227,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
ELSE()
MESSAGE(FATAL_ERROR "COMPONENT argument required")
ENDIF()
SET(TARGETS ${ARG_UNPARSED_ARGUMENTS})
IF(NOT TARGETS)
MESSAGE(FATAL_ERROR "Need target list for MYSQL_INSTALL_TARGETS")
......@@ -254,13 +252,12 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
ENDFUNCTION()
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
# (unless multi-config generator is used like Visual Studio or Xcode).
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
# (unless multi-config generator is used like Visual Studio or Xcode).
# For Makefile generators we default Debug build directory to ${buildroot}/../debug.
GET_FILENAME_COMPONENT(BINARY_PARENTDIR ${CMAKE_BINARY_DIR} PATH)
SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug build")
FUNCTION(INSTALL_MYSQL_TEST from to)
IF(INSTALL_MYSQLTESTDIR)
INSTALL(
......
# Copyright (c) 2009, 2010, 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
# the Free Software Foundation; version 2 of the License.
......@@ -36,7 +36,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
)
LIST(GET ARG_UNPARSED_ARGUMENTS 0 target)
LIST(REMOVE_AT ARG_UNPARSED_ARGUMENTS 0)
SET(sources ${ARG_UNPARSED_ARGUMENTS})
ADD_VERSION_INFO(${target} EXECUTABLE sources)
......@@ -62,6 +62,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
ELSE()
UNSET(EXCLUDE_FROM_ALL)
ENDIF()
ADD_EXECUTABLE(${target} ${WIN32} ${MACOSX_BUNDLE} ${EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
......@@ -79,16 +80,44 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
IF (COMP MATCHES ${SKIP_COMPONENTS})
RETURN()
ENDIF()
IF (WITH_STRIPPED_CLIENT AND NOT target STREQUAL mysqld)
IF (WITH_STRIPPED_CLIENT AND NOT target STREQUAL mariadbd)
INSTALL(CODE "SET(CMAKE_INSTALL_DO_STRIP 1)" COMPONENT ${COMP})
SET(reset_strip ON)
ENDIF()
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} COMPONENT ${COMP})
IF (reset_strip)
INSTALL(CODE "SET(CMAKE_INSTALL_DO_STRIP 0)" COMPONENT ${COMP})
ENDIF()
ENDIF()
# create mariadb named symlink
CREATE_MARIADB_SYMLINK(${target} ${ARG_DESTINATION} ${COMP})
# create MySQL named "legacy links"
GET_SYMLINK(${target} link)
IF(link)
IF(UNIX)
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink
${target} ${link}
COMMENT "Creating ${link} link"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
INSTALL(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${link}
DESTINATION
${ARG_DESTINATION}
COMPONENT ${COMP})
ELSE()
# Windows note:
# Here, hardlinks are used, because cmake can't install symlinks.
# In packages, there are won't be links, just copies.
SET(link ${link}.exe)
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND cmake -E remove -f ${link}
COMMAND mklink /H ${link} $<TARGET_FILE_NAME:${target}>
COMMENT "Creating ${link} link"
WORKING_DIRECTORY $<TARGET_FILE_DIR:${target}>)
INSTALL(PROGRAMS $<TARGET_FILE_DIR:${target}>/${link} DESTINATION ${ARG_DESTINATION} COMPONENT ${COMP})
ENDIF()
ENDIF()
ENDFUNCTION()
......@@ -9,68 +9,46 @@ macro(REGISTER_SYMLINK from to)
endmacro()
# MariaDB names for executables
REGISTER_SYMLINK("mysql" "mariadb")
REGISTER_SYMLINK("mysqlaccess" "mariadb-access")
REGISTER_SYMLINK("mysqladmin" "mariadb-admin")
REGISTER_SYMLINK("mariabackup" "mariadb-backup")
REGISTER_SYMLINK("mysqlbinlog" "mariadb-binlog")
REGISTER_SYMLINK("mysqlcheck" "mariadb-check")
REGISTER_SYMLINK("mysql_client_test_embedded" "mariadb-client-test-embedded")
REGISTER_SYMLINK("mysql_client_test" "mariadb-client-test")
REGISTER_SYMLINK("mariadb_config" "mariadb-config")
REGISTER_SYMLINK("mysql_convert_table_format" "mariadb-convert-table-format")
REGISTER_SYMLINK("mysqldump" "mariadb-dump")
REGISTER_SYMLINK("mysqldumpslow" "mariadb-dumpslow")
REGISTER_SYMLINK("mysql_embedded" "mariadb-embedded")
REGISTER_SYMLINK("mysql_find_rows" "mariadb-find-rows")
REGISTER_SYMLINK("mysql_fix_extensions" "mariadb-fix-extensions")
REGISTER_SYMLINK("mysqlhotcopy" "mariadb-hotcopy")
REGISTER_SYMLINK("mysqlimport" "mariadb-import")
REGISTER_SYMLINK("mysql_install_db" "mariadb-install-db")
REGISTER_SYMLINK("mysql_ldb" "mariadb-ldb")
REGISTER_SYMLINK("mysql_plugin" "mariadb-plugin")
REGISTER_SYMLINK("mysql_secure_installation" "mariadb-secure-installation")
REGISTER_SYMLINK("mysql_setpermission" "mariadb-setpermission")
REGISTER_SYMLINK("mysqlshow" "mariadb-show")
REGISTER_SYMLINK("mysqlslap" "mariadb-slap")
REGISTER_SYMLINK("mysqltest" "mariadb-test")
REGISTER_SYMLINK("mysqltest_embedded" "mariadb-test-embedded")
REGISTER_SYMLINK("mysql_tzinfo_to_sql" "mariadb-tzinfo-to-sql")
REGISTER_SYMLINK("mysql_upgrade" "mariadb-upgrade")
REGISTER_SYMLINK("mysql_upgrade_service" "mariadb-upgrade-service")
REGISTER_SYMLINK("mysql_upgrade_wizard" "mariadb-upgrade-wizard")
REGISTER_SYMLINK("mysql_waitpid" "mariadb-waitpid")
REGISTER_SYMLINK("mysqld" "mariadbd")
REGISTER_SYMLINK("mysqld_multi" "mariadbd-multi")
REGISTER_SYMLINK("mysqld_safe" "mariadbd-safe")
REGISTER_SYMLINK("mysqld_safe_helper" "mariadbd-safe-helper")
# Add MariaDB symlinks
macro(CREATE_MARIADB_SYMLINK src dir comp)
# Find the MariaDB name for executable
list(FIND MARIADB_SYMLINK_FROMS ${src} _index)
REGISTER_SYMLINK("mariadb" "mysql")
REGISTER_SYMLINK("mariadb-access" "mysqlaccess")
REGISTER_SYMLINK("mariadb-admin" "mysqladmin")
REGISTER_SYMLINK("mariadb-backup" "mariabackup")
REGISTER_SYMLINK("mariadb-binlog" "mysqlbinlog")
REGISTER_SYMLINK("mariadb-check" "mysqlcheck")
REGISTER_SYMLINK("mariadb-client-test-embedded" "mysql_client_test_embedded")
REGISTER_SYMLINK("mariadb-client-test" "mysql_client_test")
REGISTER_SYMLINK("mariadb-config" "mariadb_config")
REGISTER_SYMLINK("mariadb-convert-table-format" "mysql_convert_table_format")
REGISTER_SYMLINK("mariadb-dump" "mysqldump")
REGISTER_SYMLINK("mariadb-dumpslow" "mysqldumpslow")
REGISTER_SYMLINK("mariadb-embedded" "mysql_embedded")
REGISTER_SYMLINK("mariadb-find-rows" "mysql_find_rows")
REGISTER_SYMLINK("mariadb-fix-extensions" "mysql_fix_extensions")
REGISTER_SYMLINK("mariadb-hotcopy" "mysqlhotcopy")
REGISTER_SYMLINK("mariadb-import" "mysqlimport")
REGISTER_SYMLINK("mariadb-install-db" "mysql_install_db")
REGISTER_SYMLINK("mariadb-ldb" "mysql_ldb")
REGISTER_SYMLINK("mariadb-plugin" "mysql_plugin")
REGISTER_SYMLINK("mariadb-secure-installation" "mysql_secure_installation")
REGISTER_SYMLINK("mariadb-setpermission" "mysql_setpermission")
REGISTER_SYMLINK("mariadb-show" "mysqlshow")
REGISTER_SYMLINK("mariadb-slap" "mysqlslap")
REGISTER_SYMLINK("mariadb-test" "mysqltest")
REGISTER_SYMLINK("mariadb-test-embedded" "mysqltest_embedded")
REGISTER_SYMLINK("mariadb-tzinfo-to-sql" "mysql_tzinfo_to_sql")
REGISTER_SYMLINK("mariadb-upgrade" "mysql_upgrade")
REGISTER_SYMLINK("mariadb-upgrade-service" "mysql_upgrade_service")
REGISTER_SYMLINK("mariadb-upgrade-wizard" "mysql_upgrade_wizard")
REGISTER_SYMLINK("mariadb-waitpid" "mysql_waitpid")
REGISTER_SYMLINK("mariadbd" "mysqld")
REGISTER_SYMLINK("mariadbd-multi" "mysqld_multi")
REGISTER_SYMLINK("mariadbd-safe" "mysqld_safe")
REGISTER_SYMLINK("mariadbd-safe-helper" "mysqld_safe_helper")
MACRO(GET_SYMLINK name out)
set(${out})
list(FIND MARIADB_SYMLINK_FROMS ${name} _index)
if (${_index} GREATER -1)
list(GET MARIADB_SYMLINK_TOS ${_index} mariadbname)
endif()
if (mariadbname)
CREATE_MARIADB_SYMLINK_IN_DIR(${src} ${mariadbname} ${dir} ${comp})
endif()
endmacro(CREATE_MARIADB_SYMLINK)
# Add MariaDB symlinks in directory
macro(CREATE_MARIADB_SYMLINK_IN_DIR src dest dir comp)
if(UNIX)
add_custom_target(
SYM_${dest} ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${dest}
)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${dest} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink ${src} ${dest}
COMMENT "mklink ${src} -> ${dest}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${dest} DESTINATION ${dir} COMPONENT ${comp})
list(GET MARIADB_SYMLINK_TOS ${_index} ${out})
endif()
endmacro(CREATE_MARIADB_SYMLINK_IN_DIR)
ENDMACRO()
......@@ -244,6 +244,7 @@ Conflicts: mariadb-client-10.0,
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
......@@ -271,6 +272,7 @@ Replaces: mariadb-client-10.0,
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
......@@ -322,6 +324,7 @@ Conflicts: mariadb-client (<< ${source:Version}),
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
......@@ -339,10 +342,12 @@ Replaces: mariadb-client (<< ${source:Version}),
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
mariadb-client-5.5,
mariadb-server-10.5 (<< ${source:Version}),
mysql-client (<< 5.0.51),
mysql-client-5.0,
mysql-client-5.1,
......@@ -396,6 +401,7 @@ Breaks: mariadb-client-10.0,
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5 (<< ${source:Version}),
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5 (<< ${source:Version})
......@@ -404,6 +410,7 @@ Replaces: mariadb-client-10.0,
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5 (<< ${source:Version}),
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5 (<< ${source:Version}),
......@@ -487,6 +494,7 @@ Conflicts: mariadb-server (<< ${source:Version}),
virtual-mysql-server
Replaces: libmariadbclient-dev (<< 5.5.0),
libmariadbclient16 (<< 5.3.4),
mariadb-client-10.5 (<< ${source:Version}),
mariadb-server (<< ${source:Version}),
mariadb-server-10.0,
mariadb-server-10.1,
......
usr/bin/mariadb_config
usr/bin/mariadb-config
usr/include/mariadb
usr/lib/*/libmariadb.so
usr/lib/*/libmariadbclient.a
......@@ -7,3 +7,4 @@ usr/lib/*/libmysqlservices.a
usr/lib/*/pkgconfig/mariadb.pc
usr/share/aclocal/mysql.m4
usr/share/man/man1/mysql_config.1
usr/share/man/man1/mariadb-config.1
\ No newline at end of file
usr/share/man/man1/mysql_config.1.gz usr/share/man/man1/mariadb_config.1.gz
usr/bin/mariadb-config usr/bin/mysql_config
\ No newline at end of file
usr/bin/mariabackup
usr/bin/mariadb-backup
usr/bin/mbstream
usr/share/man/man1/mariabackup.1
usr/share/man/man1/mariadb-backup.1
......
usr/bin/mariabackup usr/bin/mariadb-backup
usr/bin/mariadb-backup usr/bin/mariabackup
debian/additions/innotop/innotop usr/bin/
debian/additions/mysqlreport usr/bin/
usr/bin/mariadb-access
usr/bin/mariadb-admin
usr/bin/mariadb-conv
usr/bin/mysql_find_rows
usr/bin/mysql_fix_extensions
usr/bin/mysql_waitpid
usr/bin/mysqlaccess
usr/bin/mysqladmin
usr/bin/mysqldump
usr/bin/mysqldumpslow
usr/bin/mysqlimport
usr/bin/mysqlshow
usr/bin/mysqlslap
usr/bin/mariadb-dump
usr/bin/mariadb-dumpslow
usr/bin/mariadb-find-rows
usr/bin/mariadb-fix-extensions
usr/bin/mariadb-import
usr/bin/mariadb-show
usr/bin/mariadb-slap
usr/bin/mariadb-waitpid
usr/bin/mytop
usr/share/man/man1/mariadb-access.1
usr/share/man/man1/mariadb-admin.1
usr/share/man/man1/mariadb-binlog.1
usr/share/man/man1/mariadb-conv.1
usr/share/man/man1/mariadb-dump.1
usr/share/man/man1/mariadb-dumpslow.1
usr/share/man/man1/mariadb-find-rows.1
usr/share/man/man1/mariadb-fix-extensions.1
usr/share/man/man1/mariadb-import.1
usr/share/man/man1/mariadb-plugin.1
usr/share/man/man1/mariadb-show.1
usr/share/man/man1/mariadb-slap.1
usr/share/man/man1/mariadb-waitpid.1
usr/share/man/man1/mysql_find_rows.1
......
usr/bin/mysql_find_rows usr/bin/mariadb-find-rows
usr/bin/mysql_fix_extensions usr/bin/mariadb-fix-extensions
usr/bin/mysql_plugin usr/bin/mariadb-plugin
usr/bin/mysql_waitpid usr/bin/mariadb-waitpid
usr/bin/mysqlaccess usr/bin/mariadb-access
usr/bin/mysqladmin usr/bin/mariadb-admin
usr/bin/mysqlbinlog usr/bin/mariadb-binlog
usr/bin/mysqlcheck usr/bin/mariadb-analyze
usr/bin/mysqlcheck usr/bin/mariadb-optimize
usr/bin/mysqlcheck usr/bin/mariadb-repair
usr/bin/mysqlcheck usr/bin/mysqlanalyze
usr/bin/mysqlcheck usr/bin/mysqloptimize
usr/bin/mysqlcheck usr/bin/mysqlrepair
usr/bin/mysqldump usr/bin/mariadb-dump
usr/bin/mysqldumpslow usr/bin/mariadb-dumpslow
usr/bin/mysqlimport usr/bin/mariadb-import
usr/bin/mysqlreport usr/bin/mariadb-report
usr/bin/mysqlslap usr/bin/mariadb-slap
usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mariadb-analyze.1.gz
usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mariadb-optimize.1.gz
usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mariadb-repair.1.gz
usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mysqlanalyze.1.gz
usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mysqloptimize.1.gz
usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mysqlrepair.1.gz
usr/share/man/man1/mysqlreport.1.gz usr/share/man/man1/mariadb-report.1.gz
usr/bin/mariadb-access usr/bin/mysqlaccess
usr/bin/mariadb-admin usr/bin/mysqladmin
usr/bin/mariadb-dump usr/bin/mysqldump
usr/bin/mariadb-dumpslow usr/bin/mysqldumpslow
usr/bin/mariadb-find-rows usr/bin/mysql_find_rows
usr/bin/mariadb-fix-extensions usr/bin/mysql_fix_extensions
usr/bin/mariadb-import usr/bin/mysqlimport
usr/bin/mariadb-report usr/bin/mysqlreport
usr/bin/mariadb-show usr/bin/mysqlshow
usr/bin/mariadb-slap usr/bin/mysqlslap
usr/bin/mariadb-waitpid usr/bin/mysql_waitpid
usr/bin/mariadb-check usr/bin/mariadb-analyze
usr/bin/mariadb-check usr/bin/mariadb-optimize
usr/bin/mariadb-check usr/bin/mariadb-repair
usr/bin/mariadb-check usr/bin/mysqlanalyze
usr/bin/mariadb-check usr/bin/mysqloptimize
usr/bin/mariadb-check usr/bin/mysqlrepair
usr/share/man/man1/mariadb-check.1 usr/share/man/man1/mariadb-analyze.1
usr/share/man/man1/mariadb-check.1 usr/share/man/man1/mariadb-optimize.1
usr/share/man/man1/mariadb-check.1 usr/share/man/man1/mariadb-repair.1
usr/share/man/man1/mariadb-check.1 usr/share/man/man1/mysqlanalyze.1
usr/share/man/man1/mariadb-check.1 usr/share/man/man1/mysqloptimize.1
usr/share/man/man1/mariadb-check.1 usr/share/man/man1/mysqlrepair.1
usr/bin/mysql
usr/bin/mysqlcheck
usr/bin/mariadb
usr/bin/mariadb-check
usr/share/man/man1/mariadb-check.1
usr/share/man/man1/mariadb.1
usr/share/man/man1/mysql.1
......
usr/bin/mysql usr/bin/mariadb
usr/bin/mysqlcheck usr/bin/mariadb-check
usr/bin/mariadb usr/bin/mysql
usr/bin/mariadb-check usr/bin/mysqlcheck
etc/mysql/conf.d/rocksdb.cnf etc/mysql/mariadb.conf.d
usr/bin/mariadb-ldb
usr/bin/myrocks_hotbackup
usr/bin/mysql_ldb
usr/bin/sst_dump
usr/lib/mysql/plugin/ha_rocksdb.so
usr/share/man/man1/mariadb-ldb.1
usr/share/man/man1/myrocks_hotbackup.1
......
usr/bin/mysql_ldb usr/bin/mariadb-ldb
usr/bin/mariadb-ldb usr/bin/mysql_ldb
......@@ -14,22 +14,22 @@ usr/bin/aria_pack
usr/bin/aria_read_log
usr/bin/galera_new_cluster
usr/bin/galera_recovery
usr/bin/mariadb-binlog
usr/bin/mariadb-convert-table-format
usr/bin/mariadb-hotcopy
usr/bin/mariadb-plugin
usr/bin/mariadb-secure-installation
usr/bin/mariadb-service-convert
usr/bin/mariadb-setpermission
usr/bin/mariadb-tzinfo-to-sql
usr/bin/mariadbd-multi
usr/bin/mariadbd-safe
usr/bin/mariadbd-safe-helper
usr/bin/msql2mysql
usr/bin/myisam_ftdump
usr/bin/myisamchk
usr/bin/myisamlog
usr/bin/myisampack
usr/bin/mysql_convert_table_format
usr/bin/mysql_plugin
usr/bin/mysql_secure_installation
usr/bin/mysql_setpermission
usr/bin/mysql_tzinfo_to_sql
usr/bin/mysqlbinlog
usr/bin/mysqld_multi
usr/bin/mysqld_safe
usr/bin/mysqld_safe_helper
usr/bin/mysqlhotcopy
usr/bin/perror
usr/bin/replace
usr/bin/resolve_stack_dump
......@@ -67,12 +67,13 @@ usr/share/man/man1/aria_pack.1
usr/share/man/man1/aria_read_log.1
usr/share/man/man1/galera_new_cluster.1
usr/share/man/man1/galera_recovery.1
usr/share/man/man1/mariadb-binlog.1
usr/share/man/man1/mariadb-convert-table-format.1
usr/share/man/man1/mariadb-hotcopy.1
usr/share/man/man1/mariadb-plugin.1
usr/share/man/man1/mariadb-secure-installation.1
usr/share/man/man1/mariadb-service-convert.1
usr/share/man/man1/mariadb-setpermission.1
usr/share/man/man1/mariadb-show.1
usr/share/man/man1/mariadb-tzinfo-to-sql.1
usr/share/man/man1/mariadbd-multi.1
usr/share/man/man1/mariadbd-safe-helper.1
......
usr/bin/mysql_convert_table_format usr/bin/mariadb-convert-table-format
usr/bin/mysql_secure_installation usr/bin/mariadb-secure-installation
usr/bin/mysql_setpermission usr/bin/mariadb-setpermission
usr/bin/mysql_tzinfo_to_sql usr/bin/mariadb-tzinfo-to-sql
usr/bin/mysqld_multi usr/bin/mariadbd-multi
usr/bin/mysqld_safe usr/bin/mariadbd-safe
usr/bin/mysqld_safe_helper usr/bin/mariadbd-safe-helper
usr/bin/mysqlhotcopy usr/bin/mariadb-hotcopy
usr/bin/mysqlshow usr/bin/mariadb-show
usr/bin/mariadb-binlog usr/bin/mysqlbinlog
usr/bin/mariadb-convert-table-format usr/bin/mysql_convert_table_format
usr/bin/mariadb-hotcopy usr/bin/mysqlhotcopy
usr/bin/mariadb-plugin usr/bin/mysql_plugin
usr/bin/mariadb-secure-installation usr/bin/mysql_secure_installation
usr/bin/mariadb-setpermission usr/bin/mysql_setpermission
usr/bin/mariadb-tzinfo-to-sql usr/bin/mysql_tzinfo_to_sql
usr/bin/mariadbd-multi usr/bin/mysqld_multi
usr/bin/mariadbd-safe usr/bin/mysqld_safe
usr/bin/mariadbd-safe-helper usr/bin/mysqld_safe_helper
usr/bin/innochecksum
usr/bin/mariadb-install-db
usr/bin/mariadb-upgrade
usr/bin/my_print_defaults
usr/bin/mysql_install_db
usr/bin/mysql_upgrade
usr/sbin/mysqld
usr/sbin/mariadbd
usr/share/man/man1/innochecksum.1
usr/share/man/man1/mariadb-install-db.1
usr/share/man/man1/mariadb-upgrade.1
usr/share/man/man8/mariadbd.8
usr/share/man/man1/my_print_defaults.1
usr/share/man/man1/mysql_install_db.1
usr/share/man/man1/mysql_upgrade.1
usr/share/man/man8/mariadbd.8
usr/share/man/man8/mysqld.8
usr/share/mysql/charsets
usr/share/mysql/czech
......
usr/bin/mysql_install_db usr/bin/mariadb-install-db
usr/bin/mysql_upgrade usr/bin/mariadb-upgrade
usr/sbin/mysqld usr/sbin/mariadbd
usr/bin/mariadb-install-db usr/bin/mysql_install_db
usr/bin/mariadb-upgrade usr/bin/mysql_upgrade
usr/sbin/mariadbd usr/sbin/mysqld
usr/bin/mysql_client_test
usr/bin/mysql_client_test_embedded
usr/bin/mysqltest
usr/bin/mysqltest_embedded
usr/bin/mariadb-client-test
usr/bin/mariadb-client-test-embedded
usr/bin/mariadb-test
usr/bin/mariadb-test-embedded
usr/lib/mysql/plugin/adt_null.so
usr/lib/mysql/plugin/auth_0x0100.so
usr/lib/mysql/plugin/auth_test_plugin.so
......@@ -17,10 +17,10 @@ usr/lib/mysql/plugin/qa_auth_client.so
usr/lib/mysql/plugin/qa_auth_interface.so
usr/lib/mysql/plugin/qa_auth_server.so
usr/lib/mysql/plugin/test_versioning.so
usr/share/man/man1/mariadb-client-test-embedded.1
usr/share/man/man1/mariadb-client-test.1
usr/share/man/man1/mariadb-test-embedded.1
usr/share/man/man1/mariadb-client-test-embedded.1
usr/share/man/man1/mariadb-test.1
usr/share/man/man1/mariadb-test-embedded.1
usr/share/man/man1/mysql-stress-test.pl.1
usr/share/man/man1/mysql-test-run.pl.1
usr/share/man/man1/mysql_client_test.1
......
usr/bin/mysql_client_test usr/bin/mariadb-client-test
usr/bin/mysql_client_test_embedded usr/bin/mariadb-client-test-embedded
usr/bin/mysqltest usr/bin/mariadb-test
usr/bin/mysqltest_embedded usr/bin/mariadb-test-embedded
usr/bin/mariadb-client-test usr/bin/mysql_client_test
usr/bin/mariadb-client-test-embedded usr/bin/mysql_client_test_embedded
usr/bin/mariadb-test usr/bin/mysqltest
usr/bin/mariadb-test-embedded usr/bin/mysqltest_embedded
usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mtr
usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mysql-test-run
# Copyright (c) 2006, 2010, 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
# 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-1335 USA
......@@ -30,9 +30,9 @@ ENDIF()
# to mysqld_error.h using cmake -E copy_if_different
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
COMMAND comp_err
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
--out-dir=${CMAKE_BINARY_DIR}/sql/share/
--header_file=${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
--header_file=${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
--name_file=${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp
--state_file=${CMAKE_BINARY_DIR}/include/sql_state.h.tmp
--in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
......@@ -43,7 +43,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
ADD_CUSTOM_TARGET(GenError
ALL
DEPENDS
DEPENDS
${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp)
MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
......@@ -106,9 +106,9 @@ IF(UNIX)
MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c)
TARGET_LINK_LIBRARIES(resolve_stack_dump mysys)
MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client)
TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
MYSQL_ADD_EXECUTABLE(mariadb-waitpid mysql_waitpid.c COMPONENT Client)
TARGET_LINK_LIBRARIES(mariadb-waitpid mysys)
MYSQL_ADD_EXECUTABLE(mysqld_safe_helper mysqld_safe_helper.c COMPONENT Server)
TARGET_LINK_LIBRARIES(mysqld_safe_helper mysys)
MYSQL_ADD_EXECUTABLE(mariadbd-safe-helper mysqld_safe_helper.c COMPONENT Server)
TARGET_LINK_LIBRARIES(mariadbd-safe-helper mysys)
ENDIF()
......@@ -55,7 +55,7 @@ ENDIF()
ADD_DEFINITIONS(-DPCRE_STATIC=1)
ADD_DEFINITIONS(${SSL_DEFINES})
MYSQL_ADD_EXECUTABLE(mariabackup
MYSQL_ADD_EXECUTABLE(mariadb-backup
xtrabackup.cc
innobackupex.cc
changed_page_bitmap.cc
......@@ -82,17 +82,13 @@ MYSQL_ADD_EXECUTABLE(mariabackup
COMPONENT backup
)
# Export all symbols on Unix, for better crash callstacks
SET_TARGET_PROPERTIES(mariabackup PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mariadb-backup PROPERTIES ENABLE_EXPORTS TRUE)
ADD_SUBDIRECTORY(crc)
TARGET_LINK_LIBRARIES(mariabackup sql sql_builtins crc)
TARGET_LINK_LIBRARIES(mariadb-backup sql sql_builtins crc)
IF(NOT HAVE_SYSTEM_REGEX)
TARGET_LINK_LIBRARIES(mariabackup pcre2-posix)
TARGET_LINK_LIBRARIES(mariadb-backup pcre2-posix)
ENDIF()
......
# Copyright (c) 2006, 2011, 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
# 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-1335 USA
......@@ -24,40 +24,40 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT)
MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
MYSQL_ADD_EXECUTABLE(mariadb-embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc
COMPONENT Client)
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
TARGET_LINK_LIBRARIES(mariadb-embedded mysqlserver)
IF(UNIX)
TARGET_LINK_LIBRARIES(mysql_embedded ${MY_READLINE_LIBRARY})
TARGET_LINK_LIBRARIES(mariadb-embedded ${MY_READLINE_LIBRARY})
ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
MYSQL_ADD_EXECUTABLE(mariadb-test-embedded ../../client/mysqltest.cc
COMPONENT Test)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcre2-posix pcre2-8)
TARGET_LINK_LIBRARIES(mariadb-test-embedded mysqlserver pcre2-posix pcre2-8)
SET_SOURCE_FILES_PROPERTIES(../../client/mysqltest.cc PROPERTIES COMPILE_FLAGS "${PCRE2_DEBIAN_HACK}")
IF(CMAKE_GENERATOR MATCHES "Xcode")
# It does not seem possible to tell Xcode the resulting target might need
# to be linked with C++ runtime. The project needs to have at least one C++
# file. Add a dummy one.
ADD_CUSTOM_COMMAND(OUTPUT
ADD_CUSTOM_COMMAND(OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
COMMAND ${CMAKE_COMMAND} -E touch
COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
)
MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded
MYSQL_ADD_EXECUTABLE(mariadb-client-test-embedded
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
../../tests/mysql_client_test.c)
ELSE()
MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c
MYSQL_ADD_EXECUTABLE(mariadb-client-test-embedded ../../tests/mysql_client_test.c
COMPONENT Test)
SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES HAS_CXX TRUE)
SET_TARGET_PROPERTIES(mariadb-client-test-embedded PROPERTIES HAS_CXX TRUE)
ENDIF()
TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver)
TARGET_LINK_LIBRARIES(mariadb-client-test-embedded mysqlserver)
IF(UNIX)
SET_TARGET_PROPERTIES(mysql_embedded PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mysqltest_embedded PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mariadb-embedded PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mariadb-test-embedded PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mariadb-client-test-embedded PROPERTIES ENABLE_EXPORTS TRUE)
ENDIF()
......@@ -46,11 +46,11 @@ INSTALL(FILES ${MAN1_DEVEL} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPage
INSTALL(FILES ${MAN1_TEST} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesTest)
macro(MARIADB_SYMLINK_MANPAGE)
list(LENGTH MARIADB_SYMLINK_FROMS _len)
list(LENGTH MARIADB_SYMLINK_TOS _len)
math(EXPR _listlen "${_len}-1")
foreach(_index RANGE ${_listlen})
list(GET MARIADB_SYMLINK_FROMS ${_index} _name)
list(GET MARIADB_SYMLINK_TOS ${_index} _name)
set(_manname "${_name}")
list(FIND MAN1_SERVER ${_manname}.1 _iman1server)
......@@ -78,7 +78,7 @@ macro(MARIADB_SYMLINK_MANPAGE)
endmacro(MARIADB_SYMLINK_MANPAGE)
macro(MARIADB_SYMLINK_MANPAGE_CREATE mysqlname index mannr dir comp)
LIST(GET MARIADB_SYMLINK_TOS ${index} _mariadbname)
LIST(GET MARIADB_SYMLINK_FROMS ${index} _mariadbname)
SET(dest "${CMAKE_CURRENT_BINARY_DIR}/${_mariadbname}.${mannr}")
FILE(WRITE ${dest} ".so ${dir}/${mysqlname}.${mannr}")
INSTALL(FILES ${dest} DESTINATION ${INSTALL_MANDIR}/${dir} COMPONENT ${comp})
......
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
# Copyright (c) 2011, 2017, 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
# 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-1335 USA
# Build comp_sql - used for embedding SQL in C or C++ programs
MACRO(INSTALL_LINK old new destination component)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E create_symlink ${old} ${new}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
INSTALL(
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${new}
DESTINATION ${destination}
COMPONENT ${component}
)
ENDMACRO()
IF(NOT CMAKE_CROSSCOMPILING)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_EXECUTABLE(comp_sql comp_sql.c)
TARGET_LINK_LIBRARIES(comp_sql)
ENDIF()
# Build mysql_fix_privilege_tables.sql (concatenate 3 sql scripts)
IF(NOT WIN32 OR CMAKE_CROSSCOMPILING)
FIND_PROGRAM(CAT_EXECUTABLE cat DOC "path to the executable")
......@@ -29,7 +41,7 @@ IF(NOT WIN32 OR CMAKE_CROSSCOMPILING)
ENDIF()
IF(CAT_EXECUTABLE)
SET(CAT_COMMAND COMMAND
SET(CAT_COMMAND COMMAND
${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
${CAT_EXECUTABLE} mysql_system_tables_fix.sql mysql_system_tables.sql mysql_performance_tables.sql >
${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
......@@ -67,7 +79,7 @@ ADD_CUSTOM_TARGET(GenFixPrivs
)
IF(UNIX)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
"cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake\n" )
EXECUTE_PROCESS(
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
......@@ -92,8 +104,8 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/maria_add_gis_sp.sql.in
${CMAKE_CURRENT_BINARY_DIR}/maria_add_gis_sp_bootstrap.sql ESCAPE_QUOTES @ONLY)
IF (NOT WITHOUT_SERVER)
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_performance_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_db.sql
......@@ -120,7 +132,6 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
ENDFOREACH()
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
SET (PERL_PATH "/usr/local/bin/perl")
ELSE()
......@@ -130,18 +141,18 @@ ENDIF()
IF(UNIX)
# FIND_PROC and CHECK_PID are used by mysqld_safe
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET (FIND_PROC
SET (FIND_PROC
"ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET (FIND_PROC
SET (FIND_PROC
"ps -p $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC)
# BSD style
EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
IF(result MATCHES 0)
SET( FIND_PROC
"ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
......@@ -154,7 +165,7 @@ IF(NOT FIND_PROC)
SET( FIND_PROC "ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()
EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null")
......@@ -195,18 +206,19 @@ SET(mysqld_locations "$basedir/${INSTALL_SBINDIR} $basedir/libexec $basedir/sbin
SET(errmsg_locations "$basedir/${INSTALL_MYSQLSHAREDIR}/english $basedir/share/english $basedir/share/mysql/english")
SET(pkgdata_locations "$basedir/${INSTALL_MYSQLSHAREDIR} $basedir/share $basedir/share/mysql")
# install mysql_install_db.sh at this point since it needs
# different values for the above variables that will change
# afterwards
IF(UNIX)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY)
EXECUTE_PROCESS(
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db
)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
${CMAKE_CURRENT_BINARY_DIR}/mariadb-install-db ESCAPE_QUOTES @ONLY)
INSTALL_SCRIPT(
"${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db"
DESTINATION ${INSTALL_SCRIPTDIR}
COMPONENT Server
)
INSTALL_SCRIPT(
"${CMAKE_CURRENT_BINARY_DIR}/mariadb-install-db"
DESTINATION ${INSTALL_SCRIPTDIR}
COMPONENT Server)
INSTALL_LINK(mariadb-install-db mysql_install_db ${INSTALL_SCRIPTDIR} Server)
ENDIF()
SET(prefix "${CMAKE_INSTALL_PREFIX}")
......@@ -245,7 +257,7 @@ SET(mysql_find_rows_COMPONENT COMPONENT Client)
SET(mytop_COMPONENT Mytop)
IF(WIN32)
# On Windows, some .sh and some .pl.in files are configured
# On Windows, some .sh and some .pl.in files are configured
# The resulting files will have .pl extension (those are perl scripts)
# Input files with pl.in extension
......@@ -284,10 +296,10 @@ ELSE()
ENDIF()
IF (NOT WITHOUT_SERVER)
SET(SERVER_SCRIPTS
mysql_fix_extensions
mysqld_multi
mysqld_safe
mysqldumpslow
mariadb-fix-extensions
mariadbd-multi
mariadbd-safe
mariadb-dumpslow
)
ENDIF()
# Configure this one, for testing, but do not install it.
......@@ -296,60 +308,53 @@ ELSE()
# On Unix, most of the files end up in the bin directory
SET(BIN_SCRIPTS
msql2mysql
mysql_config
mysql_setpermission
mysql_secure_installation
mysqlaccess
mysql_convert_table_format
mysql_find_rows
mariadb-setpermission
mariadb-secure-installation
mariadb-access
mariadb-convert-table-format
mariadb-find-rows
mytop
mysqlhotcopy
mariadb-hotcopy
${SERVER_SCRIPTS}
${WSREP_SCRIPTS}
${SYSTEMD_SCRIPTS}
)
FOREACH(file ${BIN_SCRIPTS})
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
# set name of executable
GET_SYMLINK(${file} binname)
if("${binname}" STREQUAL "")
set(binname ${file})
endif()
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${binname}.sh)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${binname}.sh
${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}
${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY)
ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${binname})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${binname}
${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY)
ELSE()
MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in "
MESSAGE(FATAL_ERROR "Can not find ${binname}.sh or ${binname} in "
"${CMAKE_CURRENT_SOURCE_DIR}" )
ENDIF()
# TODO: The following EXECUTE could be redundant as INSTALL_SCRIPT
# macro does an INSTALL(PROGRAMS ..) that automatically sets +x on
# the executable.
EXECUTE_PROCESS(COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/${file})
IF(NOT ${file}_COMPONENT)
SET(${file}_COMPONENT Server)
ENDIF()
INSTALL_SCRIPT(
${CMAKE_CURRENT_BINARY_DIR}/${file}
${CMAKE_CURRENT_BINARY_DIR}/${file}
DESTINATION ${INSTALL_BINDIR}
COMPONENT ${${file}_COMPONENT}
)
ENDFOREACH()
)
SET (wsrep_sst_rsync_wan ${CMAKE_CURRENT_BINARY_DIR}/wsrep_sst_rsync_wan)
ADD_CUSTOM_COMMAND(
OUTPUT ${wsrep_sst_rsync_wan}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
wsrep_sst_rsync
wsrep_sst_rsync_wan
)
ADD_CUSTOM_TARGET(symlink_wsrep_sst_rsync
ALL
DEPENDS ${wsrep_sst_rsync_wan}
)
INSTALL(
FILES ${wsrep_sst_rsync_wan}
DESTINATION ${INSTALL_BINDIR}
COMPONENT Server
)
# Create symlink
IF (NOT ${binname} STREQUAL ${file})
INSTALL_LINK(${file} ${binname} ${INSTALL_BINDIR} ${${file}_COMPONENT})
ENDIF()
ENDFOREACH()
INSTALL_LINK(wsrep_sst_rsync wsrep_sst_rsync_wan ${INSTALL_BINDIR} Server)
FOREACH(file ${WSREP_SOURCE})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
......
# Copyright (c) 2006, 2014, Oracle and/or its affiliates.
# Copyright (c) 2010, 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
# 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-1335 USA
......@@ -293,56 +293,56 @@ ENDIF()
ADD_LIBRARY(sql_builtins STATIC ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc)
TARGET_LINK_LIBRARIES(sql_builtins ${MYSQLD_STATIC_PLUGIN_LIBS})
MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
MYSQL_ADD_EXECUTABLE(mariadbd ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
IF(APPLE)
# Add CoreServices framework since some dloadable plugins may need it
FIND_LIBRARY(CORESERVICES NAMES CoreServices)
IF(CORESERVICES)
TARGET_LINK_LIBRARIES(mysqld LINK_PRIVATE ${CORESERVICES})
ENDIF()
ENDIF()
IF(APPLE)
# Add CoreServices framework since some dloadable plugins may need it
FIND_LIBRARY(CORESERVICES NAMES CoreServices)
IF(CORESERVICES)
TARGET_LINK_LIBRARIES(mariadbd LINK_PRIVATE ${CORESERVICES})
ENDIF()
ENDIF()
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
IF(NOT MSVC)
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mariadbd PROPERTIES ENABLE_EXPORTS TRUE)
ENDIF()
GET_TARGET_PROPERTY(mysqld_link_flags mysqld LINK_FLAGS)
GET_TARGET_PROPERTY(mysqld_link_flags mariadbd LINK_FLAGS)
IF(NOT mysqld_link_flags)
SET(mysqld_link_flags)
ENDIF()
IF (MINGW OR CYGWIN)
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} -Wl,--export-all-symbols")
SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS "${mysqld_link_flags} -Wl,--export-all-symbols")
ENDIF()
IF(MSVC)
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} \"${MYSQLD_EXP}\"")
ADD_DEPENDENCIES(mysqld gen_mysqld_lib)
SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS "${mysqld_link_flags} \"${MYSQLD_EXP}\"")
ADD_DEPENDENCIES(mariadbd gen_mysqld_lib)
ENDIF()
ENDIF(NOT WITHOUT_DYNAMIC_PLUGINS)
TARGET_LINK_LIBRARIES(mysqld LINK_PRIVATE sql sql_builtins)
TARGET_LINK_LIBRARIES(mariadbd LINK_PRIVATE sql sql_builtins)
# Provide plugins with minimal set of libraries
SET(INTERFACE_LIBS ${LIBRT})
IF(INTERFACE_LIBS)
TARGET_LINK_LIBRARIES(mysqld LINK_PUBLIC ${INTERFACE_LIBS})
TARGET_LINK_LIBRARIES(mariadbd LINK_PUBLIC ${INTERFACE_LIBS})
ENDIF()
# On Solaris, some extra effort is required in order to get dtrace probes
# from static libraries
DTRACE_INSTRUMENT_STATIC_LIBS(mysqld
DTRACE_INSTRUMENT_STATIC_LIBS(mariadbd
"sql;mysys;mysys_ssl;${MYSQLD_STATIC_PLUGIN_LIBS}")
SET(WITH_MYSQLD_LDFLAGS "" CACHE STRING "Additional linker flags for mysqld")
MARK_AS_ADVANCED(WITH_MYSQLD_LDFLAGS)
IF(WITH_MYSQLD_LDFLAGS)
GET_TARGET_PROPERTY(MYSQLD_LINK_FLAGS mysqld LINK_FLAGS)
GET_TARGET_PROPERTY(MYSQLD_LINK_FLAGS mariadbd LINK_FLAGS)
IF(NOT MYSQLD_LINK_FLAGS)
SET(MYSQLD_LINK_FLAGS)
ENDIF()
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS
SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS
"${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}")
ENDIF()
......@@ -396,11 +396,11 @@ ADD_CUSTOM_COMMAND(
DEPENDS gen_lex_hash
)
MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc COMPONENT Server)
SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql mysys mysys_ssl)
MYSQL_ADD_EXECUTABLE(mariadb-tzinfo-to-sql tztime.cc COMPONENT Server)
SET_TARGET_PROPERTIES(mariadb-tzinfo-to-sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
TARGET_LINK_LIBRARIES(mariadb-tzinfo-to-sql mysys mysys_ssl)
ADD_CUSTOM_TARGET(
ADD_CUSTOM_TARGET(
GenServerSource
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
......@@ -420,7 +420,7 @@ CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in
${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY)
ADD_CUSTOM_TARGET(dist
ADD_CUSTOM_TARGET(dist
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/make_dist.cmake
DEPENDS ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc ${CMAKE_BINARY_DIR}/sql/sql_yacc.hh
DEPENDS ${CMAKE_BINARY_DIR}/sql/sql_yacc_ora.cc ${CMAKE_BINARY_DIR}/sql/sql_yacc_ora.hh
......@@ -492,22 +492,22 @@ IF(WIN32)
DEPENDS comp_sql ${my_bootstrap_sql}
)
MYSQL_ADD_EXECUTABLE(mysql_install_db
MYSQL_ADD_EXECUTABLE(mariadb-install-db
mysql_install_db.cc
${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c
COMPONENT Server
)
SET_TARGET_PROPERTIES(mysql_install_db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
TARGET_LINK_LIBRARIES(mysql_install_db mysys shlwapi)
SET_TARGET_PROPERTIES(mariadb-install-db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
TARGET_LINK_LIBRARIES(mariadb-install-db mysys shlwapi)
ADD_LIBRARY(winservice STATIC winservice.c)
TARGET_LINK_LIBRARIES(winservice shell32)
MYSQL_ADD_EXECUTABLE(mysql_upgrade_service
MYSQL_ADD_EXECUTABLE(mariadb-upgrade-service
mysql_upgrade_service.cc
upgrade_conf_file.cc
COMPONENT Server)
TARGET_LINK_LIBRARIES(mysql_upgrade_service mysys winservice)
TARGET_LINK_LIBRARIES(mariadb-upgrade-service mysys winservice)
ENDIF(WIN32)
INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/server/private COMPONENT Development
......
......@@ -229,8 +229,8 @@ ADD_LIBRARY(rocksdb_tools STATIC
MYSQL_ADD_EXECUTABLE(sst_dump rocksdb/tools/sst_dump.cc COMPONENT rocksdb-engine)
TARGET_LINK_LIBRARIES(sst_dump rocksdblib)
MYSQL_ADD_EXECUTABLE(mysql_ldb tools/mysql_ldb.cc COMPONENT rocksdb-engine)
TARGET_LINK_LIBRARIES(mysql_ldb rocksdb_tools rocksdb_aux_lib dbug)
MYSQL_ADD_EXECUTABLE(mariadb-ldb tools/mysql_ldb.cc COMPONENT rocksdb-engine)
TARGET_LINK_LIBRARIES(mariadb-ldb rocksdb_tools rocksdb_aux_lib dbug)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/myrocks_hotbackup.py
${CMAKE_CURRENT_BINARY_DIR}/myrocks_hotbackup @ONLY)
......@@ -249,7 +249,7 @@ IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
ENDIF()
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET_TARGET_PROPERTIES(rocksdb_tools sst_dump mysql_ldb PROPERTIES COMPILE_FLAGS "-Wno-error")
SET_TARGET_PROPERTIES(rocksdb_tools sst_dump mariadb-ldb PROPERTIES COMPILE_FLAGS "-Wno-error")
ENDIF()
# Enable ZSTD if available. Upstream rocksdb cmake will use WITH_ZSTD and set
......
# Copyright (c) 2006, 2010, 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
# 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-1335 USA
......@@ -22,11 +22,11 @@ INCLUDE_DIRECTORIES(BEFORE
${CMAKE_BINARY_DIR}/libmariadb/include
${CMAKE_SOURCE_DIR}/libmariadb/include)
MYSQL_ADD_EXECUTABLE(mysql_client_test mysql_client_test.c COMPONENT Test)
MYSQL_ADD_EXECUTABLE(mariadb-client-test mysql_client_test.c COMPONENT Test)
SET(CLIENT_LIB mariadbclient mysys)
TARGET_LINK_LIBRARIES(mysql_client_test ${CLIENT_LIB})
ADD_DEPENDENCIES(mysql_client_test GenError ${CLIENT_LIB})
TARGET_LINK_LIBRARIES(mariadb-client-test ${CLIENT_LIB})
ADD_DEPENDENCIES(mariadb-client-test GenError ${CLIENT_LIB})
IF(WITH_UNIT_TESTS)
ADD_EXECUTABLE(bug25714 bug25714.c)
......
......@@ -14,21 +14,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/inc)
SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def ${CMAKE_CURRENT_BINARY_DIR}/symlinks.cc)
SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(symlinks)
LIST(LENGTH MARIADB_SYMLINK_FROMS LEN)
MATH(EXPR max_index "${LEN}-1")
SET(ALL_SYMLINKS "")
FOREACH(i RANGE 0 ${max_index})
LIST(GET MARIADB_SYMLINK_FROMS ${i} src)
LIST(GET MARIADB_SYMLINK_TOS ${i} dst)
STRING(APPEND ALL_SYMLINKS "{L\"${src}\",L\"${dst}\"},\n")
ENDFOREACH()
CONFIGURE_FILE(symlinks.cc.in symlinks.cc)
# Custom action should not depend on C runtime, since we do not know if CRT is installed.
FORCE_STATIC_CRT()
ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
......
......@@ -1013,268 +1013,3 @@ extern "C" BOOL WINAPI DllMain(
return TRUE;
}
static wstring MakeExePath(const wchar_t *installDir, const wchar_t *basename)
{
wstring path(installDir);
if (path.back() != L'\\')
path.append(L"\\");
path.append(L"bin\\");
path.append(basename);
path.append(L".exe");
return path;
}
static wstring MakeExePath(const wchar_t *installDir, string basename)
{
wstring path(installDir);
if (path.back() != L'\\')
path.append(L"\\");
path.append(L"bin\\");
for (auto c : basename)
path+= c;
path.append(L".exe");
return path;
}
static wstring MakeFixSymlinksLogPath()
{
wchar_t buf[MAX_PATH];
if (GetTempPathW(MAX_PATH, buf))
return wstring(buf) + L"\\mariadb_msi_fix_symlinks.log";
return L"";
}
static string w2s(wstring w)
{
string s;
for (auto wc : w)
s += (char)wc;
return s;
}
/*
Remove symlinks if target file does not exist.
Create symlink if target exists, but symlink is not.
*/
static void fix_symlink(const wchar_t *file, const wchar_t *link,
const wchar_t *installdir,
vector<string> &rollback_actions)
{
WcaLog(LOGMSG_STANDARD, "fix_symlink %S=>%S", link, file);
auto tgt= MakeExePath(installdir, file);
auto lnk= MakeExePath(installdir, link);
auto target_path= tgt.c_str();
auto link_path= lnk.c_str();
auto target_attr= GetFileAttributesW(target_path);
auto link_attr= GetFileAttributesW(link_path);
WcaLog(LOGMSG_STANDARD, "%S %s", target_path,
target_attr == INVALID_FILE_ATTRIBUTES ? "does not exist" : "exists");
WcaLog(LOGMSG_STANDARD, "%S %s", link_path,
link_attr == INVALID_FILE_ATTRIBUTES ? "does not exist" : "exists");
if (link_attr != INVALID_FILE_ATTRIBUTES &&
((link_attr & FILE_ATTRIBUTE_REPARSE_POINT) == 0))
{
WcaLog(LOGMSG_STANDARD, "%S is not a symlink!", link_path);
return;
}
if (target_attr == INVALID_FILE_ATTRIBUTES)
{
if (link_attr == INVALID_FILE_ATTRIBUTES)
{
return;
}
auto ok= DeleteFileW(link_path);
WcaLog(LOGMSG_STANDARD, "DeleteFileW(L\"%S\") returned %s, last error %lu",
link_path, ok ? "success" : "error", GetLastError());
if (ok)
{
rollback_actions.push_back(string("create_symlink ") + w2s(link) + " " +
w2s(file));
}
return;
}
if (link_attr != INVALID_FILE_ATTRIBUTES)
return;
auto ok= CreateSymbolicLinkW(link_path, target_path, 0);
WcaLog(LOGMSG_STANDARD,
"CreateSymbolicLinkW(\"%S\",\"%S\", 0) returned %s, last error %d",
link_path, target_path, ok ? "success" : "error",
(int) GetLastError());
if (ok)
rollback_actions.push_back(string("delete ") + w2s(link));
}
static string rollback_info_path()
{
char tmppath[MAX_PATH];
if (!GetTempPathA(MAX_PATH, tmppath))
return "";
string filepath(tmppath);
filepath.append("\\mariadb_symlink_rollback_info.tmp");
return filepath;
}
static void save_symlink_rollback_info(vector<string> rollback_info)
{
std::ofstream ofs;
string path = rollback_info_path();
ofs.open(path, std::ofstream::out | std::ofstream::trunc);
if (!ofs.good())
return;
WcaLog(LOGMSG_STANDARD,
"Storing this rollback script for custom action in %s, in case installation rolls back",
path.c_str());
for (auto line : rollback_info)
{
WcaLog(LOGMSG_STANDARD, "%s", line.c_str());
ofs << line << "\n";
}
WcaLog(LOGMSG_STANDARD, "End of rollback script");
}
#include <symlinks.h>
/* MDEV-19781 MariaDB symlinks on Windows */
extern "C" UINT __stdcall FixSymlinksRollback(MSIHANDLE hInstall)
{
HRESULT hr= S_OK;
UINT er= ERROR_SUCCESS;
wchar_t targetdir[MAX_PATH];
DWORD len= MAX_PATH;
hr= WcaInitialize(hInstall, __FUNCTION__);
WcaLog(LOGMSG_STANDARD, "Initialized.");
std::ifstream ifs;
std::string command;
if (MsiGetPropertyW(hInstall, L"CustomActionData", targetdir, &len) !=
ERROR_SUCCESS)
{
hr= HRESULT_FROM_WIN32(GetLastError());
ExitOnFailure(hr, "MsiGetPropertyW failed");
}
ifs.open(rollback_info_path(), std::ofstream::in);
if (!ifs.good())
goto LExit;
while (ifs >> command)
{
if (command == "create_symlink")
{
string link;
ifs >> link;
auto link_path= MakeExePath(targetdir, link);
string file;
ifs >> file;
auto target_path= MakeExePath(targetdir, file);
bool ok= CreateSymbolicLinkW(link_path.c_str(), target_path.c_str(), 0);
WcaLog(LOGMSG_STANDARD, "CreateSymbolicLinkW(%S,%S) %s, last error %lu",
link_path.c_str(), target_path.c_str(), ok ? "success" : "error",
GetLastError());
}
else if (command == "delete")
{
string link;
ifs >> link;
auto link_path= MakeExePath(targetdir, link);
auto link_attr= GetFileAttributesW(link_path.c_str());
if (link_attr != INVALID_FILE_ATTRIBUTES &&
(link_attr & FILE_ATTRIBUTE_REPARSE_POINT))
{
auto ok= DeleteFileW(link_path.c_str());
WcaLog(LOGMSG_STANDARD, "DeleteFile(%S) %s, last error %lu",
link_path.c_str(), ok ? "success" : "error", GetLastError());
}
}
else
{
WcaLog(LOGMSG_STANDARD, "Unknown command '%s' in rollback script ",
command.c_str());
goto LExit;
}
}
LExit:
return WcaFinalize(er);
}
extern "C" UINT __stdcall SymlinksUninstall(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
wchar_t targetdir[MAX_PATH];
DWORD len = MAX_PATH;
int i;
hr = WcaInitialize(hInstall, __FUNCTION__);
WcaLog(LOGMSG_STANDARD, "Initialized.");
if (MsiGetPropertyW(hInstall, L"CustomActionData", targetdir, &len) !=
ERROR_SUCCESS)
{
hr = HRESULT_FROM_WIN32(GetLastError());
ExitOnFailure(hr, "MsiGetPropertyW failed");
}
for (i = 0; all_symlinks[i].file; i++)
{
auto link_path = MakeExePath(targetdir, all_symlinks[i].link);
auto link_attr = GetFileAttributesW(link_path.c_str());
auto filepath = link_path.c_str();
if (link_attr == INVALID_FILE_ATTRIBUTES)
{
WcaLog(LOGMSG_STANDARD, " %S does not exist",filepath);
continue;
}
if(!(link_attr & FILE_ATTRIBUTE_REPARSE_POINT))
{
WcaLog(LOGMSG_STANDARD, " %S is not a symbolic link!",filepath);
continue;
}
BOOL ok = DeleteFileW(filepath);
WcaLog(LOGMSG_STANDARD, "DeleteFile(%S) %s, last error %lu",
filepath, ok? "succeeded":"failed", GetLastError());
}
LExit:
return WcaFinalize(er);
}
/* MDEV-19781 MariaDB symlinks on Windows */
extern "C" UINT __stdcall FixSymlinks(MSIHANDLE hInstall)
{
HRESULT hr= S_OK;
UINT er= ERROR_SUCCESS;
wchar_t targetdir[MAX_PATH];
vector<string> rollback_actions;
DWORD len= MAX_PATH;
int i;
hr= WcaInitialize(hInstall, __FUNCTION__);
WcaLog(LOGMSG_STANDARD, "Initialized.");
if (MsiGetPropertyW(hInstall, L"CustomActionData", targetdir, &len) !=
ERROR_SUCCESS)
{
hr= HRESULT_FROM_WIN32(GetLastError());
ExitOnFailure(hr, "MsiGetPropertyW failed");
}
for (i= 0; all_symlinks[i].file; i++)
fix_symlink(all_symlinks[i].file, all_symlinks[i].link, targetdir,
rollback_actions);
save_symlink_rollback_info(rollback_actions);
LExit:
return WcaFinalize(er);
}
......@@ -8,6 +8,3 @@ CheckDatabaseProperties
CheckDataDirectoryEmpty
CheckDBInUse
CheckServiceUpgrades
FixSymlinks
FixSymlinksRollback
SymlinksUninstall
#include "symlinks.h"
symlink all_symlinks[]=
{
@ALL_SYMLINKS@
{nullptr, nullptr}
};
#pragma once
struct symlink
{
const wchar_t *file;
const wchar_t *link;
};
extern symlink all_symlinks[];
......@@ -311,9 +311,11 @@ ENDFUNCTION()
SET(CPACK_WIX_COMPONENTS)
SET(CPACK_WIX_COMPONENT_GROUPS)
GET_FILENAME_COMPONENT(abs . ABSOLUTE)
FOREACH(d ${DIRS})
GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
GET_FILENAME_COMPONENT(d_name ${d} NAME)
MAKE_WIX_IDENTIFIER("${d_name}" d_name)
FILE(WRITE ${abs}/${d_name}_component_group.wxs
"<ComponentGroup Id='componentgroup.${d_name}'>")
......
......@@ -597,21 +597,6 @@
<?endif ?>
<!-- Custom action, create symlinks -->
<CustomAction Id="Symlinks.SetProperty" Return="check" Property="Symlinks" Value="[INSTALLDIR]" />
<CustomAction Id="Symlinks" BinaryKey="wixca.dll" DllEntry="FixSymlinks" Execute="deferred" Impersonate="no" Return="ignore"/>
<CustomAction Id="SymlinksRollback.SetProperty" Return="check" Property="SymlinksRollback" Value="[INSTALLDIR]" />
<CustomAction Id="SymlinksRollback" BinaryKey="wixca.dll" DllEntry="FixSymlinksRollback" Execute="rollback" Impersonate="no" Return="ignore"/>
<CustomAction Id="SymlinksUninstall.SetProperty" Return="check" Property="SymlinksUninstall" Value="[INSTALLDIR]" />
<CustomAction Id="SymlinksUninstall" BinaryKey="wixca.dll" DllEntry="SymlinksUninstall" Execute="deferred" Impersonate="no" Return="ignore"/>
<InstallExecuteSequence>
<Custom Action="Symlinks.SetProperty" Before="Symlinks">NOT Installed OR UPGRADINGPRODUCTCODE</Custom>
<Custom Action="Symlinks" After="SymlinksRollback">NOT Installed OR UPGRADINGPRODUCTCODE</Custom>
<Custom Action="SymlinksRollback.SetProperty" Before="SymlinksRollback">NOT Installed OR UPGRADINGPRODUCTCODE</Custom>
<Custom Action="SymlinksRollback" After="InstallFiles">NOT Installed OR UPGRADINGPRODUCTCODE</Custom>
<Custom Action="SymlinksUninstall.SetProperty" Before="SymlinksUninstall">Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="SymlinksUninstall" Before="RemoveFiles">Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
</InstallExecuteSequence>
<!-- Custom action, call mysql_install_db -->
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="SKIPNETWORKING" Value="--skip-networking" >SKIPNETWORKING</SetProperty>
......@@ -633,7 +618,7 @@
<CustomAction Id="CreateDatabaseRollback" BinaryKey="wixca.dll" DllEntry="CreateDatabaseRollback"
Execute="rollback" Return="check" Impersonate="no"/>
<UI>
<ProgressText Action="CreateDatabase">Running mysql_install_db.exe</ProgressText>
<ProgressText Action="CreateDatabase">Running mariadb-install-db.exe</ProgressText>
</UI>
<!-- Error injection script activated by TEST_FAIL=1 passed to msiexec (to see how good custom action rollback works) -->
......
......@@ -40,20 +40,20 @@ SET(CMAKE_MFC_FLAG 1)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc -DNO_WARN_MBCS_MFC_DEPRECATION")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
MYSQL_ADD_EXECUTABLE(mysql_upgrade_wizard
MYSQL_ADD_EXECUTABLE(mariadb-upgrade-wizard
upgrade.cpp upgradeDlg.cpp upgrade.rc ${UPGRADE_WIZARD_SOURCES}
COMPONENT Server)
TARGET_LINK_LIBRARIES(mysql_upgrade_wizard ${UPGRADE_WIZARD_LINK_LIBRARIES})
TARGET_LINK_LIBRARIES(mariadb-upgrade-wizard ${UPGRADE_WIZARD_LINK_LIBRARIES})
# upgrade_wizard is Windows executable, set WIN32_EXECUTABLE so it does not
# create a console.
SET_TARGET_PROPERTIES(mysql_upgrade_wizard PROPERTIES WIN32_EXECUTABLE 1)
SET_TARGET_PROPERTIES(mariadb-upgrade-wizard PROPERTIES WIN32_EXECUTABLE 1)
# Embed Vista "admin" manifest, since upgrade_wizard needs admin privileges
# to change service configuration. Due to a CMake bug http://www.vtk.org/Bug/view.php?id=11171
# it is not possible currenly to do it with linker flags. Work around is to use
# manifest tool mt.exe and embed the manifest post-build.
ADD_CUSTOM_COMMAND(
TARGET mysql_upgrade_wizard POST_BUILD
TARGET mariadb-upgrade-wizard POST_BUILD
COMMAND mt.exe -manifest ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_wizard.exe.manifest
"-outputresource:$<TARGET_FILE:mysql_upgrade_wizard>;#1"
"-outputresource:$<TARGET_FILE:mariadb-upgrade-wizard>;#1"
)
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