diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-09-14 16:12:55 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-09-15 11:06:18 +0200 |
commit | b29402009831f8a96fd77fc1042c3004c224a350 (patch) | |
tree | de1493051d57bcfdb60e5e9e6995a0691b936086 /external/mysql-connector-cpp | |
parent | 15b973ed64cb0c655b387c5022fc2ff0894520dd (diff) |
consistent naming of externals: mysqlcppconn -> mysql-connector-cpp
Change-Id: Ibfb3aa69895eef6023c38e2ff3b7ae98a05f5820
Reviewed-on: https://gerrit.libreoffice.org/42300
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'external/mysql-connector-cpp')
12 files changed, 392 insertions, 0 deletions
diff --git a/external/mysql-connector-cpp/Library_mysqlcppconn.mk b/external/mysql-connector-cpp/Library_mysqlcppconn.mk new file mode 100644 index 000000000000..152aee8c0764 --- /dev/null +++ b/external/mysql-connector-cpp/Library_mysqlcppconn.mk @@ -0,0 +1,87 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Library_Library,mysqlcppconn)) + +$(eval $(call gb_Library_use_unpacked,mysqlcppconn,mysql-connector-cpp)) + +$(eval $(call gb_Library_use_externals,mysqlcppconn, \ + boost_headers \ + mariadb-connector-c \ +)) + +ifneq ($(OS),WNT) + +$(eval $(call gb_Library_add_libs,mysqlcppconn,\ + $(if $(filter-out MACOSX,$(OS)),-ldl) \ +)) + +endif + +ifeq ($(OS),MACOSX) +ifeq ($(SYSTEM_MARIADB_CONNECTOR_C),) +$(eval $(call gb_Library_use_externals,mysqlcppconn,\ + iconv \ +)) +endif +endif + +$(eval $(call gb_Library_set_external_code,mysqlcppconn)) + +$(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn)) + +$(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp)) + +$(eval $(call gb_Library_set_include,mysqlcppconn,\ + $$(INCLUDE) \ + -I$(call gb_UnpackedTarball_get_dir,mysql-connector-cpp) \ + -I$(call gb_UnpackedTarball_get_dir,mysql-connector-cpp)/cppconn \ +)) + +$(eval $(call gb_Library_add_defs,mysqlcppconn,\ + -Dmysqlcppconn_EXPORTS \ + $(if $(filter WNT,$(OS)),\ + -DCPPDBC_WIN32 \ + -D_CRT_SECURE_NO_WARNINGS \ + -D_SCL_SECURE_NO_WARNINGS ) \ +)) + +ifeq ($(OS),LINUX) +$(eval $(call gb_Library_add_libs,mysqlcppconn,\ + -lpthread \ +)) +endif + +$(eval $(call gb_Library_add_generated_exception_objects,mysqlcppconn,\ + UnpackedTarball/mysql-connector-cpp/driver/mysql_art_resultset \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_art_rset_metadata \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_connection \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_debug \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_driver \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_metadata \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_parameter_metadata \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_prepared_statement \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_ps_resultset \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_ps_resultset_metadata \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_resultbind \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_resultset \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_resultset_metadata \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_statement \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_uri \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_util \ + UnpackedTarball/mysql-connector-cpp/driver/mysql_warning \ + UnpackedTarball/mysql-connector-cpp/driver/nativeapi/mysql_client_api \ + UnpackedTarball/mysql-connector-cpp/driver/nativeapi/library_loader \ + UnpackedTarball/mysql-connector-cpp/driver/nativeapi/mysql_native_driver_wrapper \ + UnpackedTarball/mysql-connector-cpp/driver/nativeapi/mysql_native_connection_wrapper \ + UnpackedTarball/mysql-connector-cpp/driver/nativeapi/mysql_native_resultset_wrapper \ + UnpackedTarball/mysql-connector-cpp/driver/nativeapi/mysql_native_statement_wrapper \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/mysql-connector-cpp/Makefile b/external/mysql-connector-cpp/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/mysql-connector-cpp/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/mysql-connector-cpp/Module_mysql-connector-cpp.mk b/external/mysql-connector-cpp/Module_mysql-connector-cpp.mk new file mode 100644 index 000000000000..59e6229166bd --- /dev/null +++ b/external/mysql-connector-cpp/Module_mysql-connector-cpp.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,mysql-connector-cpp)) + +$(eval $(call gb_Module_add_targets,mysql-connector-cpp,\ + UnpackedTarball_mysql-connector-cpp \ + Library_mysqlcppconn \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/mysql-connector-cpp/README b/external/mysql-connector-cpp/README new file mode 100644 index 000000000000..b49803dadfdb --- /dev/null +++ b/external/mysql-connector-cpp/README @@ -0,0 +1 @@ +From [http://dev.mysql.com/downloads/connector/cpp/] diff --git a/external/mysql-connector-cpp/UnpackedTarball_mysql-connector-cpp.mk b/external/mysql-connector-cpp/UnpackedTarball_mysql-connector-cpp.mk new file mode 100644 index 000000000000..be0e482d5315 --- /dev/null +++ b/external/mysql-connector-cpp/UnpackedTarball_mysql-connector-cpp.mk @@ -0,0 +1,26 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,mysql-connector-cpp)) + +$(eval $(call gb_UnpackedTarball_set_tarball,mysql-connector-cpp,$(MYSQL_CONNECTOR_CPP_TARBALL))) + +$(eval $(call gb_UnpackedTarball_add_file,mysql-connector-cpp,cppconn/config.h,external/mysql-connector-cpp/config.h)) +$(eval $(call gb_UnpackedTarball_add_file,mysql-connector-cpp,version_info.h,external/mysql-connector-cpp/version_info.h)) + +$(eval $(call gb_UnpackedTarball_add_file,mysql-connector-cpp,driver/nativeapi/binding_config.h,external/mysql-connector-cpp/binding_config.h)) + +$(eval $(call gb_UnpackedTarball_add_patches,mysql-connector-cpp,\ + external/mysql-connector-cpp/patches/mysql-connector-c++-1.1.0.patch \ + external/mysql-connector-cpp/patches/warnings.patch.0 \ + external/mysql-connector-cpp/patches/enable-libmysql-proxy.patch \ + external/mysql-connector-cpp/patches/dynexcspec.patch.0 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/mysql-connector-cpp/binding_config.h b/external/mysql-connector-cpp/binding_config.h new file mode 100644 index 000000000000..23811e8965b3 --- /dev/null +++ b/external/mysql-connector-cpp/binding_config.h @@ -0,0 +1,5 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +#define HAVE_DLFCN_H 1 +#define MYSQLCLIENT_STATIC_BINDING 1 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/external/mysql-connector-cpp/config.h b/external/mysql-connector-cpp/config.h new file mode 100644 index 000000000000..eaa929437182 --- /dev/null +++ b/external/mysql-connector-cpp/config.h @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +#include <sal/types.h> + +#define HAVE_FUNCTION_STRTOL 1 +#define HAVE_FUNCTION_STRTOUL 1 +#define HAVE_FUNCTION_STRTOL 1 +#define HAVE_FUNCTION_STRTOULL 1 + +#if defined(MACOSX) || defined(__sun) || defined(LINUX) || defined (_MSC_VER) + #define HAVE_STDINT_H +#ifndef _MSC_VER + #define HAVE_INTTYPES_H +#endif +#endif + +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif + +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#endif + +#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) + +// if we do not have the standard C99 integer types, then define them based on the respective SAL types +#if !defined(_SYS_TYPES_H) +typedef sal_Int8 int8_t; +typedef sal_Int16 int16_t; +typedef sal_Int32 int32_t; +#endif // !defined(_SYS_TYPES_H) +typedef sal_uInt8 uint8_t; +typedef sal_uInt16 uint16_t; +typedef sal_uInt32 uint32_t; +typedef sal_Int64 int64_t; +typedef sal_uInt64 uint64_t; +#endif // !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/external/mysql-connector-cpp/patches/dynexcspec.patch.0 b/external/mysql-connector-cpp/patches/dynexcspec.patch.0 new file mode 100644 index 000000000000..ed7ac3685a4b --- /dev/null +++ b/external/mysql-connector-cpp/patches/dynexcspec.patch.0 @@ -0,0 +1,15 @@ +--- cppconn/exception.h ++++ cppconn/exception.h +@@ -36,10 +36,10 @@ + { + + #define MEMORY_ALLOC_OPERATORS(Class) \ +- void* operator new(size_t size) throw (std::bad_alloc) { return ::operator new(size); } \ ++ void* operator new(size_t size) { return ::operator new(size); } \ + void* operator new(size_t, void*) throw(); \ + void* operator new(size_t, const std::nothrow_t&) throw(); \ +- void* operator new[](size_t) throw (std::bad_alloc); \ ++ void* operator new[](size_t); \ + void* operator new[](size_t, void*) throw(); \ + void* operator new[](size_t, const std::nothrow_t&) throw(); \ + void* operator new(size_t N, std::allocator<Class>&); diff --git a/external/mysql-connector-cpp/patches/enable-libmysql-proxy.patch b/external/mysql-connector-cpp/patches/enable-libmysql-proxy.patch new file mode 100644 index 000000000000..6a5894cb1e9c --- /dev/null +++ b/external/mysql-connector-cpp/patches/enable-libmysql-proxy.patch @@ -0,0 +1,27 @@ +--- UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_client_api.cpp 2014-07-30 13:41:37.000000000 +0200 ++++ UnpackedTarball/mysqlcppconn/driver/nativeapi/mysql_client_api.cpp 2014-09-17 22:12:26.000000000 +0200 +@@ -32,10 +32,10 @@ + + #ifdef MYSQLCLIENT_STATIC_BINDING + /* MySQL client library is linked */ +-# include "libmysql_static_proxy.h" ++ #include "libmysql_static_proxy.h" + #else + /* MySQL client library will be dynamically loaded */ +-# include "libmysql_dynamic_proxy.h" ++ #include "libmysql_dynamic_proxy.h" + #endif + + namespace sql +@@ -76,9 +76,9 @@ + #include "binding_config.h" + + #ifdef MYSQLCLIENT_STATIC_BINDING +-# include "libmysql_static_proxy.cpp" ++ #include "libmysql_static_proxy.cpp" + #else +-# include "libmysql_dynamic_proxy.cpp" ++ #include "libmysql_dynamic_proxy.cpp" + #endif + + /* diff --git a/external/mysql-connector-cpp/patches/mysql-connector-c++-1.1.0.patch b/external/mysql-connector-cpp/patches/mysql-connector-c++-1.1.0.patch new file mode 100644 index 000000000000..ec439d2dfd56 --- /dev/null +++ b/external/mysql-connector-cpp/patches/mysql-connector-c++-1.1.0.patch @@ -0,0 +1,115 @@ +--- misc/mysql-connector-c++-1.1.0/cppconn/build_config.h 2010-09-10 11:47:47.000000000 +0200 ++++ misc/build/mysql-connector-c++-1.1.0/cppconn/build_config.h 2011-11-12 00:45:19.000000000 +0100 +@@ -25,25 +25,21 @@ + #ifndef _SQL_BUILD_CONFIG_H_ + #define _SQL_BUILD_CONFIG_H_ + +-#ifndef CPPCONN_PUBLIC_FUNC ++#include <sal/types.h> + +-#if defined(_WIN32) + // mysqlcppconn_EXPORTS is added by cmake and defined for dynamic lib build only + #ifdef mysqlcppconn_EXPORTS +- #define CPPCONN_PUBLIC_FUNC __declspec(dllexport) ++ #define CPPCONN_PUBLIC_FUNC SAL_DLLPUBLIC_EXPORT + #else + // this is for static build + #ifdef CPPCONN_LIB_BUILD + #define CPPCONN_PUBLIC_FUNC + #else + // this is for clients using dynamic lib +- #define CPPCONN_PUBLIC_FUNC __declspec(dllimport) ++ #define CPPCONN_PUBLIC_FUNC SAL_DLLPUBLIC_IMPORT + #endif + #endif +-#else +- #define CPPCONN_PUBLIC_FUNC +-#endif + +-#endif //#ifndef CPPCONN_PUBLIC_FUNC ++ #define CPPCONN_PUBLIC_EXCEPTION SAL_EXCEPTION_DLLPUBLIC_EXPORT + + #endif //#ifndef _SQL_BUILD_CONFIG_H_ +--- misc/mysql-connector-c++-1.1.0/cppconn/exception.h 2009-08-20 17:51:23.000000000 +0200 ++++ misc/build/mysql-connector-c++-1.1.0/cppconn/exception.h 2009-09-11 09:41:41.076379817 +0200 +@@ -37,7 +37,7 @@ + #pragma warning(push) + #pragma warning(disable: 4275) + #endif +-class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error ++class CPPCONN_PUBLIC_EXCEPTION SQLException : public std::runtime_error + { + #ifdef _WIN32 + #pragma warning(pop) +@@ -83,26 +83,26 @@ + MEMORY_ALLOC_OPERATORS(SQLException) + }; + +-struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION MethodNotImplementedException : public SQLException + { + MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {} + }; + +-struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION InvalidArgumentException : public SQLException + { + InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {} + }; + +-struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION InvalidInstanceException : public SQLException + { + InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {} + }; + + +-struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION NonScrollableException : public SQLException + { + NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {} +--- misc/mysql-connector-c++-1.1.0/driver/mysql_debug.h 2009-08-13 17:13:46.000000000 +0200 ++++ misc/build/mysql-connector-c++-1.1.0/driver/mysql_debug.h 2009-08-14 09:56:37.015625000 +0200 +@@ -25,16 +25,6 @@ + + + +-#if defined(WE_HAVE_VARARGS_MACRO_SUPPORT) && (CPPCONN_TRACE_ENABLED || defined(SAL_DLLPRIVATE)) +- #define CPP_ENTER(msg) const boost::shared_ptr< MySQL_DebugLogger > __l = this->logger;(void)__l;\ +- MySQL_DebugEnterEvent __this_func(__LINE__, __FILE__, msg, this->logger) +- #define CPP_ENTER_WL(l, msg) const boost::shared_ptr< MySQL_DebugLogger > __l = (l);(void)__l;\ +- MySQL_DebugEnterEvent __this_func(__LINE__, __FILE__, msg, (l)) +- #define CPP_INFO(msg) {if (__l) __l->log("INF", msg); } +- #define CPP_INFO_FMT(...) {if (__l) __l->log_va("INF", __VA_ARGS__); } +- #define CPP_ERR(msg) {if (__l) __l->log("ERR", msg); } +- #define CPP_ERR_FMT(...) {if (__l) __l->log_va("ERR", __VA_ARGS__); } +-#else + #define CPP_ENTER(msg) + #define CPP_ENTER_WL(l, msg) + #define CPP_INFO(msg) +@@ -42,7 +32,6 @@ + #define CPP_ENTER_WL(l, msg) + static inline void CPP_INFO_FMT(...) {} + static inline void CPP_ERR_FMT(...) {} +-#endif + + #include <stack> + #include "mysql_util.h" +--- misc/mysql-connector-c++-1.1.0/driver/mysql_prepared_statement.cpp 2013-03-06 10:29:26.890721534 +0100 ++++ misc/build/mysql-connector-c++-1.1.0/driver/mysql_prepared_statement.cpp 2013-03-06 10:32:02.979904080 +0100 +@@ -46,6 +46,10 @@ + + #include "mysql_debug.h" + ++#ifndef CR_INVALID_BUFFER_USE ++#define CR_INVALID_BUFFER_USE 2035 ++#endif ++ + + namespace sql + { + diff --git a/external/mysql-connector-cpp/patches/warnings.patch.0 b/external/mysql-connector-cpp/patches/warnings.patch.0 new file mode 100644 index 000000000000..2cda42d86398 --- /dev/null +++ b/external/mysql-connector-cpp/patches/warnings.patch.0 @@ -0,0 +1,11 @@ +--- cppconn/warning.h ++++ cppconn/warning.h +@@ -59,7 +59,7 @@ + + virtual ~SQLWarning(){}; + +- SQLWarning(const SQLWarning& e){}; ++ SQLWarning(const SQLWarning&){}; + + private: + const SQLWarning & operator = (const SQLWarning & rhs); diff --git a/external/mysql-connector-cpp/version_info.h b/external/mysql-connector-cpp/version_info.h new file mode 100644 index 000000000000..a0203da33864 --- /dev/null +++ b/external/mysql-connector-cpp/version_info.h @@ -0,0 +1,42 @@ +/* +Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + +The MySQL Connector/C++ is licensed under the terms of the GPLv2 +<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most +MySQL Connectors. There are special exceptions to the terms and +conditions of the GPLv2 as it is applied to this software, see the +FLOSS License Exception +<http://www.mysql.com/about/legal/licensing/foss-exception.html>. + +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 the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Please do not edit this file - it is generated by cmake. Edit its source file instead. */ + +#define MYCPPCONN_MAJOR_VERSION 1 +#define MYCPPCONN_MINOR_VERSION 1 +#define MYCPPCONN_PATCH_VERSION 4 + +#define SETUP_VERSION "1.01.0004" +#define DRIVER_VERSION "0" SETUP_VERSION + +#define MYCPPCONN_VERSION SETUP_VERSION +#define MYCPPCONN_FILEVER 1,1,4,0 +#define MYCPPCONN_PRODUCTVER MYCPPCONN_FILEVER +#define MYCPPCONN_STRFILEVER "1, 1, 4, 0\0" +#define MYCPPCONN_STRPRODUCTVER MYCPPCONN_STRFILEVER + +#define MYCPPCONN_STRSERIES "1.1" +#define MYCPPCONN_STRQUALITY "GA" +#define MYCPPCONN_STRVERSION "1.1.4" |