diff --git a/configure.ac b/configure.ac index 7ebf57ce8..ac4b1ac22 100644 --- a/configure.ac +++ b/configure.ac @@ -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