diff options
author | Vladislav Vaintroub <vvaintroub@fe> | 2009-12-19 22:15:10 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@fe> | 2009-12-19 22:15:10 +0100 |
commit | 728c437a85b120db5e6c02fd801ab116d3eaccb2 (patch) | |
tree | 4bd2393cb8cd2c6bf70130ea12d6e867ca0e8701 /cmake/readline.cmake | |
parent | 3de04825514e4dc3fd6f1a8f5eb18a280f817699 (diff) | |
download | mariadb-git-728c437a85b120db5e6c02fd801ab116d3eaccb2.tar.gz |
Fix build with LDFLAGS=--Wl,--as-needed on Linux
Diffstat (limited to 'cmake/readline.cmake')
-rw-r--r-- | cmake/readline.cmake | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cmake/readline.cmake b/cmake/readline.cmake index 44be0c2196e..4f0cb4a30c7 100644 --- a/cmake/readline.cmake +++ b/cmake/readline.cmake @@ -79,7 +79,7 @@ MACRO (MYSQL_CHECK_MULTIBYTE) ENDMACRO() MACRO (FIND_CURSES) - INCLUDE (FindCurses) + FIND_PACKAGE(Curses) MARK_AS_ADVANCED(CURSES_CURSES_H_PATH CURSES_FORM_LIBRARY CURSES_HAVE_CURSES_H) IF(NOT CURSES_FOUND) SET(ERRORMSG "Curses library not found. Please install appropriate package, @@ -104,6 +104,18 @@ MACRO (FIND_CURSES) SET(CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE) SET(CURSES_CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE) ENDIF() + + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + # -Wl,--as-needed breaks linking with -lcurses, e.g on Fedora + # Lower-level libcurses calls are exposed by libtinfo + CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} tputs "" HAVE_TPUTS_IN_CURSES) + IF(NOT HAVE_TPUTS_IN_CURSES) + CHECK_LIBRARY_EXISTS(tinfo tputs "" HAVE_TPUTS_IN_TINFO) + IF(HAVE_TPUTS_IN_TINFO) + SET(CURSES_LIBRARY tinfo) + ENDIF() + ENDIF() + ENDIF() ENDMACRO() MACRO (MYSQL_USE_BUNDLED_READLINE) |