From 286759692f1d5c84da625d5c0ced374a2585e978 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 11 Aug 2020 11:35:06 +0200 Subject: fix: mysql version detection Fix detection macro and support mysql8+ my_bool deprecation. Fixes #6465. --- configure.ac | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 39e7ffa7e..88a2134ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1404,12 +1404,11 @@ AS_IF([test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"], AC_MSG_CHECKING(mysql version) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[ - #include ]], + #include ]], [[ #if (MYSQL_VERSION_ID < 40100) #error needs at least version >= 4.1 #endif - int main () { return 0; } ]]) ], [mysql=true], @@ -1423,6 +1422,21 @@ AS_IF([test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"], mysqlfail=false AC_MSG_RESULT(ok) ]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ + #include ]], + [[ + #if (MYSQL_VERSION_ID < 80000) + #error needs at least version >= 4.1 + #endif + ]]) + ], + [mysql8=true], + [mysql8=false]) + AS_IF([test x$mysql8 = xtrue], + [ + AC_DEFINE([HAVE_MYSQL8],[1],[Have mysql8]) + ],[]) ]) AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue) -- cgit v1.2.3