diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-25 18:19:55 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-25 18:19:55 +0100 |
commit | 00d1db7a38b17d4512a6ba5147926608aca5624d (patch) | |
tree | c2b28145304e9eacf79fcabaeb962a20d79fec93 /configure.cmake | |
parent | 0485328d030f4b742dac7b667e8ed099beb9e9f2 (diff) | |
parent | 0251232f8c3bca33b4dd15d6668105f3de9d024d (diff) | |
download | mariadb-git-00d1db7a38b17d4512a6ba5147926608aca5624d.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'configure.cmake')
-rw-r--r-- | configure.cmake | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/configure.cmake b/configure.cmake index 8f7ff762e13..294c5e24ca8 100644 --- a/configure.cmake +++ b/configure.cmake @@ -196,6 +196,7 @@ CHECK_INCLUDE_FILES (ndir.h HAVE_NDIR_H) CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H) CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H) CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H) +CHECK_INCLUDE_FILES (sys/poll.h HAVE_SYS_POLL_H) CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H) CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H) CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H) @@ -727,16 +728,36 @@ ENDIF() # # Test for how the C compiler does inline, if at all # +# SunPro is weird, apparently it only supports inline at -xO3 or -xO4. +# And if CMAKE_C_FLAGS has -xO4 but CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} has -xO2 +# then CHECK_C_SOURCE_COMPILES will succeed but the built will fail. +# We must test all flags here. +# XXX actually, we can do this for all compilers, not only SunPro +IF (CMAKE_CXX_COMPILER_ID MATCHES "SunPro" AND + CMAKE_GENERATOR MATCHES "Makefiles") + STRING(TOUPPER "CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}" flags) + SET(CMAKE_REQUIRED_FLAGS "${${flags}}") +ENDIF() CHECK_C_SOURCE_COMPILES(" -static inline int foo(){return 0;} +extern int bar(int x); +static inline int foo(){return bar(1);} int main(int argc, char *argv[]){return 0;}" C_HAS_inline) IF(NOT C_HAS_inline) CHECK_C_SOURCE_COMPILES(" - static __inline int foo(){return 0;} + extern int bar(int x); + static __inline int foo(){return bar(1);} int main(int argc, char *argv[]){return 0;}" C_HAS___inline) - SET(C_INLINE __inline) + IF(C_HAS___inline) + SET(C_INLINE __inline) + ElSE() + SET(C_INLINE) + MESSAGE(WARNING "C compiler does not support funcion inlining") + IF(NOT NOINLINE) + MESSAGE(FATAL_ERROR "Use -DNOINLINE=TRUE to allow compilation without inlining") + ENDIF() + ENDIF() ENDIF() IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) |