diff --git a/cmakelists.txt b/cmakelists.txt index ab5317ef171..6c6834730b0 100644 --- a/cmakelists.txt +++ b/cmakelists.txt @@ -1,17 +1,18 @@ PROJECT(MySql) EXEC_PROGRAM(cscript.exe win ARGS config-version.js OUT_VARIABLE out) +INCLUDE(win/configure.data) # in some places we use DBUG_OFF SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D DBUG_OFF") -IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") - SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") - SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") +#IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") +# SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") +# SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") +# SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") +# SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") +#ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") # replace /MDd with /MTd @@ -29,7 +30,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT}) ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") -ADD_DEFINITIONS("-D_WINDOWS -D__WIN__") +ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE") SUBDIRS(vio dbug strings regex mysys extra/yassl extra/yassl/taocrypt extra zlib storage/innobase storage/heap storage/myisam storage/myisammrg diff --git a/sql/cmakelists.txt b/sql/cmakelists.txt index 2099ef94996..d4e8c9a826b 100644 --- a/sql/cmakelists.txt +++ b/sql/cmakelists.txt @@ -18,8 +18,47 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h ${PROJECT_SOURCE_DIR}/include/sql_state.h PROPERTIES GENERATED 1) -ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE -DHAVE_ARCHIVE_DB -DHAVE_BLACKHOLE_DB -DHAVE_EXAMPLE_DB) -ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DHAVE_FEDERATED_DB -DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN -DWITH_PARTITION_STORAGE_ENGINE -D_CRT_SECURE_NO_DEPRECATE) +IF(WITH_ARCHIVE_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &archive_hton") + SET (mysql_se_decls "${mysql_se_decls}, archive_hton") +ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) +IF(WITH_BLACKHOLE_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &blackhole_hton") + SET (mysql_se_decls "${mysql_se_decls}, blackhole_hton") +ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) +IF(WITH_EXAMPLE_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &example_hton") + SET (mysql_se_decls "${mysql_se_decls}, example_hton") +ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) +IF(WITH_INNOBASE_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &innobase_hton") + SET (mysql_se_decls "${mysql_se_decls}, innobase_hton") +ENDIF(WITH_INNOBASE_STORAGE_ENGINE) +IF(WITH_PARTITION_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &partition_hton") + SET (mysql_se_decls "${mysql_se_decls}, partition_hton") +ENDIF(WITH_PARTITION_STORAGE_ENGINE) +IF(WITH_FEDERATED_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &federated_hton") + SET (mysql_se_decls "${mysql_se_decls}, federated_hton") +ENDIF(WITH_FEDERATED_STORAGE_ENGINE) +IF(WITH_BERKELEY_STORAGE_ENGINE) + ADD_DEFINITIONS(-D WITH_BERKELEY_STORAGE_ENGINE) + SET (mysql_se_htons "${mysql_se_htons}, &berkeley_hton") + SET (mysql_se_decls "${mysql_se_decls}, berkeley_hton") +ENDIF(WITH_BERKELEY_STORAGE_ENGINE) +IF(__NT__) + ADD_DEFINITIONS(-D __NT__) +ENDIF(__NT__) +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/handlerton.cc.in ${CMAKE_SOURCE_DIR}/sql/handlerton.cc @ONLY) + +ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN) ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc filesort.cc gstream.cc ha_blackhole.cc @@ -67,52 +106,11 @@ ADD_CUSTOM_COMMAND( # Windows message file ADD_CUSTOM_COMMAND( - SOURCE ../VC++Files/sql/message.mc + SOURCE ../VC++Files/sql/messae.mc OUTPUT message.rc message.h COMMAND mc ARGS ../VC++Files/sql/message.mc DEPENDS ../VC++Files/sql/message.mc) -# MySql_version.h. -#ADD_CUSTOM_COMMAND( -# SOURCE ${PROJECT_SOURCE_DIR}/include/mysql_version.h.in -# OUTPUT ${PROJECT_SOURCE_DIR}/include/mysql_version.h -# COMMAND cscript.exe ${PROJECT_SOURCE_DIR}/win/config-version.js -# DEPENDS ${PROJECT_SOURCE_DIR}/include/mysql_version.h.in) - -# Handlerton file -ADD_CUSTOM_COMMAND( - SOURCE ${PROJECT_SOURCE_DIR}/sql/handlerton.cc.in - OUTPUT ${PROJECT_SOURCE_DIR}/sql/handlerton.cc - COMMAND cscript.exe ${PROJECT_SOURCE_DIR}/win/config-handlerton.js ARGS ${PROJECT_SOURCE_DIR}/win/configure.data - DEPENDS ${PROJECT_SOURCE_DIR}/sql/handlerton.cc.in) - -# Error file -#GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION) -#ADD_CUSTOM_COMMAND( - #SOURCE ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt - #OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h - #COMMAND ${COMP_ERR_EXE} - #ARGS --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets - # --out-dir=${PROJECT_SOURCE_DIR}/sql/share/ -## --header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h -# --name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h -# --state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h - # --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt - # DEPENDS ${COMP_ERR_EXE} share/errmsg.txt) - -#ADD_CUSTOM_COMMAND( -# OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h -# COMMAND echo -# DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_error.h -#) - -#ADD_CUSTOM_COMMAND( -# OUTPUT ${PROJECT_SOURCE_DIR}/include/sql_state.h -# COMMAND echo -# DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h -#) - - # Gen_lex_hash ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32) diff --git a/sql/handlerton-win.cc b/sql/handlerton-win.cc deleted file mode 100644 index 9ce4eab2444..00000000000 --- a/sql/handlerton-win.cc +++ /dev/null @@ -1,72 +0,0 @@ -#include "mysql_priv.h" - -extern handlerton heap_hton; -extern handlerton myisam_hton; -extern handlerton myisammrg_hton; -extern handlerton binlog_hton; -#ifdef WITH_INNOBASE_STORAGE_ENGINE -extern handlerton innobase_hton; -#endif -#ifdef WITH_BERKELEY_STORAGE_ENGINE -extern handlerton berkeley_hton; -#endif -#ifdef WITH_EXAMPLE_STORAGE_ENGINE -extern handlerton example_hton; -#endif -#ifdef WITH_ARCHIVE_STORAGE_ENGINE -extern handlerton archive_hton; -#endif -#ifdef WITH_CSV_STORAGE_ENGINE -extern handlerton tina_hton; -#endif -#ifdef WITH_BLACKHOLE_STORAGE_ENGINE -extern handlerton blackhole_hton; -#endif -#ifdef WITH_FEDERATED_STORAGE_ENGINE -extern handlerton federated_hton; -#endif -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE -extern handlerton ndbcluster_hton; -#endif -#ifdef WITH_PARTITION_STORAGE_ENGINE -extern handlerton partition_hton; -#endif - -/* - This array is used for processing compiled in engines. -*/ -handlerton *sys_table_types[]= -{ - &heap_hton, - &myisam_hton, -#ifdef WITH_INNOBASE_STORAGE_ENGINE - &innobase_hton, -#endif -#ifdef WITH_BERKELEY_STORAGE_ENGINE - &berkeley_hton, -#endif -#ifdef WITH_EXAMPLE_STORAGE_ENGINE - &example_hton, -#endif -#ifdef WITH_ARCHIVE_STORAGE_ENGINE - &archive_hton, -#endif -#ifdef WITH_CSV_STORAGE_ENGINE - &tina_hton, -#endif -#ifdef WITH_BLACKHOLE_STORAGE_ENGINE - &blackhole_hton, -#endif -#ifdef WITH_FEDERATED_STORAGE_ENGINE - &federated_hton, -#endif -#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE - &ndbcluster_hton, -#endif -#ifdef WITH_PARTITION_STORAGE_ENGINE - &partition_hton, -#endif - &myisammrg_hton, - &binlog_hton, - NULL -}; diff --git a/win/configure.js b/win/configure.js index b1c269d4eed..263b4fe7da0 100644 --- a/win/configure.js +++ b/win/configure.js @@ -14,7 +14,27 @@ try var configfile = fso.CreateTextFile("win\\configure.data", true); for (i=0; i < args.Count(); i++) { - configfile.WriteLine(args.Item(i)); + var parts = args.Item(i).split('='); + switch (parts[0]) + { + case "WITH_ARCHIVE_STORAGE_ENGINE": + case "WITH_BERKELEY_STORAGE_ENGINE": + case "WITH_BLACKHOLE_STORAGE_ENGINE": + case "WITH_EXAMPLE_STORAGE_ENGINE": + case "WITH_FEDERATED_STORAGE_ENGINE": + case "WITH_INNOBASE_STORAGE_ENGINE": + case "WITH_PARTITION_STORAGE_ENGINE": + case "__NT__": + line = "SET (" + args.Item(i) + " TRUE)"; + break; + case "MYSQL_SERVER_SUFFIX": + case "COMPILATION_COMMENT": + case "MYSQL_TCP_PORT": + line = "SET (" + parts[0] + " " + parts[1] + ")"; + break; + } + + configfile.WriteLine(line); } configfile.Close();