diff options
-rw-r--r-- | cmake/os/WindowsCache.cmake | 12 | ||||
-rw-r--r-- | config.h.cmake | 37 | ||||
-rw-r--r-- | configure.cmake | 35 | ||||
-rw-r--r-- | extra/yassl/CMakeLists.txt | 7 | ||||
-rw-r--r-- | extra/yassl/taocrypt/CMakeLists.txt | 6 | ||||
-rw-r--r-- | mysys/CMakeLists.txt | 17 | ||||
-rw-r--r-- | sql/CMakeLists.txt | 15 | ||||
-rw-r--r-- | sql/gen_lex_hash.cc | 86 | ||||
-rw-r--r-- | strings/CMakeLists.txt | 10 |
9 files changed, 63 insertions, 162 deletions
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 81942a8c053..732f5d74181 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -339,4 +339,16 @@ SET(C_HAS_inline CACHE INTERNAL "") SET(C_HAS___inline 1 CACHE INTERNAL "") SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "") SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "") +SET(HAVE_CXXABI_H CACHE INTERNAL "") +SET(HAVE_NDIR_H CACHE INTERNAL "") +SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") +SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") +SET(HAVE_ASM_TERMBITS_H CACHE INTERNAL "") +SET(HAVE_TERMBITS_H CACHE INTERNAL "") +SET(HAVE_VIS_H CACHE INTERNAL "") +SET(HAVE_WCHAR_H 1 CACHE INTERNAL "") +SET(HAVE_WCTYPE_H 1 CACHE INTERNAL "") +SET(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP CACHE INTERNAL "") +SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "") +SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "") ENDIF() diff --git a/config.h.cmake b/config.h.cmake index 0800e191aa9..1b59c580503 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -103,7 +103,6 @@ #cmakedefine HAVE_SYS_UTIME_H 1 #cmakedefine HAVE_SYS_WAIT_H 1 #cmakedefine HAVE_SYS_PARAM_H 1 -#cmakedefine HAVE_XFS_XFS_H 1 /* Libraries */ #cmakedefine HAVE_LIBPTHREAD 1 @@ -252,15 +251,6 @@ #cmakedefine HAVE_SIGWAIT 1 #cmakedefine HAVE_SLEEP 1 #cmakedefine HAVE_SNPRINTF 1 -/* Some that currently are not real defines, internal to CMake setup */ -/* #cmakedefine HAVE_FCNTL_NONBLOCK 1 */ -/* #cmakedefine HAVE_FINITE_IN_MATH_H 1 */ -/* #cmakedefine HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 */ -/* #cmakedefine HAVE_SOCKADDR_STORAGE___SS_FAMILY 1 */ -/* #cmakedefine HAVE_SOCKET_SIZE_T_AS_int 1 */ -/* #cmakedefine HAVE_SOCKET_SIZE_T_AS_size_t 1 */ -/* #cmakedefine HAVE_SOCKET_SIZE_T_AS_socklen_t */ -/* #cmakedefine HAVE_SOCKET_TIMEOUT */ #cmakedefine HAVE_STPCPY 1 #cmakedefine HAVE_STRERROR 1 #cmakedefine HAVE_STRCOLL 1 @@ -343,13 +333,13 @@ #endif #cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ -#cmakedefine HAVE_CHAR 1 -#cmakedefine HAVE_LONG 1 -#cmakedefine HAVE_CHARP 1 +#define HAVE_CHAR 1 +#define HAVE_LONG 1 +#define HAVE_CHARP 1 #cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ -#cmakedefine HAVE_SHORT 1 +#define HAVE_SHORT 1 #cmakedefine SIZEOF_INT @SIZEOF_INT@ -#cmakedefine HAVE_INT 1 +#define HAVE_INT 1 #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ #cmakedefine HAVE_LONG_LONG 1 #cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ @@ -581,23 +571,6 @@ #cmakedefine HAVE_UCA_COLLATIONS 1 #cmakedefine HAVE_COMPRESS 1 -/* - Hard coded platform settings -*/ - -/* This is ugly, but we need lots of tweaks for HP-UX */ -#cmakedefine HPUX11 1 -#cmakedefine DO_NOT_REMOVE_THREAD_WRAPPERS 1 -#cmakedefine HAVE_BROKEN_PREAD 1 -#cmakedefine HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT 1 -#cmakedefine SNPRINTF_RETURN_TRUNC 1 -#cmakedefine _INCLUDE_LONGLONG 1 - -/* Mac OS X */ -#cmakedefine SIGNALS_DONT_BREAK_READ 1 -#cmakedefine IGNORE_SIGHUP_SIGQUIT 1 -#cmakedefine _P1003_1B_VISIBLE 1 -#cmakedefine DONT_DECLARE_CXA_PURE_VIRTUAL 1 /* Stuff that always need to be defined (compile breaks without it) diff --git a/configure.cmake b/configure.cmake index f6276a054c3..d032d7ed448 100644 --- a/configure.cmake +++ b/configure.cmake @@ -257,7 +257,6 @@ 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 @@ -502,14 +501,17 @@ IF(HAVE_STDINT_H) SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h) ENDIF(HAVE_STDINT_H) -# 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. +SET(HAVE_VOIDP 1) +SET(HAVE_CHARP 1) +SET(HAVE_LONG 1) +SET(HAVE_SIZE_T 1) + +IF(NOT APPLE) 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) +ENDIF() MY_CHECK_TYPE_SIZE(char CHAR) MY_CHECK_TYPE_SIZE(short SHORT) @@ -1046,26 +1048,3 @@ SET(CMAKE_EXTRA_INCLUDE_FILES) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO) 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() diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt index 63eabb45824..ea991fee8dc 100644 --- a/extra/yassl/CMakeLists.txt +++ b/extra/yassl/CMakeLists.txt @@ -28,7 +28,12 @@ ${CMAKE_CXX_FLAGS}) ENDIF() SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp - src/yassl_imp.cpp src/yassl_int.cpp src/template_instnt.cpp) + src/yassl_imp.cpp src/yassl_int.cpp) + +IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION) + SET(YASSL_SOURCES ${YASSL_SOURCES} src/template_instnt.cpp) +ENDIF() + ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES}) RESTRICT_SYMBOL_EXPORTS(yassl) diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt index 9417dda4095..1781ea6f2fa 100644 --- a/extra/yassl/taocrypt/CMakeLists.txt +++ b/extra/yassl/taocrypt/CMakeLists.txt @@ -21,12 +21,16 @@ ADD_DEFINITIONS(${SSL_DEFINES}) SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp - src/template_instnt.cpp include/aes.hpp include/algebra.hpp include/arc4.hpp include/asn.hpp include/block.hpp include/coding.hpp include/des.hpp include/dh.hpp include/dsa.hpp include/dsa.hpp include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp) + +IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION) + SET(TAOCRYPT_SOURCES ${TAOCRYPT_SOURCES} src/template_instnt.cpp) +ENDIF() + ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES}) RESTRICT_SYMBOL_EXPORTS(taocrypt) diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index ab0799b22f9..ae41151a981 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -18,16 +18,16 @@ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys) SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c - errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c + errors.c hash.c list.c md5.c mf_cache.c mf_dirname.c mf_fn_ext.c mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_arr_appstr.c mf_tempdir.c mf_tempfile.c mf_unixpath.c mf_wcomp.c mulalloc.c my_access.c - my_aes.c my_alarm.c my_alloc.c my_bit.c my_bitmap.c my_chsize.c - my_compress.c my_copy.c my_crc32.c my_create.c my_delete.c + my_aes.c my_alloc.c my_bit.c my_bitmap.c my_chsize.c + my_compress.c my_copy.c my_create.c my_delete.c my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethostbyname.c my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c - my_lib.c my_lock.c my_lockmem.c my_malloc.c my_mess.c + my_lib.c my_lock.c my_malloc.c my_mess.c my_mkdir.c my_mmap.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_redel.c my_rename.c my_seek.c my_sleep.c my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c @@ -42,6 +42,10 @@ IF (WIN32) SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_winthread.c my_wincond.c my_winerr.c my_winfile.c my_windac.c my_conio.c) ENDIF() +IF(HAVE_ALARM) + SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_alarm.c) +ENDIF() + IF(NOT HAVE_CXX_NEW) # gcc as C++ compiler does not have new/delete SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_new.cc) @@ -58,10 +62,15 @@ IF(HAVE_LARGE_PAGES) SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_largepage.c) ENDIF() +IF(HAVE_MLOCK) + SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_lockmem.c) +ENDIF() + IF(UNIX) # some workarounds SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c) ENDIF() + ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY} ${LIBNSL} ${LIBM} ${LIBRT}) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index b3ac22aca01..e8a594c4d8b 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -43,7 +43,7 @@ SET (SQL_SOURCE discover.cc ../libmysql/errmsg.c field.cc field_conv.cc filesort.cc gstream.cc sha2.cc ha_partition.cc - handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h + handler.cc hash_filo.h sql_plugin_services.h hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc item_create.cc item_func.cc item_geofunc.cc item_row.cc item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc @@ -185,22 +185,15 @@ RUN_BISON( # Gen_lex_hash ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) -TARGET_LINK_LIBRARIES(gen_lex_hash mysys) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h - COMMAND gen_lex_hash ARGS > lex_hash.h.tmp && - ${CMAKE_COMMAND} -E copy_if_different lex_hash.h.tmp lex_hash.h - COMMAND ${CMAKE_COMMAND} -E remove -f lex_hash.h.tmp - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_lex_hash.cc) + COMMAND gen_lex_hash > lex_hash.h +) MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc) SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL") -TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql ${MYSQLD_STATIC_PLUGIN_LIBS} - mysys dbug strings vio regex - ${LIBWRAP} ${LIBCRYPT} ${LIBDL} - ${SSL_LIBRARIES}) +TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql mysys) ADD_CUSTOM_TARGET( GenServerSource diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index 178b038a6cd..a9c03f7e2a7 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -77,34 +77,12 @@ So, we can read full search-structure as 32-bit word */ #define NO_YACC_SYMBOLS -#include "my_global.h" -#include "my_sys.h" -#include "m_string.h" -#ifndef __GNU_LIBRARY__ -#define __GNU_LIBRARY__ // Skip warnings in getopt.h -#endif -#include <my_getopt.h> +#include <my_global.h> #include "mysql_version.h" #include "lex.h" - -static char default_dbug_option[]= "d:t:o,/tmp/gen_lex_hash.trace"; -static char *dbug_option= default_dbug_option; - -struct my_option my_long_options[] = -{ -#ifdef DBUG_OFF - {"debug", '#', "This is a non-debug version. Catch this and exit", - 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#else - {"debug", '#', "Output debug log", &dbug_option, - &dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#endif - {"help", '?', "Display help and exit", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"version", 'V', "Output version information and exit", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} -}; +#include <stdlib.h> +#include <stdio.h> +#include <string.h> struct hash_lex_struct { @@ -341,57 +319,6 @@ void print_find_structs() } -static void usage(int version) -{ - printf("%s Ver 3.6 Distrib %s, for %s (%s)\n", - my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); - if (version) - return; - puts("Copyright (C) 2001 MySQL AB, by VVA and Monty"); - puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ -and you are welcome to modify and redistribute it under the GPL license\n"); - puts("This program generates a perfect hashing function for the sql_lex.cc"); - printf("Usage: %s [OPTIONS]\n\n", my_progname); - my_print_help(my_long_options); -} - - -extern "C" my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) -{ - switch(optid) { - case 'V': - usage(1); - exit(0); - case 'I': - case '?': - usage(0); - exit(0); - case '#': - DBUG_PUSH(argument ? argument : dbug_option); - break; - } - return 0; -} - - -static int get_options(int argc, char **argv) -{ - int ho_error; - - if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option))) - exit(ho_error); - - if (argc >= 1) - { - usage(0); - exit(1); - } - return(0); -} - - int check_dup_symbols(SYMBOL *s1, SYMBOL *s2) { if (s1->length!=s2->length || strncmp(s1->name,s2->name,s1->length)) @@ -442,11 +369,7 @@ int check_duplicates() int main(int argc,char **argv) { - MY_INIT(argv[0]); - DBUG_PROCESS(argv[0]); - if (get_options(argc,(char **) argv)) - exit(1); /* Broken up to indicate that it's not advice to you, gentle reader. */ printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n"); @@ -563,7 +486,6 @@ static SYMBOL *get_hash_symbol(const char *s,\n\ }\n\ }\n" ); - my_end(0); exit(0); } diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 00955c4baed..e1e14f20218 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -15,15 +15,19 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) -SET(STRINGS_SOURCES bchange.c bfill.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c +SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c - strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c - my_strchr.c strcont.c strnlen.c strappend.c) + strxmov.c strxnmov.c xml.c + my_strchr.c strcont.c strappend.c) +IF(NOT HAVE_STRNLEN) + # OSX does not have strnlen + SET(STRINGS_SOURCES ${STRINGS_SOURCES} strnlen.c) +ENDIF() # Avoid dependencies on perschema data defined in mysys ADD_DEFINITIONS(-DDISABLE_MYSQL_THREAD_H) ADD_CONVENIENCE_LIBRARY(strings ${STRINGS_SOURCES}) |