diff options
author | Karel Zak | 2017-05-31 11:01:46 +0200 |
---|---|---|
committer | Karel Zak | 2017-05-31 11:01:46 +0200 |
commit | 3947ca4ca9737d830f54658ef353f5626c0d0282 (patch) | |
tree | 81f157f6f3b2ce751db3e943cce970e30377b78c | |
parent | cfdisk: fix compiler warning (diff) | |
download | kernel-qcow2-util-linux-3947ca4ca9737d830f54658ef353f5626c0d0282.tar.gz kernel-qcow2-util-linux-3947ca4ca9737d830f54658ef353f5626c0d0282.tar.xz kernel-qcow2-util-linux-3947ca4ca9737d830f54658ef353f5626c0d0282.zip |
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>
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | lib/colors.c | 15 | ||||
-rw-r--r-- | misc-utils/cal.c | 8 | ||||
-rw-r--r-- | term-utils/setterm.c | 8 | ||||
-rw-r--r-- | text-utils/more.c | 8 | ||||
-rw-r--r-- | text-utils/pg.c | 16 | ||||
-rw-r--r-- | text-utils/ul.c | 8 |
7 files changed, 37 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac index 8bb7fb71e..217d5dc5b 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) ]) diff --git a/lib/colors.c b/lib/colors.c index 72c5158cb..f82496d7a 100644 --- a/lib/colors.c +++ b/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 diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 2b16979db..604eb26a7 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -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 diff --git a/term-utils/setterm.c b/term-utils/setterm.c index 53826f954..9f60e5693 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -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 diff --git a/text-utils/more.c b/text-utils/more.c index cc53075f6..72dd96bf4 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -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" diff --git a/text-utils/pg.c b/text-utils/pg.c index bc485e2fe..1b9b8d7dd 100644 --- a/text-utils/pg.c +++ b/text-utils/pg.c @@ -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" diff --git a/text-utils/ul.c b/text-utils/ul.c index 3d1518cea..3986b4206 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -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" |