Recognize NetBSD's terminfo implementation.
[oota-llvm.git] / cmake / config-ix.cmake
index 85c4d81255f3d37181b65e6135a3b0bf042cc6e3..93046fe1b51d9c6be999742a0c40de9c8106e8e1 100755 (executable)
@@ -97,6 +97,20 @@ if( NOT PURE_WINDOWS )
   else()
     set(HAVE_LIBZ 0)
   endif()
+  if(LLVM_ENABLE_TERMINFO)
+    set(HAVE_TERMINFO 0)
+    foreach(library tinfo terminfo curses ncurses ncursesw)
+      string(TOUPPER ${library} library_suffix)
+      check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
+      if(HAVE_TERMINFO_${library_suffix})
+        set(HAVE_TERMINFO 1)
+        set(TERMINFO_LIBS "${library}")
+        break()
+      endif()
+    endforeach()
+  else()
+    set(HAVE_TERMINFO 0)
+  endif()
 endif()
 
 # function checks