Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
tarantool-devel packages).
* MySQL 5.1 header files (libmysqlclient-dev package).
* OpenSSL development package.
* libucontext (only for Alpine).

If you prefer to install the connector using a system package manager you don't
need to manually install dependencies.
Expand Down
21 changes: 21 additions & 0 deletions mysql/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
add_library(driver SHARED driver.c)
add_dependencies(driver mariadbclient)
target_link_libraries(driver mariadbclient)

# Check 'makecontext', 'getcontext', 'setcontext' and 'swapcontext' symbols.

include(CheckLibraryExists)
check_library_exists(c makecontext "" HAVE_UCONTEXT_LIBC)

if (NOT HAVE_UCONTEXT_LIBC)
# Search for libucontext.
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(libucontext IMPORTED_TARGET libucontext)
if (libucontext_FOUND)
target_link_libraries(driver PkgConfig::libucontext)
else()
message(FATAL_ERROR "Missing 'makecontext', 'getcontext', 'setcontext' or 'swapcontext' symbol in libc and no libucontext found.")
endif()
else()
message(FATAL_ERROR "PkgConfig is required to link libucontext.")
endif()
endif()

set_target_properties(driver PROPERTIES PREFIX "" OUTPUT_NAME "driver")
install(TARGETS driver LIBRARY DESTINATION ${TARANTOOL_INSTALL_LIBDIR}/mysql)
install(FILES init.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR}/mysql)