Skip to content

Commit

Permalink
build: Don't test "stdscr" with linking with libtinfo
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Explorer09 authored and BenBE committed Dec 14, 2024
1 parent 76e7dd4 commit b458299
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b458299

Please sign in to comment.