From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29253 invoked from network); 26 Apr 2001 15:43:34 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Apr 2001 15:43:34 -0000 Received: (qmail 28856 invoked by alias); 26 Apr 2001 15:43:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14123 Received: (qmail 28840 invoked from network); 26 Apr 2001 15:43:26 -0000 Date: Thu, 26 Apr 2001 11:43:16 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: avoid unnecessary curses.h include Message-ID: <20010426114315.A4344@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i This might help some situations. Index: acconfig.h =================================================================== RCS file: /cvsroot/zsh/zsh/acconfig.h,v retrieving revision 1.8 diff -u -r1.8 acconfig.h --- acconfig.h 2001/04/23 19:59:03 1.8 +++ acconfig.h 2001/04/26 15:35:02 @@ -317,3 +317,6 @@ /* Define if you have the terminfo strnames symbol. */ #undef HAVE_STRNAMES + +/* Define if term.h chokes without curses.h */ +#undef TERM_H_NEEDS_CURSES_H Index: configure.in =================================================================== RCS file: /cvsroot/zsh/zsh/configure.in,v retrieving revision 1.49 diff -u -r1.49 configure.in --- configure.in 2001/04/24 06:48:54 1.49 +++ configure.in 2001/04/26 15:35:03 @@ -515,18 +515,38 @@ esac AC_SEARCH_LIBS(tgetent, [$termcap_curses_order]) +AC_MSG_CHECKING(if term.h needs curses.h) +AC_TRY_COMPILE([#include ], [char **test = boolcodes;], boolcodes_with_only_term_h=yes, +boolcodes_with_only_term_h=no) +AC_TRY_COMPILE([#include +#include ], [char **test = boolcodes;], boolcodes_with_curses_h_and_term_h=yes, +boolcodes_with_curses_h_and_term_h=no) +if test "x$boolcodes_with_curses_h_and_term_h" = xyes && test "x$boolcodes_with_only_term_h" = xno; +then +AC_DEFINE(TERM_H_NEEDS_CURSES_H) +AC_MSG_RESULT(yes) +else +AC_MSG_RESULT(no) +fi + AC_MSG_CHECKING(if boolcodes is available) -AC_TRY_LINK([#include +AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H +#include +#endif #include ], [char **test = boolcodes;], AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes, boolcodes=no) AC_MSG_RESULT($boolcodes) AC_MSG_CHECKING(if numcodes is available) -AC_TRY_LINK([#include +AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H +#include +#endif #include ], [char **test = numcodes;], AC_DEFINE(HAVE_NUMCODES) numcodes=yes, numcodes=no) AC_MSG_RESULT($numcodes) AC_MSG_CHECKING(if strcodes is available) -AC_TRY_LINK([#include +AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H +#include +#endif #include ], [char **test = strcodes;], AC_DEFINE(HAVE_STRCODES) strcodes=yes, strcodes=no) AC_MSG_RESULT($strcodes) Index: Src/Modules/termcap.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v retrieving revision 1.10 diff -u -r1.10 termcap.c --- Src/Modules/termcap.c 2001/04/26 14:35:53 1.10 +++ Src/Modules/termcap.c 2001/04/26 15:35:04 @@ -55,7 +55,9 @@ # ifdef HAVE_TERMIO_H # include # endif -# include +# ifdef TERM_H_NEEDS_CURSES_H +# include +# endif # include # else # ifdef USES_TERMCAP_H