Skip to content

Commit

Permalink
build: Improve "tinfo" library detection in configure
Browse files Browse the repository at this point in the history
Now it can guess the terminfo library name based on the ncurses
library file name. E.g. "-ltinfow" for the corresponding"-lncursesw".
If the guessed library name doesn't link, try the "-ltinfo" name then.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed Nov 2, 2024
1 parent a1f2175 commit 174c87d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,20 @@ none-*|nonwide-yes)
if htop_check_curses_capability "" "-l$curses_name"; then
break
fi
# For ncurses implementation, an extra "-ltinfo" or "-ltinfow"
# flag might be needed to link.
if test "x$enable_unicode" = xyes &&
htop_check_curses_capability "" "-l$curses_name -ltinfow"; then
break
fi
# For ncurses implementation, an extra terminfo library might be
# needed. Guess the terminfo library name based on the ncurses
# library file name (e.g. "-ltinfow" for "-lncursesw"), before
# trying the "-ltinfo" name.
tinfo_name=`echo x$curses_name | sed 's/^xncurses/tinfo/p; d'`
case x$tinfo_name in
x|xtinfo)
;;
*)
if htop_check_curses_capability "" "-l$curses_name -l$tinfo_name"; then
break
fi
;;
esac
if htop_check_curses_capability "" "-l$curses_name -ltinfo"; then
break
fi
Expand Down

0 comments on commit 174c87d

Please sign in to comment.