From c0548aa91a77096f7fea07d2bff0e526822b1b75 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 8 Oct 2015 16:21:07 +1100 Subject: libmysqlclient: enable shared and don't install docs --- src/libmysqlclient-1-fixes.patch | 71 +++++++++++++++++----- src/libmysqlclient.def | 124 +++++++++++++++++++++++++++++++++++++++ src/libmysqlclient.mk | 14 +++-- 3 files changed, 190 insertions(+), 19 deletions(-) create mode 100644 src/libmysqlclient.def diff --git a/src/libmysqlclient-1-fixes.patch b/src/libmysqlclient-1-fixes.patch index 4152295..1570f4b 100644 --- a/src/libmysqlclient-1-fixes.patch +++ b/src/libmysqlclient-1-fixes.patch @@ -3,10 +3,10 @@ See index.html for further information. Contains ad hoc patches for cross building. -From 71cfce45995b6480ce152e114f9b1200285aff25 Mon Sep 17 00:00:00 2001 +From fe2dc073c1944a148266731783ffbb44ca05dff0 Mon Sep 17 00:00:00 2001 From: MXE Date: Sun, 6 Sep 2015 22:34:47 +0100 -Subject: [PATCH 1/5] use comp_err tool built in native build +Subject: [PATCH 1/6] use comp_err tool built in native build See http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build @@ -45,13 +45,13 @@ index ac28c62..b2cbb75 100644 ${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys COMMAND comp_err -- -2.3.2 (Apple Git-55) +2.3.8 (Apple Git-58) -From 107ff4667803afbfa33802081b4684ccf546aaea Mon Sep 17 00:00:00 2001 +From 0016ad64182c792db3a73a088edd2fb8f0979bf4 Mon Sep 17 00:00:00 2001 From: MXE Date: Sun, 6 Sep 2015 22:53:33 +0100 -Subject: [PATCH 2/5] fix extra qualification 'Handshake::' +Subject: [PATCH 2/6] fix extra qualification 'Handshake::' Compilation error. @@ -69,13 +69,13 @@ index 14b1386..395af36 100644 bool virtual is_complete() const { -- -2.3.2 (Apple Git-55) +2.3.8 (Apple Git-58) -From 5f61b1e80ce1b059de333ae87f5e6477aab9db2e Mon Sep 17 00:00:00 2001 +From f8d00456e899c9f894c5ffd129492cd1a0071a1a Mon Sep 17 00:00:00 2001 From: MXE Date: Mon, 7 Sep 2015 22:59:18 +0100 -Subject: [PATCH 3/5] fix case in headers and libs (should be lowercase) +Subject: [PATCH 3/6] fix case in headers and libs (should be lowercase) diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp @@ -131,13 +131,13 @@ index d25aae8..ecfee79 100644 static int win_auth_client_plugin_init(char*, size_t, int, va_list) -- -2.3.2 (Apple Git-55) +2.3.8 (Apple Git-58) -From 0f25aa3b8c8a5b08b484806e462517d982099931 Mon Sep 17 00:00:00 2001 +From 92a89df619d80882178f73fc05ad78d2bb9cb44f Mon Sep 17 00:00:00 2001 From: MXE Date: Mon, 7 Sep 2015 23:01:35 +0100 -Subject: [PATCH 4/5] define missing types +Subject: [PATCH 4/6] define missing types We do not use types CERT_NAME_BLOB and CRYPT_HASH_BLOB, though they are used in mprapi.h. And are not defined! @@ -157,13 +157,13 @@ index 780c765..e2cd321 100644 /* -- -2.3.2 (Apple Git-55) +2.3.8 (Apple Git-58) -From ac6210388d78e3459adc558d3aff5b2f734360e1 Mon Sep 17 00:00:00 2001 +From 9ae06886d2c38c9fef0a4f04e81c6fad71306482 Mon Sep 17 00:00:00 2001 From: MXE Date: Mon, 7 Sep 2015 23:04:23 +0100 -Subject: [PATCH 5/5] macro NATIVE_WIN32 for stuff we don't have here +Subject: [PATCH 5/6] macro NATIVE_WIN32 for stuff we don't have here Macro NATIVE_WIN32 is undefined in MXE. It is used instead of _WIN32 in #ifdef's where working variant is Unix and not Win32: @@ -271,5 +271,46 @@ index 226d469..db94096 100644 #include "m_string.h" #include -- -2.3.2 (Apple Git-55) +2.3.8 (Apple Git-58) + + +From 2c02e9ed72db74f4a9c52a198e82d06293470ce7 Mon Sep 17 00:00:00 2001 +From: MXE +Date: Thu, 8 Oct 2015 13:30:53 +1100 +Subject: [PATCH 6/6] fix shared lib names + + +diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt +index 17c8c03..9e2980b 100644 +--- a/libmysql/CMakeLists.txt ++++ b/libmysql/CMakeLists.txt +@@ -216,7 +216,7 @@ MACRO(GET_TARGET_NAME target out_name) + SET(${out_name} ${name}) + ENDMACRO() + +-IF(UNIX) ++IF(UNIX OR MINGW) + MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME) + SET(DOT_VERSION ".${VERSION}") + IF(DOT_VERSION STREQUAL ".") +@@ -230,7 +230,7 @@ IF(UNIX) + ENDMACRO() + ENDIF() + +-IF(UNIX) ++IF(UNIX OR MINGW) + GET_TARGET_NAME(mysqlclient lib_name) + INSTALL_SYMLINK(mysqlclient + ${lib_name} ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a +@@ -252,7 +252,7 @@ IF(NOT DISABLE_SHARED) + MERGE_LIBRARIES(libmysql SHARED ${LIBS} + EXPORTS ${CLIENT_API_FUNCTIONS} + COMPONENT SharedLibraries) +- IF(UNIX) ++ IF(UNIX OR MINGW) + # libtool compatability + IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) + SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}") +-- +2.3.8 (Apple Git-58) diff --git a/src/libmysqlclient.def b/src/libmysqlclient.def new file mode 100644 index 0000000..761b933 --- /dev/null +++ b/src/libmysqlclient.def @@ -0,0 +1,124 @@ +; +; Definition file of liblibmysql.dll +; Automatic generated by gendef +; written by Kai Tietz 2008 +; +LIBRARY "libmysqlclient.dll" +EXPORTS +get_tty_password +handle_options +load_defaults +my_init +myodbc_remove_escape@8 +mysql_affected_rows@4 +mysql_autocommit@8 +mysql_change_user@16 +mysql_character_set_name@4 +mysql_client_find_plugin +mysql_client_register_plugin +mysql_close@4 +mysql_commit@4 +mysql_data_seek@12 +mysql_debug@4 +mysql_dump_debug_info@4 +mysql_embedded@0 +mysql_eof@4 +mysql_errno@4 +mysql_error@4 +mysql_escape_string@12 +mysql_fetch_field@4 +mysql_fetch_field_direct@8 +mysql_fetch_fields@4 +mysql_fetch_lengths@4 +mysql_fetch_row@4 +mysql_field_count@4 +mysql_field_seek@8 +mysql_field_tell@4 +mysql_free_result@4 +mysql_get_character_set_info@8 +mysql_get_client_info@0 +mysql_get_client_version@0 +mysql_get_host_info@4 +mysql_get_option@12 +mysql_get_proto_info@4 +mysql_get_server_info@4 +mysql_get_server_version@4 +mysql_get_ssl_cipher@4 +mysql_hex_string@12 +mysql_info@4 +mysql_init@4 +mysql_insert_id@4 +mysql_kill@8 +mysql_list_dbs@8 +mysql_list_fields@12 +mysql_list_processes@4 +mysql_list_tables@8 +mysql_load_plugin +mysql_load_plugin_v +mysql_more_results@4 +mysql_next_result@4 +mysql_num_fields@4 +mysql_num_rows@4 +mysql_options@12 +mysql_options4@16 +mysql_ping@4 +mysql_plugin_options +mysql_query@8 +mysql_read_query_result@4 +mysql_real_connect@32 +mysql_real_escape_string@16 +mysql_real_query@12 +mysql_refresh@8 +mysql_reset_connection@4 +mysql_rollback@4 +mysql_row_seek@8 +mysql_row_tell@4 +mysql_select_db@8 +mysql_send_query@12 +mysql_server_end@0 +mysql_server_init@12 +mysql_session_track_get_first@16 +mysql_session_track_get_next@16 +mysql_set_character_set@8 +mysql_set_local_infile_default +mysql_set_local_infile_handler +mysql_set_server_option@8 +mysql_shutdown@8 +mysql_sqlstate@4 +mysql_ssl_set@24 +mysql_stat@4 +mysql_stmt_affected_rows@4 +mysql_stmt_attr_get@12 +mysql_stmt_attr_set@12 +mysql_stmt_bind_param@8 +mysql_stmt_bind_result@8 +mysql_stmt_close@4 +mysql_stmt_data_seek@12 +mysql_stmt_errno@4 +mysql_stmt_error@4 +mysql_stmt_execute@4 +mysql_stmt_fetch@4 +mysql_stmt_fetch_column@16 +mysql_stmt_field_count@4 +mysql_stmt_free_result@4 +mysql_stmt_init@4 +mysql_stmt_insert_id@4 +mysql_stmt_next_result@4 +mysql_stmt_num_rows@4 +mysql_stmt_param_count@4 +mysql_stmt_param_metadata@4 +mysql_stmt_prepare@12 +mysql_stmt_reset@4 +mysql_stmt_result_metadata@4 +mysql_stmt_row_seek@8 +mysql_stmt_row_tell@4 +mysql_stmt_send_long_data@16 +mysql_stmt_sqlstate@4 +mysql_stmt_store_result@4 +mysql_store_result@4 +mysql_thread_end@0 +mysql_thread_id@4 +mysql_thread_init@0 +mysql_thread_safe@0 +mysql_use_result@4 +mysql_warning_count@4 diff --git a/src/libmysqlclient.mk b/src/libmysqlclient.mk index ee36127..58d1137 100644 --- a/src/libmysqlclient.mk +++ b/src/libmysqlclient.mk @@ -30,12 +30,18 @@ define $(PKG)_BUILD -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ -DIMPORT_COMP_ERR='$(1).native/ImportCompErr.cmake' \ -DHAVE_GCC_ATOMIC_BUILTINS=1 \ - -DDISABLE_SHARED=1 \ + -DDISABLE_SHARED=$(CMAKE_STATIC_BOOL) \ -DENABLE_DTRACE=OFF \ -DWITH_ZLIB=system \ '$(1)' + + # def file created by cmake creates link errors + cp '$(PWD)/src/$(PKG).def' '$(1).build/libmysql/libmysql_exports.def' + $(MAKE) -C '$(1).build' -j '$(JOBS)' VERBOSE=1 - $(MAKE) -C '$(1).build' -j 1 install VERBOSE=1 -endef + $(MAKE) -C '$(1).build/include' -j 1 install VERBOSE=1 + $(MAKE) -C '$(1).build/libmysql' -j 1 install VERBOSE=1 -$(PKG)_BUILD_SHARED = + # no easy way to configure location of dll + -mv '$(PREFIX)/$(TARGET)/lib/$(PKG).dll' '$(PREFIX)/$(TARGET)/bin/' +endef -- cgit v0.12