From 8d7ea40bfa6a267cf7ca44e05f2380fca8937ce6 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 27 Nov 2010 02:51:14 +0100 Subject: [PATCH] Fix detection of tgoto declaration: it needs curses.h to be included before term.h on Solaris Express 11 --- cmd-line-utils/libedit/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd-line-utils/libedit/CMakeLists.txt b/cmd-line-utils/libedit/CMakeLists.txt index b0e375dfcbd..76fcfc3204e 100644 --- a/cmd-line-utils/libedit/CMakeLists.txt +++ b/cmd-line-utils/libedit/CMakeLists.txt @@ -26,6 +26,21 @@ int main() tgoto(0,0,0); return 0; }" HAVE_DECL_TGOTO) +IF(NOT HAVE_DECL_TGOTO) + # On Solaris 11, term.h is broken, curses.h is also required. + CHECK_CXX_SOURCE_COMPILES(" + #include + #include + int main() + { + tgoto(0,0,0); + return 0; + }" HAVE_DECL_TGOTO2) + IF(HAVE_DECL_TGOTO2) + SET(HAVE_DECL_TGOTO 1 CACHE INTERNAL "" FORCE) + ENDIF() +ENDIF() + SET(CMAKE_REQUIRED_LIBRARIES)