summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@sun.com>2010-11-27 02:51:14 +0100
committerVladislav Vaintroub <wlad@sun.com>2010-11-27 02:51:14 +0100
commita97677944b96f6a38b351dae4803dc5c1ee4f158 (patch)
tree4c8b7065b1a462cef375d12671afd1f9184e77cf /cmd-line-utils
parentd6ad6b3dc10178928caf2c976734c69b8826dcf9 (diff)
downloadmariadb-git-a97677944b96f6a38b351dae4803dc5c1ee4f158.tar.gz
Fix detection of tgoto declaration:
it needs curses.h to be included before term.h on Solaris Express 11
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/libedit/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
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 <curses.h>
+ #include <term.h>
+ 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)