If ncurses*-config script is present, use it in configure

when testing for ncurses library. See #198.
This commit is contained in:
Hisham Muhammad 2015-12-06 19:06:23 -02:00
parent 96c929f82b
commit c23770245e
1 changed files with 9 additions and 2 deletions

View File

@ -147,15 +147,22 @@ fi
# HTOP_CHECK_NCURSES_LIBRARY(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART) # HTOP_CHECK_NCURSES_LIBRARY(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART)
m4_define([HTOP_CHECK_NCURSES_LIBRARY], m4_define([HTOP_CHECK_NCURSES_LIBRARY],
[ [
config_script=$([$4] --libs 2> /dev/null)
save_LDFLAGS="$LDFLAGS"
if test ! "x$config_script" = x; then
LDFLAGS="$config_script $LDFLAGS"
fi
AC_CHECK_LIB([$1], [$2], [ AC_CHECK_LIB([$1], [$2], [
AC_DEFINE([$3], 1, [The library is present.]) AC_DEFINE([$3], 1, [The library is present.])
config_script=$([$4] --libs 2> /dev/null)
if test ! "x$config_script" = x; then if test ! "x$config_script" = x; then
LIBS="$config_script $LIBS " LIBS="$config_script $LIBS "
else else
LIBS="-l[$1] $LIBS " LIBS="-l[$1] $LIBS "
fi fi
], [$5]) LDFLAGS="$save_LDFLAGS"
], [
LDFLAGS="$save_LDFLAGS"
$5])
]) ])
AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes") AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes")