build-sys: ncurses headers cleanup
* assume ncursesw headers in ncursesw/ directory only * prefer long paths, <term.h> and <ncurses.h> should be last possibility * fix typos Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
c71f5a568f
commit
3947ca4ca9
|
@ -803,9 +803,8 @@ have_ncursesw_header=no
|
|||
AS_IF([test "x$with_ncursesw" != xno], [
|
||||
UL_NCURSES_CHECK([ncursesw])
|
||||
AS_IF([test "x$have_ncursesw" = xyes], [
|
||||
AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses.h],
|
||||
[have_ncursesw_header=yes])
|
||||
AC_CHECK_HEADERS([ncursesw/term.h term.h])
|
||||
AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes])
|
||||
AC_CHECK_HEADERS([ncursesw/term.h])
|
||||
AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no])
|
||||
])
|
||||
AS_IF([test "x$have_ncursesw" = xyes], [
|
||||
|
@ -830,8 +829,7 @@ AS_CASE([$with_ncurses:$build_widechar],
|
|||
AS_IF([test "x$have_ncursesw" = xno -a "x$with_ncurses" != xno ], [
|
||||
UL_NCURSES_CHECK([ncurses])
|
||||
AS_IF([test "x$have_ncurses" = xyes], [
|
||||
AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h],
|
||||
[have_ncurses_header=yes])
|
||||
AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h], [have_ncurses_header=yes])
|
||||
AC_CHECK_HEADERS([ncurses/term.h term.h])
|
||||
AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no])
|
||||
])
|
||||
|
|
15
lib/colors.c
15
lib/colors.c
|
@ -12,12 +12,19 @@
|
|||
#include <ctype.h>
|
||||
|
||||
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW)
|
||||
# ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
# if defined(HAVE_NCURSESW_NCURSES_H)
|
||||
# include <ncursesw/ncurses.h>
|
||||
# elif defined(HAVE_NCURSES_NCURSES_H)
|
||||
# include <ncurses/ncurses.h>
|
||||
# elif defined(HAVE_NCURSES_H)
|
||||
# include <ncurses.h>
|
||||
# endif
|
||||
# if defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
# elif defined(HAVE_NCURSES_TERM_H)
|
||||
# include <ncurses/term.h>
|
||||
# elif defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
# elif defined(HAVE_TERM_H)
|
||||
# include <term.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -80,12 +80,12 @@ static int has_term = 0;
|
|||
static const char *Senter = "", *Sexit = ""; /* enter and exit standout mode */
|
||||
|
||||
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW)
|
||||
# ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
# if defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
# elif defined(HAVE_NCURSES_TERM_H)
|
||||
# include <ncurses/term.h>
|
||||
# elif defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
# elif defined(HAVE_TERM_H)
|
||||
# include <term.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -60,12 +60,12 @@
|
|||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
#if defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_NCURSES_TERM_H)
|
||||
# include <ncurses/term.h>
|
||||
#elif defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_TERM_H)
|
||||
# include <term.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUX_TIOCL_H
|
||||
|
|
|
@ -190,12 +190,12 @@ static struct {
|
|||
} context, screen_start;
|
||||
extern char PC; /* pad character */
|
||||
|
||||
#ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
#if defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_NCURSES_TERM_H)
|
||||
# include <ncurses/term.h>
|
||||
#elif defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_TERM_H)
|
||||
# include <term.h>
|
||||
#endif
|
||||
|
||||
#define TERM_AUTO_RIGHT_MARGIN "am"
|
||||
|
|
|
@ -59,22 +59,20 @@
|
|||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#ifdef HAVE_NCURSESW_H
|
||||
# include <ncursesw.h>
|
||||
#elif defined(HAVE_NCURSES_H)
|
||||
# include <ncurses.h>
|
||||
#elif defined(HAVE_NCURSESW_NCURSES_H)
|
||||
#if defined(HAVE_NCURSESW_NCURSES_H)
|
||||
# include <ncursesw/ncurses.h>
|
||||
#elif defined(HAVE_NCURSES_NCURSES_H)
|
||||
# include <ncurses/ncurses.h>
|
||||
#elif defined(HAVE_NCURSES_H)
|
||||
# include <ncurses.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
#if defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_NCURSES_TERM_H)
|
||||
# include <ncurses/term.h>
|
||||
#elif defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_TERM_H)
|
||||
# include <term.h>
|
||||
#endif
|
||||
|
||||
#include "nls.h"
|
||||
|
|
|
@ -49,12 +49,12 @@
|
|||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
#if defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_NCURSES_TERM_H)
|
||||
# include <ncurses/term.h>
|
||||
#elif defined(HAVE_NCURSESW_TERM_H)
|
||||
# include <ncursesw/term.h>
|
||||
#elif defined(HAVE_TERM_H)
|
||||
# include <term.h>
|
||||
#endif
|
||||
|
||||
#include "nls.h"
|
||||
|
|
Loading…
Reference in New Issue