qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	libvir-list@redhat.com, Markus Armbruster <armbru@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [Qemu-devel] [PULL 3/7] iconv: detect and make curses depend on it
Date: Thu,  7 Mar 2019 16:11:37 +0100	[thread overview]
Message-ID: <20190307151141.6483-4-kraxel@redhat.com> (raw)
In-Reply-To: <20190307151141.6483-1-kraxel@redhat.com>

From: Samuel Thibault <samuel.thibault@ens-lyon.org>

curses will use it for proper wide output support.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190304210217.7056-2-samuel.thibault@ens-lyon.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure | 40 ++++++++++++++++++++++++++++++++++++++++
 vl.c      |  2 +-
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index cefeb8fcce44..c594d2be18c7 100755
--- a/configure
+++ b/configure
@@ -1214,6 +1214,10 @@ for opt do
   ;;
   --enable-curses) curses="yes"
   ;;
+  --disable-iconv) iconv="no"
+  ;;
+  --enable-iconv) iconv="yes"
+  ;;
   --disable-curl) curl="no"
   ;;
   --enable-curl) curl="yes"
@@ -1703,6 +1707,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
@@ -3424,8 +3429,39 @@ EOF
   fi
 fi
 
+##########################################
+# iconv probe
+if test "$iconv" != "no" ; then
+  cat > $TMPC << EOF
+#include <iconv.h>
+int main(void) {
+  iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
+  return conv != (iconv_t) -1;
+}
+EOF
+  for iconv_lib in '' -liconv; do
+    if compile_prog "" "$iconv_lib" ; then
+      iconv_found=yes
+      libs_softmmu="$iconv_lib $libs_softmmu"
+      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):"
@@ -6137,6 +6173,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"
@@ -6461,6 +6498,9 @@ 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
+fi
 if test "$curses" = "yes" ; then
   echo "CONFIG_CURSES=m" >> $config_host_mak
   echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak
diff --git a/vl.c b/vl.c
index 4c5cc0d8ad91..b1eef2b60a03 100644
--- a/vl.c
+++ b/vl.c
@@ -3172,7 +3172,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;
-- 
2.18.1

  parent reply	other threads:[~2019-03-07 15:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 15:11 [Qemu-devel] [PULL 0/7] Ui 20190307 patches Gerd Hoffmann
2019-03-07 15:11 ` [Qemu-devel] [PULL 1/7] Reduce curses escdelay from 1s to 25ms Gerd Hoffmann
2019-03-07 15:11 ` [Qemu-devel] [PULL 2/7] curses: support wide input Gerd Hoffmann
2019-03-07 15:11 ` Gerd Hoffmann [this message]
2019-03-07 15:11 ` [Qemu-devel] [PULL 4/7] curses: add option to specify VGA font encoding Gerd Hoffmann
2019-03-07 15:11 ` [Qemu-devel] [PULL 5/7] vnc: fix update stalls Gerd Hoffmann
2019-03-07 15:11 ` [Qemu-devel] [PULL 6/7] vnc: allow specifying a custom authorization object name Gerd Hoffmann
2019-03-07 15:11 ` [Qemu-devel] [PULL 7/7] monitor: deprecate acl_show, acl_reset, acl_policy, acl_add, acl_remove Gerd Hoffmann
2019-03-08 14:04 ` [Qemu-devel] [PULL 0/7] Ui 20190307 patches Peter Maydell
2019-03-11  8:33   ` Gerd Hoffmann
2019-03-11 13:52     ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307151141.6483-4-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).