3921 magnus.blaudd@stripped 2012-05-09
ndb
- add reference to JNI_OnLoad() to ndbclient_exports.cpp if
ndbjite is linked into shared ndbclient, this causes
"everything" from ndbjtie to be included into shared ndbclient
- Set compiler def. NDB_WITH_NDBJTIE if ndbjtie is included
- Move the setup part of ndbjti into it's scope outside of
building shared ndbclient
- Remove use of EXTRA_SRC, ndbclient_shared now always consist only
of the fucntions refernced in ndbclient_exports.cpp
- Change the lib named ndbjtie to be convenience library allowing
it to be compiled with PIC when necessary to include it
into shared ndbclient
- Note! The above removes double build of ndbjtie_lib.cpp
modified:
storage/ndb/src/CMakeLists.txt
storage/ndb/src/ndbclient_exports.cpp
storage/ndb/src/ndbjtie/CMakeLists.txt
3920 magnus.blaudd@stripped 2012-05-09
ndb
- fix comments
modified:
storage/ndb/src/CMakeLists.txt
3919 magnus.blaudd@stripped 2012-05-09
ndb
- add small test program and build it against ndbclient_static
added:
storage/ndb/src/ndbclient_link_test.cpp
modified:
storage/ndb/src/CMakeLists.txt
=== modified file 'storage/ndb/src/CMakeLists.txt'
--- a/storage/ndb/src/CMakeLists.txt 2012-05-09 07:59:21 +0000
+++ b/storage/ndb/src/CMakeLists.txt 2012-05-09 09:59:23 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2012, 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
@@ -13,7 +13,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE(libutils) # MERGE_STATIC_LIBS
+INCLUDE(libutils)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(mgmapi)
@@ -22,70 +22,52 @@ ADD_SUBDIRECTORY(kernel)
ADD_SUBDIRECTORY(mgmclient)
ADD_SUBDIRECTORY(mgmsrv)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include
- ${CMAKE_SOURCE_DIR}/include)
-
-SET(NDBCLIENT_LIBS
- mysys dbug strings
- ndbapi
- ndbtransport
- ndbtrace
- ndbsignaldata
- ndbmgmapi
- ndbmgmcommon
- ndblogger
- ndbportlib
- ndbgeneral
- ndbconf)
+SET(NDBJTIE_LIB)
+IF(HAVE_JDK)
+ ADD_SUBDIRECTORY(ndbjtie)
+ SET(NDBJTIE_LIB ndbjtie)
+ ADD_DEFINITIONS(-DNDB_WITH_NDBJTIE)
+ENDIF()
#
# Build static ndbclient library
#
+SET(NDBCLIENT_LIBS
+ mysys dbug strings
+ ndbapi
+ ndbtransport
+ ndbtrace
+ ndbsignaldata
+ ndbmgmapi
+ ndbmgmcommon
+ ndblogger
+ ndbportlib
+ ndbgeneral
+ ndbconf)
+
MERGE_LIBRARIES(ndbclient_static STATIC ${NDBCLIENT_LIBS} COMPONENT Development)
# Build test program to check linking against ndclient_static
ADD_EXECUTABLE(ndbclient_static_link_test ndbclient_link_test.cpp)
TARGET_LINK_LIBRARIES(ndbclient_static_link_test ndbclient_static)
#
-# Do a shared libd
+# Build shared ndbclient library
#
-SET(NDBCLIENT_SO_LIBS ${NDBCLIENT_LIBS})
-SET(EXTRA_SRC ndbclient_exports.cpp)
-
-IF(HAVE_JDK AND HAVE_JAVA)
-
- ADD_SUBDIRECTORY(ndbjtie)
-
- SET(NDBCLIENT_SO_LIBS ${NDBCLIENT_SO_LIBS} ndbjtie)
-
- INCLUDE_DIRECTORIES(${JNI_INCLUDE_DIRS})
- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi
- ${CMAKE_SOURCE_DIR}/storage/ndb/include/mgmapi
- ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie
- ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie
- ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/utils
- ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/mysql
- )
- # JNI needs a DLL
- SET(EXTRA_SRC ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/ndbjtie_lib.cpp)
-ENDIF()
+SET(NDBCLIENT_SO_LIBS ${NDBCLIENT_LIBS} ${NDBJTIE_LIB})
-#
-# Version
-#
-INCLUDE("${NDB_SOURCE_DIR}/cmake/ndb_get_config_value.cmake")
+# Extract version from storage/ndb/VERSION
+INCLUDE(ndb_get_config_value)
NDB_GET_CONFIG_VALUE(NDB_SHARED_LIB_VERSION_MAJOR major)
NDB_GET_CONFIG_VALUE(NDB_SHARED_LIB_VERSION_MINOR minor)
NDB_GET_CONFIG_VALUE(NDB_SHARED_LIB_VERSION_BUILD build)
SET(NDB_SHARED_LIB_VERSION "${major}.${minor}.${build}")
-#
-# libndbclient.so
-#
-ADD_LIBRARY(ndbclient_so SHARED ${EXTRA_SRC})
+ADD_LIBRARY(ndbclient_so SHARED ndbclient_exports.cpp)
TARGET_LINK_LIBRARIES(ndbclient_so ${NDBCLIENT_SO_LIBS})
SET_TARGET_PROPERTIES(ndbclient_so PROPERTIES
- OUTPUT_NAME "ndbclient"
- SOVERSION ${NDB_SHARED_LIB_VERSION})
-MYSQL_INSTALL_TARGETS(ndbclient_so DESTINATION "${INSTALL_LIBDIR}" COMPONENT Developement)
+ OUTPUT_NAME "ndbclient"
+ SOVERSION ${NDB_SHARED_LIB_VERSION})
+MYSQL_INSTALL_TARGETS(ndbclient_so
+ DESTINATION "${INSTALL_LIBDIR}"
+ COMPONENT Developement)
=== modified file 'storage/ndb/src/ndbclient_exports.cpp'
--- a/storage/ndb/src/ndbclient_exports.cpp 2012-05-09 07:20:11 +0000
+++ b/storage/ndb/src/ndbclient_exports.cpp 2012-05-09 09:59:23 +0000
@@ -24,9 +24,14 @@
#include "../include/ndbapi/NdbApi.hpp"
+extern "C" void* JNI_OnLoad(void*, void*);
+
void
_ndbclient_exports(void)
{
Ndb_cluster_connection cluster_connection;
NdbScanFilter scan_filter((NdbOperation*)0);
+#ifdef NDB_WITH_NDBJTIE
+ JNI_OnLoad(0,0);
+#endif
}
=== modified file 'storage/ndb/src/ndbjtie/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/CMakeLists.txt 2012-03-12 09:22:04 +0000
+++ b/storage/ndb/src/ndbjtie/CMakeLists.txt 2012-05-09 09:59:23 +0000
@@ -37,7 +37,7 @@ IF(HAVE_JDK)
INCLUDE_DIRECTORIES(utils
jtie)
- ADD_LIBRARY(ndbjtie STATIC ndbjtie_lib.cpp)
+ ADD_CONVENIENCE_LIBRARY(ndbjtie ndbjtie_lib.cpp)
ENDIF(HAVE_JDK)
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3919 to 3921) | magnus.blaudd | 9 May |