All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] Prefer ncurses over curses
Date: Wed, 24 Jun 2009 12:29:11 +0200	[thread overview]
Message-ID: <4A41FFF7.8080407@siemens.com> (raw)

Not every distro provides libcurses anymore, at least OpenSUSE, and at
least under a standard library search path. So try to link against
standard ncurses first and then fall back to legacy curses.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 configure |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 7e99ad2..d71629c 100755
--- a/configure
+++ b/configure
@@ -1078,6 +1078,7 @@ fi # -z $brlapi
 
 if test "$curses" = "yes" ; then
   curses=no
+  ncurses=no
   cat > $TMPC << EOF
 #include <curses.h>
 #ifdef __OpenBSD__
@@ -1085,7 +1086,10 @@ if test "$curses" = "yes" ; then
 #endif
 int main(void) { resize_term(0, 0); return curses_version(); }
 EOF
-  if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
+  if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lncurses > /dev/null 2> /dev/null ; then
+    curses=yes
+    ncurses=yes
+  elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
     curses=yes
   fi
 fi # test "$curses"
@@ -1735,7 +1739,11 @@ fi
 if test "$curses" = "yes" ; then
   echo "#define CONFIG_CURSES 1" >> $config_h
   echo "CONFIG_CURSES=yes" >> $config_mak
-  echo "CURSES_LIBS=-lcurses" >> $config_mak
+  if test "$ncurses" = "yes" ; then
+    echo "CURSES_LIBS=-lncurses" >> $config_mak
+  else
+    echo "CURSES_LIBS=-lcurses" >> $config_mak
+  fi
 fi
 if test "$atfile" = "yes" ; then
   echo "#define CONFIG_ATFILE 1" >> $config_h

                 reply	other threads:[~2009-06-24 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4A41FFF7.8080407@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.