mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Use pkg-config to detect ncurses
Ncurses provides a pkg-config module which could be used here. If not available we fall back to the old detection heuristic. Signed-off-by: Justin Lecher <jlec@gentoo.org>
This commit is contained in:
parent
1c8662ea63
commit
1324d45491
1 changed files with 12 additions and 8 deletions
20
configure.ac
20
configure.ac
|
|
@ -36,16 +36,20 @@ AC_ARG_WITH([ncursesw],
|
||||||
AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library @<:@default@:>@]),
|
AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library @<:@default@:>@]),
|
||||||
[ncurses=ncursesw])
|
[ncurses=ncursesw])
|
||||||
if test "$ncurses" = "auto" -o "$ncurses" = "ncursesw"; then
|
if test "$ncurses" = "auto" -o "$ncurses" = "ncursesw"; then
|
||||||
AC_CHECK_LIB([ncursesw],
|
PKG_CHECK_MODULES([NCURSES], [ncursesw], [LIBS="$LIBS $NCURSES_LIBS"; ncurses=ncursesw],
|
||||||
[initscr],
|
[AC_CHECK_LIB([ncursesw],
|
||||||
[LIBS="$LIBS -lncursesw"; ncurses=ncursesw],
|
[initscr],
|
||||||
[ncurses=ncurses])
|
[LIBS="$LIBS -lncursesw"; ncurses=ncursesw],
|
||||||
|
[ncurses=ncurses])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
if test "$ncurses" = "ncurses"; then
|
if test "$ncurses" = "ncurses"; then
|
||||||
AC_CHECK_LIB([ncurses],
|
PKG_CHECK_MODULES([NCURSES], [ncurses], [LIBS="$LIBS $NCURSES_LIBS"],
|
||||||
[initscr],
|
[AC_CHECK_LIB([ncurses],
|
||||||
[LIBS="$LIBS -lncurses"],
|
[initscr],
|
||||||
[AC_MSG_ERROR(ncurses library is required)])
|
[LIBS="$LIBS -lncurses"],
|
||||||
|
[AC_MSG_ERROR(ncurses library is required)])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue