From 2ca42b2025cceaabd64889aa3b932195e8d5720c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 13 Mar 2008 11:10:59 +0000 Subject: 24705: rationalise curses and term headers even more --- Src/Modules/curses.c | 22 ++-------------------- Src/Modules/termcap.c | 8 ++++---- Src/Modules/terminfo.c | 28 +++++----------------------- Src/zsh.mdd | 19 ++++++++++++++++++- 4 files changed, 29 insertions(+), 48 deletions(-) (limited to 'Src') diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c index 0649f5750..df8a9cdc6 100644 --- a/Src/Modules/curses.c +++ b/Src/Modules/curses.c @@ -41,26 +41,8 @@ # undef HAVE_NCURSESW_NCURSES_H #endif -#ifdef ZSH_IGNORE_NCURSES -# ifdef HAVE_CURSES_H -# include -# endif -#else -# ifdef HAVE_NCURSESW_NCURSES_H -# include -# else -# ifdef HAVE_NCURSES_NCURSES_H -# include -# else -# ifdef HAVE_NCURSES_H -# include -# else -# ifdef HAVE_CURSES_H -# include -# endif -# endif -# endif -# endif +#ifdef ZSH_HAVE_CURSES_H +# include "../zshcurses.h" #endif #ifdef HAVE_SETCCHAR diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c index 351324a68..776351cf6 100644 --- a/Src/Modules/termcap.c +++ b/Src/Modules/termcap.c @@ -36,7 +36,7 @@ #include "../../config.h" #ifdef HAVE_TGETENT -# if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) +# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H) # define USES_TERM_H 1 # else # ifdef HAVE_TERMCAP_H @@ -54,10 +54,10 @@ # ifdef HAVE_TERMIO_H # include # endif -# ifdef TERM_H_NEEDS_CURSES_H -# include +# ifdef ZSH_HAVE_CURSES_H +# include "../zshcurses.h" # endif -# include +# include "../zshterm.h" # else # ifdef USES_TERMCAP_H # include diff --git a/Src/Modules/terminfo.c b/Src/Modules/terminfo.c index 1038c243e..db9a6c053 100644 --- a/Src/Modules/terminfo.c +++ b/Src/Modules/terminfo.c @@ -30,7 +30,7 @@ #define USES_TERM_H 1 #include "terminfo.mdh" -#if defined(HAVE_TIGETFLAG) && (defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H) || defined(HAVE_NCURSES_NCURSES_H) || defined(HAVE_NCURSESW_NCURSES_H)) +#if defined(HAVE_TIGETFLAG) && defined(ZSH_HAVE_CURSES_H) # define USE_TERMINFO_MODULE 1 #else # undef USE_TERMINFO_MODULE @@ -49,30 +49,12 @@ # undef offsetof # endif -#ifdef ZSH_IGNORE_NCURSES -# ifdef HAVE_CURSES_H -# include -# endif -#else -# ifdef HAVE_NCURSESW_NCURSES_H -# include -# else -# ifdef HAVE_NCURSES_NCURSES_H -# include -# else -# ifdef HAVE_NCURSES_H -# include -# else -# ifdef HAVE_CURSES_H -# include -# endif -# endif -# endif -# endif +#ifdef ZSH_HAVE_CURSES_H +# include "../zshcurses.h" #endif -# ifdef HAVE_TERM_H -# include +# ifdef ZSH_HAVE_TERM_H +# include "../zshterm.h" # endif /* echoti: output a terminfo capability */ diff --git a/Src/zsh.mdd b/Src/zsh.mdd index 8aef628c5..ab36ec8d7 100644 --- a/Src/zsh.mdd +++ b/Src/zsh.mdd @@ -33,9 +33,26 @@ init.o: bltinmods.list zshpaths.h zshxmods.h init.o params.o parse.o: version.h -version.h: $(sdir_top)/Config/version.mk +# The main shell doesn't currently need zshcurses.h and zshterm.h, +# but make sure these are built with the headers. +# If it did need need them they would be in headers at the top instead. +version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h echo '#define ZSH_VERSION "'$(VERSION)'"' > $@ +zshcurses.h: ../config.h + @if test x$(ZSH_CURSES_H) != x; then \ + echo "#include <$(ZSH_CURSES_H)>" >zshcurses.h; \ + else \ + echo >zshcurses.h; \ + fi + +zshterm.h: ../config.h + @if test x$(ZSH_TERM_H) != x; then \ + echo "#include <$(ZSH_TERM_H)>" >zshterm.h; \ + else \ + echo >zshterm.h; \ + fi + zshpaths.h: Makemod $(CONFIG_INCS) @echo '#define MODULE_DIR "'$(MODDIR)'"' > zshpaths.h.tmp @if test x$(sitescriptdir) != xno; then \ -- cgit 1.4.1