diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-03-06 11:45:50 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-03-06 11:46:04 +0100 |
commit | 1bf4306c3967560948f22630ff8f76c268a9c8bd (patch) | |
tree | 763c9f201d9f8a20b6990e8d74b01f3bc4fcaf50 | |
parent | 499e53a95e79b175037ec9264d34e2ca6f7e692a (diff) |
Switch from libmysqlc library to mariadb-native-client
Change-Id: I867918bbb61b289e1ad8752e6f46705af6e85b7c
-rw-r--r-- | RepositoryExternal.mk | 10 | ||||
-rw-r--r-- | config_host.mk.in | 18 | ||||
-rw-r--r-- | configure.ac | 110 | ||||
-rw-r--r-- | mysqlc/Extension_mysql-connector-ooo.mk | 4 | ||||
-rw-r--r-- | mysqlc/Library_mysqlc.mk | 2 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_connection.cxx | 4 | ||||
-rw-r--r-- | mysqlcppconn/Library_mysqlcppconn.mk | 8 | ||||
-rw-r--r-- | mysqlcppconn/UnpackedTarball_mysqlcppconn.mk | 4 | ||||
-rw-r--r-- | mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch | 13 |
9 files changed, 97 insertions, 76 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index af9698080a55..869e17936efd 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -183,20 +183,20 @@ $(call gb_LinkTarget_add_libs,$(1),-liconv) endef -ifeq ($(SYSTEM_MYSQL),YES) +ifeq ($(SYSTEM_MARIADB),YES) define gb_LinkTarget__use_mysql $(call gb_LinkTarget_add_defs,$(1),\ - -DSYSTEM_MYSQL \ + -DSYSTEM_MARIADB \ ) $(call gb_LinkTarget_add_libs,$(1),\ - $(MYSQL_LIB) \ + $(MARIADB_LIB) \ ) $(call gb_LinkTarget_set_include,$(1),\ - $(MYSQL_INC) \ + $(MARIADB_INC) \ $$(INCLUDE) \ ) endef @@ -206,7 +206,7 @@ else define gb_LinkTarget__use_mysql $(call gb_LinkTarget_set_include,$(1),\ - -I$(LIBMYSQL_PATH)/include \ + -I$(LIBMARIADB_PATH)/mariadbclient/include \ $$(INCLUDE) \ ) diff --git a/config_host.mk.in b/config_host.mk.in index 172ab31adfd9..c3d97d655a9d 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -296,9 +296,9 @@ export LIBLANGTAG_CFLAGS=$(gb_SPACE)@LIBLANGTAG_CFLAGS@ export LIBLANGTAG_LIBS=$(gb_SPACE)@LIBLANGTAG_LIBS@ export LIBLAYOUT_JAR=@LIBLAYOUT_JAR@ export LIBLOADER_JAR=@LIBLOADER_JAR@ +export LIBMARIADB=@LIBMARIADB@ +export LIBMARIADB_PATH=@LIBMARIADB_PATH@ export LIBMGR_X64_BINARY=@LIBMGR_X64_BINARY@ -export LIBMYSQL=@LIBMYSQL@ -export LIBMYSQL_PATH=@LIBMYSQL_PATH@ export LIBO_THIS_YEAR=@LIBO_THIS_YEAR@ export LIBO_VERSION_MAJOR=@LIBO_VERSION_MAJOR@ export LIBO_VERSION_MICRO=@LIBO_VERSION_MICRO@ @@ -325,6 +325,12 @@ export MACOSX_SDK_VERSION=@MACOSX_SDK_VERSION@ export MAC_OS_X_VERSION_MAX_ALLOWED=@MAC_OS_X_VERSION_MAX_ALLOWED@ export MAC_OS_X_VERSION_MIN_REQUIRED=@MAC_OS_X_VERSION_MIN_REQUIRED@ export MANDIR=@MANDIR@ +export MARIADBC_MAJOR=@MARIADBC_MAJOR@ +export MARIADBC_MICRO=@MARIADBC_MICRO@ +export MARIADBC_MINOR=@MARIADBC_MINOR@ +export MARIADB_DEFINES=@MARIADB_DEFINES@ +export MARIADB_INC=@MARIADB_INC@ +export MARIADB_LIB=@MARIADB_LIB@ export MD5SUM=@MD5SUM@ export MDDS_CPPFLAGS=$(gb_SPACE)@MDDS_CPPFLAGS@ export MERGELIBS=@MERGELIBS@ @@ -400,12 +406,6 @@ export MSVC_DLLS=@MSVC_DLLS@ export MSVC_DLL_PATH=@MSVC_DLL_PATH@ export MSVC80_DLLS=@MSVC80_DLLS@ export MSVC80_DLL_PATH=@MSVC80_DLL_PATH@ -export MYSQLC_MAJOR=@MYSQLC_MAJOR@ -export MYSQLC_MICRO=@MYSQLC_MICRO@ -export MYSQLC_MINOR=@MYSQLC_MINOR@ -export MYSQL_DEFINES=@MYSQL_DEFINES@ -export MYSQL_INC=@MYSQL_INC@ -export MYSQL_LIB=@MYSQL_LIB@ export MYTHES_CFLAGS=$(gb_SPACE)@MYTHES_CFLAGS@ export MYTHES_LIBS=$(gb_SPACE)@MYTHES_LIBS@ export NEON_CFLAGS=$(gb_SPACE)@NEON_CFLAGS@ @@ -554,7 +554,7 @@ export SYSTEM_LIBXSLT_FOR_BUILD=@SYSTEM_LIBXSLT_FOR_BUILD@ export SYSTEM_LPSOLVE=@SYSTEM_LPSOLVE@ export SYSTEM_MDDS=@SYSTEM_MDDS@ export SYSTEM_MESA_HEADERS=@SYSTEM_MESA_HEADERS@ -export SYSTEM_MYSQL=@SYSTEM_MYSQL@ +export SYSTEM_MARIADB=@SYSTEM_MARIADB@ export SYSTEM_MYSQL_CPPCONN=@SYSTEM_MYSQL_CPPCONN@ export SYSTEM_MYTHES=@SYSTEM_MYTHES@ export SYSTEM_NEON=@SYSTEM_NEON@ diff --git a/configure.ac b/configure.ac index 066fa80502a2..257ea3474d49 100644 --- a/configure.ac +++ b/configure.ac @@ -608,9 +608,9 @@ AC_ARG_ENABLE(dynamic-loading, [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.]) ) -AC_ARG_ENABLE(ext-mysql-connector, - AS_HELP_STRING([--enable-ext-mysql-connector], - [Enable the build of the MySQL Connector extension.]) +AC_ARG_ENABLE(ext-mariadb-connector, + AS_HELP_STRING([--enable-ext-mariadb-connector], + [Enable the build of the MariaDB/MySQL Connector extension.]) ) AC_ARG_ENABLE(ext-presenter-minimizer, @@ -1298,19 +1298,19 @@ AC_ARG_WITH(system-apache-commons, [Use Apache commons libraries already on system.]),, [with_system_apache_commons="$with_system_jars"]) -AC_ARG_WITH(system-mysql, - AS_HELP_STRING([--with-system-mysql], - [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice - extension. If the mysql_config executable is not in PATH, use MYSQLCONFIG to +AC_ARG_WITH(system-mariadb, + AS_HELP_STRING([--with-system-mariadb], + [Use MariaDB libraries already on system, for building the MySQL Connector/LibreOffice + extension. If the mariadb_config executable is not in PATH, use MARIADBCONFIG to point to it.]),, - [with_system_mysql="$with_system_libs"]) + [with_system_mariadb="$with_system_libs"]) -AC_ARG_WITH(libmysql-path, - AS_HELP_STRING([--with-libmysql-path], - [Use Connector/C (libmysql) installation for building the MySQL +AC_ARG_WITH(libmariadb-path, + AS_HELP_STRING([--with-libmariadb-path], + [Use Connector/C (libmariadb) installation for building the MariaDB/MySQL Connector/LibreOffice extension.]) [ - Usage: --with-libmysql-path=<absolute path to + Usage: --with-libmariadb-path=<absolute path to your Connector/C installation> ], ,) @@ -7556,76 +7556,76 @@ AC_SUBST([MINGW_PYTHON_DLL]) AC_SUBST([MINGW_READLINE_DLL]) AC_SUBST([MINGW_TERMCAP_DLL]) -AC_MSG_CHECKING([whether to build the MySQL Connector extension]) -if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then +AC_MSG_CHECKING([whether to build the MariaDB/MySQL Connector extension]) +if test "x$enable_ext_mariadb_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then AC_MSG_RESULT([yes]) - ENABLE_MYSQLC=YES - MYSQLC_MAJOR=1 - MYSQLC_MINOR=0 - MYSQLC_MICRO=1 - BUILD_TYPE="$BUILD_TYPE MYSQLC" + ENABLE_MARIADBC=YES + MARIADBC_MAJOR=1 + MARIADBC_MINOR=0 + MARIADBC_MICRO=1 + BUILD_TYPE="$BUILD_TYPE MARIADBC" else AC_MSG_RESULT([no]) - ENABLE_MYSQLC=NO + ENABLE_MARIADBC=NO fi -AC_SUBST(ENABLE_MYSQLC) -AC_SUBST(MYSQLC_MAJOR) -AC_SUBST(MYSQLC_MINOR) -AC_SUBST(MYSQLC_MICRO) +AC_SUBST(ENABLE_MARIADBC) +AC_SUBST(MARIADBC_MAJOR) +AC_SUBST(MARIADBC_MINOR) +AC_SUBST(MARIADBC_MICRO) -if test "$ENABLE_MYSQLC" = "YES"; then +if test "$ENABLE_MARIADBC" = "YES"; then - SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC" + SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC" dnl =================================================================== dnl Check for system MySQL dnl =================================================================== AC_MSG_CHECKING([for MySQL prerequisites]) - if test "$with_system_mysql" = "yes"; then + if test "$with_system_mariadb" = "yes"; then AC_MSG_RESULT([external MySQL]) - SYSTEM_MYSQL=YES - AC_PATH_PROG( MYSQLCONFIG, mysql_config) + SYSTEM_MARIADB=YES + AC_PATH_PROG( MARIADBCONFIG, mariadb_config) AC_MSG_CHECKING([MySQL version]) - MYSQL_VERSION=`$MYSQLCONFIG --version` - MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1` - if test "$MYSQL_MAJOR" -ge "5"; then + MARIADB_VERSION=`$MARIADBCONFIG --version` + MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1` + if test "$MARIADB_MAJOR" -ge "5"; then AC_MSG_RESULT([OK]) else AC_MSG_ERROR([too old, use 5.0.x or 5.1.x]) fi AC_MSG_CHECKING([for MySQL Client library]) - MYSQL_INC=`$MYSQLCONFIG --include` - MYSQL_LIB=`$MYSQLCONFIG --libs` - MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,` - AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB]) - else - SYSTEM_MYSQL=NO - if test -n "$with_libmysql_path"; then - AC_MSG_RESULT([external Connector/C (libmysql)]) - LIBMYSQL=libmysql.so + MARIADB_INC=`$MARIADBCONFIG --include` + MARIADB_LIB=`$MARIADBCONFIG --libs` + MARIADB_DEFINES=`$MARIADBCONFIG --cflags | $SED -e s,$MARIADB_INC,,` + AC_MSG_RESULT([includes $MARIADB_INC, libraries $MARIADB_LIB]) + else + SYSTEM_MARIADB=NO + if test -n "$with_libmariadb_path"; then + AC_MSG_RESULT([external Connector/C (libmariadb)]) + LIBMARIADB=libmariadb.so if test "$_os" = "Darwin"; then - LIBMYSQL=libmysql.dylib + LIBMARIADB=libmariadb.dylib elif test "$_os" = "WINNT"; then - LIBMYSQL=libmysql.dll + LIBMARIADB=libmariadb.dll fi - AC_MSG_CHECKING([for $LIBMYSQL]) - if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then + AC_MSG_CHECKING([for $LIBMARIADB]) + if test -e "$with_libmariadb_path/lib/$LIBMARIADB"; then AC_MSG_RESULT([found.]) - PathFormat "$with_libmysql_path" - LIBMYSQL_PATH="$formatted_path" + PathFormat "$with_libmariadb_path" + LIBMARIADB_PATH="$formatted_path" else - AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.]) + AC_MSG_ERROR([not found. Please specify proper path in --with-libmariadb-path.]) fi else - AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path]) + AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmariadb-path]) fi fi - AC_SUBST(SYSTEM_MYSQL) - AC_SUBST(MYSQL_INC) - AC_SUBST(MYSQL_LIB) - AC_SUBST(MYSQL_DEFINES) - AC_SUBST([LIBMYSQL]) - AC_SUBST(LIBMYSQL_PATH) + AC_SUBST(SYSTEM_MARIADB) + AC_SUBST(MARIADB_INC) + AC_SUBST(MARIADB_LIB) + AC_SUBST(MARIADB_DEFINES) + AC_SUBST(LIBMARIADB) + AC_SUBST(LIBMARIADB_PATH) AC_LANG_PUSH([C++]) dnl =================================================================== diff --git a/mysqlc/Extension_mysql-connector-ooo.mk b/mysqlc/Extension_mysql-connector-ooo.mk index 7da474c47ebd..67c7c8f745d7 100644 --- a/mysqlc/Extension_mysql-connector-ooo.mk +++ b/mysqlc/Extension_mysql-connector-ooo.mk @@ -24,9 +24,9 @@ $(eval $(call gb_Extension_add_library,mysql-connector-ooo,mysqlcppconn)) endif # HACK: comes from Library_mysql.mk -ifeq ($(SYSTEM_MYSQL),NO) +ifeq ($(SYSTEM_MARIADB),NO) $(eval $(call gb_Extension_add_files,mysql-connector-ooo,,\ - $(LIBMYSQL_PATH)/lib/$(LIBMYSQL) \ + $(LIBMARIADB_PATH)/lib/$(LIBMARIADB) \ )) endif diff --git a/mysqlc/Library_mysqlc.mk b/mysqlc/Library_mysqlc.mk index cf77bc057761..ab6e5457def7 100644 --- a/mysqlc/Library_mysqlc.mk +++ b/mysqlc/Library_mysqlc.mk @@ -41,7 +41,7 @@ $(eval $(call gb_Library_add_defs,mysqlc,\ -DMYSQLC_VERSION_MAJOR=$(MYSQLC_MAJOR) \ -DMYSQLC_VERSION_MINOR=$(MYSQLC_MINOR) \ -DMYSQLC_VERSION_MICRO=$(MYSQLC_MICRO) \ - $(if $(filter NO,$(SYSTEM_MYSQL)),-DMYSQL_LIB=\"$(LIBMYSQL)\") \ + $(if $(filter NO,$(SYSTEM_MARIADB)),-DMYSQL_LIB=\"$(LIBMARIADB)\") \ $(if $(filter NO,$(SYSTEM_MYSQL_CPPCONN)),\ -DCPPCONN_LIB=\"$(call gb_Library_get_runtime_filename,mysqlcppconn)\") \ )) diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx index d0d4a467957b..717adf9e302e 100644 --- a/mysqlc/source/mysqlc_connection.cxx +++ b/mysqlc/source/mysqlc_connection.cxx @@ -99,7 +99,7 @@ void SAL_CALL OConnection::release() } /* }}} */ -#ifndef SYSTEM_MYSQL +#ifndef SYSTEM_MARIADB extern "C" { void SAL_CALL thisModule() {} } #endif @@ -194,7 +194,7 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue > connProps["socket"] = pipe_str; } -#ifndef SYSTEM_MYSQL +#ifndef SYSTEM_MARIADB ::rtl::OUString sMySQLClientLib( MYSQL_LIB ); ::rtl::OUString moduleBase; diff --git a/mysqlcppconn/Library_mysqlcppconn.mk b/mysqlcppconn/Library_mysqlcppconn.mk index 7d932da9742b..ccb121d407dc 100644 --- a/mysqlcppconn/Library_mysqlcppconn.mk +++ b/mysqlcppconn/Library_mysqlcppconn.mk @@ -21,6 +21,14 @@ $(eval $(call gb_Library_use_externals,mysqlcppconn, \ boost_headers \ )) +ifneq ($(OS)$(COM),WNTMSC) + +$(eval $(call gb_Library_add_libs,mysqlcppconn,\ + $(if $(filter-out MACOSX,$(OS)),-ldl) \ +)) + +endif + $(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn)) $(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp)) diff --git a/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk b/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk index 542c384c4364..eeca11ed357b 100644 --- a/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk +++ b/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk @@ -13,14 +13,14 @@ $(eval $(call gb_UnpackedTarball_set_tarball,mysqlcppconn,$(MYSQLCPPCONN_TARBALL $(eval $(call gb_UnpackedTarball_add_file,mysqlcppconn,cppconn/config.h,mysqlcppconn/config.h)) -ifeq ($(SYSTEM_MYSQL),YES) +ifeq ($(SYSTEM_MARIADB),YES) $(eval $(call gb_UnpackedTarball_add_file,mysqlcppconn,driver/nativeapi/binding_config.h,mysqlcppconn/binding_static.h)) else $(eval $(call gb_UnpackedTarball_add_file,mysqlcppconn,driver/nativeapi/binding_config.h,mysqlcppconn/binding_dynamic.h)) endif $(eval $(call gb_UnpackedTarball_add_patches,mysqlcppconn,\ mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch \ - $(if $(filter NO,$(SYSTEM_MYSQL)), \ + $(if $(filter NO,$(SYSTEM_MARIADB)), \ mysqlcppconn/patches/mysql-connector-c++-1.1.0-mysql-binding-dynamic.patch) \ mysqlcppconn/patches/default_to_protocol_tcp.patch \ )) diff --git a/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch b/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch index 722aa92132e9..c7fd21b58ba5 100644 --- a/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch +++ b/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch @@ -101,4 +101,17 @@ #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 + { |