Add an ncurses UI.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3976 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/configure b/configure
index 65016b2..bbda3f7 100755
--- a/configure
+++ b/configure
@@ -108,6 +108,7 @@
 darwin_user="no"
 build_docs="no"
 uname_release=""
+curses="yes"
 
 # OS specific
 targetos=`uname -s`
@@ -323,6 +324,8 @@
   ;;
   --disable-werror) werror="no"
   ;;
+  --disable-curses) curses="no"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -669,6 +672,20 @@
   fi
 fi
 
+##########################################
+# curses probe
+
+if test "$curses" = "yes" ; then
+  curses=no
+  cat > $TMPC << EOF
+#include <curses.h>
+int main(void) { return curses_version(); }
+EOF
+  if $cc -o $TMPE $TMPC -lcurses 2> /dev/null ; then
+    curses=yes
+  fi
+fi # test "$curses"
+
 # Check if tools are available to build documentation.
 if [ -x "`which texi2html 2>/dev/null`" ] && \
    [ -x "`which pod2man 2>/dev/null`" ]; then
@@ -720,6 +737,7 @@
 if test "$sdl" != "no" ; then
     echo "SDL static link   $sdl_static"
 fi
+echo "curses support    $curses"
 echo "mingw32 support   $mingw32"
 echo "Adlib support     $adlib"
 echo "AC97 support      $ac97"
@@ -974,8 +992,13 @@
   fi
 fi
 if test "$cocoa" = "yes" ; then
-    echo "#define CONFIG_COCOA 1" >> $config_h
-    echo "CONFIG_COCOA=yes" >> $config_mak
+  echo "#define CONFIG_COCOA 1" >> $config_h
+  echo "CONFIG_COCOA=yes" >> $config_mak
+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
 fi
 
 # XXX: suppress that
@@ -1040,7 +1063,8 @@
         -a "$sdl" = "no" -a "$cocoa" = "no" ; then
     echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
     echo "To build QEMU without graphical output configure with --disable-gfx-check"
-    echo "Note that this will disable all output from the virtual graphics card."
+    echo "Note that this will disable all output from the virtual graphics card"
+    echo "except through VNC or curses."
     exit 1;
 fi