From patchwork Sat Oct 15 19:53:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 9377927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BED75607FD for ; Sat, 15 Oct 2016 20:20:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B12A72932D for ; Sat, 15 Oct 2016 20:20:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A43042947B; Sat, 15 Oct 2016 20:20:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C2732932D for ; Sat, 15 Oct 2016 20:20:06 +0000 (UTC) Received: from localhost ([::1]:53102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvVR7-0001iI-B7 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 15 Oct 2016 16:20:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvVQ2-0001Ba-7U for qemu-devel@nongnu.org; Sat, 15 Oct 2016 16:18:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvVQ1-0004SG-11 for qemu-devel@nongnu.org; Sat, 15 Oct 2016 16:18:58 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:35864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvVQ0-0004S7-RM for qemu-devel@nongnu.org; Sat, 15 Oct 2016 16:18:56 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 9454C9D54; Sat, 15 Oct 2016 22:18:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F8kzWzX9wQ7l; Sat, 15 Oct 2016 22:18:56 +0200 (CEST) Received: from var.youpi.perso.aquilenet.fr (unknown [IPv6:2a01:cb19:181:c200:3602:86ff:fe2c:6a19]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 009909CFD; Sat, 15 Oct 2016 22:18:56 +0200 (CEST) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.87) (envelope-from ) id 1bvV13-0005L0-Nv; Sat, 15 Oct 2016 21:53:09 +0200 From: Samuel Thibault To: qemu-devel@nongnu.org, kraxel@redhat.com, pbonzini@redhat.com, berrange@redhat.com, peter.maydell@linaro.org, mjt@tls.msk.ru Date: Sat, 15 Oct 2016 21:53:05 +0200 Message-Id: <20161015195308.20473-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161015195308.20473-1-samuel.thibault@ens-lyon.org> References: <20161015195308.20473-1-samuel.thibault@ens-lyon.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 141.255.128.1 Subject: [Qemu-devel] [PATCH 2/5] curses: Use cursesw instead of curses X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- configure | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 7d083bd..29649d9 100755 --- a/configure +++ b/configure @@ -2890,27 +2890,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 #include +#include 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