summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-02-05 21:50:58 +0300
committerAndrei Karas <akaras@inbox.ru>2019-02-11 04:14:42 +0300
commit9288a2b0ff525eb212f1417e797f18876ea9bd17 (patch)
tree81591cb75c9c62fda3f8a5c3888c3bb99cb8a638
parent2d8a44b753832610d23678629127369f5db576a3 (diff)
downloadhercules-9288a2b0ff525eb212f1417e797f18876ea9bd17.tar.gz
hercules-9288a2b0ff525eb212f1417e797f18876ea9bd17.tar.bz2
hercules-9288a2b0ff525eb212f1417e797f18876ea9bd17.tar.xz
hercules-9288a2b0ff525eb212f1417e797f18876ea9bd17.zip
Add support for mysql versions where type my_bool not exists.
In new MySQL versions my_bool was replaced to bool.
-rwxr-xr-xconfigure40
-rw-r--r--configure.ac22
2 files changed, 62 insertions, 0 deletions
diff --git a/configure b/configure
index 0560d8d85..4ab9057e8 100755
--- a/configure
+++ b/configure
@@ -9452,6 +9452,46 @@ else
fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether my_bool is supported (MySQL)" >&5
+$as_echo_n "checking whether my_bool is supported (MySQL)... " >&6; }
+if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef WIN32
+ #include "common/winapi.h" // Needed before mysql.h
+ #endif
+ #include <mysql.h>
+ int main(int argc, char **argv){
+ my_bool val = (my_bool)0;
+ return (int)val;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (converting my_bool to bool)" >&5
+$as_echo "no (converting my_bool to bool)" >&6; }
+ MYSQL_CFLAGS="$MYSQL_CFLAGS -Dmy_bool=bool"
+
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
CPPFLAGS="$MYSQL_OLD_CPPFLAGS"
LIBS="$MYSQL_OLD_LIBS"
diff --git a/configure.ac b/configure.ac
index 9e88b618b..ec9e35cfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1597,6 +1597,28 @@ MYSQL_OLD_LIBS="$LIBS" ; LIBS="$LIBS $MYSQL_LIBS"
MYSQL_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
AC_CHECK_FUNC([mysql_init], [HAVE_MYSQL="yes"])
AC_CHECK_HEADER([mysql.h], [], [HAVE_MYSQL=""])
+
+AC_MSG_CHECKING([whether my_bool is supported (MySQL)])
+AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([
+ #ifdef WIN32
+ #include "common/winapi.h" // Needed before mysql.h
+ #endif
+ #include <mysql.h>
+ int main(int argc, char **argv){
+ my_bool val = (my_bool)0;
+ return (int)val;
+ }
+ ])],
+ [
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ AC_MSG_RESULT([no (converting my_bool to bool)])
+ MYSQL_CFLAGS="$MYSQL_CFLAGS -Dmy_bool=bool"
+ ]
+)
+
CPPFLAGS="$MYSQL_OLD_CPPFLAGS"
LIBS="$MYSQL_OLD_LIBS"