summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorBoqun Feng <boqun.feng@gmail.com>2014-02-17 09:49:26 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-02-17 11:21:06 +0800
commit9acc4ce5d1e4d166f9fb916d3417ea52fbe16b70 (patch)
tree28ade8908be5414bd8a11de8eb1ba5f46c645d69 /backend
parent9b5573858a188eb9ab810171a1d2c7e8396fcb8e (diff)
GBE: fix terminfo library linkage
In some distros, the terminal libraries are divided into two libraries, one is tinfo and the other is ncurses, however, for other distros, there is only one single ncurses library with all functions. In order to link proper terminal library for LLVM, find_library macro in cmake can be used. In this patch, the tinfo is prefered, so that it wouldn't affect linkage behavior in distros with tinfo. Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'backend')
-rw-r--r--backend/src/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt
index 6db4a2a6..6e37d95d 100644
--- a/backend/src/CMakeLists.txt
+++ b/backend/src/CMakeLists.txt
@@ -189,7 +189,13 @@ target_link_libraries(
${CMAKE_DL_LIBS})
if (LLVM_VERSION_NODOT VERSION_EQUAL 34)
- target_link_libraries(gbe tinfo)
+ find_library(TERMINFO NAMES tinfo ncurses)
+ if (${TERMINFO} STREQUAL TERMINFO-NOTFOUND)
+ message(FATAL_ERROR "no libtinfo or libncurses is found in system")
+ else (${TERMINFO} STREQUAL TERMINFO-NOTFOUND)
+ target_link_libraries(gbe ${TERMINFO})
+ message(STATUS "use ${TERMINFO} as terminal control library")
+ endif (${TERMINFO} STREQUAL TERMINFO-NOTFOUND)
endif(LLVM_VERSION_NODOT VERSION_EQUAL 34)
link_directories (${LLVM_LIBRARY_DIR})