diff options
author | Vasil Dimov <vasil.dimov@oracle.com> | 2010-07-21 17:22:29 +0300 |
---|---|---|
committer | Vasil Dimov <vasil.dimov@oracle.com> | 2010-07-21 17:22:29 +0300 |
commit | 5ba39365176be7042754632489c1e2ec885ba290 (patch) | |
tree | a66f5514fa9172ae7f3906bc68be75d6a9c59d82 /configure.cmake | |
parent | 0802e5da694b3105dd723eacd3d7dc92b24f1f0b (diff) | |
parent | 74d67316829134f04bac656879408d4f7f2de8a4 (diff) | |
download | mariadb-git-5ba39365176be7042754632489c1e2ec885ba290.tar.gz |
Merge mysql-trunk-bugfixing -> mysql-trunk-innodb
(resolving conflicts in mysql-test/suite/rpl/t/rpl_sync-slave.opt and
configure.cmake)
Diffstat (limited to 'configure.cmake')
-rw-r--r-- | configure.cmake | 143 |
1 files changed, 91 insertions, 52 deletions
diff --git a/configure.cmake b/configure.cmake index 246133f1fbe..27950513b36 100644 --- a/configure.cmake +++ b/configure.cmake @@ -90,6 +90,21 @@ ENDIF(WITHOUT_DYNAMIC_PLUGINS) # Large files, common flag SET(_LARGEFILE_SOURCE 1) +# If finds the size of a type, set SIZEOF_<type> and HAVE_<type> +FUNCTION(MY_CHECK_TYPE_SIZE type defbase) + CHECK_TYPE_SIZE("${type}" SIZEOF_${defbase}) + IF(SIZEOF_${defbase}) + SET(HAVE_${defbase} 1 PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +# Same for structs, setting HAVE_STRUCT_<name> instead +FUNCTION(MY_CHECK_STRUCT_SIZE type defbase) + CHECK_TYPE_SIZE("struct ${type}" SIZEOF_${defbase}) + IF(SIZEOF_${defbase}) + SET(HAVE_STRUCT_${defbase} 1 PARENT_SCOPE) + ENDIF() +ENDFUNCTION() # Searches function in libraries # if function is found, sets output parameter result to the name of the library @@ -108,6 +123,7 @@ FUNCTION(MY_SEARCH_LIBS func libs result) CHECK_LIBRARY_EXISTS(${lib} ${func} "" HAVE_${func}_IN_${lib}) IF(HAVE_${func}_IN_${lib}) SET(${result} ${lib} PARENT_SCOPE) + SET(HAVE_${result} 1 PARENT_SCOPE) RETURN() ENDIF() ENDFOREACH() @@ -169,6 +185,7 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H) CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) +CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H) CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H) @@ -185,6 +202,7 @@ CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H) CHECK_INCLUDE_FILES (locale.h HAVE_LOCALE_H) CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H) +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 (port.h HAVE_PORT_H) @@ -193,9 +211,9 @@ CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H) CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H) CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H) CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H) -CHECK_INCLUDE_FILES (sys/dir.h HAVE_SYS_DIR_H) +CHECK_INCLUDE_FILES ("sys/types.h;sys/dir.h" HAVE_SYS_DIR_H) +CHECK_INCLUDE_FILES (sys/ndir.h HAVE_SYS_NDIR_H) CHECK_INCLUDE_FILES (sys/pte.h HAVE_SYS_PTE_H) -CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) CHECK_INCLUDE_FILES (stddef.h HAVE_STDDEF_H) CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H) @@ -220,6 +238,8 @@ CHECK_INCLUDE_FILES (sys/stream.h HAVE_SYS_STREAM_H) CHECK_INCLUDE_FILES (sys/termcap.h HAVE_SYS_TERMCAP_H) CHECK_INCLUDE_FILES ("time.h;sys/timeb.h" HAVE_SYS_TIMEB_H) CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H) +CHECK_INCLUDE_FILES (asm/termbits.h HAVE_ASM_TERMBITS_H) +CHECK_INCLUDE_FILES (termbits.h HAVE_TERMBITS_H) CHECK_INCLUDE_FILES (termios.h HAVE_TERMIOS_H) CHECK_INCLUDE_FILES (termio.h HAVE_TERMIO_H) CHECK_INCLUDE_FILES (termcap.h HAVE_TERMCAP_H) @@ -233,7 +253,18 @@ CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H) CHECK_INCLUDE_FILES (sys/vadvise.h HAVE_SYS_VADVISE_H) CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H) CHECK_INCLUDE_FILES (stdarg.h HAVE_STDARG_H) -CHECK_INCLUDE_FILES("stdlib.h;sys/un.h" HAVE_SYS_UN_H) +CHECK_INCLUDE_FILES ("stdlib.h;sys/un.h" HAVE_SYS_UN_H) +CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H) +CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H) +CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H) +CHECK_INCLUDE_FILES (xfs/xfs.h HAVE_XFS_XFS_H) + +IF(HAVE_SYS_STREAM_H) + # Needs sys/stream.h on Solaris + CHECK_INCLUDE_FILES ("sys/stream.h;sys/ptem.h" HAVE_SYS_PTEM_H) +ELSE() + CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) +ENDIF() # Figure out threading library # @@ -250,7 +281,6 @@ CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE) CHECK_FUNCTION_EXISTS (backtrace_symbols HAVE_BACKTRACE_SYMBOLS) CHECK_FUNCTION_EXISTS (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD) CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK) -CHECK_FUNCTION_EXISTS (bcmp HAVE_BCMP) CHECK_FUNCTION_EXISTS (bfill HAVE_BFILL) CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE) CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH) @@ -458,14 +488,11 @@ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS) SET(CMAKE_EXTRA_INCLUDE_FILES signal.h) -CHECK_TYPE_SIZE(sigset_t SIZEOF_SIGSET_T) -IF(SIZEOF_SIGSET_T) - SET(HAVE_SIGSET_T 1) -ENDIF() +MY_CHECK_TYPE_SIZE(sigset_t SIGSET_T) IF(NOT SIZEOF_SIGSET_T) SET(sigset_t int) ENDIF() -CHECK_TYPE_SIZE(mode_t SIZEOF_MODE_T) +MY_CHECK_TYPE_SIZE(mode_t MODE_T) IF(NOT SIZEOF_MODE_T) SET(mode_t int) ENDIF() @@ -475,46 +502,45 @@ IF(HAVE_STDINT_H) SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h) ENDIF(HAVE_STDINT_H) -IF(NOT APPLE) - # Prevent some checks on OSX, they return ambigious results - # on universal 32/64 bit binariess - CHECK_TYPE_SIZE("char *" SIZEOF_CHARP) - CHECK_TYPE_SIZE(long SIZEOF_LONG) - CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T) -ENDIF() -CHECK_TYPE_SIZE(char SIZEOF_CHAR) -CHECK_TYPE_SIZE(short SIZEOF_SHORT) -CHECK_TYPE_SIZE(int SIZEOF_INT) -CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) +# These first four SIZE_* values are not really used on Mac OS X, +# as we only know at comile time what architecture to build for, +# see "config.h.cmake". But as same macro MY_CHECK_TYPE_SIZE also +# sets HAVE_* macros, we run the check here, doesn't hurt. +MY_CHECK_TYPE_SIZE("void *" VOIDP) +MY_CHECK_TYPE_SIZE("char *" CHARP) +MY_CHECK_TYPE_SIZE(long LONG) +MY_CHECK_TYPE_SIZE(size_t SIZE_T) + +MY_CHECK_TYPE_SIZE(char CHAR) +MY_CHECK_TYPE_SIZE(short SHORT) +MY_CHECK_TYPE_SIZE(int INT) +MY_CHECK_TYPE_SIZE("long long" LONG_LONG) SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h) -CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T) -CHECK_TYPE_SIZE(uchar SIZEOF_UCHAR) -CHECK_TYPE_SIZE(uint SIZEOF_UINT) -CHECK_TYPE_SIZE(ulong SIZEOF_ULONG) -CHECK_TYPE_SIZE(int8 SIZEOF_INT8) -CHECK_TYPE_SIZE(uint8 SIZEOF_UINT8) -CHECK_TYPE_SIZE(int16 SIZEOF_INT16) -CHECK_TYPE_SIZE(uint16 SIZEOF_UINT16) -CHECK_TYPE_SIZE(int32 SIZEOF_INT32) -CHECK_TYPE_SIZE(uint32 SIZEOF_UINT32) -CHECK_TYPE_SIZE(u_int32_t SIZEOF_U_INT32_T) -CHECK_TYPE_SIZE(int64 SIZEOF_INT64) -CHECK_TYPE_SIZE(uint64 SIZEOF_UINT64) +MY_CHECK_TYPE_SIZE(off_t OFF_T) +MY_CHECK_TYPE_SIZE(uchar UCHAR) +MY_CHECK_TYPE_SIZE(uint UINT) +MY_CHECK_TYPE_SIZE(ulong ULONG) +MY_CHECK_TYPE_SIZE(int8 INT8) +MY_CHECK_TYPE_SIZE(uint8 UINT8) +MY_CHECK_TYPE_SIZE(int16 INT16) +MY_CHECK_TYPE_SIZE(uint16 UINT16) +MY_CHECK_TYPE_SIZE(int32 INT32) +MY_CHECK_TYPE_SIZE(uint32 UINT32) +MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T) +MY_CHECK_TYPE_SIZE(int64 INT64) +MY_CHECK_TYPE_SIZE(uint64 UINT64) SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h) -CHECK_TYPE_SIZE(bool SIZEOF_BOOL) +MY_CHECK_TYPE_SIZE(bool BOOL) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_SYS_SOCKET_H) SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) ENDIF(HAVE_SYS_SOCKET_H) -CHECK_TYPE_SIZE(socklen_t SIZEOF_SOCKLEN_T) +MY_CHECK_TYPE_SIZE(socklen_t SOCKLEN_T) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_IEEEFP_H) SET(CMAKE_EXTRA_INCLUDE_FILES ieeefp.h) - CHECK_TYPE_SIZE(fp_except SIZEOF_FP_EXCEPT) - IF(SIZEOF_FP_EXCEPT) - SET(HAVE_FP_EXCEPT TRUE) - ENDIF() + MY_CHECK_TYPE_SIZE(fp_except FP_EXCEPT) ENDIF() @@ -678,6 +704,7 @@ int main(int ac, char **av) {} " SIGNAL_RETURN_TYPE_IS_VOID) IF(SIGNAL_RETURN_TYPE_IS_VOID) SET(RETSIGTYPE void) + SET(VOID_SIGHANDLER 1) ELSE(SIGNAL_RETURN_TYPE_IS_VOID) SET(RETSIGTYPE int) ENDIF(SIGNAL_RETURN_TYPE_IS_VOID) @@ -731,7 +758,6 @@ IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) ENDIF() CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1) -CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL 1) # # Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) @@ -777,7 +803,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS) # Assume regular sprintf SET(SPRINTFS_RETURNS_INT 1) -IF(CMAKE_COMPILER_IS_GNUCXX) +IF(CMAKE_COMPILER_IS_GNUCXX AND HAVE_CXXABI_H) CHECK_CXX_SOURCE_COMPILES(" #include <cxxabi.h> int main(int argc, char **argv) @@ -787,9 +813,6 @@ CHECK_CXX_SOURCE_COMPILES(" return 0; }" HAVE_ABI_CXA_DEMANGLE) -IF(HAVE_ABI_CXA_DEMANGLE) - SET(HAVE_CXXABI_H 1) -ENDIF() ENDIF() CHECK_C_SOURCE_COMPILES(" @@ -991,14 +1014,8 @@ ELSEIF(WIN32) SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h) ENDIF() -CHECK_TYPE_SIZE("struct sockaddr_in6" SIZEOF_SOCKADDR_IN6) -CHECK_TYPE_SIZE("struct in6_addr" SIZEOF_IN6_ADDR) -IF(SIZEOF_SOCKADDR_IN6) - SET(HAVE_STRUCT_SOCKADDR_IN6 1) -ENDIF() -IF(SIZEOF_IN6_ADDR) - SET(HAVE_STRUCT_IN6_ADDR 1) -ENDIF() +MY_CHECK_STRUCT_SIZE("sockaddr_in6" SOCKADDR_IN6) +MY_CHECK_STRUCT_SIZE("in6_addr" IN6_ADDR) IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR) SET(HAVE_IPV6 TRUE CACHE INTERNAL "") @@ -1038,3 +1055,25 @@ CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_IN CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN) SET(SPRINTF_RETURNS_INT 1) +#-------------------------------------------------------------------- +# Hard coded platform settings +#-------------------------------------------------------------------- + +# This is ugly, but we need lots of tweaks for HP-UX +IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") + SET(HPUX11 1) + SET(DO_NOT_REMOVE_THREAD_WRAPPERS 1) + SET(HAVE_BROKEN_PREAD 1) + SET(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT 1) + SET(NO_FCNTL_NONBLOCK 1) # Set conditionally in code above + SET(SNPRINTF_RETURN_TRUNC 1) + SET(_INCLUDE_LONGLONG 1) +ENDIF() + +IF(APPLE) + SET(DONT_DECLARE_CXA_PURE_VIRTUAL 1) + SET(IGNORE_SIGHUP_SIGQUIT 1) + SET(SIGNALS_DONT_BREAK_READ 1) + SET(SIGNAL_WITH_VIO_CLOSE 1) # FIXME better handled in mysql-trunk + SET(_P1003_1B_VISIBLE 1) +ENDIF() |