--- qemu-1.6.0/configure.bak 2013-08-21 10:48:45.602456700 +0100 +++ qemu-1.6.0/configure 2013-10-04 15:53:08.184727500 +0100 @@ -241,6 +241,7 @@ virtio_blk_data_plane="" gtk="" gtkabi="2.0" +vte="" tpm="no" libssh2="" @@ -939,6 +940,10 @@ ;; --with-gtkabi=*) gtkabi="$optarg" ;; + --disable-vte) vte="no" + ;; + --enable-vte) vte="yes" + ;; --enable-tpm) tpm="yes" ;; --disable-libssh2) libssh2="no" @@ -1685,34 +1690,45 @@ gtkpackage="gtk+-$gtkabi" if test "$gtkabi" = "3.0" ; then gtkversion="3.0.0" - vtepackage="vte-2.90" - vteversion="0.32.0" else gtkversion="2.18.0" - vtepackage="vte" - vteversion="0.24.0" fi if ! $pkg_config --exists "$gtkpackage >= $gtkversion"; then if test "$gtk" = "yes" ; then feature_not_found "gtk" fi gtk="no" - elif ! $pkg_config --exists "$vtepackage >= $vteversion"; then - if test "$gtk" = "yes" ; then - error_exit "libvte not found (required for gtk support)" - fi - gtk="no" else gtk_cflags=`$pkg_config --cflags $gtkpackage 2>/dev/null` gtk_libs=`$pkg_config --libs $gtkpackage 2>/dev/null` - vte_cflags=`$pkg_config --cflags $vtepackage 2>/dev/null` - vte_libs=`$pkg_config --libs $vtepackage 2>/dev/null` - libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" + libs_softmmu="$gtk_libs $libs_softmmu" gtk="yes" fi fi ########################################## +# VTE probe +if test "$vte" != "no"; then + if test "$gtkabi" = "3.0"; then + vtepackage="vte-2.90" + vteversion="0.32.0" + else + vtepackage="vte" + vteversion="0.24.0" + fi + if $pkg_config --exists "$vtepackage >= $vteversion"; then + vte_cflags=`$pkg_config --cflags $vtepackage` + vte_libs=`$pkg_config --libs $vtepackage` + libs_softmmu="$vte_libs $libs_softmmu" + vte="yes" + elif test "$vte" = "yes"; then + feature_not_found "vte" + else + vte="no" + fi + fi + +########################################## # SDL probe # Look for sdl configuration program (pkg-config or sdl-config). Try @@ -3548,6 +3564,7 @@ echo "pixman $pixman" echo "SDL support $sdl" echo "GTK support $gtk" +echo "VTE support $vte" echo "curses support $curses" echo "curl support $curl" echo "mingw32 support $mingw32" @@ -3853,6 +3870,9 @@ if test "$gtk" = "yes" ; then echo "CONFIG_GTK=y" >> $config_host_mak echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak +fi +if test "$vte" = "yes" ; then + echo "CONFIG_VTE=y" >> $config_host_mak echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak fi if test "$xen" = "yes" ; then --- qemu-1.6.0/ui/gtk.c.bak 2013-08-15 20:56:23.000000000 +0100 +++ qemu-1.6.0/ui/gtk.c 2013-10-04 15:54:31.626070800 +0100 @@ -50,7 +50,9 @@ #include #include #include +#if defined(CONFIG_VTE) #include +#endif #include #include #include @@ -66,10 +68,21 @@ //#define DEBUG_GTK +#define DPRINTF(fmt, ...) debug_printf(fmt, ## __VA_ARGS__) + +static inline GCC_FMT_ATTR(1, 2) void debug_printf(const char *fmt, ...) +{ #ifdef DEBUG_GTK -#define DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__) + va_list arg; + va_start(arg, fmt); + vprintf(fmt, arg); + va_end(arg); #else -#define DPRINTF(fmt, ...) do { } while (0) +#endif +} + +#if !defined(CONFIG_VTE) +# define VTE_CHECK_VERSION(a, b, c) 0 #endif #define MAX_VCS 10 @@ -1067,6 +1080,7 @@ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->vga_item), TRUE); } else { VirtualConsole *vc = &s->vc[arg2 - 1]; +#if defined(CONFIG_VTE) VteTerminal *term = VTE_TERMINAL(vc->terminal); int width, height; @@ -1075,6 +1089,10 @@ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item), TRUE); gtk_widget_set_size_request(vc->terminal, width, height); +#else + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item), TRUE); + gtk_widget_set_size_request(vc->terminal, 640, 480); +#endif } gtk_widget_set_sensitive(s->grab_item, on_vga); @@ -1145,6 +1163,7 @@ register_vc_handler(gd_vc_handler); } +#if defined(CONFIG_VTE) static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque) { VirtualConsole *vc = opaque; @@ -1160,10 +1179,12 @@ return TRUE; } +#endif static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSList *group, GtkWidget *view_menu) { +#if defined(CONFIG_VTE) const char *label; char buffer[32]; char path[32]; @@ -1233,6 +1254,7 @@ chan = g_io_channel_unix_new(vc->fd); g_io_add_watch(chan, G_IO_IN, gd_vc_in, vc); +#endif /* CONFIG_GTK */ return group; }