From b458299bf148a332cbda2c16223a303366c9d77d Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Tue, 29 Oct 2024 07:59:08 +0800 Subject: [PATCH] build: Don't test "stdscr" with linking with libtinfo When ncurses is compiled with reentrant support, the "stdscr" may be only available as a macro and not a symbol for direct linking. We can check for "stdscr" only after the curses headers are included. For now we can remove the "stdscr" test when checking for keypad() function. Signed-off-by: Kang-Che Sung --- configure.ac | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index f0b712749..f53917721 100644 --- a/configure.ac +++ b/configure.ac @@ -450,18 +450,17 @@ htop_check_curses_capability () { # At this point we have not checked the name of curses header, so # use forward declaration for the linking tests below. - # htop uses keypad() and "stdscr", but for ncurses implementation, - # the symbols are in "-ltinfo" and not "-lncurses". + # htop uses keypad(), but for ncurses implementation, the symbol is + # in "-ltinfo" and not "-lncurses". # Check "-ltinfo" symbols first, as libncurses might require # explicit "-ltinfo" to link (for internal dependency). AC_MSG_CHECKING([for keypad in $htop_msg_linker_flags]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -/* extern WINDOW* stdscr; */ /* int keypad(WINDOW* win, bool enable); */ -extern void* stdscr; int keypad(void* win, int enable); ]], [[ -keypad(stdscr, 0); +static char dummy; +keypad((void*)&dummy, 0); ]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)