1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00
Files
mariadb-connector-c/cmake/export.cmake
Sergei Golubchik f91561bf54 MDEV-13588 /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18: version `libmariadbclient_18' not found
MDEV-13593 dlopen failure loading after upgrade from 10.2.6 to 10.2.8
MDEV-13619 libmariadb missing version info for libmariadbclient_18
MDEV-13615 MariaDB 10.2 client library (Debian 9/Stretch) not compatible with Perl MySQL DBI module

Debian 9, just for the fun of it, I presume, renamed
version nodes in the libmysqlclient.so, introducing
new incompatible with anything, version
"libmariadbclient_18". This version will supposedly
disappear in Debian 10 (breaking compatibility again).

But libmariadb.so.3 needs to be compatible with
Debian 8 (libmysqlclient_18),
Debian 9 (libmariadbclient_18), and, in the future,
Debian 10 (libmariadb_3?). At the same time!

To achieve this remarkable feat we version old symbols
with libmysqlclient_18, and (!) alias them into
libmariadbclient_18. New symbols are versioned under
libmariadb_3.
2017-09-16 22:51:37 +02:00

31 lines
1.1 KiB
CMake

#
# Copyright (C) 2013-2016 MariaDB Corporation AB
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the COPYING-CMAKE-SCRIPTS file.
#
MACRO(CREATE_EXPORT_FILE op outfile version symbols alias_version)
IF(WIN32)
SET(EXPORT_CONTENT "EXPORTS\n")
FOREACH(exp_symbol ${symbols})
SET(EXPORT_CONTENT ${EXPORT_CONTENT} "${exp_symbol}\n")
ENDFOREACH()
ELSE()
SET(EXPORT_CONTENT "VERSION {\n${version} {\nglobal:\n")
FOREACH(exp_symbol ${symbols})
SET(EXPORT_CONTENT "${EXPORT_CONTENT} ${exp_symbol}\\;\n")
ENDFOREACH()
SET(EXPORT_CONTENT "${EXPORT_CONTENT}local:\n *\\;\n}\\;\n")
IF ("${alias_version}" STRGREATER "")
SET(EXPORT_CONTENT "${EXPORT_CONTENT}${alias_version} {\n}\\;\n}\\;\n")
FOREACH(exp_symbol ${symbols})
SET(EXPORT_CONTENT "${EXPORT_CONTENT}\"${exp_symbol}@${alias_version}\" = ${exp_symbol}\\;\n")
ENDFOREACH()
ELSE()
SET(EXPORT_CONTENT "${EXPORT_CONTENT}}\\;\n")
ENDIF()
ENDIF()
FILE(${op} ${CMAKE_CURRENT_BINARY_DIR}/${outfile} ${EXPORT_CONTENT})
ENDMACRO()