Added detection whether the basic structure of MySQL / MariaDB

client is named st_mysql or MYSQL.

This resolves FTBFS with MySQL client >= 8.0.
This resolves issue #4.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit fa4a35fd4b)
pull/8/head
Slávek Banko 5 years ago
parent 2f8af82ffc
commit 3c395c2ebd
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -90,6 +90,43 @@ dnl *** Show that we are doing as requested. ***
AC_MSG_NOTICE([Not attempting to configure MySQL as requested]) AC_MSG_NOTICE([Not attempting to configure MySQL as requested])
fi fi
if test "$compile_mysql_plugin" = "yes"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -I$mysql_incdir"
AC_MSG_CHECKING([if mysql has st_mysql struct])
AC_TRY_COMPILE(
[
#include <mysql.h>
typedef struct st_mysql MYSQL;
],
[],
AC_MSG_RESULT( yes )
mysql_struct=st_mysql,
AC_MSG_RESULT( no )
[
AC_MSG_CHECKING([if mysql has MYSQL struct])
AC_TRY_COMPILE(
[
#include <mysql.h>
typedef struct MYSQL MYSQL;
],
[],
AC_MSG_RESULT( yes )
mysql_struct=MYSQL,
AC_MSG_RESULT( no )
compile_mysql_plugin=no
)
]
)
CXXFLAGS="$save_CXXFLAGS"
AC_LANG_RESTORE
fi
AC_DEFINE_UNQUOTED(MYSQL_STRUCT, $mysql_struct, [struct type name for MySql])
AM_CONDITIONAL(compile_mysql_plugin, test "$compile_mysql_plugin" = "yes") AM_CONDITIONAL(compile_mysql_plugin, test "$compile_mysql_plugin" = "yes")
dnl ======================================== dnl ========================================

@ -20,6 +20,10 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#ifndef KEXIDB_MYSQLCLIENT_P_H #ifndef KEXIDB_MYSQLCLIENT_P_H
#define KEXIDB_MYSQLCLIENT_P_H #define KEXIDB_MYSQLCLIENT_P_H
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
#include <kexidb/connection_p.h> #include <kexidb/connection_p.h>
#ifdef TQ_WS_WIN #ifdef TQ_WS_WIN
@ -28,7 +32,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#include <mysql_version.h> #include <mysql_version.h>
#include <mysql.h> #include <mysql.h>
typedef struct st_mysql MYSQL; typedef struct MYSQL_STRUCT MYSQL;
#undef bool #undef bool
class TQCString; class TQCString;

Loading…
Cancel
Save