Skip to content

Commit

Permalink
build: Add friendly warning to advise user to install pkg-config
Browse files Browse the repository at this point in the history
If we can detect the presence of '*curses*.pc' files in some
pkg-config default search directories, print a warning message.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 committed Aug 21, 2024
1 parent 86c18f8 commit ce00fef
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,36 @@ esac

case ${htop_curses_capability}-$enable_unicode in
none-*|nonwide-yes)
if test "x$PKG_CONFIG" = x; then (
# Friendly warning to advise user to install pkg-config.
# The local variables get discarded when done.
list=/usr/lib/pkgconfig
if test "$cross_compiling" != yes; then
case $host_os in
darwin*)
list="/opt/homebrew/Library/Homebrew/os/mac/pkgconfig $list"
;;
freebsd*)
list="/usr/libdata/pkgconfig $list"
;;
netbsd*)
list="/usr/pkg/lib/pkgconfig $list"
;;
esac
fi
if test "x$host_alias" != x; then
list="/usr/lib/${host_alias}/pkgconfig $list"
fi

for d in $list; do
result=`find "$d" -name '*curses*.pc' 2>/dev/null | sed '1 q'`
if test "x$result" != x; then
AC_MSG_WARN([your system supports pkg-config; installing pkg-config is recommended before configuring htop])
break
fi
done
) fi

# OpenBSD and Solaris are known to not provide '*curses*.pc' files.
AC_MSG_RESULT([no curses information found through '*-config' utilities; will guess the linker flags])
for curses_name in $curses_pkg_names; do
Expand Down

0 comments on commit ce00fef

Please sign in to comment.