Commit 657e8675 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix portability problems

- Solaris readline always needs curses
- -rdynamic is not portable, replaced by SET_TARGET_PROPERTIES(...ENABLE_EXPORTS)
parent d8751d28
......@@ -31,7 +31,7 @@ MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc
TARGET_LINK_LIBRARIES(mysql mysqlclient)
IF(UNIX)
TARGET_LINK_LIBRARIES(mysql ${MY_READLINE_LIBRARY})
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
SET_TARGET_PROPERTIES(mysql PROPERTIES ENABLE_EXPORTS TRUE)
ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
......
......@@ -116,7 +116,6 @@ MACRO (MYSQL_USE_BUNDLED_READLINE)
SET(HAVE_HIST_ENTRY)
SET(READLINE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/cmd-line-utils)
SET(READLINE_LIBRARY readline)
FIND_CURSES()
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/cmd-line-utils/readline)
ENDMACRO()
......@@ -126,10 +125,10 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
SET(CMAKE_REQUIRES_LIBRARIES ${READLINE_LIBRARY})
SET(CMAKE_REQUIRES_LIBRARIES ${READLINE_LIBRARY} ${CURSES_LIBRARY})
IF(READLINE_LIBRARY AND READLINE_INCLUDE_DIR)
SET(CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARY})
SET(CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARY} ${CURSES_LIBRARY})
CHECK_CXX_SOURCE_COMPILES("
#include <stdio.h>
#include <readline/readline.h>
......@@ -175,6 +174,7 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
ENDIF(READLINE_V5)
ENDIF(NEW_READLINE_INTERFACE)
ENDIF()
SET(CMAKE_REQUIRES_LIBRARIES )
ENDMACRO()
MACRO (MYSQL_FIND_SYSTEM_LIBEDIT)
......@@ -197,6 +197,7 @@ MACRO (MYSQL_FIND_SYSTEM_LIBEDIT)
LIBEDIT_INTERFACE)
SET(USE_LIBEDIT_INTERFACE ${LIBEDIT_INTERFACE})
ENDIF()
SET(CMAKE_REQUIRES_LIBRARIES)
ENDMACRO()
......@@ -204,6 +205,7 @@ MACRO (MYSQL_CHECK_READLINE)
IF (NOT WIN32)
MYSQL_CHECK_MULTIBYTE()
SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline")
FIND_CURSES()
IF(WITH_READLINE)
MYSQL_USE_BUNDLED_READLINE()
......@@ -217,7 +219,7 @@ MACRO (MYSQL_CHECK_READLINE)
ENDIF()
ENDIF()
SET(MY_READLINE_INCLUDE_DIR ${READLINE_INCLUDE_DIR})
SET(MY_READLINE_LIBRARY ${READLINE_LIBRARY})
SET(MY_READLINE_LIBRARY ${READLINE_LIBRARY} ${CURSES_LIBRARY})
ENDIF(NOT WIN32)
ENDMACRO()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment