Use different function on different detection method to avoid caching

Using the same function for the same library causes AC_CHECK_LIB to use
cached results.
Since we change the detection method via different or no
ncurses(5|6)-config invocation, avoid such caching by using different
functions.
This commit is contained in:
Christian Göttsche 2021-01-28 17:40:33 +01:00 committed by cgzones
parent f27bab470b
commit fd8c0611af
1 changed files with 9 additions and 9 deletions

View File

@ -253,13 +253,13 @@ AC_ARG_ENABLE([unicode],
[],
[enable_unicode=yes])
if test "x$enable_unicode" = xyes; then
HTOP_CHECK_SCRIPT([ncursesw6], [waddnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
HTOP_CHECK_SCRIPT([ncursesw], [waddnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
HTOP_CHECK_SCRIPT([ncursesw], [waddnwstr], [HAVE_LIBNCURSESW], "ncursesw5-config",
HTOP_CHECK_SCRIPT([ncurses], [waddnwstr], [HAVE_LIBNCURSESW], "ncurses5-config",
HTOP_CHECK_LIB([ncursesw6], [waddnwstr], [HAVE_LIBNCURSESW],
HTOP_CHECK_LIB([ncursesw], [waddnwstr], [HAVE_LIBNCURSESW],
HTOP_CHECK_LIB([ncurses], [waddnwstr], [HAVE_LIBNCURSESW],
HTOP_CHECK_SCRIPT([ncursesw6], [waddwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
HTOP_CHECK_SCRIPT([ncursesw], [waddwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
HTOP_CHECK_SCRIPT([ncursesw], [wadd_wch], [HAVE_LIBNCURSESW], "ncursesw5-config",
HTOP_CHECK_SCRIPT([ncurses], [wadd_wch], [HAVE_LIBNCURSESW], "ncurses5-config",
HTOP_CHECK_LIB([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW],
HTOP_CHECK_LIB([ncursesw], [addnwstr], [HAVE_LIBNCURSESW],
HTOP_CHECK_LIB([ncurses], [addnwstr], [HAVE_LIBNCURSESW],
AC_MSG_ERROR([can not find required library libncursesw; you may want to use --disable-unicode])
)))))))
@ -275,8 +275,8 @@ if test "x$enable_unicode" = xyes; then
else
HTOP_CHECK_SCRIPT([ncurses6], [wnoutrefresh], [HAVE_LIBNCURSES], [ncurses6-config],
HTOP_CHECK_SCRIPT([ncurses], [wnoutrefresh], [HAVE_LIBNCURSES], [ncurses5-config],
HTOP_CHECK_LIB([ncurses6], [wnoutrefresh], [HAVE_LIBNCURSES],
HTOP_CHECK_LIB([ncurses], [wnoutrefresh], [HAVE_LIBNCURSES],
HTOP_CHECK_LIB([ncurses6], [doupdate], [HAVE_LIBNCURSES],
HTOP_CHECK_LIB([ncurses], [doupdate], [HAVE_LIBNCURSES],
AC_MSG_ERROR([can not find required library libncurses])
))))