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: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161015195308.20473-3-samuel.thibault@ens-lyon.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
697783a736
commit
8ddc5bf9e5
29
configure
vendored
29
configure
vendored
@ -2917,27 +2917,38 @@ fi
|
|||||||
# curses probe
|
# curses probe
|
||||||
if test "$curses" != "no" ; then
|
if test "$curses" != "no" ; then
|
||||||
if test "$mingw32" = "yes" ; 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
|
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
|
fi
|
||||||
curses_found=no
|
curses_found=no
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
|
#include <locale.h>
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
|
#include <wchar.h>
|
||||||
int main(void) {
|
int main(void) {
|
||||||
const char *s = curses_version();
|
const char *s = curses_version();
|
||||||
|
wchar_t wch = L'w';
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
resize_term(0, 0);
|
resize_term(0, 0);
|
||||||
|
addwstr(L"wide chars\n");
|
||||||
|
addnwstr(&wch, 1);
|
||||||
return s != 0;
|
return s != 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
IFS=:
|
IFS=:
|
||||||
for curses_lib in $curses_list; do
|
for curses_inc in $curses_inc_list; do
|
||||||
unset IFS
|
for curses_lib in $curses_lib_list; do
|
||||||
if compile_prog "" "$curses_lib" ; then
|
unset IFS
|
||||||
curses_found=yes
|
if compile_prog "$curses_inc" "$curses_lib" ; then
|
||||||
libs_softmmu="$curses_lib $libs_softmmu"
|
curses_found=yes
|
||||||
break
|
QEMU_CFLAGS="$curses_inc $QEMU_CFLAGS"
|
||||||
fi
|
libs_softmmu="$curses_lib $libs_softmmu"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
if test "$curses_found" = "yes" ; then
|
if test "$curses_found" = "yes" ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user