diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-11-25 20:50:14 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-11-25 20:50:14 +0100 |
commit | 6be24a771a27a077d58d21a4a1f8db3fbd14cac4 (patch) | |
tree | 5a538cb0ef4ecb753cf304c7716cbaca09526a61 /storage/xtradb | |
parent | 74da49894f44a46ba086120bade714a5cc29992a (diff) | |
download | mariadb-git-6be24a771a27a077d58d21a4a1f8db3fbd14cac4.tar.gz |
Avoid mysqld dependency on libaio.so by linking xtradb statically to libaio.
A variable XTRADB_PREFER_STATIC_LIBAIO should be set to 1 (or TRUE
or ON) for static linking.
Even if mysqld can avoid dependency on shared libaio, shared libraries
libmysqld.so or ha_innodb.so cannot link without it.
Given that the patch primarily addresses building tar.gz package, and
shared libraries mentioned above deemed less important than mysqld
executable, we accept shared lib dependency on libaio.so
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/CMakeLists.txt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index b55f31e08d1..044a259c65d 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -23,12 +23,18 @@ INCLUDE(CheckCSourceRuns) IF(UNIX) IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") CHECK_INCLUDE_FILES (libaio.h HAVE_LIBAIO_H) - CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO) - ADD_DEFINITIONS("-DUNIV_LINUX -D_GNU_SOURCE=1") - IF(HAVE_LIBAIO_H AND HAVE_LIBAIO) - ADD_DEFINITIONS(-DLINUX_NATIVE_AIO=1) - LINK_LIBRARIES(aio) + IF (XTRADB_PREFER_STATIC_LIBAIO) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF() + FIND_LIBRARY(AIO_LIBRARY aio) + IF(AIO_LIBRARY) + CHECK_LIBRARY_EXISTS(${AIO_LIBRARY} io_queue_init "" HAVE_LIBAIO) + IF(HAVE_LIBAIO AND HAVE_LIBAIO_H) + ADD_DEFINITIONS(-DLINUX_NATIVE_AIO=1) + ENDIF() + LINK_LIBRARIES(${AIO_LIBRARY}) ENDIF() + ADD_DEFINITIONS("-DUNIV_LINUX -D_GNU_SOURCE=1") ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP*") ADD_DEFINITIONS("-DUNIV_HPUX -DUNIV_MUST_NOT_INLINE") ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "AIX") |