Commit 2bdffb1d authored by Tor Didriksen's avatar Tor Didriksen

Backport of Bug#16809055 MYSQL 5.6 AND 5.7 STILL USE LIBMYSQLCLIENT.SO.18

Backported only the softlink part of the patch,
*not* the bumping of library version.

With this patch, the libmysql/ directory contains:
libmysqlclient.a
libmysqlclient_r.a -> libmysqlclient.a
libmysqlclient_r.so -> libmysqlclient.so*
libmysqlclient_r.so.18 -> libmysqlclient.so.18*
libmysqlclient_r.so.18.0.0 -> libmysqlclient.so.18.0.0*
libmysqlclient.so -> libmysqlclient.so.18*
libmysqlclient.so.18 -> libmysqlclient.so.18.0.0*
libmysqlclient.so.18.0.0*
parent 75c2cc45
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -111,28 +111,28 @@ FUNCTION(INSTALL_SCRIPT) ...@@ -111,28 +111,28 @@ FUNCTION(INSTALL_SCRIPT)
ENDFUNCTION() ENDFUNCTION()
# Install symbolic link to CMake target. # Install symbolic link to CMake target.
# the link is created in the same directory as target # We do 'cd path; ln -s target_name link_name'
# and extension will be the same as for target file. # We also add an INSTALL target for "${path}/${link_name}"
MACRO(INSTALL_SYMLINK linkname target destination component) MACRO(INSTALL_SYMLINK target target_name link_name destination component)
IF(UNIX) IF(UNIX)
GET_TARGET_PROPERTY(location ${target} LOCATION) GET_TARGET_PROPERTY(location ${target} LOCATION)
GET_FILENAME_COMPONENT(path ${location} PATH) GET_FILENAME_COMPONENT(path ${location} PATH)
GET_FILENAME_COMPONENT(name ${location} NAME)
SET(output ${path}/${linkname}) SET(output ${path}/${link_name})
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${output} OUTPUT ${output}
COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output} COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
${name} ${target_name}
${linkname} ${link_name}
WORKING_DIRECTORY ${path} WORKING_DIRECTORY ${path}
DEPENDS ${target} DEPENDS ${target}
) )
ADD_CUSTOM_TARGET(symlink_${linkname} ADD_CUSTOM_TARGET(symlink_${link_name}
ALL ALL
DEPENDS ${output}) DEPENDS ${output})
SET_TARGET_PROPERTIES(symlink_${linkname} PROPERTIES CLEAN_DIRECT_OUTPUT 1) SET_TARGET_PROPERTIES(symlink_${link_name} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
IF(CMAKE_GENERATOR MATCHES "Xcode") IF(CMAKE_GENERATOR MATCHES "Xcode")
# For Xcode, replace project config with install config # For Xcode, replace project config with install config
STRING(REPLACE "${CMAKE_CFG_INTDIR}" STRING(REPLACE "${CMAKE_CFG_INTDIR}"
......
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# #
SET(SHARED_LIB_MAJOR_VERSION "18") SET(SHARED_LIB_MAJOR_VERSION "18")
SET(SHARED_LIB_MINOR_VERSION "0")
SET(PROTOCOL_VERSION "10") SET(PROTOCOL_VERSION "10")
SET(DOT_FRM_VERSION "6") SET(DOT_FRM_VERSION "6")
......
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -174,6 +174,12 @@ IF(MSVC) ...@@ -174,6 +174,12 @@ IF(MSVC)
INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug) INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug)
ENDIF() ENDIF()
MACRO(GET_TARGET_NAME target out_name)
GET_TARGET_PROPERTY(location ${target} LOCATION)
GET_FILENAME_COMPONENT(name ${location} NAME)
SET(${out_name} ${name})
ENDMACRO()
IF(UNIX) IF(UNIX)
MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME) MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME)
SET(DOT_VERSION ".${VERSION}") SET(DOT_VERSION ".${VERSION}")
...@@ -186,11 +192,19 @@ IF(UNIX) ...@@ -186,11 +192,19 @@ IF(UNIX)
SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION}) SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
ENDIF() ENDIF()
ENDMACRO() ENDMACRO()
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development) ENDIF()
IF(UNIX)
GET_TARGET_NAME(mysqlclient lib_name)
INSTALL_SYMLINK(mysqlclient
${lib_name} ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a
${INSTALL_LIBDIR} Development)
ENDIF() ENDIF()
IF(NOT DISABLE_SHARED) IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT SharedLibraries) MERGE_LIBRARIES(libmysql SHARED ${LIBS}
EXPORTS ${CLIENT_API_FUNCTIONS}
COMPONENT SharedLibraries)
IF(UNIX) IF(UNIX)
# libtool compatability # libtool compatability
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)
...@@ -198,7 +212,8 @@ IF(NOT DISABLE_SHARED) ...@@ -198,7 +212,8 @@ IF(NOT DISABLE_SHARED)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0") SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0")
ELSE() ELSE()
SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0") SET(OS_SHARED_LIB_VERSION
"${SHARED_LIB_MAJOR_VERSION}.${SHARED_LIB_MINOR_VERSION}.0")
ENDIF() ENDIF()
# Name of shared library is mysqlclient on Unix # Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES SET_TARGET_PROPERTIES(libmysql PROPERTIES
...@@ -224,8 +239,13 @@ IF(NOT DISABLE_SHARED) ...@@ -224,8 +239,13 @@ IF(NOT DISABLE_SHARED)
"${CMAKE_SHARED_LIBRARY_SUFFIX}" "${CMAKE_SHARED_LIBRARY_SUFFIX}"
"" ""
linkname) linkname)
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) GET_TARGET_NAME(libmysql lib_name)
SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}") GET_FILENAME_COMPONENT(lib_name_we ${lib_name} NAME_WE)
INSTALL_SYMLINK(libmysql
${lib_name} ${linkname}
${INSTALL_LIBDIR} SharedLibraries)
SET(OS_SHARED_LIB_SYMLINKS
"${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS) LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS)
FOREACH(ver ${OS_SHARED_LIB_SYMLINKS}) FOREACH(ver ${OS_SHARED_LIB_SYMLINKS})
GET_VERSIONED_LIBNAME( GET_VERSIONED_LIBNAME(
...@@ -233,7 +253,11 @@ IF(NOT DISABLE_SHARED) ...@@ -233,7 +253,11 @@ IF(NOT DISABLE_SHARED)
"${CMAKE_SHARED_LIBRARY_SUFFIX}" "${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${ver}" "${ver}"
linkname) linkname)
INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) GET_VERSIONED_LIBNAME(
${lib_name_we} "${CMAKE_SHARED_LIBRARY_SUFFIX}" "${ver}" lib_name_ver)
INSTALL_SYMLINK(libmysql
${lib_name_ver} ${linkname}
${INSTALL_LIBDIR} SharedLibraries)
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
ENDIF() ENDIF()
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