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 #9.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/11/head
Slávek Banko 3 years ago
parent 33c6b81031
commit 7b0045aa6b
Signed by: SlavekB
GPG Key ID: 608F5293A04BE668
  1. 35
      amarok/configure.in.in
  2. 2
      amarok/src/collectiondb.h
  3. 3
      config.h.in

@ -496,6 +496,40 @@ if test "$enable_mysql" = "yes"; then
mysql_includes=`mysql_config --cflags`
mysql_libs=`mysql_config --libs`
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $mysql_includes"
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 )
enable_mysql=no
)
]
)
CXXFLAGS="$save_CXXFLAGS"
AC_LANG_RESTORE
else
amarok_warning_mysql_notfound=yes
enable_mysql=no
@ -504,6 +538,7 @@ if test "$enable_mysql" = "yes"; then
fi
AM_CONDITIONAL(enable_mysql, test x$enable_mysql = xyes)
AC_DEFINE_UNQUOTED(MYSQL_STRUCT, $mysql_struct, [struct type name for MySql])
AC_SUBST(mysql_includes)
AC_SUBST(mysql_libs)

@ -149,7 +149,7 @@ class SqliteConnection : public DbConnection
#ifdef USE_MYSQL
typedef struct st_mysql MYSQL;
typedef struct MYSQL_STRUCT MYSQL;
class MySqlConnection : public DbConnection
{

@ -230,6 +230,9 @@
*/
#undef LT_OBJDIR
/* struct type name for MySql */
#undef MYSQL_STRUCT
/* Name of package */
#undef PACKAGE

Loading…
Cancel
Save