提交 8ddc5bf9 编写于 作者: S Samuel Thibault 提交者: Gerd Hoffmann

curses: Use cursesw instead of curses

Use ncursesw package instead of curses on non-mingw, and check a few
functions.
Also take cflags from pkg-config, since cursesw headers may be in a
separate, non-default directory.
Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
Message-id: 20161015195308.20473-3-samuel.thibault@ens-lyon.org
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 697783a7
......@@ -2917,27 +2917,38 @@ fi
# curses probe
if test "$curses" != "no" ; then
if test "$mingw32" = "yes" ; then
curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):"
curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
else
curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses"
curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):"
curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw"
fi
curses_found=no
cat > $TMPC << EOF
#include <locale.h>
#include <curses.h>
#include <wchar.h>
int main(void) {
const char *s = curses_version();
wchar_t wch = L'w';
setlocale(LC_ALL, "");
resize_term(0, 0);
addwstr(L"wide chars\n");
addnwstr(&wch, 1);
return s != 0;
}
EOF
IFS=:
for curses_lib in $curses_list; do
unset IFS
if compile_prog "" "$curses_lib" ; then
curses_found=yes
libs_softmmu="$curses_lib $libs_softmmu"
break
fi
for curses_inc in $curses_inc_list; do
for curses_lib in $curses_lib_list; do
unset IFS
if compile_prog "$curses_inc" "$curses_lib" ; then
curses_found=yes
QEMU_CFLAGS="$curses_inc $QEMU_CFLAGS"
libs_softmmu="$curses_lib $libs_softmmu"
break
fi
done
done
unset IFS
if test "$curses_found" = "yes" ; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册