diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-10-06 14:27:02 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-10-06 14:27:02 -0400 |
commit | 866643fc6d7163eebaee17b5c0958933cb9e5f25 (patch) | |
tree | 482d19fc206cf523cfa8a07ab46cad5c73800258 | |
parent | d6371d3a8eccedb056708b9d8abae9cc4db3ed4e (diff) | |
download | mariadb-git-866643fc6d7163eebaee17b5c0958933cb9e5f25.tar.gz |
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.
-rwxr-xr-x | BUILD/compile-solaris-amd64 | 2 | ||||
-rwxr-xr-x | BUILD/compile-solaris-amd64-debug | 2 | ||||
-rw-r--r-- | wsrep/CMakeLists.txt | 5 | ||||
-rw-r--r-- | wsrep/wsrep_api.h | 2 | ||||
-rw-r--r-- | wsrep/wsrep_dummy.c | 9 | ||||
-rw-r--r-- | 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 <stdint.h> +#ifndef __cplusplus #include <stdbool.h> +#endif #include <stdlib.h> #include <unistd.h> #include <time.h> 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 <my_config.h> /* MACRO definitions */ #include "wsrep_api.h" - #include <errno.h> -#include <stdbool.h> +#if defined(HAVE_STRINGS_H) +#include <strings.h> +#endif +#if defined(HAVE_STRING_H) #include <string.h> +#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 <dlfcn.h> +/* Macros related to dynamic linking */ +#include <my_global.h> + +#if !defined(HAVE_DLOPEN) +#error "Dynamic linking not available." +#endif + #include <errno.h> #include <string.h> #include <stdio.h> |