2017-03-23 13:15:46 +01:00
|
|
|
Author: Adam Majer <amajer@suse.de>
|
|
|
|
Date: Thu Mar 23 11:54:11 CET 2017
|
|
|
|
Summary: Build private symbols library
|
|
|
|
|
|
|
|
Some of the private symbols have very generic names and are required
|
|
|
|
by other connectors, like the ODBC connector. Instead of using
|
|
|
|
static linking, create a private shared library that simply
|
|
|
|
exports all symbols. With the exception of exported symbols, it is
|
|
|
|
identical to the regular library.
|
|
|
|
|
2022-02-28 11:00:35 +01:00
|
|
|
Index: mariadb-connector-c-3.2.6-src/libmariadb/CMakeLists.txt
|
2017-03-23 13:15:46 +01:00
|
|
|
===================================================================
|
2022-02-28 11:00:35 +01:00
|
|
|
--- mariadb-connector-c-3.2.6-src.orig/libmariadb/CMakeLists.txt
|
|
|
|
+++ mariadb-connector-c-3.2.6-src/libmariadb/CMakeLists.txt
|
|
|
|
@@ -416,6 +416,12 @@ TARGET_LINK_LIBRARIES(libmariadb LINK_PR
|
2021-08-05 08:57:32 +02:00
|
|
|
|
|
|
|
SIGN_TARGET(libmariadb)
|
2017-03-23 13:15:46 +01:00
|
|
|
|
|
|
|
+ADD_LIBRARY(libmariadbprivate SHARED ${libmariadb_RC} $<TARGET_OBJECTS:mariadb_obj> ${EMPTY_FILE} ${EXPORT_LINK})
|
|
|
|
+TARGET_LINK_LIBRARIES(libmariadbprivate ${SYSTEM_LIBS})
|
|
|
|
+IF(UNIX)
|
|
|
|
+ SET_TARGET_PROPERTIES(libmariadbprivate PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
|
|
|
|
+ENDIF()
|
|
|
|
+
|
2019-07-04 17:05:50 +02:00
|
|
|
IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR
|
2020-07-06 14:48:44 +02:00
|
|
|
CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR
|
2019-07-04 17:05:50 +02:00
|
|
|
CMAKE_SYSTEM_NAME MATCHES "GNU")
|
2022-02-28 11:00:35 +01:00
|
|
|
@@ -423,11 +429,13 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR
|
2020-05-22 21:50:54 +02:00
|
|
|
TARGET_LINK_LIBRARIES (libmariadb LINK_PRIVATE "-Wl,--no-undefined")
|
2017-09-12 16:29:43 +02:00
|
|
|
ENDIF()
|
2018-08-09 12:28:56 +02:00
|
|
|
SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def")
|
|
|
|
+ SET_TARGET_PROPERTIES(libmariadbprivate PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
|
2017-03-23 13:15:46 +01:00
|
|
|
ENDIF()
|
|
|
|
|
2017-09-12 16:29:43 +02:00
|
|
|
SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}")
|
|
|
|
SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}")
|
|
|
|
|
2017-03-23 13:15:46 +01:00
|
|
|
+SET_TARGET_PROPERTIES(libmariadbprivate PROPERTIES PREFIX "")
|
|
|
|
SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "")
|
|
|
|
|
2018-07-17 15:41:22 +02:00
|
|
|
#
|
2022-02-28 11:00:35 +01:00
|
|
|
@@ -469,6 +477,9 @@ INSTALL(TARGETS libmariadb LIBRARY DESTI
|
|
|
|
COMPONENT SharedLibraries NAMELINK_SKIP)
|
|
|
|
INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR}
|
|
|
|
COMPONENT Development NAMELINK_ONLY)
|
2017-09-12 16:29:43 +02:00
|
|
|
+INSTALL(TARGETS libmariadbprivate
|
2022-02-28 11:00:35 +01:00
|
|
|
+ COMPONENT SharedLibraries
|
|
|
|
+ DESTINATION ${INSTALL_LIBDIR})
|
2022-07-07 15:06:50 +02:00
|
|
|
ENDIF()
|
2017-03-23 13:15:46 +01:00
|
|
|
|
2020-05-22 21:50:54 +02:00
|
|
|
IF(MSVC)
|
2022-02-28 11:00:35 +01:00
|
|
|
Index: mariadb-connector-c-3.2.6-src/mariadb_config/mariadb_config.c.in
|
2017-03-23 13:15:46 +01:00
|
|
|
===================================================================
|
2022-02-28 11:00:35 +01:00
|
|
|
--- mariadb-connector-c-3.2.6-src.orig/mariadb_config/mariadb_config.c.in
|
|
|
|
+++ mariadb-connector-c-3.2.6-src/mariadb_config/mariadb_config.c.in
|
|
|
|
@@ -33,6 +33,7 @@ static char *mariadb_progname;
|
2020-11-05 16:57:23 +01:00
|
|
|
#define INCLUDE "-I%s/@INSTALL_INCLUDEDIR@ -I%s/@INSTALL_INCLUDEDIR@/mysql"
|
|
|
|
#define LIBS "-L%s/@INSTALL_LIBDIR@/ -lmariadb"
|
2017-09-12 16:29:43 +02:00
|
|
|
#define LIBS_SYS "@extra_dynamic_LDFLAGS@"
|
2021-05-28 09:35:43 +02:00
|
|
|
+#define PRIVATE_LIBS "-L%s/@INSTALL_LIBDIR@ -lmariadbprivate " LIBS_SYS
|
2017-09-12 16:29:43 +02:00
|
|
|
#define CFLAGS INCLUDE
|
|
|
|
#define VERSION "@MARIADB_CLIENT_VERSION@"
|
2020-11-05 16:57:23 +01:00
|
|
|
#define CC_VERSION "@CPACK_PACKAGE_VERSION@"
|
2022-02-28 11:00:35 +01:00
|
|
|
@@ -72,6 +73,7 @@ static struct option long_options[]=
|
2020-05-22 21:50:54 +02:00
|
|
|
{OPT_STRING_TYPE "plugindir", no_argument, 0, 'j'},
|
|
|
|
{OPT_STRING_TYPE "tlsinfo", no_argument, 0, 'k'},
|
2020-11-05 16:57:23 +01:00
|
|
|
{OPT_STRING_TYPE "variable", 2, 0, 'm'},
|
|
|
|
+ {OPT_STRING_TYPE "privatelibs", no_argument, 0, 'z'},
|
2022-02-28 11:00:35 +01:00
|
|
|
#ifdef HAVE_EMBEDDED
|
|
|
|
{OPT_STRING_TYPE "libmysqld-libs", no_argument, 0, 'n' },
|
|
|
|
{OPT_STRING_TYPE "embedded-libs", no_argument, 0, 'n' },
|
|
|
|
@@ -104,6 +106,7 @@ static const char *values[]=
|
2018-04-19 13:51:02 +02:00
|
|
|
CC_VERSION,
|
2017-03-23 13:15:46 +01:00
|
|
|
SOCKET,
|
|
|
|
PORT,
|
|
|
|
+ PRIVATE_LIBS,
|
2017-09-12 16:29:43 +02:00
|
|
|
PLUGIN_DIR,
|
2020-11-05 16:57:23 +01:00
|
|
|
TLS_LIBRARY_VERSION,
|
|
|
|
"VAR VAR is one of:"
|
2022-02-28 11:00:35 +01:00
|
|
|
@@ -303,6 +306,9 @@ int main(int argc, char **argv)
|
2020-11-05 16:57:23 +01:00
|
|
|
}
|
2017-03-23 13:15:46 +01:00
|
|
|
break;
|
2020-11-05 16:57:23 +01:00
|
|
|
}
|
|
|
|
+ case 'z':
|
2017-03-23 13:15:46 +01:00
|
|
|
+ puts(PRIVATE_LIBS);
|
|
|
|
+ break;
|
2022-02-28 11:00:35 +01:00
|
|
|
#ifdef HAVE_EMBEDDED
|
|
|
|
case 'n':
|
|
|
|
puts(EMBEDDED_LIBS);
|