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?

-- 
SASANO Takayoshi (JG1UAA) <u...@mx5.nisiq.net>

Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/qemu/Makefile,v
retrieving revision 1.160
diff -u -p -r1.160 Makefile
--- Makefile    23 Apr 2017 13:24:17 -0000      1.160
+++ Makefile    24 Apr 2017 12:03:31 -0000
@@ -7,6 +7,7 @@ ONLY_FOR_ARCHS= aarch64 amd64 arm i386 p
 COMMENT=       multi system emulator
 
 DISTNAME=      qemu-2.9.0
+REVISION=      1
 CATEGORIES=    emulators
 MASTER_SITES=  http://wiki.qemu.org/download/
 EXTRACT_SUFX=  .tar.bz2
@@ -78,6 +79,7 @@ CONFIGURE_ARGS=       --prefix=${PREFIX} \
                --host-cc="${CC}" \
                --extra-cflags="${EXTRA_CFLAGS}" \
                --extra-ldflags="${EXTRA_LDFLAGS}" \
+               --enable-curses \
                --disable-bsd-user \
                --disable-gcrypt \
                --disable-smartcard \
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/emulators/qemu/patches/patch-configure,v
retrieving revision 1.51
diff -u -p -r1.51 patch-configure
--- patches/patch-configure     23 Apr 2017 13:24:17 -0000      1.51
+++ patches/patch-configure     24 Apr 2017 12:03:31 -0000
@@ -1,7 +1,64 @@
 $OpenBSD: patch-configure,v 1.51 2017/04/23 13:24:17 ajacoutot Exp $
---- configure.orig     Tue Apr 11 14:00:36 2017
-+++ configure  Tue Apr 11 21:38:09 2017
-@@ -4787,10 +4787,6 @@ fi
+--- configure.orig     Thu Apr 20 23:57:00 2017
++++ configure  Mon Apr 24 20:13:06 2017
+@@ -2976,54 +2976,8 @@ fi
+ ##########################################
+ # curses probe
+ if test "$curses" != "no" ; then
+-  if test "$mingw32" = "yes" ; then
+-    curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):"
+-    curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
+-  else
+-    curses_inc_list="$($pkg_config --cflags ncursesw 
2>/dev/null):-I/usr/include/ncursesw:"
+-    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);
+-  add_wch(WACS_DEGREE);
+-  return s != 0;
+-}
+-EOF
+-  IFS=:
+-  for curses_inc in $curses_inc_list; do
+-    IFS=:
+-    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
+-    if test "$curses_found" = yes ; then
+-      break
+-    fi
+-  done
+-  unset IFS
+-  if test "$curses_found" = "yes" ; then
+-    curses=yes
+-  else
+-    if test "$curses" = "yes" ; then
+-      feature_not_found "curses" "Install ncurses devel"
+-    fi
+-    curses=no
+-  fi
++  curses=yes
++  libs_softmmu="-lncurses $libs_softmmu"
+ fi
+ 
+ ##########################################
+@@ -4787,10 +4741,6 @@ fi
  if test "$gcov" = "yes" ; then
    CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
    LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
@@ -12,7 +69,7 @@ $OpenBSD: patch-configure,v 1.51 2017/04
  fi
  
  ##########################################
-@@ -4939,7 +4935,7 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a 
+@@ -4939,7 +4889,7 @@ if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a 
      # Different host OS linkers have different ideas about the name of the ELF
      # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd
      # variant; and Windows uses i386pe.

Reply via email to