From patchwork Mon Mar 11 13:51:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1054469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J03561T8z9s4V for ; Tue, 12 Mar 2019 00:54:41 +1100 (AEDT) Received: from localhost ([127.0.0.1]:33868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3LO2-0003fa-Lf for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2019 09:54:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3LNC-0003bP-Hi for qemu-devel@nongnu.org; Mon, 11 Mar 2019 09:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3LL2-00054c-T9 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 09:51:33 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:35472) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3LL2-00053i-Hf for qemu-devel@nongnu.org; Mon, 11 Mar 2019 09:51:32 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 01ADBCBD7; Mon, 11 Mar 2019 14:51:30 +0100 (CET) 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 7oUngbv5EVQq; Mon, 11 Mar 2019 14:51:28 +0100 (CET) Received: from function (dhcp-13-99.lip.ens-lyon.fr [140.77.13.99]) by hera.aquilenet.fr (Postfix) with ESMTPSA id BE7A89753; Mon, 11 Mar 2019 14:51:28 +0100 (CET) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1h3LKx-0000ak-Lc; Mon, 11 Mar 2019 14:51:27 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 14:51:26 +0100 Message-Id: <20190311135127.2229-2-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311135127.2229-1-samuel.thibault@ens-lyon.org> References: <20190311135127.2229-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PATCHv3 1/2] iconv: detect and make curses depend on it 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: ekohler@gmail.com, armbru@redhat.com, kraxel@redhat.com, pbonzini@redhat.com, Samuel Thibault Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" curses will use it for proper wide output support. Signed-off-by: Samuel Thibault --- configure | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ ui/Makefile.objs | 4 ++-- vl.c | 2 +- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 540bee19ba..c97c78a6a4 100755 --- a/configure +++ b/configure @@ -1217,6 +1217,10 @@ for opt do ;; --enable-curses) curses="yes" ;; + --disable-iconv) iconv="no" + ;; + --enable-iconv) iconv="yes" + ;; --disable-curl) curl="no" ;; --enable-curl) curl="yes" @@ -1718,6 +1722,7 @@ disabled with --disable-FEATURE, default is enabled if available: gtk gtk UI vte vte support for the gtk UI curses curses UI + iconv font glyph conversion support vnc VNC UI support vnc-sasl SASL encryption for VNC server vnc-jpeg JPEG lossy compression for VNC server @@ -3398,8 +3403,52 @@ EOF fi fi +########################################## +# iconv probe +if test "$iconv" != "no" ; then + cat > $TMPC << EOF +#include +int main(void) { + iconv_t conv = iconv_open("WCHAR_T", "UCS-2"); + return conv != (iconv_t) -1; +} +EOF + iconv_prefix_list="/usr/local:/usr" + iconv_lib_list=":-liconv" + IFS=: + for iconv_prefix in $iconv_prefix_list; do + IFS=: + iconv_cflags="-I$iconv_prefix/include" + iconv_ldflags="-L$iconv_prefix/lib" + for iconv_link in $iconv_lib_list; do + unset IFS + iconv_lib="$iconv_ldflags $iconv_link" + echo "looking at iconv in '$iconv_cflags' '$iconv_lib'" >> config.log + if compile_prog "$iconv_cflags" "$iconv_lib" ; then + iconv_found=yes + break + fi + done + if test "$iconv_found" = yes ; then + break + fi + done + if test "$iconv_found" = "yes" ; then + iconv=yes + else + if test "$iconv" = "yes" ; then + feature_not_found "iconv" "Install iconv devel" + fi + iconv=no + fi +fi + ########################################## # curses probe +if test "$iconv" = "no" ; then + # curses will need iconv + curses=no +fi if test "$curses" != "no" ; then if test "$mingw32" = "yes" ; then curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" @@ -6111,6 +6160,7 @@ echo "libgcrypt $gcrypt" echo "nettle $nettle $(echo_version $nettle $nettle_version)" echo "libtasn1 $tasn1" echo "PAM $auth_pam" +echo "iconv support $iconv" echo "curses support $curses" echo "virgl support $virglrenderer $(echo_version $virglrenderer $virgl_version)" echo "curl support $curl" @@ -6435,6 +6485,11 @@ fi if test "$cocoa" = "yes" ; then echo "CONFIG_COCOA=y" >> $config_host_mak fi +if test "$iconv" = "yes" ; then + echo "CONFIG_ICONV=y" >> $config_host_mak + echo "ICONV_CFLAGS=$iconv_cflags" >> $config_host_mak + echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak +fi if test "$curses" = "yes" ; then echo "CONFIG_CURSES=m" >> $config_host_mak echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak diff --git a/ui/Makefile.objs b/ui/Makefile.objs index fe1a7aed97..cc2bf5b180 100644 --- a/ui/Makefile.objs +++ b/ui/Makefile.objs @@ -46,8 +46,8 @@ endif common-obj-$(CONFIG_CURSES) += curses.mo curses.mo-objs := curses.o -curses.mo-cflags := $(CURSES_CFLAGS) -curses.mo-libs := $(CURSES_LIBS) +curses.mo-cflags := $(CURSES_CFLAGS) $(ICONV_CFLAGS) +curses.mo-libs := $(CURSES_LIBS) $(ICONV_LIBS) common-obj-$(call land,$(CONFIG_SPICE),$(CONFIG_GIO)) += spice-app.mo spice-app.mo-objs := spice-app.o diff --git a/vl.c b/vl.c index 502857a176..c8594fc6d5 100644 --- a/vl.c +++ b/vl.c @@ -3171,7 +3171,7 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_CURSES dpy.type = DISPLAY_TYPE_CURSES; #else - error_report("curses support is disabled"); + error_report("curses or iconv support is disabled"); exit(1); #endif break;