summaryrefslogtreecommitdiff
path: root/cmake/symlinks.cmake
diff options
context:
space:
mode:
authorRasmus Johansson <rasmus@mariadb.com>2020-03-20 16:41:54 +0200
committerSergei Golubchik <serg@mariadb.org>2020-03-21 20:20:29 +0100
commit9e1b3af4a490d6fb6704756aba90281ff5ac033a (patch)
tree513967006d4809562e38a04ae741916c2c32e119 /cmake/symlinks.cmake
parent6fb59d525b7047c82e350d2b721bffc50431eb12 (diff)
downloadmariadb-git-9e1b3af4a490d6fb6704756aba90281ff5ac033a.tar.gz
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
Diffstat (limited to 'cmake/symlinks.cmake')
-rw-r--r--cmake/symlinks.cmake104
1 files changed, 41 insertions, 63 deletions
diff --git a/cmake/symlinks.cmake b/cmake/symlinks.cmake
index ec638bc82de..e040ff19f77 100644
--- a/cmake/symlinks.cmake
+++ b/cmake/symlinks.cmake
@@ -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()