clients/memslap
clients/memstat
clients/memtouch
-cmake-build-debug/
+cmake-build-*/
config.cache
config.log
config.status
mem_config.h
mem_config.h.in
mem_config.in
-memcached/.git
-memcached/.gitignore
-memcached/memcached
-memcached/memcached.spec
out
patch
patch2
--- /dev/null
+include(CMakePushCheckState)
+include(CheckCXXCompilerFlag)
+
+function(check_debug)
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_compile_options(-O1)
+ add_compile_definitions(DEBUG=1)
+ foreach(FLAG IN ITEMS
+ -fno-inline
+ -fno-omit-frame-pointer
+ -fno-eliminate-unused-debug-types
+ -funsafe-loop-optimizations
+
+ -g3
+
+ -Wall
+ -Wextra
+
+ -Wdouble-promotion
+ -Wduplicated-cond
+ -Wduplicated-branches
+ -Wformat=2
+ -Wlogical-op
+ -Wnull-dereference
+ -Wrestrict
+ -Wshadow
+ -Wunknown-pragmas
+ -Wunsafe-loop-optimizations
+ )
+ unset(FLAG_CONSTANT)
+ string(MAKE_C_IDENTIFIER CXX${FLAG} FLAG_CONSTANT)
+ check_cxx_compiler_flag(${FLAG} ${FLAG_CONSTANT})
+ if(${FLAG_CONSTANT})
+ add_compile_options(${FLAG})
+ endif()
+ endforeach()
+
+ if(ENABLE_SANITIZERS)
+ if(address IN_LIST ENABLE_SANITIZERS OR asan IN_LIST ENABLE_SANITIZERS)
+ cmake_push_check_state(RESET)
+ set(CMAKE_REQUIRED_LIBRARIES asan)
+ check_cxx_compiler_flag(-fsanitize=address HAVE_ASAN)
+ cmake_pop_check_state()
+ if(HAVE_ASAN)
+ add_compile_options(-fsanitize=address)
+ add_link_options(-lasan)
+ endif()
+ endif()
+
+ if(undefined IN_LIST ENABLE_SANITIZERS OR ubsan IN_LIST ENABLE_SANITIZERS)
+ cmake_push_check_state(RESET)
+ set(CMAKE_REQUIRED_LIBRARIES ubsan)
+ check_cxx_compiler_flag(-fsanitize=undefined HAVE_UBSAN)
+ cmake_pop_check_state()
+ if(HAVE_UBSAN)
+ add_compile_options(-fsanitize=undefined)
+ add_link_options(-lubsan)
+ endif()
+ endif()
+ endif()
+ else()
+ add_compile_definitions(DEBUG=0)
+ endif()
+endfunction()
--- /dev/null
+include(CheckCXXSymbolExists)
+
+# check for symbol and set HAVE_SYMBOL
+function(check_decl DECL HEADER)
+ safe_string(${DECL} DECL_CONST)
+ check_cxx_symbol_exists(${DECL} ${HEADER} HAVE_${DECL_CONST})
+endfunction(check_decl)
--- /dev/null
+find_package(PkgConfig)
+
+include(SafeString)
+include(CheckHeader)
+
+function(check_dependency NAME LIB HEADER)
+ if(PKG_CONFIG_FOUND)
+ pkg_check_modules(${NAME} lib${LIB}${ARGN})
+ if(NOT ${NAME}_FOUND)
+ pkg_check_modules(${NAME} ${LIB}${ARGN})
+ endif()
+ set(${NAME} ${${NAME}_FOUND} PARENT_SCOPE)
+ set(${NAME}_LIBRARIES ${${NAME}_LIBRARIES} PARENT_SCOPE)
+ set(${NAME}_INCLUDEDIR ${${NAME}_INCLUDEDIR}} PARENT_SCOPE)
+
+ safe_string(${LIB} LIB_CONST)
+ set(HAVE_${NAME} ${${NAME}_FOUND} PARENT_SCOPE)
+ safe_string(${HEADER} HEADER_CONST)
+ find_path(HAVE_${HEADER_CONST} ${HEADER} PATHS ${${NAME}_INCLUDEDIR})
+ else()
+ set(FOUND 1)
+ find_library(LIB${LIB} NAMES ${LIB})
+ if(NOT LIB${LIB})
+ set(FOUND 0)
+ endif()
+ if(HEADER)
+ safe_string(${HEADER} HEADER_CONST)
+ check_header(${HEADER})
+ if(NOT HAVE_${HEADER_CONST})
+ set(FOUND 0)
+ else()
+ find_path(${HEADER_CONST}_ROOT ${HEADER})
+ if(NOT ${HEADER_CONST}_ROOT)
+ set(FOUND 0)
+ endif()
+ endif()
+ endif()
+ set(${NAME} ${FOUND} PARENT_SCOPE)
+ set(${NAME}_LIBRARIES ${LIB${LIB}} PARENT_SCOPE)
+ set(${NAME}_INCLUDEDIR ${${HEADER_CONST}_ROOT} PARENT_SCOPE)
+ endif()
+endfunction()
--- /dev/null
+include(CheckIncludeFileCXX)
+
+include(SafeString)
+
+# check for header.h and set HAVE_HEADER_H
+function(check_header HEADER_PATH)
+ safe_string(${HEADER_PATH} HEADER_CONST)
+ check_include_file_cxx(${HEADER_PATH} HAVE_${HEADER_CONST})
+endfunction(check_header)
+
--- /dev/null
+include(CheckCSourceRuns)
+include(CheckCXXSourceRuns)
+
+# check for C11 stdatomic and C++11 std::atomic, set HAVE_C_STDATOMIC and/or HAVE_CXX_STDATOMIC
+function(check_stdatomic)
+ check_cxx_source_runs(
+ "#include <atomic>
+ int main() {
+ std::atomic<int> i(0);
+ return atomic_fetch_add(&i,1);
+ }"
+ HAVE_CXX_STDATOMIC)
+ check_c_source_runs(
+ "#include <stdatomic.h>
+ int main() {
+ atomic_int i;
+ atomic_init(&i, 0);
+ return atomic_fetch_add(&i,1);
+ }"
+ HAVE_C_STDATOMIC)
+endfunction( )
--- /dev/null
+include(CheckTypeSize)
+
+include(SafeString)
+
+# check for type (possibly in header.h) and set HAVE_TYPE
+function(check_type TYPE HEADER)
+ safe_string(${TYPE} TYPE_CONST)
+ SET(CMAKE_EXTRA_INCLUDE_FILES ${HEADER})
+ check_type_size(${TYPE} ${TYPE_CONST} LANGUAGE CXX)
+ SET(CMAKE_EXTRA_INCLUDE_FILES)
+endfunction(check_type)
--- /dev/null
+
+# replace any non-alnum characters with underscore and uppercase the result
+function(safe_string STRING OUTPUT)
+ string(REGEX REPLACE "[^0-9a-zA-Z_]" "_" HEADER_SAFE ${STRING})
+ string(TOUPPER "${HEADER_SAFE}" HEADER_DEFN)
+ set(${OUTPUT} ${HEADER_DEFN} PARENT_SCOPE)
+endfunction(safe_string)
+
--- /dev/null
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
+
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+
+# globals
+include(CTest)
+include(GNUInstallDirs)
+
+find_package(PkgConfig)
+find_package(Threads REQUIRED)
+
+# locals
+include(SafeString)
+include(CheckDebug)
+include(CheckDecl)
+include(CheckDependency)
+include(CheckHeader)
+include(CheckType)
+include(CheckStdatomic)
+
+# configuration
+
+## debug
+check_debug()
+
+## memaslap
+if(ENABLE_MEMASLAP)
+ check_stdatomic()
+ check_dependency(LIBEVENT event event.h)
+ check_decl(getline stdio.h)
+endif()
+
+## dtrace
+if(ENABLE_DTRACE)
+ set(HAVE_DTRACE 1)
+endif()
+
+##uuid
+if(BUILD_TESTING)
+ check_dependency(LIBUUID uuid uuid/uuid.h)
+endif()
+
+## sasl
+if(ENABLE_SASL)
+ check_dependency(LIBSASL sasl2 sasl/sasl.h)
+ if(LIBSASL)
+ set(LIBMEMCACHED_WITH_SASL_SUPPORT 1)
+ endif()
+endif()
+
+## hashes
+if(ENABLE_FNV64_HASH)
+ set(HAVE_FNV64_HASH 1)
+endif()
+if(ENABLE_MURMUR_HASH)
+ set(HAVE_MURMUR_HASH 1)
+endif()
+if(ENABLE_HSIEH_HASH)
+ set(HAVE_HSIEH_HASH 1)
+endif()
+
+# system checks
+
+check_header(arpa/inet.h)
+check_header(dlfcn.h)
+check_header(errno.h)
+check_header(execinfo.h)
+check_header(fcntl.h)
+check_header(io.h)
+check_header(limits.h)
+check_header(netdb.h)
+check_header(poll.h)
+check_header(stddef.h)
+check_header(stdlib.h)
+check_header(strings.h)
+check_header(sys/socket.h)
+check_header(sys/time.h)
+check_header(sys/types.h)
+check_header(sys/un.h)
+check_header(sys/wait.h)
+check_header(time.h)
+check_header(umem.h)
+check_header(unistd.h)
+check_header(winsock2.h)
+check_header(ws2tcpip.h)
+
+check_decl(fcntl fcntl.h)
+check_decl(htonll arpa/inet.h)
+check_decl(MSG_DONTWAIT sys/socket.h)
+check_decl(MSG_MORE sys/socket.h)
+check_decl(MSG_NOSIGNAL sys/socket.h)
+check_decl(rcvtimeo sys/socket.h)
+check_decl(sndtimeo sys/socket.h)
+check_decl(strerror_r string.h)
+check_decl(strerror string.h)
+check_decl(abi::__cxa_demangle cxxabi.h)
+set(HAVE_GCC_ABI_DEMANGLE ${HAVE_ABI____CXA_DEMANGLE})
+
+check_type(in_port_t netinet/in.h)
+
+check_header(cstdint)
+check_header(cinttypes)
--- /dev/null
+set(CMAKE_BUILD_TYPE Release
+ CACHE STRING "build type (Release, Debug, ...)")
+set(CMAKE_INSTALL_PREFIX /usr/local
+ CACHE PATH "install prefix")
+
+# make test
+
+set(BUILD_TESTING ON
+ CACHE STRING "whether to enable build of the test suite")
+
+set(ENABLE_SANITIZERS ""
+ CACHE STRING "sanitizers to enable (e.g. address undefined ...)")
+
+# sasl
+
+set(ENABLE_SASL OFF
+ CACHE BOOL "enable SASL support")
+
+# hashes
+
+set(ENABLE_FNV64_HASH ON
+ CACHE BOOL "enable fnv64 hash support")
+set(ENABLE_MURMUR_HASH ON
+ CACHE BOOL "enable murmur hash support")
+set(ENABLE_HSIEH_HASH OFF
+ CACHE BOOL "enable hsieh hash support")
+
+# memaslap, needs libevent and stdatomic
+set(ENABLE_MEMASLAP ON
+ CACHE BOOL "enable memaslap client")
+
+# dtrace
+
+set(ENABLE_DTRACE OFF
+ CACHE BOOL "enable dtrace support")
+
+# sphinx
+
+set(SPHINX_OPTIONS ""
+ CACHE STRING "additional sphinx-build command line options")
+set(SPHINX_THEME "sphinx_rtd_theme"
+ CACHE STRING "sphinx HTML theme")
+set(SPHINX_THEME_OPTIONS "'collapse_navigation':False, 'navigation_depth':2, 'titles_only':False, 'includehidden':False"
+ CACHE STRING "sphinx HTML theme options")
+set(SPHINX_EXTENSIONS ""
+ CACHE STRING "comma separated list of quoted sphinx extensions")
+set(SPHINX_CONF_APPEND ""
+ CACHE STRING "append verbatim code to sphinx' conf.py")
+
+# legacy
+
+set(HAVE_VISIBILITY 1)
+set(HAVE_SHARED_ENABLED 1)
+set(HAVE_GCC_BUILTIN_ATOMIC 1)
+
+# modules
+
+
+include(CMake/_Include.cmake)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
+include(CMakeVersions.txt)
+
project(libmemcached
- VERSION 1.99
+ VERSION "${LIBMEMCACHED_VERSION}"
DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached"
)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-include(Config.cmake)
-include(Include.cmake)
-
-find_package(Threads REQUIRED)
-set(THREADS_PREFER_PTHREAD_FLAG ON)
-
-find_library(HAVE_LIBSASL NAMES sasl sasl2)
-check_header(sasl/sasl.h)
-
-check_header(arpa/inet.h)
-check_header(dlfcn.h)
-check_header(errno.h)
-check_header(execinfo.h)
-check_header(fcntl.h)
-check_header(io.h)
-check_header(limits.h)
-check_header(netdb.h)
-check_header(poll.h)
-check_header(stddef.h)
-check_header(stdlib.h)
-check_header(strings.h)
-check_header(sys/socket.h)
-check_header(sys/time.h)
-check_header(sys/types.h)
-check_header(sys/un.h)
-check_header(sys/wait.h)
-check_header(time.h)
-check_header(umem.h)
-check_header(unistd.h)
-check_header(winsock2.h)
-check_header(ws2tcpip.h)
-
-check_decl(fcntl fcntl.h)
-check_decl(htonll arpa/inet.h)
-check_decl(MSG_DONTWAIT sys/socket.h)
-check_decl(MSG_MORE sys/socket.h)
-check_decl(MSG_NOSIGNAL sys/socket.h)
-check_decl(rcvtimeo sys/socket.h)
-check_decl(sndtimeo sys/socket.h)
-check_decl(strerror_r string.h)
-check_decl(strerror string.h)
-check_decl(abi::__cxa_demangle cxxabi.h)
-set(HAVE_GCC_ABI_DEMANGLE ${HAVE_ABI____CXA_DEMANGLE})
-
-check_type(in_port_t netinet/in.h)
-
-check_header(cstdint)
-check_header(cinttypes)
-
-check_debug()
+include(CMakeConfig.txt)
include_directories(${CMAKE_BINARY_DIR})
set(AUTOHEADER_FILE mem_config.h)
add_subdirectory(libmemcached)
add_subdirectory(libmemcached-1.0)
add_subdirectory(libmemcachedutil)
+add_subdirectory(libmemcachedutil-1.0)
-
-include(CTest)
-enable_testing()
-add_subdirectory(libtest)
-add_subdirectory(tests)
+if(BUILD_TESTING)
+ add_subdirectory(libtest)
+ add_subdirectory(tests)
+endif()
add_subdirectory(docs)
+add_subdirectory(support)
# keep last
configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/${AUTOHEADER_FILE} @ONLY)
--- /dev/null
+
+set(LIBMEMCACHED_VERSION_MAJOR 1)
+set(LIBMEMCACHED_VERSION_MINOR 0)
+set(LIBMEMCACHED_VERSION_PATCH 99)
+
+set(LIBMEMCACHED_VERSION ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}.${LIBMEMCACHED_VERSION_PATCH})
+
+set(LIBMEMCACHED_VERSION_HEX)
+math(EXPR LIBMEMCACHED_VERSION_HEX "(${LIBMEMCACHED_VERSION_MAJOR}<<16) + (${LIBMEMCACHED_VERSION_MINOR}<<8) + ${LIBMEMCACHED_VERSION_PATCH}+0"
+ OUTPUT_FORMAT HEXADECIMAL)
+
+set(LIBMEMCACHED_SO_VERSION_CUR 12)
+set(LIBMEMCACHED_SO_VERSION_REV 0)
+set(LIBMEMCACHED_SO_VERSION_AGE 0)
+
+set(LIBMEMCACHED_SO_VERSION ${LIBMEMCACHED_SO_VERSION_CUR}.${LIBMEMCACHED_SO_VERSION_REV}.${LIBMEMCACHED_SO_VERSION_AGE})
+
+set(LIBMEMCACHEDUTIL_SO_VERSION_CUR 2)
+set(LIBMEMCACHEDUTIL_SO_VERSION_REV 0)
+set(LIBMEMCACHEDUTIL_SO_VERSION_AGE 0)
+
+set(LIBMEMCACHEDUTIL_SO_VERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHEDUTIL_SO_VERSION_REV}.${LIBMEMCACHEDUTIL_SO_VERSION_AGE})
+
+set(LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR 0)
+set(LIBMEMCACHEDPROTOCOL_SO_VERSION_REV 0)
+set(LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE 0)
+
+set(LIBMEMCACHEDPROTOCOL_SO_VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_REV}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE})
+
+set(LIBHASHKIT_VERSION_MAJOR 1)
+set(LIBHASHKIT_VERSION_MINOR 0)
+set(LIBHASHKIT_VERSION_PATCH 0)
+
+set(LIBHASHKIT_VERSION ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}.${LIBHASHKIT_VERSION_PATCH})
+
+set(LIBHASHKIT_VERSION_HEX)
+math(EXPR LIBHASHKIT_VERSION_HEX "(${LIBHASHKIT_VERSION_MAJOR}<<16) + (${LIBHASHKIT_VERSION_MINOR}<<8) + ${LIBHASHKIT_VERSION_PATCH}+0"
+ OUTPUT_FORMAT HEXADECIMAL)
+
+set(LIBHASHKIT_SO_VERSION_CUR 2)
+set(LIBHASHKIT_SO_VERSION_REV 0)
+set(LIBHASHKIT_SO_VERSION_AGE 0)
+
+set(LIBHASHKIT_SO_VERSION ${LIBHASHKIT_SO_VERSION_CUR}.${LIBHASHKIT_SO_VERSION_REV}.${LIBHASHKIT_SO_VERSION_AGE})
+++ /dev/null
-#set(CMAKE_INSTALL_PREFIX /usr)
-
-set(LIBMEMCACHED_WITH_SASL_SUPPORT 0)
-
-set(HAVE_FNV64_HASH 1)
-set(HAVE_MURMUR_HASH 1)
-set(HAVE_HSIEH_HASH 0)
-
-#set(SPHINX_OPTIONS)
-#set(SPHINX_THEME)
-#set(SPHINX_THEME_DIR)
-#set(SPHINX_THEME_OPTIONS)
-#set(SPHINX_CONF_APPEND)
-#set(SPHINX_EXTENSIONS "''")
-#set(SPHINX_CONF_APPEND)
-
-set(HAVE_DTRACE 0)
-set(HAVE_VISIBILITY 1)
-set(HAVE_GCC_BUILTIN_ATOMIC 1)
-set(HAVE_SHARED_ENABLED 1)
+++ /dev/null
-
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
-
-function(set_test_target TARGET2)
- foreach(TEST IN LISTS TESTS)
- add_custom_command(TARGET ${TARGET2} POST_BUILD COMMAND ${TEST})
- endforeach()
-endfunction()
-
-include(CheckTypeSize)
-include(CheckCSourceRuns)
-include(CheckIncludeFileCXX)
-include(CheckCXXSymbolExists)
-include(CheckCXXCompilerFlag)
-include(CheckCXXSourceRuns)
-
-function(safe_string STRING OUTPUT)
- string(REGEX REPLACE "[^0-9a-zA-Z_]" "_" HEADER_SAFE ${STRING})
- string(TOUPPER "${HEADER_SAFE}" HEADER_DEFN)
- set(${OUTPUT} ${HEADER_DEFN} PARENT_SCOPE)
-endfunction(safe_string)
-
-function(define_cpp DEF)
- safe_string(${DEF} CNST)
- add_compile_definitions(HAVE_${CNST}=1)
-endfunction(define_cpp)
-
-function(check_header HEADER_PATH)
- safe_string(${HEADER_PATH} HEADER_CONST)
- check_include_file_cxx(${HEADER_PATH} HAVE_${HEADER_CONST})
-endfunction(check_header)
-
-function(check_decl DECL HEADER)
- safe_string(${DECL} DECL_CONST)
- check_cxx_symbol_exists(${DECL} ${HEADER} HAVE_${DECL_CONST})
-endfunction(check_decl)
-
-function(check_type TYPE HEADER)
- safe_string(${TYPE} TYPE_CONST)
- SET(CMAKE_EXTRA_INCLUDE_FILES ${HEADER})
- check_type_size(${TYPE} ${TYPE_CONST} LANGUAGE CXX)
- SET(CMAKE_EXTRA_INCLUDE_FILES)
-endfunction(check_type)
-
-function(check_debug)
- if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
- add_compile_definitions(DEBUG=1)
- add_compile_options(-Wall -Wextra)
- endif()
-endfunction(check_debug)
-
-function(check_stdatomic)
- check_cxx_source_runs(
- "#include <atomic>
- int main() {
- std::atomic<int> i(0);
- return atomic_fetch_add(&i,1);
- }"
- HAVE_CXX_STDATOMIC)
- check_c_source_runs(
- "#include <stdatomic.h>
- int main() {
- atomic_int i;
- atomic_init(&i, 0);
- return atomic_fetch_add(&i,1);
- }"
- HAVE_C_STDATOMIC)
-endfunction(check_atomic_builtins)
add_executable(${CLIENT} ${CLIENT}.cc)
target_include_directories(${CLIENT} PRIVATE ..)
target_link_libraries(${CLIENT} libclient_utilities)
+ install(TARGETS ${CLIENT})
endforeach()
# extra sources
# memaslap is special
-find_library(LIBEVENT event)
-check_stdatomic()
-
-if(LIBEVENT AND HAVE_C_STDATOMIC)
- check_decl(getline stdio.h)
- add_executable(memaslap memaslap.c
- ms_conn.c ms_setting.c ms_sigsegv.c ms_stats.c ms_task.c ms_thread.c)
- target_include_directories(memaslap PRIVATE ..)
- target_link_libraries(memaslap libclient_utilities ${LIBEVENT} Threads::Threads)
+if(ENABLE_MEMASLAP)
+ if(LIBEVENT AND HAVE_C_STDATOMIC)
+ add_executable(memaslap memaslap.c
+ ms_conn.c ms_setting.c ms_sigsegv.c ms_stats.c ms_task.c ms_thread.c)
+ target_include_directories(memaslap PRIVATE .. ${LIBEVENT_INCLUDEDIR})
+ target_link_libraries(memaslap libclient_utilities ${LIBEVENT_LIBRARIES} Threads::Threads)
+ install(TARGETS memaslap)
+ endif()
endif()
find_package(Sphinx)
-if(SPHINX_EXECUTABLE)
+if(NOT SPHINX_EXECUTABLE)
- if(NOT DEFINED SPHINX_THEME)
- set(SPHINX_THEME sphinx_rtd_theme)
- set(SPHINX_THEME_OPTIONS "'collapse_navigation':False, 'navigation_depth':2, 'titles_only':False, 'includehidden':False")
- endif()
+ message(WARNING "The sphinx-build command is required to build manpages.")
- if(NOT DEFINED SPHINX_THEME_DIR)
- set(SPHINX_THEME_DIR)
- endif()
+else()
if(NOT DEFINED SPHINX_OPTIONS)
set(SPHINX_OPTIONS)
endif()
+ if(NOT DEFINED SPHINX_THEME)
+ set(SPHINX_THEME sphinx_rtd_theme)
+ set(SPHINX_THEME_OPTIONS "'collapse_navigation':False, 'navigation_depth':2, 'titles_only':False, 'includehidden':False")
+ endif()
+
set(SPHINX_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/source")
# configured documentation tools and intermediate build results
add_custom_target(html
${SPHINX_EXECUTABLE}
- -q -a -b html
+ -q -b html
-c "${SPHINX_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
${SPHINX_OPTIONS}
"${SPHINX_SOURCE_DIR}"
"${SPHINX_HTML_DIR}"
BYPRODUCTS ${SPHINX_HTML_DIR}
- COMMENT "Build HTML documentation with Sphinx")
- add_custom_target(man
+ )
+ add_custom_target(man ALL
${SPHINX_EXECUTABLE}
- -q -a -b man
+ -q -b man
-c "${SPHINX_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
${SPHINX_OPTIONS}
"${SPHINX_SOURCE_DIR}"
"${SPHINX_MAN_DIR}"
BYPRODUCTS ${SPHINX_MAN_DIR}
- COMMENT "Build manpage documentation with Sphinx")
+ )
+
+ install(DIRECTORY ${SPHINX_MAN_DIR}/
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+ FILES_MATCHING PATTERN *.1
+ )
+ install(DIRECTORY ${SPHINX_MAN_DIR}/
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
+ FILES_MATCHING PATTERN *.3
+ )
endif()
configure_file(configure.h.in configure.h @ONLY)
+
+install(DIRECTORY ../libhashkit-1.0
+ TYPE INCLUDE
+ FILES_MATCHING REGEX "\\.h(pp)?$"
+ )
#pragma once
-#define LIBHASHKIT_VERSION_STRING "@LIBHASHKIT_VERSION_STRING@"
+#define LIBHASHKIT_VERSION_STRING "@LIBHASHKIT_VERSION@"
#define LIBHASHKIT_VERSION_HEX @LIBHASHKIT_VERSION_HEX@
#ifdef __cplusplus
target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT)
configure_file(hashkitcon.h.in hashkitcon.h @ONLY)
+
+set_target_properties(libhashkit PROPERTIES SOVERSION ${LIBHASHKIT_SO_VERSION})
+install(TARGETS libhashkit EXPORT libhashkit)
+export(EXPORT libhashkit)
+install(EXPORT libhashkit DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ TYPE INCLUDE
+ FILES_MATCHING PATTERN hashkit.h
+ )
configure_file(configure.h.in configure.h @ONLY)
+
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ TYPE INCLUDE
+ FILES_MATCHING REGEX "\\.h(pp)?$"
+ PATTERN t EXCLUDE
+ )
extern "C" {
#endif
-#cmakedefine DEPRECATED
-#cmakedefine LIBMEMCACHED_WITH_SASL_SUPPORT
+#cmakedefine01 LIBMEMCACHED_ENABLE_DEPRECATED
+#cmakedefine01 LIBMEMCACHED_WITH_SASL_SUPPORT
-#define LIBMEMCACHED_VERSION_STRING "@LIBMEMCACHED_VERSION_STRING@"
+#define LIBMEMCACHED_VERSION_STRING "@LIBMEMCACHED_VERSION@"
#define LIBMEMCACHED_VERSION_HEX @LIBMEMCACHED_VERSION_HEX@
#ifdef __cplusplus
find_package(FLEX)
find_package(BISON)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csl)
bison_target(CSL_PARSER csl/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.cc
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.h
)
${LIBMEMCACHED_SOURCES})
add_library(memcached ALIAS libmemcached)
set_target_properties(libmemcached PROPERTIES LIBRARY_OUTPUT_NAME memcached)
-target_link_libraries(libmemcached libhashkit Threads::Threads ${CMAKE_DL_LIBS})
-target_include_directories(libmemcached PRIVATE ..)
+target_link_libraries(libmemcached libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
+target_include_directories(libmemcached PRIVATE .. ${LIBSASL_INCLUDEDIR})
target_compile_definitions(libmemcached PRIVATE -DBUILDING_LIBMEMCACHED)
+set_target_properties(libmemcached PROPERTIES SOVERSION ${LIBMEMCACHED_SO_VERSION})
+install(TARGETS libmemcached EXPORT libmemcached)
+export(EXPORT libmemcached)
+install(EXPORT libmemcached DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake)
+
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ TYPE INCLUDE
+ FILES_MATCHING REGEX "(memcached|util)\\.h(pp)?"
+ PATTERN csl EXCLUDE
+ PATTERN memcached EXCLUDE
+ PATTERN util EXCLUDE
+ )
+
+# FIXME: dtrace
+
add_library(libmemcachedinternal STATIC
${LIBMEMCACHED_SOURCES})
add_library(memcachedinternal ALIAS libmemcachedinternal)
set_target_properties(libmemcachedinternal PROPERTIES LIBRARY_OUTPUT_NAME memcachedinternal)
-target_link_libraries(libmemcachedinternal libhashkit Threads::Threads ${CMAKE_DL_LIBS})
-target_include_directories(libmemcachedinternal PRIVATE ..)
+target_link_libraries(libmemcachedinternal libhashkit Threads::Threads ${LIBSASL_LIBRARIES} ${CMAKE_DL_LIBS})
+target_include_directories(libmemcachedinternal PRIVATE .. ${LIBSASL_INCLUDEDIR})
target_compile_definitions(libmemcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL)
{
memcached_instance_st* instance= memcached_instance_fetch(memc_ptr, 0);
-
- rc= memcached_vdo(instance, vector, 4, true);
+ rc= memcached_vdo(instance, vector, 2, true);
if (rc == MEMCACHED_SUCCESS)
{
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
- int send_length= snprintf(buffer, sizeof(buffer), "%u", verbosity);
+ int send_length= snprintf(buffer, sizeof(buffer), "verbosity %u\r\n", verbosity);
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE or send_length < 0)
{
return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
libmemcached_io_vector_st vector[]=
{
{ NULL, 0 },
- { memcached_literal_param("verbosity ") },
{ buffer, size_t(send_length) },
- { memcached_literal_param("\r\n") }
};
callbacks[0]= _set_verbosity;
--- /dev/null
+
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ TYPE INCLUDE
+ FILES_MATCHING REGEX "\\.h(pp)?$"
+ )
target_include_directories(libmemcachedutil PRIVATE ..)
target_compile_definitions(libmemcachedutil PRIVATE -DBUILDING_LIBMEMCACHED)
target_link_libraries(libmemcachedutil libmemcached Threads::Threads)
+
+set_target_properties(libmemcachedutil PROPERTIES SOVERSION ${LIBMEMCACHEDUTIL_SO_VERSION})
+install(TARGETS libmemcachedutil EXPORT libmemcachedutil)
+export(EXPORT libmemcachedutil)
+install(EXPORT libmemcachedutil DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake)
exec $@
")
if(UNIX)
- execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/libtool)
+ if (EXISTS ${CMAKE_BINARY_DIR}/libtool)
+ execute_process(COMMAND chmod +x ${CMAKE_BINARY_DIR}/libtool)
+ endif()
endif()
add_library(libtest STATIC
add_executable(core_count core_count.cc cpu.cc)
target_include_directories(core_count PRIVATE ..)
-add_executable(abort abort.cc)
add_executable(backtrace backtrace_test.cc ../libmemcached/backtrace.cc)
target_link_libraries(backtrace PRIVATE ${CMAKE_DL_LIBS})
target_include_directories(backtrace PRIVATE ..)
+++ /dev/null
-/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * Data Differential YATL (i.e. libtest) library
- *
- * Copyright (C) 2012 Data Differential, http://datadifferential.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * * The names of its contributors may not be used to endorse or
- * promote products derived from this software without specific prior
- * written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <cstdlib>
-
-int main(void)
-{
- if (1)
- {
- abort();
- }
-
- return 0;
-}
auto output = server->output();
if (output.first.size())
{
- err << "Server stdout:\n" << output.first << "\n";
+ err << "Server(" << server->port() << ") stdout:\n" << output.first << "\n";
}
if (output.second.size())
{
- err << "Server stderr:\n" << output.second << "\n";
+ err << "Server(" << server->port() << ") stderr:\n" << output.second << "\n";
}
}
throw;
auto output = server->output();
if (output.first.size())
{
- Out << "Server stdout:\n" << output.first << "\n";
+ Out << "Server(" << server->port() << ") stdout:\n" << output.first << "\n";
}
if (output.second.size())
{
- Out << "Server stderr:\n" << output.second << "\n";
+ Out << "Server(" << server->port() << ") stderr:\n" << output.second << "\n";
}
}
break;
+++ /dev/null
-# ===========================================================================
-# https//libmemcached.org/
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_LIBMEMCACHED, AX_LIBMEMCACHED_UTIL, AX_ENABLE_LIBMEMCACHED
-#
-# DESCRIPTION
-#
-# Checked for installation of libmemcached
-#
-# AC_SUBST(LIBMEMCACHED_CFLAGS)
-# AC_SUBST(LIBMEMCACHED_LDFLAGS)
-# AC_SUBST(LIBMEMCACHED_UTIL_LDFLAGS)
-#
-# NOTE: Implementation uses AC_CHECK_HEADER.
-#
-# LICENSE
-#
-# Copyright (C) 2012 Brian Aker
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#
-# * The names of its contributors may not be used to endorse or
-# promote products derived from this software without specific prior
-# written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#serial 1
-
-AC_DEFUN([AX_LIBMEMCACHED], [
- AC_CHECK_HEADER([libmemcached-1.0/memcached.h], [
- AC_CACHE_CHECK([check for -lmemcached], [ax_cv_libmemcached], [
- AC_LANG_PUSH([C])
- AX_SAVE_FLAGS
- LIBS="-lmemcached $LIBS"
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([#include <libmemcached-1.0/memcached.h>], [
- memcached_st *memc;
- memc= memcached(NULL, 0);
- memcached_free(memc);
- ])],
- [ax_cv_libmemcached=yes],
- [ax_cv_libmemcached=no],
- [AC_MSG_WARN([test program execution failed])])
- AC_LANG_POP
- AX_RESTORE_FLAGS
- ])
- ])
-
- AS_IF([test "x$ax_cv_libmemcached" = "xyes"], [
- AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [1], [Have libmemcached-1.0/memcached.h])
- ],[
- AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [0], [Have libmemcached-1.0/memcached.h])
- ])
- ])
-
- AC_DEFUN([AX_LIBMEMCACHED_UTIL], [
- AC_REQUIRE([AX_LIBMEMCACHED])
- AS_IF([test "$ax_cv_libmemcached" = yes], [
- AC_CHECK_HEADER([libmemcachedutil-1.0/util.h], [
- AC_CACHE_CHECK([check for -lmemcachedutil], [ax_cv_libmemcached_util], [
- AX_SAVE_FLAGS
- AC_LANG_PUSH([C])
- LIBS="-lmemcachedutil -lmemcached $LIBS"
- AC_RUN_IFELSE([
- AC_LANG_PROGRAM([#include <libmemcachedutil-1.0/util.h>], [
- memcached_pool_st *memc_pool= memcached_pool_create(NULL, 0, 3);
- memcached_pool_destroy(memc_pool);
- ])],
- [ax_cv_libmemcached_util=yes],
- [ax_cv_libmemcached_util=no],
- [AC_MSG_WARN([test program execution failed])])
- AC_LANG_POP
- AX_RESTORE_FLAGS
- ])
- ])
- ])
-
- AS_IF([test "x$ax_cv_libmemcached_util" = "xyes"], [
- AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [1], [Have libmemcachedutil-1.0/util.h])
- ],[
- AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [0], [Have libmemcachedutil-1.0/util.h])
- ])
- ])
-
-AC_DEFUN([_ENABLE_LIBMEMCACHED], [
- AC_REQUIRE([AX_LIBMEMCACHED_UTIL])
- AC_ARG_ENABLE([libmemcached],
- [AS_HELP_STRING([--disable-libmemcached],
- [Build with libmemcached support @<:@default=on@:>@])],
- [ax_enable_libmemcached="$enableval"],
- [ax_enable_libmemcached="yes"])
-
- AS_IF([test "x$ax_cv_libmemcached" != "xyes"], [
- ax_enable_libmemcached="not found"
- ])
-
- AS_IF([test "x$ax_enable_libmemcached" = "xyes"], [
- AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enable libmemcached support])
- LIBMEMCACHED_CFLAGS=
- AC_SUBST([LIBMEMCACHED_CFLAGS])
- LIBMEMCACHED_LDFLAGS="-lmemcached"
- AC_SUBST([LIBMEMCACHED_LDFLAGS])
- AS_IF([test "x$ax_cv_libmemcached_util" = "xyes"], [
- LIBMEMCACHED_UTIL_LDFLAGS="-lmemcached -lmemcachedutil"
- AC_SUBST([LIBMEMCACHED_UTIL_LDFLAGS])
- ])
- ],[
- AC_DEFINE([HAVE_LIBMEMCACHED], [0], [Enable libmemcached support])
- ])
- AM_CONDITIONAL(HAVE_LIBMEMCACHED, test "x${ax_enable_libmemcached}" = "xyes")
- ])
-
-AC_DEFUN([AX_ENABLE_LIBMEMCACHED], [ AC_REQUIRE([_ENABLE_LIBMEMCACHED]) ])
--- /dev/null
+
+install(FILES ax_libmemcached.m4
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/aclocal
+ )
+
+configure_file(example.cnf.in example.cnf @ONLY)
+install(FILES example.cnf
+ DESTINATION ${CMAKE_INSTALL_DATADIR}
+ )
+
+configure_file(libmemcached.pc.in libmemcached.pc @ONLY)
+install(FILES libmemcached.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ )
--- /dev/null
+# ===========================================================================
+# https//libmemcached.org/
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LIBMEMCACHED, AX_LIBMEMCACHED_UTIL, AX_ENABLE_LIBMEMCACHED
+#
+# DESCRIPTION
+#
+# Checked for installation of libmemcached
+#
+# AC_SUBST(LIBMEMCACHED_CFLAGS)
+# AC_SUBST(LIBMEMCACHED_LDFLAGS)
+# AC_SUBST(LIBMEMCACHED_UTIL_LDFLAGS)
+#
+# NOTE: Implementation uses AC_CHECK_HEADER.
+#
+# LICENSE
+#
+# Copyright (C) 2012 Brian Aker
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#
+# * The names of its contributors may not be used to endorse or
+# promote products derived from this software without specific prior
+# written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#serial 1
+
+AC_DEFUN([AX_LIBMEMCACHED], [
+ AC_CHECK_HEADER([libmemcached-1.0/memcached.h], [
+ AC_CACHE_CHECK([check for -lmemcached], [ax_cv_libmemcached], [
+ AC_LANG_PUSH([C])
+ AX_SAVE_FLAGS
+ LIBS="-lmemcached $LIBS"
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([#include <libmemcached-1.0/memcached.h>], [
+ memcached_st *memc;
+ memc= memcached(NULL, 0);
+ memcached_free(memc);
+ ])],
+ [ax_cv_libmemcached=yes],
+ [ax_cv_libmemcached=no],
+ [AC_MSG_WARN([test program execution failed])])
+ AC_LANG_POP
+ AX_RESTORE_FLAGS
+ ])
+ ])
+
+ AS_IF([test "x$ax_cv_libmemcached" = "xyes"], [
+ AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [1], [Have libmemcached-1.0/memcached.h])
+ ],[
+ AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H], [0], [Have libmemcached-1.0/memcached.h])
+ ])
+ ])
+
+ AC_DEFUN([AX_LIBMEMCACHED_UTIL], [
+ AC_REQUIRE([AX_LIBMEMCACHED])
+ AS_IF([test "$ax_cv_libmemcached" = yes], [
+ AC_CHECK_HEADER([libmemcachedutil-1.0/util.h], [
+ AC_CACHE_CHECK([check for -lmemcachedutil], [ax_cv_libmemcached_util], [
+ AX_SAVE_FLAGS
+ AC_LANG_PUSH([C])
+ LIBS="-lmemcachedutil -lmemcached $LIBS"
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([#include <libmemcachedutil-1.0/util.h>], [
+ memcached_pool_st *memc_pool= memcached_pool_create(NULL, 0, 3);
+ memcached_pool_destroy(memc_pool);
+ ])],
+ [ax_cv_libmemcached_util=yes],
+ [ax_cv_libmemcached_util=no],
+ [AC_MSG_WARN([test program execution failed])])
+ AC_LANG_POP
+ AX_RESTORE_FLAGS
+ ])
+ ])
+ ])
+
+ AS_IF([test "x$ax_cv_libmemcached_util" = "xyes"], [
+ AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [1], [Have libmemcachedutil-1.0/util.h])
+ ],[
+ AC_DEFINE([HAVE_LIBMEMCACHED_UTIL_H], [0], [Have libmemcachedutil-1.0/util.h])
+ ])
+ ])
+
+AC_DEFUN([_ENABLE_LIBMEMCACHED], [
+ AC_REQUIRE([AX_LIBMEMCACHED_UTIL])
+ AC_ARG_ENABLE([libmemcached],
+ [AS_HELP_STRING([--disable-libmemcached],
+ [Build with libmemcached support @<:@default=on@:>@])],
+ [ax_enable_libmemcached="$enableval"],
+ [ax_enable_libmemcached="yes"])
+
+ AS_IF([test "x$ax_cv_libmemcached" != "xyes"], [
+ ax_enable_libmemcached="not found"
+ ])
+
+ AS_IF([test "x$ax_enable_libmemcached" = "xyes"], [
+ AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enable libmemcached support])
+ LIBMEMCACHED_CFLAGS=
+ AC_SUBST([LIBMEMCACHED_CFLAGS])
+ LIBMEMCACHED_LDFLAGS="-lmemcached"
+ AC_SUBST([LIBMEMCACHED_LDFLAGS])
+ AS_IF([test "x$ax_cv_libmemcached_util" = "xyes"], [
+ LIBMEMCACHED_UTIL_LDFLAGS="-lmemcached -lmemcachedutil"
+ AC_SUBST([LIBMEMCACHED_UTIL_LDFLAGS])
+ ])
+ ],[
+ AC_DEFINE([HAVE_LIBMEMCACHED], [0], [Enable libmemcached support])
+ ])
+ AM_CONDITIONAL(HAVE_LIBMEMCACHED, test "x${ax_enable_libmemcached}" = "xyes")
+ ])
+
+AC_DEFUN([AX_ENABLE_LIBMEMCACHED], [ AC_REQUIRE([_ENABLE_LIBMEMCACHED]) ])
add_executable(testhashkit hashkit_functions.cc)
target_link_libraries(testhashkit PRIVATE libtest libhashkit)
target_include_directories(testhashkit PRIVATE ..)
-add_test(hashkit testhashkit)
+add_test(testhashkit testhashkit)
add_executable(hash_plus hash_plus.cc)
target_link_libraries(hash_plus PRIVATE libtest libhashkit)
target_include_directories(hash_plus PRIVATE ..)
-add_test(hashplus hash_plus)
+add_test(testhashplus hash_plus)
foreach(CLIENT IN LISTS CLIENTS)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CLIENT}.cc)
target_include_directories(internals PRIVATE ../..)
add_test(internals internals)
-add_executable(sasl
+add_executable(testsasl
basic.cc
debug.cc
deprecated.cc
fetch_all_results.cc
generate.cc
)
-target_link_libraries(sasl PRIVATE
+target_link_libraries(testsasl PRIVATE
libclient_utilities
libhashkit
libmemcached
libtest
Threads::Threads
)
-target_include_directories(sasl PRIVATE ../..)
-add_test(sasl sasl)
+target_include_directories(testsasl PRIVATE ../..)
+add_test(testsasl testsasl)
add_executable(atomsmasher atomsmasher.cc)
add_executable(testplus plus.cpp)
endforeach()
-find_library(LIBUUID uuid REQUIRED)
-
add_executable(testapp all_tests.cc)
add_executable(testsocket all_tests_socket.cc)
libmemcachedutil
libtest
Threads::Threads
- ${LIBUUID}
+ ${LIBUUID_LIBRARIES}
)
- target_include_directories(${TEST} PRIVATE ../..)
+ target_include_directories(${TEST} PRIVATE ../.. ${LIBUUID_INCLUDEDIR})
add_test(${TEST} ${TEST})
endforeach()
test_return_t test_verbosity(memcached_st *memc)
{
- memcached_verbosity(memc, 3);
+ test_compare(MEMCACHED_SUCCESS, memcached_verbosity(memc, 0));
return TEST_SUCCESS;
}
increment_request_id(&expected_ids[x]);
}
- test_compare(MEMCACHED_SUCCESS, memcached_verbosity(memc, 3));
+ test_compare(MEMCACHED_SUCCESS, memcached_verbosity(memc, 0));
return post_udp_op_check(memc, expected_ids);
}