diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index e946f0f..1e08bfc 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -115,7 +115,9 @@ MACRO(MYSQL_ADD_PLUGIN) # Build either static library or module IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY) ADD_LIBRARY(${target} STATIC ${SOURCES}) - SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER") + SET_TARGET_PROPERTIES(${target} + PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER") + DTRACE_INSTRUMENT(${target}) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) IF(WITH_EMBEDDED_SERVER) diff --git a/storage/archive/CMakeLists.txt b/storage/archive/CMakeLists.txt index 78fb95c..b685675 100644 --- a/storage/archive/CMakeLists.txt +++ b/storage/archive/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,5 +14,6 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA SET(ARCHIVE_SOURCES azio.c ha_archive.cc ha_archive.h) -MYSQL_ADD_PLUGIN(archive ${ARCHIVE_SOURCES} STORAGE_ENGINE LINK_LIBRARIES ${ZLIB_LIBRARY}) +MYSQL_ADD_PLUGIN(archive ${ARCHIVE_SOURCES} + STORAGE_ENGINE RECOMPILE_FOR_EMBEDDED LINK_LIBRARIES ${ZLIB_LIBRARY}) diff --git a/storage/archive/azio.c b/storage/archive/azio.c index 15b3434..0efa00b 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -15,6 +15,7 @@ #include #include +#include "mysql/psi/mysql_file.h" static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ static int const az_magic[3] = {0xfe, 0x03, 0x01}; /* az magic header */ diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h index 29a6329..490cb39 100644 --- a/storage/archive/azlib.h +++ b/storage/archive/azlib.h @@ -1,6 +1,10 @@ /* This libary has been modified for use by the MySQL Archive Engine. -Brian Aker + + This file was modified by Oracle on 02-08-2016. + Modifications copyright (c) 2016, Oracle and/or its affiliates. + All rights reserved. */ /* zlib.h -- interface of the 'zlib' general purpose compression library @@ -33,7 +37,6 @@ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ -#include "../../mysys/mysys_priv.h" #include #include diff --git a/storage/csv/CMakeLists.txt b/storage/csv/CMakeLists.txt index 9109423..4e28650 100644 --- a/storage/csv/CMakeLists.txt +++ b/storage/csv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,4 +17,4 @@ SET(CSV_PLUGIN_STATIC "csv") SET(CSV_PLUGIN_MANDATORY TRUE) SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h) -MYSQL_ADD_PLUGIN(csv ${CSV_SOURCES} STORAGE_ENGINE MANDATORY) +MYSQL_ADD_PLUGIN(csv ${CSV_SOURCES} STORAGE_ENGINE MANDATORY RECOMPILE_FOR_EMBEDDED) diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt index 8f3c1be..4ec40fe 100644 --- a/storage/heap/CMakeLists.txt +++ b/storage/heap/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,8 +24,12 @@ SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create MYSQL_ADD_PLUGIN(heap ${HEAP_SOURCES} STORAGE_ENGINE MANDATORY RECOMPILE_FOR_EMBEDDED) -ADD_EXECUTABLE(hp_test1 hp_test1.c) -TARGET_LINK_LIBRARIES(hp_test1 mysys heap dbug strings) +IF(WITH_UNIT_TESTS AND WITH_EMBEDDED_SERVER) + ADD_EXECUTABLE(hp_test1 hp_test1.c) + TARGET_LINK_LIBRARIES(hp_test1 heap_embedded mysys) + ADD_TEST(hp_test1 hp_test1) -ADD_EXECUTABLE(hp_test2 hp_test2.c) -TARGET_LINK_LIBRARIES(hp_test2 mysys heap dbug strings) + ADD_EXECUTABLE(hp_test2 hp_test2.c) + TARGET_LINK_LIBRARIES(hp_test2 heap_embedded mysys) + ADD_TEST(hp_test2 hp_test2) +ENDIF() diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index a5fffac..0e762a8 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -280,3 +280,6 @@ MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE DEFAULT MODULE_OUTPUT_NAME ha_innodb LINK_LIBRARIES ${ZLIB_LIBRARY}) + +# Remove -DMYSQL_SERVER, it breaks embedded build +SET_TARGET_PROPERTIES(innobase PROPERTIES COMPILE_DEFINITIONS "") diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt index 487fbde..cfd8fe8 100644 --- a/storage/myisam/CMakeLists.txt +++ b/storage/myisam/CMakeLists.txt @@ -33,21 +33,35 @@ MYSQL_ADD_PLUGIN(myisam ${MYISAM_SOURCES} TARGET_LINK_LIBRARIES(myisam mysys) +IF (WITH_EMBEDDED_SERVER) + SET(MYISAM_NOPFS myisam_embedded) + TARGET_LINK_LIBRARIES(myisam_embedded mysys) +ELSE() + ADD_CONVENIENCE_LIBRARY(myisam_nopfs ${MYISAM_SOURCES}) + ADD_DEPENDENCIES(myisam_nopfs GenError) + TARGET_LINK_LIBRARIES(myisam_nopfs mysys) + SET(MYISAM_NOPFS myisam_nopfs) +ENDIF() + MYSQL_ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c) -TARGET_LINK_LIBRARIES(myisam_ftdump myisam) +TARGET_LINK_LIBRARIES(myisam_ftdump ${MYISAM_NOPFS}) +SET_TARGET_PROPERTIES(myisam_ftdump PROPERTIES LINKER_LANGUAGE CXX) MYSQL_ADD_EXECUTABLE(myisamchk myisamchk.c) -TARGET_LINK_LIBRARIES(myisamchk myisam) +TARGET_LINK_LIBRARIES(myisamchk ${MYISAM_NOPFS}) +SET_TARGET_PROPERTIES(myisamchk PROPERTIES LINKER_LANGUAGE CXX) MYSQL_ADD_EXECUTABLE(myisamlog myisamlog.c) -TARGET_LINK_LIBRARIES(myisamlog myisam) +TARGET_LINK_LIBRARIES(myisamlog ${MYISAM_NOPFS} ${LIBSOCKET}) MYSQL_ADD_EXECUTABLE(myisampack myisampack.c) -TARGET_LINK_LIBRARIES(myisampack myisam) +TARGET_LINK_LIBRARIES(myisampack ${MYISAM_NOPFS}) +SET_TARGET_PROPERTIES(myisampack PROPERTIES LINKER_LANGUAGE CXX) IF(WITH_UNIT_TESTS AND FALSE) ADD_EXECUTABLE(mi_test1 mi_test1.c) - TARGET_LINK_LIBRARIES(mi_test1 myisam) + TARGET_LINK_LIBRARIES(mi_test1 ${MYISAM_NOPFS}) + SET_TARGET_PROPERTIES(mi_test1 PROPERTIES LINKER_LANGUAGE CXX) ADD_EXECUTABLE(mi_test2 mi_test2.c) TARGET_LINK_LIBRARIES(mi_test2 myisam)