summaryrefslogtreecommitdiffstats
path: root/amarok/configure.in.in
diff options
context:
space:
mode:
Diffstat (limited to 'amarok/configure.in.in')
-rw-r--r--amarok/configure.in.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/amarok/configure.in.in b/amarok/configure.in.in
index efc35c45..897bac90 100644
--- a/amarok/configure.in.in
+++ b/amarok/configure.in.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)