summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 14:44:29 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 14:44:29 -0300
commitc36fee08f6fa7974324438572a260101335cb4b4 (patch)
tree5cd22b1feaf7fd5459966139762af314803cdb12
parentb0035c76d46caf25d6b52f4e1552c1e83f7f0911 (diff)
downloadmariadb-git-c36fee08f6fa7974324438572a260101335cb4b4.tar.gz
Bug#52514: mysql 5.1 do_abi_check does not compile w/ gcc4.5
due to GCC preprocessor change The problem is that newer GCC versions treats missing headers as fatal errors. The solution is to use a guard macro to prevent the inclusion of system headers when checking the ABI with the C Preprocessor. Reference: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15638 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44836 Makefile.am: Define guard macro. configure.in: Remove workaround. include/mysql.h: Guard the header inclusion. include/mysql.h.pp: Header is not included anymore.
-rw-r--r--Makefile.am2
-rw-r--r--configure.in11
-rw-r--r--include/mysql.h2
-rw-r--r--include/mysql.h.pp1
4 files changed, 4 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 7953b81fb7b..4ce753ad8aa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -314,7 +314,7 @@ abi_check_all: $(TEST_PREPROCESSOR_HEADER)
do_abi_check:
set -ex; \
for file in $(abi_headers); do \
- @CC@ -E -nostdinc -dI \
+ @CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/mysql \
-I$(top_srcdir)/sql \
diff --git a/configure.in b/configure.in
index 0264c351b07..8dcdecf8ea2 100644
--- a/configure.in
+++ b/configure.in
@@ -444,16 +444,7 @@ if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
then
ABI_CHECK=""
else
- # Workaround GCC >= 4.5 - See Bug#52514
- case `$CC -dumpversion` in
- [[4-9]].[[5-9]]*)
- AC_MSG_WARN([ABI check disabled (GCC >= 4.5)])
- ABI_CHECK=""
- ;;
- *)
- ABI_CHECK="abi_check"
- ;;
- esac
+ ABI_CHECK="abi_check"
fi
AC_SUBST(ABI_CHECK)
diff --git a/include/mysql.h b/include/mysql.h
index d114afb6c93..dcf3e167e6a 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -44,7 +44,9 @@ extern "C" {
#endif
#ifndef _global_h /* If not standard header */
+#ifndef MYSQL_ABI_CHECK
#include <sys/types.h>
+#endif
#ifdef __LCC__
#include <winsock2.h> /* For windows */
#endif
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 633cde41130..0a397863022 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -1,4 +1,3 @@
-#include <sys/types.h>
typedef char my_bool;
typedef int my_socket;
#include "mysql_version.h"