zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: "Zsh Hackers' List" <zsh-workers@sunsite.dk>
Subject: Re: zsh-4.3.4-dev-2.tar.gz
Date: Tue, 20 Nov 2007 15:42:46 +0000	[thread overview]
Message-ID: <20071120154246.30388170@news01> (raw)
In-Reply-To: <4742F733.4030908@math.technion.ac.il>

On Tue, 20 Nov 2007 17:03:15 +0200
"Zvi Har'El" <rl@math.technion.ac.il> wrote:
> I believe ncurses.h is in the standard place, but not where it is
> configures looks for and the sources include it:
>...
> so, one should have
> #include <ncursesw/ncurses.h>

Aieee.

This looks for the header in more places and tries to be consistent about
multibyte support.

It also tries to be consistent the other way:  if we haven't found
the ncurses library, we shouldn't be using the headers.

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.79
diff -u -r1.79 configure.ac
--- configure.ac	20 Nov 2007 14:20:00 -0000	1.79
+++ configure.ac	20 Nov 2007 15:39:40 -0000
@@ -557,7 +557,8 @@
 		 unistd.h sys/capability.h \
 		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
 		 netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \
-		 sys/stropts.h iconv.h ncurses.h)
+		 sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \
+		 ncurses/ncurses.h)
 if test x$dynamic = xyes; then
   AC_CHECK_HEADERS(dlfcn.h)
   AC_CHECK_HEADERS(dl.h)
@@ -639,7 +640,7 @@
 dnl Various features of ncurses depend on having the right header
 dnl (the system's own curses.h may well not be good enough).
 dnl So don't search for ncurses unless we found the header.
-if test x$ac_cv_header_ncurses_h = xyes; then
+if 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
   ncursesw_test=ncursesw
   ncurses_test=ncurses
 else
@@ -719,6 +720,16 @@
 AC_MSG_RESULT(no)
 fi
 
+dnl If our terminal library is not ncurses, don't try including
+dnl any ncurses headers.
+AH_TEMPLATE([ZSH_IGNORE_NCURSES],
+[Define to 1 to ignore any ncurses library headers found on the system.])
+case $LIBS in
+  ncurses*) ;;
+  *)
+  AC_DEFINE(ZSH_IGNORE_NCURSES) ;;
+esac
+
 AC_MSG_CHECKING(if boolcodes is available)
 AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H
 #include <curses.h>
@@ -1381,7 +1392,7 @@
 AC_CACHE_CHECK(where curses key definitions are located, zsh_cv_path_curses_keys_h,
 [dnl This is an identical trick to errno.h, except we use ncurses.h
 dnl if we can.
-if test x$ac_cv_header_ncurses_h = xyes; then
+if 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
   echo "#include <ncurses.h>" >nametmp.c
 else
   if test x$ac_cv_header_curses_h = xyes; then
Index: Src/Modules/curses.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/curses.c,v
retrieving revision 1.40
diff -u -r1.40 curses.c
--- Src/Modules/curses.c	12 Nov 2007 12:16:52 -0000	1.40
+++ Src/Modules/curses.c	20 Nov 2007 15:39:41 -0000
@@ -32,20 +32,35 @@
 #include "curses.mdh"
 #include "curses.pro"
 
-#ifdef HAVE_NCURSES_H
-# include <ncurses.h>
-#else
-# ifdef HAVE_CURSES_H
-#  include <curses.h>
-# endif
-#endif
-
 #ifndef MULTIBYTE_SUPPORT
 # undef HAVE_GETCCHAR
 # undef HAVE_SETCCHAR
 # undef HAVE_WADDWSTR
 # undef HAVE_WGET_WCH
 # undef HAVE_WIN_WCH
+# undef HAVE_NCURSESW_NCURSES_H
+#endif
+
+#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_H
+#   include <ncurses.h>
+#  else
+#   ifdef HAVE_NCURSES_NCURSES_H
+#    include <ncurses/ncurses.h>
+#   else
+#    ifdef HAVE_CURSES_H
+#     include <curses.h>
+#    endif
+#   endif
+#  endif
+# endif
 #endif
 
 #ifdef HAVE_SETCCHAR

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  parent reply	other threads:[~2007-11-20 15:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11649.1195558694@csr.com>
     [not found] ` <4742E805.5030402@math.technion.ac.il>
2007-11-20 14:08   ` zsh-4.3.4-dev-2.tar.gz Peter Stephenson
     [not found] ` <4742DC87.5030901@math.technion.ac.il>
2007-11-20 14:14   ` zsh-4.3.4-dev-2.tar.gz Peter Stephenson
2007-11-20 15:03     ` zsh-4.3.4-dev-2.tar.gz Zvi Har'El
2007-11-20 15:11       ` zsh-4.3.4-dev-2.tar.gz Zvi Har'El
2007-11-20 15:42       ` Peter Stephenson [this message]
2007-11-20 15:59         ` zsh-4.3.4-dev-2.tar.gz Peter Stephenson
2007-11-21  9:40         ` zsh-4.3.4-dev-2.tar.gz Vincent Lefevre
2007-11-21  9:49           ` zsh-4.3.4-dev-2.tar.gz Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071120154246.30388170@news01 \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).