From 6dc04f1329e79d5bb0934c33413c4b1af9431dfc Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Thu, 26 Apr 2001 15:48:14 +0000 Subject: 14123: don't include curses.h in termcap.c if term.h doesn't need it --- configure.in | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 7837fae2b..87d787320 100644 --- a/configure.in +++ b/configure.in @@ -515,18 +515,38 @@ case "$host_os" in 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) -- cgit 1.4.1