mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 04:30:24 +02:00
24107: extra search for ncurses headers but dont use if library isnt ncurses
This commit is contained in:
parent
c41324baa0
commit
bb70fc6fe6
3 changed files with 43 additions and 11 deletions
|
@ -1,5 +1,11 @@
|
|||
2007-11-20 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 24107: configure.ac, Src/Modules/curses.c: yet more
|
||||
library fun: search for ncurses headers in other places,
|
||||
don't use ncursesw/ncurses.h if no multibyte support,
|
||||
don't use any ncurses headers if the terminal library
|
||||
isn't ncurses.
|
||||
|
||||
* 24104: INSTALL, configure.ac: don't search for ncurses if
|
||||
we can't find ncurses.h.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
17
configure.ac
17
configure.ac
|
@ -557,7 +557,8 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
|
|||
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 @@ AC_CHECK_LIB(m, pow)
|
|||
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 @@ else
|
|||
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 @@ dnl Where are curses key definitions located? Need for keypad() mode.
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue