From: John David Duncan Date: September 22 2011 1:04am Subject: bzr push into mysql-5.5-cluster branch (john.duncan:3514 to 3516) List-Archive: http://lists.mysql.com/commits/141064 Message-Id: <201109220104.p8M14YJ6000514@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3516 John David Duncan 2011-09-21 Solaris portability fixes (memcache) modified: extra/memcached/CMakeLists.txt storage/ndb/memcache/CMakeLists.txt 3515 John David Duncan 2011-09-21 Update sandbox & CMake to work with bundled memcached modified: extra/memcached/CMakeLists.txt storage/ndb/memcache/FindMemcached.cmake storage/ndb/memcache/memcached_path.pl.in storage/ndb/memcache/sandbox.sh.in 3514 John David Duncan 2011-09-21 [merge] Merge r3503 from mainline mysql-5.5-cluster (so that it can be adapted for bundled memcached) added: storage/ndb/memcache/README modified: storage/ndb/memcache/CMakeLists.txt storage/ndb/memcache/include/ndb_configuration.h storage/ndb/memcache/sandbox.sh.in storage/ndb/memcache/src/Configuration.cc storage/ndb/memcache/src/ndb_configuration.cc storage/ndb/memcache/src/ndb_engine.c === modified file 'extra/memcached/CMakeLists.txt' --- a/extra/memcached/CMakeLists.txt 2011-09-21 08:35:55 +0000 +++ b/extra/memcached/CMakeLists.txt 2011-09-22 01:03:13 +0000 @@ -23,6 +23,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOUR IF(${CMAKE_COMPILER_IS_GNUCC}) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") +ELSEIF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xc99=all") ENDIF() # memcached cannot currently be built with -Werror; @@ -66,16 +68,9 @@ SET(MEMCACHED_SOURCES add_executable(memcached ${MEMCACHED_SOURCES}) -target_link_libraries(memcached event memcached_utilities) - -if(LIBDL) - target_link_libraries(memcached dl) -endif() - -if(LIBM) - target_link_libraries(memcached m) -endif() - +target_link_libraries(memcached + event memcached_utilities + ${LIBDL} ${LIBM} ${LIBNSL} ${LIBSOCKET}) CHECK_INCLUDE_FILE("link.h" HAVE_LINK_H) CHECK_INCLUDE_FILE("stdbool.h" HAVE_STDBOOL_H) @@ -88,4 +83,6 @@ CHECK_INCLUDE_FILES("sys/types.h;netinet configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config_tests.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h) +install(PROGRAMS memcached DESTINATION ${INSTALL_SBINDIR}) + === modified file 'storage/ndb/memcache/CMakeLists.txt' --- a/storage/ndb/memcache/CMakeLists.txt 2011-09-21 08:37:13 +0000 +++ b/storage/ndb/memcache/CMakeLists.txt 2011-09-22 01:03:13 +0000 @@ -82,16 +82,13 @@ add_definitions(-DDEBUG_OUTPUT) # Set extra flags for the C compiler IF(${CMAKE_COMPILER_IS_GNUCC}) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=gnu99 -Wall -Wredundant-decls") -ELSE() - message(STATUS "Not gnu c") +ELSEIF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xc99=all") ENDIF() # Set extra flags for the C++ compiler IF(${CMAKE_COMPILER_IS_GNUCXX}) STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros") -ELSE() - message(STATUS "Not gnu c++") ENDIF() === modified file 'storage/ndb/memcache/FindMemcached.cmake' --- a/storage/ndb/memcache/FindMemcached.cmake 2011-09-20 16:13:34 +0000 +++ b/storage/ndb/memcache/FindMemcached.cmake 2011-09-21 09:21:54 +0000 @@ -11,6 +11,7 @@ if(WITH_MEMCACHE) set(MEMCACHED_ROOT_DIR ${CMAKE_SOURCE_DIR}/extra/memcached) set(MEMCACHED_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extra/memcached/include) set(MEMCACHED_UTILITIES_LIBRARY memcached_utilities) + set(MEMCACHED_BIN_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_SBINDIR}/memcached) else() # Find an installed memcached @@ -35,6 +36,8 @@ else() HINTS ${MEMCACHED_ROOT_DIR} PATH_SUFFIXES lib/memcached lib memcached/lib ) + + set(MEMCACHED_BIN_PATH ${MEMCACHED_ROOT_DIR}/bin/memcached) endif() if(MEMCACHED_ROOT_DIR AND MEMCACHED_INCLUDE_DIR AND MEMCACHED_UTILITIES_LIBRARY) @@ -45,4 +48,5 @@ endif() mark_as_advanced(MEMCACHED_ROOT_DIR MEMCACHED_INCLUDE_DIR - MEMCACHED_UTILITIES_LIBRARY) \ No newline at end of file + MEMCACHED_UTILITIES_LIBRARY + MEMCACHED_BIN_PATH) \ No newline at end of file === modified file 'storage/ndb/memcache/memcached_path.pl.in' --- a/storage/ndb/memcache/memcached_path.pl.in 2011-09-20 05:13:01 +0000 +++ b/storage/ndb/memcache/memcached_path.pl.in 2011-09-21 09:21:54 +0000 @@ -31,14 +31,7 @@ sub memcached_is_available() { } sub get_memcached_exe_path() { - my $memcached_base = "@MEMCACHED_ROOT_DIR@"; - if("@WITH_MEMCACHE@" eq "ON") { - # bundled in source tree: - return "$memcached_base/memcached"; - } - else { - return "$memcached_base/bin/memcached"; - } + return "@MEMCACHED_BIN_PATH@"; } 1; === modified file 'storage/ndb/memcache/sandbox.sh.in' --- a/storage/ndb/memcache/sandbox.sh.in 2011-09-21 08:30:46 +0000 +++ b/storage/ndb/memcache/sandbox.sh.in 2011-09-21 09:21:54 +0000 @@ -8,6 +8,7 @@ scriptsdir=@INSTALL_SCRIPTDIR@ memcachedir=@MEMCACHED_ROOT_DIR@ sourcetree=@CMAKE_CURRENT_SOURCE_DIR@ installtree=@CMAKE_BINARY_DIR@/memcache-api +memcached_binary=@MEMCACHED_BIN_PATH@ MYSQL_PREFIX=$prefix MYSQL_BIN=$prefix/$bindir @@ -27,7 +28,11 @@ test_paths() { test_path $MYSQL_LIBEXEC ndbd test_path $MYSQL_LIBEXEC mysqld_safe test_path $MYSQL_SCRIPTS mysql_install_db - test_path $MEMCACHE_BASE/bin memcached + if [ ! -x $memcached_binary ] + then + echo "Cannot execute $memcached_binary" + exit + fi } test_path() { @@ -141,7 +146,7 @@ load_metadata() { } start_memcached() { - $MEMCACHE_BASE/bin/memcached -d -v \ + $memcached_binary -d -v \ -P $HOME_BASE/sandbox/memcached.pid \ -E $MYSQL_LIB/ndb_engine.so $1 $2 } No bundle (reason: useless for push emails).