summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/terminfo.c23
-rw-r--r--Src/Modules/terminfo.mdd4
3 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a376bc0b..94f10a070 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-05  Clint Adams  <clint@zsh.org>
+
+	* 24160: Src/Modules/terminfo.c, Src/Modules/terminfo.mdd:
+	build terminfo module if ncursesw is present but curses.h is not.
+
 2007-12-05  Peter Stephenson  <pws@csr.com>
 
 	* unposted: Completion/Unix/Command/_ip: typo in "addr replace"
diff --git a/Src/Modules/terminfo.c b/Src/Modules/terminfo.c
index 63cbd2abc..15bd913f6 100644
--- a/Src/Modules/terminfo.c
+++ b/Src/Modules/terminfo.c
@@ -49,7 +49,28 @@
 #  undef offsetof
 # endif
 
-# include <curses.h>
+#ifdef ZSH_IGNORE_NCURSES
+# ifdef HAVE_CURSES_H
+#  include <curses.h>
+# endif
+#else
+# ifdef HAVE_NCURSESW_NCURSES_H
+#  include <ncursesw/ncurses.h>
+# else
+#  ifdef HAVE_NCURSES_NCURSES_H
+#   include <ncurses/ncurses.h>
+#  else
+#   ifdef HAVE_NCURSES_H
+#    include <ncurses.h>
+#   else
+#    ifdef HAVE_CURSES_H
+#     include <curses.h>
+#    endif
+#   endif
+#  endif
+# endif
+#endif
+
 # ifdef HAVE_TERM_H
 #  include <term.h>
 # endif
diff --git a/Src/Modules/terminfo.mdd b/Src/Modules/terminfo.mdd
index ee6d39f08..1d15a4912 100644
--- a/Src/Modules/terminfo.mdd
+++ b/Src/Modules/terminfo.mdd
@@ -1,6 +1,8 @@
 name=zsh/terminfo
 
-link='if test "x$ac_cv_func_tigetflag" = xyes -a "x$ac_cv_header_curses_h" = xyes; then
+link='if test "x$ac_cv_func_tigetflag" = xyes -a "x$ac_cv_header_curses_h" = xyes ||
+      test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes ||
+      test x$ac_cv_header_ncursesw_ncurses_h = xyes; then
           if test "x$zsh_cv_shared_tigetstr" = xyes; then
 	      echo either
 	  else