Wednesday, May 03, 2017

Re: curses support for qemu-2.9.0

On 2017/05/04 05:31, SASANO Takayoshi wrote:
> Hello,
>
> QEMU's -curses option is not enabled because configure script requires
> the information of ncurses by pkg-config.
>
> The diff specifies the place of ncurses library to enable QEMU's
> curses support.
>
> I sent the diff for qemu-2.8.1 ago, I re-write the patch for current
> version.
>
> ok or comment?

The pkg-config files don't matter, there is a fallback. Here is the
problem:

: #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);
> add_wch(WACS_DEGREE);
: return s != 0;
: }

Look in ncurses.h and you'll see that WACS_DEGREE is only defined if
_XOPEN_SOURCE_EXTENDED is set.

The simplest fix is probably to add "#define _XOPEN_SOURCE_EXTENDED"
to the test code, somewhere before curses.h is included. This would
be better than removing a whole bunch of lines from configure
because it reduces the chance of merge conflicts when the port
is updated.

No comments:

Post a Comment