From 866643fc6d7163eebaee17b5c0958933cb9e5f25 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 6 Oct 2015 14:27:02 -0400 Subject: MDEV-5429: wsrep-patch related build failures Switch to c99 in order to make stdbool.h work on Solaris. Also, use macro definitions from my_config.h and my_global.h to properly check the inclusion of headers and fix dynamic linking APIs in wsrep library, respectively. --- BUILD/compile-solaris-amd64 | 2 +- BUILD/compile-solaris-amd64-debug | 2 +- wsrep/CMakeLists.txt | 5 ++--- wsrep/wsrep_api.h | 2 ++ wsrep/wsrep_dummy.c | 9 ++++++--- wsrep/wsrep_loader.c | 8 +++++++- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/BUILD/compile-solaris-amd64 b/BUILD/compile-solaris-amd64 index 2ae8ff333e8..812885751a7 100755 --- a/BUILD/compile-solaris-amd64 +++ b/BUILD/compile-solaris-amd64 @@ -1,7 +1,7 @@ #!/bin/sh # used for sol10-64 builder in buildbot, don't use it elsewhere export LDFLAGS='-m64 -lmtmalloc -R/usr/sfw/lib/64' -export CFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64' +export CFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64 -std=c99' export CXXFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64' cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=complex -DWITH_READLINE=ON -DWITH_SSL=bundled -DWITH_MAX=ON -DWITH_EMBEDDED_SERVER=ON gmake -j6 VERBOSE=1 diff --git a/BUILD/compile-solaris-amd64-debug b/BUILD/compile-solaris-amd64-debug index 49e1e90ebeb..34d33dabbab 100755 --- a/BUILD/compile-solaris-amd64-debug +++ b/BUILD/compile-solaris-amd64-debug @@ -18,7 +18,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64 $debug_cflags" +extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64 -std=c99 $debug_cflags" extra_configs="$amd64_configs $debug_configs $max_configs --with-libevent" LDFLAGS="-m64 -lmtmalloc -R/usr/sfw/lib/64" diff --git a/wsrep/CMakeLists.txt b/wsrep/CMakeLists.txt index 53c8e853078..520261f8660 100644 --- a/wsrep/CMakeLists.txt +++ b/wsrep/CMakeLists.txt @@ -13,10 +13,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) + SET(WSREP_SOURCES wsrep_gtid.c wsrep_uuid.c wsrep_loader.c wsrep_dummy.c) ADD_CONVENIENCE_LIBRARY(wsrep ${WSREP_SOURCES}) DTRACE_INSTRUMENT(wsrep) - -#ADD_EXECUTABLE(listener wsrep_listener.c ${WSREP_SOURCES}) -#TARGET_LINK_LIBRARIES(listener ${LIBDL}) diff --git a/wsrep/wsrep_api.h b/wsrep/wsrep_api.h index c3304d7ed7c..b0e312250c3 100644 --- a/wsrep/wsrep_api.h +++ b/wsrep/wsrep_api.h @@ -48,7 +48,9 @@ #define WSREP_H #include +#ifndef __cplusplus #include +#endif #include #include #include diff --git a/wsrep/wsrep_dummy.c b/wsrep/wsrep_dummy.c index bab5329dc02..5eba1798ea4 100644 --- a/wsrep/wsrep_dummy.c +++ b/wsrep/wsrep_dummy.c @@ -15,12 +15,15 @@ */ /*! @file Dummy wsrep API implementation. */ - +#include /* MACRO definitions */ #include "wsrep_api.h" - #include -#include +#if defined(HAVE_STRINGS_H) +#include +#endif +#if defined(HAVE_STRING_H) #include +#endif /*! Dummy backend context. */ typedef struct wsrep_dummy diff --git a/wsrep/wsrep_loader.c b/wsrep/wsrep_loader.c index 5c4e61e1832..dc35844efce 100644 --- a/wsrep/wsrep_loader.c +++ b/wsrep/wsrep_loader.c @@ -16,7 +16,13 @@ /*! @file wsrep implementation loader */ -#include +/* Macros related to dynamic linking */ +#include + +#if !defined(HAVE_DLOPEN) +#error "Dynamic linking not available." +#endif + #include #include #include -- cgit v1.2.1