summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahil Siddiq <icegambit91@gmail.com>2023-02-07 22:56:57 +0530
committerBenBE <BenBE@geshi.org>2023-05-22 12:07:16 +0200
commit3fc286257d3f40733d73722a0ea6b2ad1fd1a550 (patch)
tree494fa12d41aed8b6823209c467fabe2413e376f9
parentf77ea80b8c6aa65329a66b9bcf3d1fa665fe01cd (diff)
Changes in configuration to identify location of 'term.h'
* ProvideTerm.h: New file * Update configure.ac to detect term.h * Update iwyu/htop.imp * Add ProvideTerm.h to Makefile Co-authored-by: BenBE <BenBE@geshi.org>
-rw-r--r--Makefile.am1
-rw-r--r--ProvideTerm.h24
-rw-r--r--configure.ac12
-rw-r--r--iwyu/htop.imp4
4 files changed, 40 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index b25d1cb8..e36994c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -139,6 +139,7 @@ myhtopheaders = \
ProcessList.h \
ProcessLocksScreen.h \
ProvideCurses.h \
+ ProvideTerm.h \
RichString.h \
Scheduling.h \
ScreenManager.h \
diff --git a/ProvideTerm.h b/ProvideTerm.h
new file mode 100644
index 00000000..0e07b1c4
--- /dev/null
+++ b/ProvideTerm.h
@@ -0,0 +1,24 @@
+#ifndef HEADER_ProvideTerm
+#define HEADER_ProvideTerm
+/*
+htop - Filename.h
+(C) 2023 htop dev team
+Released under the GNU GPLv2+, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h" // IWYU pragma: keep
+
+// IWYU pragma: begin_exports
+
+#if defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+
+// IWYU pragma: end_exports
+
+#endif // HEADER_ProvideTerm
diff --git a/configure.ac b/configure.ac
index 36f25b22..a3cc572f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -360,6 +360,11 @@ if test "x$enable_unicode" = xyes; then
[AC_CHECK_HEADERS([ncurses.h], [],
[AC_MSG_ERROR([can not find required ncurses header file])])])])])
+ AC_CHECK_HEADERS([ncursesw/term.h], [],
+ [AC_CHECK_HEADERS([ncurses/term.h], [],
+ [AC_CHECK_HEADERS([term.h], [],
+ [AC_MSG_ERROR([can not find required term header file])])])])
+
# check if additional linker flags are needed for keypad(3)
# (at this point we already link against a working ncurses library with wide character support)
AC_SEARCH_LIBS([keypad], [tinfow tinfo])
@@ -375,13 +380,18 @@ else
AC_CHECK_HEADERS([curses.h], [],
[AC_CHECK_HEADERS([ncurses/curses.h], [],
[AC_CHECK_HEADERS([ncurses/ncurses.h], [],
- [AC_CHECK_HEADERS([ncurses.h] ,[],
+ [AC_CHECK_HEADERS([ncurses.h], [],
[AC_MSG_ERROR([can not find required ncurses header file])])])])])
+ AC_CHECK_HEADERS([ncurses/term.h], [],
+ [AC_CHECK_HEADERS([term.h], [],
+ [AC_MSG_ERROR([can not find required term header file])])])
+
# check if additional linker flags are needed for keypad(3)
# (at this point we already link against a working ncurses library)
AC_SEARCH_LIBS([keypad], [tinfo])
fi
+
if test "$enable_static" = yes; then
AC_SEARCH_LIBS([Gpm_GetEvent], [gpm])
fi
diff --git a/iwyu/htop.imp b/iwyu/htop.imp
index 1416d743..5e87cdbf 100644
--- a/iwyu/htop.imp
+++ b/iwyu/htop.imp
@@ -4,6 +4,10 @@
{ include: ["<ncurses/curses.h>", "private", "\"ProvideCurses.h\"", "public"] },
{ include: ["<ncurses/ncurses.h>", "private", "\"ProvideCurses.h\"", "public"] },
+ { include: ["<term.h>", "private", "\"ProvideTerm.h\"", "public"] },
+ { include: ["<ncurses/term.h>", "private", "\"ProvideTerm.h\"", "public"] },
+ { include: ["<ncursesw/term.h>", "private", "\"ProvideTerm.h\"", "public"] },
+
{ include: ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
{ include: ["<bits/getopt_core.h>", "private", "<unistd.h>", "public"] },

© 2014-2024 Faster IT GmbH | imprint | privacy policy