diff options
author | unknown <iggy@alf.> | 2007-06-15 14:32:16 -0400 |
---|---|---|
committer | unknown <iggy@alf.> | 2007-06-15 14:32:16 -0400 |
commit | 290414712e654bd26c550188cdbf7f95a84c8c21 (patch) | |
tree | a99e37995345d1f6afa5a8c17d594bb24252f34c | |
parent | 442adbb2e4657aca018f9aba42f7dd56b3d0221a (diff) | |
download | mariadb-git-290414712e654bd26c550188cdbf7f95a84c8c21.tar.gz |
Embedded Server doesn't build on Windows.
- Add build configuration parameter EMBEDDED_ONLY which will configure
the VS solution to produce only mysql embedded binary.
- Make necessary updates to successfully compile solution.
CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Remove leading space from various definitions.
- Remove optimizations from RelWithDebInfo configuration for debugging.
- Conditionally add the necessary build directories based on
EMBEDDED_ONLY flag.
BitKeeper/etc/ignore:
Embedded Server doesn't build on Windows.
- Ignore CMake's default configuration output directories.
- Ignore autogenerated cmake_dummy.c file.
libmysql/client_settings.h:
Embedded Server doesn't build on Windows.
- Build fixup
libmysqld/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Update for recent changes.
libmysqld/libmysqld.def:
Embedded Server doesn't build on Windows.
- Export necessary methods.
libmysqld/examples/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Updated include directories.
- test_libmysqld fixup.
- Added mysqltest_embedded and mysql_client_test_embedded exes needed for
testing.
sql/mysqld.cc:
Embedded Server doesn't build on Windows.
- Build fixup.
sql/sql_binlog.cc:
Embedded Server doesn't build on Windows.
- Build fixup.
sql-common/client.c:
Embedded Server doesn't build on Windows.
- Build fixup.
storage/federated/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Define USE_TLS for embedded only builds.
storage/heap/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Define USE_TLS for embedded only builds.
storage/innobase/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Define USE_TLS for embedded only builds.
storage/myisam/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Define USE_TLS for embedded only builds.
storage/myisam/ha_myisam.cc:
Embedded Server doesn't build on Windows.
- Define USE_TLS for embedded only builds.
storage/myisammrg/CMakeLists.txt:
Embedded Server doesn't build on Windows.
- Define USE_TLS for embedded only builds.
win/configure.js:
Embedded Server doesn't build on Windows.
- Add EMBEDDED_ONLY build configuration.
-rw-r--r-- | .bzrignore | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 71 | ||||
-rw-r--r-- | libmysql/client_settings.h | 2 | ||||
-rw-r--r-- | libmysqld/CMakeLists.txt | 104 | ||||
-rw-r--r-- | libmysqld/examples/CMakeLists.txt | 14 | ||||
-rw-r--r-- | libmysqld/libmysqld.def | 8 | ||||
-rw-r--r-- | sql-common/client.c | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 | ||||
-rw-r--r-- | sql/sql_binlog.cc | 2 | ||||
-rw-r--r-- | storage/federated/CMakeLists.txt | 3 | ||||
-rw-r--r-- | storage/heap/CMakeLists.txt | 3 | ||||
-rw-r--r-- | storage/innobase/CMakeLists.txt | 3 | ||||
-rw-r--r-- | storage/myisam/CMakeLists.txt | 4 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 2 | ||||
-rw-r--r-- | storage/myisammrg/CMakeLists.txt | 3 | ||||
-rw-r--r-- | win/configure.js | 1 |
16 files changed, 154 insertions, 73 deletions
diff --git a/.bzrignore b/.bzrignore index 8347800ffb3..bc7a7a6429d 100644 --- a/.bzrignore +++ b/.bzrignore @@ -39,6 +39,8 @@ */.pure */debug/* */release/* +*/relwithdebinfo/* +*/minsizerel/* *~ .*.swp ./CMakeCache.txt @@ -1020,6 +1022,7 @@ libmysqld/backup_dir libmysqld/client.c libmysqld/client_settings.h libmysqld/convert.cc +libmysqld/cmake_dummy.c libmysqld/derror.cc libmysqld/discover.cc libmysqld/emb_qcache.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b1268e0699..538c5cb122e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,50 +18,64 @@ PROJECT(MySql) # This reads user configuration, generated by configure.js. INCLUDE(win/configure.data) -# Hardcode support for CSV storage engine -SET(WITH_CSV_STORAGE_ENGINE TRUE) +# By default, CMake will create Release, Debug, RelWithDebInfo and MinSizeRel +# configurations. The EMBEDDED_ONLY build parameter is necessary because CMake +# doesn't support custom build configurations for VS2005. Since the Debug +# configuration does not work properly with USE_TLS defined +# (see mysys/CMakeLists.txt) the easiest way to debug the Embedded Server is to +# use the RelWithDebInfo configuration without optimizations. +# +# Debug default CXX_FLAGS "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" +# RelWithDebInfo default CXX_FLAGS "/MD /Zi /O2 /Ob1 /D NDEBUG" +# +IF(NOT EMBEDDED_ONLY) + # Hardcode support for CSV storage engine + SET(WITH_CSV_STORAGE_ENGINE TRUE) +ELSE(NOT EMBEDDED_ONLY) + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /Od /Ob0 /D NDEBUG" CACHE STRING "No Optimization" FORCE) +ENDIF(NOT EMBEDDED_ONLY) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in ${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY) SET(WITH_HEAP_STORAGE_ENGINE TRUE) -ADD_DEFINITIONS(-D WITH_HEAP_STORAGE_ENGINE) +ADD_DEFINITIONS(-DWITH_HEAP_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin") SET(WITH_MYISAM_STORAGE_ENGINE TRUE) -ADD_DEFINITIONS(-D WITH_MYISAM_STORAGE_ENGINE) +ADD_DEFINITIONS(-DWITH_MYISAM_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin") SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE) -ADD_DEFINITIONS(-D WITH_MYISAMMRG_STORAGE_ENGINE) +ADD_DEFINITIONS(-DWITH_MYISAMMRG_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin") IF(WITH_ARCHIVE_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_ARCHIVE_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin") ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_BLACKHOLE_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_BLACKHOLE_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin") ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) IF(WITH_CSV_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_CSV_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_CSV_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin") ENDIF(WITH_CSV_STORAGE_ENGINE) IF(WITH_EXAMPLE_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_EXAMPLE_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin") ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin") ENDIF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_PARTITION_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_PARTITION_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin") ENDIF(WITH_PARTITION_STORAGE_ENGINE) IF(WITH_FEDERATED_STORAGE_ENGINE) - ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE) + ADD_DEFINITIONS(-DWITH_FEDERATED_STORAGE_ENGINE) SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin") ENDIF(WITH_FEDERATED_STORAGE_ENGINE) @@ -81,15 +95,15 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh ${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY) IF(__NT__) - ADD_DEFINITIONS(-D __NT__) + ADD_DEFINITIONS(-D__NT__) ENDIF(__NT__) IF(CYBOZU) - ADD_DEFINITIONS(-D CYBOZU) + ADD_DEFINITIONS(-DCYBOZU) ENDIF(CYBOZU) # 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") +SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF") +SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF") IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") @@ -132,7 +146,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") -ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE") +ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") IF(EMBED_MANIFESTS) # Search for the Manifest tool. CMake will first search it's defaults @@ -179,7 +193,7 @@ ADD_SUBDIRECTORY(extra) ADD_SUBDIRECTORY(storage/heap) ADD_SUBDIRECTORY(storage/myisam) ADD_SUBDIRECTORY(storage/myisammrg) -ADD_SUBDIRECTORY(client) + IF(WITH_ARCHIVE_STORAGE_ENGINE) ADD_SUBDIRECTORY(storage/archive) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) @@ -198,11 +212,16 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE) ADD_SUBDIRECTORY(storage/innobase) ENDIF(WITH_INNOBASE_STORAGE_ENGINE) -ADD_SUBDIRECTORY(sql) -ADD_SUBDIRECTORY(server-tools/instance-manager) -ADD_SUBDIRECTORY(libmysql) -ADD_SUBDIRECTORY(tests) - -# disable libmysqld until it's fixed, so we can use Cmake 2.2 and 2.4 -#ADD_SUBDIRECTORY(libmysqld) -#ADD_SUBDIRECTORY(libmysqld/examples) +# CMAKE will not allow custom VS7+ configurations. mysqld and libmysqld +# cannot be built at the same time as they require different configurations +IF(EMBEDDED_ONLY) + ADD_DEFINITIONS(-DEMBEDDED_LIBRARY) + ADD_SUBDIRECTORY(libmysqld) + ADD_SUBDIRECTORY(libmysqld/examples) +ELSE(EMBEDDED_ONLY) + ADD_SUBDIRECTORY(client) + ADD_SUBDIRECTORY(sql) + ADD_SUBDIRECTORY(server-tools/instance-manager) + ADD_SUBDIRECTORY(libmysql) + ADD_SUBDIRECTORY(tests) +ENDIF(EMBEDDED_ONLY) diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index 1d415488037..a803ff8372f 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name); -MYSQL * +MYSQL * STDCALL cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag); diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 8a855ebdbf5..dd42bafcfe0 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -18,7 +18,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") # Need to set USE_TLS, since __declspec(thread) approach to thread local # storage does not work properly in DLLs. -ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER -DEMBEDDED_LIBRARY) +ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER) # The old Windows build method used renamed (.cc -> .cpp) source files, fails # in #include in lib_sql.cc. So disable that using the USING_CMAKE define. @@ -38,47 +38,51 @@ SET_SOURCE_FILES_PROPERTIES(${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc PROPERTIES GENERATED 1) ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc - ../client/get_password.c ../libmysql/errmsg.c - ../libmysql/libmysql.c ../sql/password.c ../sql-common/client.c - ../sql-common/my_time.c ../sql-common/my_user.c - ../sql-common/pack.c ../sql/derror.cc ../sql/event_scheduler.cc - ../sql/event_timed.cc ../sql/events.cc ../sql/discover.cc - ../sql/field_conv.cc ../sql/field.cc ../sql/filesort.cc - ../sql/gstream.cc ${mysql_se_ha_src} - ../sql/handler.cc ../sql/hash_filo.cc - ../sql/hostname.cc ../sql/init.cc ../sql/item_buff.cc - ../sql/item_cmpfunc.cc ../sql/item.cc ../sql/item_create.cc - ../sql/item_func.cc ../sql/item_geofunc.cc ../sql/item_row.cc - ../sql/item_strfunc.cc ../sql/item_subselect.cc ../sql/item_sum.cc - ../sql/item_timefunc.cc ../sql/item_uniq.cc ../sql/item_xmlfunc.cc - ../sql/key.cc ../sql/lock.cc ../sql/log.cc ../sql/log_event.cc - ../sql/mf_iocache.cc ../sql/my_decimal.cc ../sql/net_serv.cc - ../sql/opt_range.cc ../sql/opt_sum.cc ../sql/parse_file.cc - ../sql/procedure.cc ../sql/protocol.cc ../sql/records.cc - ../sql/repl_failsafe.cc ../sql/rpl_filter.cc ../sql/set_var.cc - ../sql/spatial.cc ../sql/sp_cache.cc ../sql/sp.cc - ../sql/sp_head.cc ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc - ../sql/sql_acl.cc ../sql/sql_analyse.cc ../sql/sql_base.cc - ../sql/sql_cache.cc ../sql/sql_class.cc ../sql/sql_crypt.cc - ../sql/sql_cursor.cc ../sql/sql_db.cc ../sql/sql_delete.cc - ../sql/sql_derived.cc ../sql/sql_do.cc ../sql/sql_error.cc - ../sql/sql_handler.cc ../sql/sql_help.cc ../sql/sql_insert.cc - ../sql/sql_lex.cc ../sql/sql_list.cc ../sql/sql_load.cc - ../sql/sql_manager.cc ../sql/sql_map.cc ../sql/sql_parse.cc - ../sql/sql_partition.cc ../sql/sql_plugin.cc ../sql/sql_prepare.cc - ../sql/sql_rename.cc ../sql/sql_repl.cc ../sql/sql_select.cc - ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc - ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc - ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc - ../sql/sql_update.cc ../sql/sql_view.cc - ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc - ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc - ../sql/partition_info.cc ../sql/sql_locale.cc - ../sql/sql_connect.cc ../sql/scheduler.cc - ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c - ../vio/viosslfactories.c - ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc - ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h) + ../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c + ../sql-common/client.c ../sql-common/my_time.c + ../sql-common/my_user.c ../sql-common/pack.c + ../sql/password.c ../sql/discover.cc ../sql/derror.cc + ../sql/event_scheduler.cc ../sql/events.cc + ../sql/event_data_objects.cc ../sql/event_queue.cc + ../sql/event_db_repository.cc ../sql/field.cc ../sql/field_conv.cc + ../sql/filesort.cc ../sql/gstream.cc ../sql/ha_partition.cc + ../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc + ../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc + ../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc + ../sql/item_geofunc.cc ../sql/item_row.cc ../sql/item_strfunc.cc + ../sql/item_subselect.cc ../sql/item_sum.cc ../sql/item_timefunc.cc + ../sql/item_xmlfunc.cc ../sql/key.cc ../sql/lock.cc ../sql/log.cc + ../sql/log_event.cc ../sql/mf_iocache.cc ../sql/my_decimal.cc + ../sql/net_serv.cc ../sql/opt_range.cc ../sql/opt_sum.cc + ../sql/parse_file.cc ../sql/procedure.cc ../sql/protocol.cc + ../sql/records.cc ../sql/repl_failsafe.cc ../sql/rpl_filter.cc + ../sql/rpl_record.cc + ../sql/rpl_injector.cc ../sql/set_var.cc ../sql/spatial.cc + ../sql/sp_cache.cc ../sql/sp.cc ../sql/sp_head.cc + ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc ../sql/sql_acl.cc + ../sql/sql_analyse.cc ../sql/sql_base.cc ../sql/sql_cache.cc + ../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sql_cursor.cc + ../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc + ../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc + ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/sql_lex.cc + ../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc + ../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc + ../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc + ../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc + ../sql/sql_select.cc ../sql/sql_servers.cc ../sql/sql_builtin.cc + ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc + ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc + ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc + ../sql/sql_update.cc ../sql/sql_view.cc + ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc + ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc + ../sql/partition_info.cc ../sql/sql_locale.cc ../sql/sql_connect.cc + ../sql/scheduler.cc + ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c + ../vio/viosslfactories.c + ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc + ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h) +ADD_DEPENDENCIES(mysqldemb GenError) # Seems we cannot make a library without at least one source file. So use a # dummy empty file @@ -86,14 +90,20 @@ FILE(WRITE cmake_dummy.c " ") ADD_LIBRARY(mysqlserver cmake_dummy.c) TARGET_LINK_LIBRARIES(mysqlserver wsock32) -ADD_DEPENDENCIES(mysqlserver dbug mysys strings zlib mysqldemb regex myisam myisammrg - heap yassl taocrypt) +ADD_DEPENDENCIES(mysqlserver mysqldemb heap myisam myisammrg dbug mysys zlib strings mysqldemb regex + yassl taocrypt vio) IF(WITH_ARCHIVE_STORAGE_ENGINE) ADD_DEPENDENCIES(mysqlserver archive) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_EXAMPLE_STORAGE_ENGINE) ADD_DEPENDENCIES(mysqlserver example) ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) +IF(WITH_BLACKHOLE_STORAGE_ENGINE) + TARGET_LINK_LIBRARIES(mysqlserver blackhole) +ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) +IF(WITH_CSV_STORAGE_ENGINE) + TARGET_LINK_LIBRARIES(mysqlserver csv) +ENDIF(WITH_CSV_STORAGE_ENGINE) IF(WITH_FEDERATED_STORAGE_ENGINE) ADD_DEPENDENCIES(mysqlserver federated) ENDIF(WITH_FEDERATED_STORAGE_ENGINE) @@ -104,3 +114,9 @@ ENDIF(WITH_INNOBASE_STORAGE_ENGINE) ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def) TARGET_LINK_LIBRARIES(libmysqld wsock32) ADD_DEPENDENCIES(libmysqld mysqlserver) +IF(WITH_ARCHIVE_STORAGE_ENGINE) + ADD_DEPENDENCIES(libmysqld archive) +ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) +IF(WITH_BLACKHOLE_STORAGE_ENGINE) + TARGET_LINK_LIBRARIES(libmysqld blackhole) +ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index b33b4740c93..59fa390399d 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -15,12 +15,24 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libmysqld/include + ${CMAKE_SOURCE_DIR}/libmysqld/release + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/extra/yassl/include) # Currently does not work with DBUG, there are missing symbols reported. ADD_DEFINITIONS(-DDBUG_OFF) +ADD_DEFINITIONS(-DUSE_TLS) ADD_EXECUTABLE(test_libmysqld ../../client/completion_hash.cc ../../client/mysql.cc ../../client/readline.cc ../../client/sql_string.cc) -TARGET_LINK_LIBRARIES(test_libmysqld yassl taocrypt zlib wsock32) +TARGET_LINK_LIBRARIES(test_libmysqld mysys yassl taocrypt zlib dbug regex strings wsock32) ADD_DEPENDENCIES(test_libmysqld libmysqld) + +ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c) +TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib dbug regex strings wsock32) +ADD_DEPENDENCIES(mysqltest_embedded libmysqld) + +ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c) +TARGET_LINK_LIBRARIES(mysql_client_test_embedded dbug mysys yassl taocrypt zlib strings wsock32) +ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld) diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 6f7800ee207..21e61da15a7 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -41,7 +41,9 @@ EXPORTS mysql_commit mysql_data_seek mysql_debug + mysql_disable_rpl_parse mysql_dump_debug_info + mysql_enable_rpl_parse mysql_eof mysql_errno mysql_error @@ -55,6 +57,7 @@ EXPORTS mysql_field_seek mysql_field_tell mysql_free_result + mysql_get_character_set_info mysql_get_client_info mysql_get_host_info mysql_get_proto_info @@ -84,6 +87,8 @@ EXPORTS mysql_rollback mysql_row_seek mysql_row_tell + mysql_rpl_parse_enabled + mysql_rpl_probe mysql_select_db mysql_send_query mysql_shutdown @@ -109,6 +114,7 @@ EXPORTS get_tty_password sql_protocol_typelib mysql_get_server_version + mysql_set_character_set mysql_sqlstate charsets_dir disabled_my_option @@ -133,6 +139,8 @@ EXPORTS my_read llstr mysql_get_parameters + mysql_thread_init + mysql_thread_end mysql_stmt_bind_param mysql_stmt_bind_result mysql_stmt_execute diff --git a/sql-common/client.c b/sql-common/client.c index 50da5298591..42d3be17798 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -50,7 +50,7 @@ #define MYSQL_CLIENT #endif -#define CLI_MYSQL_REAL_CONNECT cli_mysql_real_connect +#define CLI_MYSQL_REAL_CONNECT STDCALL cli_mysql_real_connect #undef net_flush my_bool net_flush(NET *net); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1fa08a1d862..4d4eadd0ed9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1883,9 +1883,11 @@ static void init_signals(void) static void start_signal_handler(void) { +#ifndef EMBEDDED_LIBRARY // Save vm id of this process if (!opt_bootstrap) create_pid_file(); +#endif /* EMBEDDED_LIBRARY */ } diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 77432ce518e..87224b8eea0 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -172,6 +172,7 @@ void mysql_client_binlog_statement(THD* thd) not used at all: the rli_fake instance is used only for error reporting. */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) if (IF_DBUG(int err= ) ev->apply_event(thd->rli_fake)) { DBUG_PRINT("info", ("apply_event() returned: %d", err)); @@ -182,6 +183,7 @@ void mysql_client_binlog_statement(THD* thd) my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement"); goto end; } +#endif delete ev; ev= 0; diff --git a/storage/federated/CMakeLists.txt b/storage/federated/CMakeLists.txt index 1f1f4dcd517..359a8784877 100644 --- a/storage/federated/CMakeLists.txt +++ b/storage/federated/CMakeLists.txt @@ -15,6 +15,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +IF(EMBEDDED_ONLY) + ADD_DEFINITIONS(-DUSE_TLS) +ENDIF(EMBEDDED_ONLY) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt index 39953684b8f..f4732397cc4 100644 --- a/storage/heap/CMakeLists.txt +++ b/storage/heap/CMakeLists.txt @@ -15,6 +15,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +IF(EMBEDDED_ONLY) + ADD_DEFINITIONS(-DUSE_TLS) +ENDIF(EMBEDDED_ONLY) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/sql diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 873a73be0ec..d2b6162ba26 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -16,6 +16,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) +IF(EMBEDDED_ONLY) + ADD_DEFINITIONS(-DUSE_TLS) +ENDIF(EMBEDDED_ONLY) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib include diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt index ad0efe4a4e4..ec7cde9a789 100644 --- a/storage/myisam/CMakeLists.txt +++ b/storage/myisam/CMakeLists.txt @@ -16,6 +16,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +IF(EMBEDDED_ONLY) + ADD_DEFINITIONS(-DUSE_TLS) + ADD_DEFINITIONS(-DEMBEDDED_LIBRARY) +ENDIF(EMBEDDED_ONLY) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/sql diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 8b95cdb30fd..f35b6ae761b 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1437,8 +1437,10 @@ int ha_myisam::enable_indexes(uint mode) might have been set by the first repair. They can still be seen with SHOW WARNINGS then. */ +#ifndef EMBEDDED_LIBRARY if (! error) thd->clear_error(); +#endif /* EMBEDDED_LIBRARY */ } info(HA_STATUS_CONST); thd->proc_info=save_proc_info; diff --git a/storage/myisammrg/CMakeLists.txt b/storage/myisammrg/CMakeLists.txt index 8c8c8bcf9fb..b35638ac91d 100644 --- a/storage/myisammrg/CMakeLists.txt +++ b/storage/myisammrg/CMakeLists.txt @@ -15,6 +15,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +IF(EMBEDDED_ONLY) + ADD_DEFINITIONS(-DUSE_TLS) +ENDIF(EMBEDDED_ONLY) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/sql diff --git a/win/configure.js b/win/configure.js index 7225fff119b..06c2fe56a51 100644 --- a/win/configure.js +++ b/win/configure.js @@ -47,6 +47,7 @@ try case "__NT__": case "CYBOZU": case "EMBED_MANIFESTS": + case "EMBEDDED_ONLY": configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); break; case "MYSQL_SERVER_SUFFIX": |