1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
From 51157b7416cd9d09cb21ee8cebf5750b48f44201 Mon Sep 17 00:00:00 2001
From: Carlos Santos <casantos@datacom.ind.br>
Date: Thu, 22 Jun 2017 20:53:55 -0300
Subject: [PATCH] Revert "build-sys: ncurses headers cleanup"
This reverts commit 3947ca4ca9737d830f54658ef353f5626c0d0282.
---
configure.ac | 8 +++++---
lib/colors.c | 15 ++++-----------
misc-utils/cal.c | 8 ++++----
term-utils/setterm.c | 8 ++++----
text-utils/more.c | 8 ++++----
text-utils/pg.c | 16 +++++++++-------
text-utils/ul.c | 8 ++++----
7 files changed, 34 insertions(+), 37 deletions(-)
diff --git a/configure.ac b/configure.ac
index 53d25b8ab..3512162df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -803,8 +803,9 @@ 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], [have_ncursesw_header=yes])
- AC_CHECK_HEADERS([ncursesw/term.h])
+ AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses.h],
+ [have_ncursesw_header=yes])
+ AC_CHECK_HEADERS([ncursesw/term.h term.h])
AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no])
])
AS_IF([test "x$have_ncursesw" = xyes], [
@@ -829,7 +830,8 @@ 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 f82496d7a..72c5158cb 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -12,19 +12,12 @@
#include <ctype.h>
#if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW)
-# 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>
+# ifdef HAVE_TERM_H
+# include <term.h>
# elif defined(HAVE_NCURSES_TERM_H)
# include <ncurses/term.h>
-# elif defined(HAVE_TERM_H)
-# include <term.h>
+# elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
# endif
#endif
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 604eb26a7..2b16979db 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)
-# if defined(HAVE_NCURSESW_TERM_H)
-# include <ncursesw/term.h>
+# ifdef HAVE_TERM_H
+# include <term.h>
# elif defined(HAVE_NCURSES_TERM_H)
# include <ncurses/term.h>
-# elif defined(HAVE_TERM_H)
-# include <term.h>
+# elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
# endif
#endif
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 9f60e5693..53826f954 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -60,12 +60,12 @@
#include <termios.h>
#include <unistd.h>
-#if defined(HAVE_NCURSESW_TERM_H)
-# include <ncursesw/term.h>
+#ifdef HAVE_TERM_H
+# include <term.h>
#elif defined(HAVE_NCURSES_TERM_H)
# include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-# include <term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
#endif
#ifdef HAVE_LINUX_TIOCL_H
diff --git a/text-utils/more.c b/text-utils/more.c
index 72dd96bf4..cc53075f6 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 */
-#if defined(HAVE_NCURSESW_TERM_H)
-# include <ncursesw/term.h>
+#ifdef HAVE_TERM_H
+# include <term.h>
#elif defined(HAVE_NCURSES_TERM_H)
# include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-# include <term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
#endif
#define TERM_AUTO_RIGHT_MARGIN "am"
diff --git a/text-utils/pg.c b/text-utils/pg.c
index 1b9b8d7dd..bc485e2fe 100644
--- a/text-utils/pg.c
+++ b/text-utils/pg.c
@@ -59,20 +59,22 @@
#include <signal.h>
#include <setjmp.h>
-#if defined(HAVE_NCURSESW_NCURSES_H)
+#ifdef HAVE_NCURSESW_H
+# include <ncursesw.h>
+#elif defined(HAVE_NCURSES_H)
+# include <ncurses.h>
+#elif 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>
+#ifdef HAVE_TERM_H
+# include <term.h>
#elif defined(HAVE_NCURSES_TERM_H)
# include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-# include <term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
#endif
#include "nls.h"
diff --git a/text-utils/ul.c b/text-utils/ul.c
index 3986b4206..3d1518cea 100644
--- a/text-utils/ul.c
+++ b/text-utils/ul.c
@@ -49,12 +49,12 @@
#include <errno.h>
#include <getopt.h>
-#if defined(HAVE_NCURSESW_TERM_H)
-# include <ncursesw/term.h>
+#ifdef HAVE_TERM_H
+# include <term.h>
#elif defined(HAVE_NCURSES_TERM_H)
# include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-# include <term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
#endif
#include "nls.h"
--
2.11.0
|