MinGW related patches
Subsystems (2)
This includes a patch for GTK (needed for MinGW, but not restricted to it) and most of the patches which restructure the includes for the Win API. I ommitted the last optional block patch.
Stefan
[PULL for 2.0 1/5] gtk: Support GTK without VTE
[PULL for 2.0 2/5] w32: Add and use intermediate include file for [PULL for 2.0 3/5] w32: Move inline function from header file to C [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h [PULL for 2.0 5/5] w32: Replace Windows specific data types in
[Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h
Most *.o files depend on that file, but many of them don't need windows.h or winsock2.h. sysemu/os-win32.h only needs some definitions from winerror.h.
After that change, all files which depend on windows.h or winsock2.h and which no longer get it indirectly have to be fixed. Use qemu/sockets.h to get winsock2.h. Add comments to all those new include statements.
The modification in ui/vnc-enc-tight.c is needed temporarily and will be removed again in the following patch.
--- coroutine-win32.c | 1 + include/net/eth.h | 2 +- include/sysemu/os-win32.h | 3 +-- target-xtensa/xtensa-semi.c | 1 + ui/vnc-enc-tight.c | 1 + 5 files changed, 5 insertions(+), 3 deletions(-)
coroutine-win32.c +1 -0
@@ -24,6 +24,7 @@#include "qemu-common.h" #include "block/coroutine_int.h" +#include "qemu/winapi.h" /* CreateFiber, ... */ typedef struct {
include/net/eth.h +1 -1
@@ -26,10 +26,10 @@#ifndef QEMU_ETH_H #define QEMU_ETH_H -#include <sys/types.h> #include <string.h> #include "qemu/bswap.h" #include "qemu/iov.h" +#include "qemu/sockets.h" /* u_short */ #define ETH_ALEN 6
include/sysemu/os-win32.h +1 -2
@@ -26,8 +26,7 @@#ifndef QEMU_OS_WIN32_H #define QEMU_OS_WIN32_H -#include "qemu/winapi.h" -#include <winsock2.h> +#include <winerror.h> /* WSAECONNREFUSED, ... */ /* Workaround for older versions of MinGW. */ #ifndef ECONNREFUSED
target-xtensa/xtensa-semi.c +1 -0
@@ -32,6 +32,7 @@#include "cpu.h" #include "helper.h" #include "qemu/log.h" +#include "qemu/sockets.h" /* select */ enum { TARGET_SYS_exit =1 ,
ui/vnc-enc-tight.c +1 -0
@@ -31,6 +31,7 @@/* This needs to be before jpeglib.h line because of conflict with INT32 definitions between jmorecfg.h (included by jpeglib.h) and Win32 basetsd.h (included by windows.h). */ +#include "qemu/winapi.h" /* TODO: workaround, remove */ #include "qemu-common.h" #ifdef CONFIG_VNC_PNG
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source
In reply to Stefan WeilA lot of files depend on qemu/timer.h. We don't want that all these files depend on windows.h, too.
--- include/qemu/timer.h | 8 +------- util/qemu-timer-common.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 8 deletions(-)
include/qemu/timer.h +1 -7
@@ -712,14 +712,8 @@ static inline int64_t get_clock_realtime(void)also used by simpletrace backend and tracepoints would cause an infinite recursion! */ #ifdef _WIN32 -extern int64_t clock_freq; -static inline int64_t get_clock (void ) -{ -LARGE_INTEGER ti; -QueryPerformanceCounter (&ti); -return muldiv64 (ti.QuadPart,get_ticks_per_sec (), clock_freq); -} +int64_t get_clock (void );#else
util/qemu-timer-common.c +10 -1
@@ -28,7 +28,16 @@#ifdef _WIN32 -int64_t clock_freq; +#include "qemu/winapi.h" /* QueryPerformanceCounter, ... */ + +static int64_t clock_freq; + +int64_t get_clock (void ) +{ +LARGE_INTEGER ti; +QueryPerformanceCounter (&ti); +return muldiv64 (ti.QuadPart,get_ticks_per_sec (), clock_freq); +}static void __attribute__((constructor))init_get_clock (void ) {
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h
In reply to Stefan WeilIncluding windows.h from the new file include/qemu/winapi.h allows better tracking of the files which depend on the Windows API.
1864 *.o files depend on windows.h in a typical build, only 88 *.o files don't.
The windows.h specific macro WIN32_LEAN_AND_MEAN is now defined in the new file and no longer part of the QEMU_CFLAGS. A hack in ui/sdl.c can be removed after this change.
WINVER is still needed for all compilations with MinGW, so it cannot be defined in the new file. Replace its numeric value by a symbolic value to show which API is requested.
--- audio/audio_win_int.c | 2 +- audio/dsoundaudio.c | 2 +- audio/winwaveaudio.c | 2 +- block.c | 2 +- block/raw-win32.c | 2 +- block/win32-aio.c | 2 +- configure | 2 +- include/qemu/event_notifier.h | 2 +- include/qemu/sockets.h | 2 +- include/qemu/thread-win32.h | 2 +- include/qemu/winapi.h | 22 ++++++++++++++++++++++ include/sysemu/os-win32.h | 2 +- net/tap-win32.c | 2 +- os-win32.c | 2 +- qga/channel-win32.c | 2 +- qga/commands-win32.c | 2 +- qga/service-win32.c | 2 +- qga/service-win32.h | 2 +- qga/vss-win32.c | 2 +- qga/vss-win32/vss-common.h | 2 +- slirp/slirp.h | 2 +- translate-all.c | 2 +- ui/sdl.c | 3 --- util/oslib-win32.c | 2 +- 24 files changed, 44 insertions(+), 25 deletions(-) create mode 100644 include/qemu/winapi.h
audio/audio_win_int.c +1 -1
@@ -3,7 +3,7 @@#include "qemu-common.h" #define AUDIO_CAP "win-int" -#include <windows.h> +#include "qemu/winapi.h" #include <mmsystem.h> #include "audio.h"
audio/dsoundaudio.c +1 -1
@@ -32,7 +32,7 @@#define AUDIO_CAP "dsound"#include "audio_int.h" -#include <windows.h> +#include "qemu/winapi.h" #include <mmsystem.h> #include <objbase.h> #include <dsound.h>
audio/winwaveaudio.c +1 -1
@@ -7,7 +7,7 @@#define AUDIO_CAP "winwave"#include "audio_int.h" -#include <windows.h> +#include "qemu/winapi.h" #include <mmsystem.h> #include "audio_win_int.h"
block.c +1 -1
@@ -47,7 +47,7 @@#endif #ifdef _WIN32 -#include <windows.h> +#include "qemu/winapi.h" #endif struct BdrvDirtyBitmap {
block/raw-win32.c +1 -1
@@ -23,13 +23,13 @@*/ #include "qemu-common.h" #include "qemu/timer.h" +#include "qemu/winapi.h" /* HANDLE (in raw-aio.h) */ #include "block/block_int.h" #include "qemu/module.h" #include "raw-aio.h" #include "trace.h" #include "block/thread-pool.h" #include "qemu/iov.h" -#include <windows.h> #include <winioctl.h> #define FTYPE_FILE 0
block/win32-aio.c +1 -1
@@ -23,13 +23,13 @@*/ #include "qemu-common.h" #include "qemu/timer.h" +#include "qemu/winapi.h" /* HANDLE (in raw-aio.h) */ #include "block/block_int.h" #include "qemu/module.h" #include "block/aio.h" #include "raw-aio.h" #include "qemu/event_notifier.h" #include "qemu/iov.h" -#include <windows.h> #include <winioctl.h> #define FTYPE_FILE 0
configure +1 -1
@@ -670,7 +670,7 @@ fi if test "$mingw32" = "yes" ; then EXESUF=".exe" DSOSUF=".dll" - QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" + QEMU_CFLAGS="-DWINVER=_WIN32_WINNT_WINXP $QEMU_CFLAGS" # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
include/qemu/event_notifier.h +1 -1
@@ -16,7 +16,7 @@#include "qemu-common.h" #ifdef _WIN32 -#include <windows.h> +#include "qemu/winapi.h" #endif struct EventNotifier {
include/qemu/sockets.h +1 -1
@@ -3,7 +3,7 @@#define QEMU_SOCKET_H #ifdef _WIN32 -#include <windows.h> +#include "qemu/winapi.h" #include <winsock2.h> #include <ws2tcpip.h>
include/qemu/thread-win32.h +1 -1
@@ -1,6 +1,6 @@ #ifndef __QEMU_THREAD_WIN32_H #define __QEMU_THREAD_WIN32_H 1 -#include "windows.h" +#include "qemu/winapi.h" struct QemuMutex { CRITICAL_SECTION lock;
include/qemu/winapi.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* QEMU interface to the Windows API +* +* Copyright (c) 2014 Stefan Weil +* +* This work is licensed under the terms of the GNU GPL, version 2 +* or later. See the COPYING file in the top-level directory. +*/ + +#ifndef QEMU_WINAPI_H +#define QEMU_WINAPI_H + +/* Don't include some less frequently used APIs. */ +#define WIN32_LEAN_AND_MEAN + +#if !defined(WINVER ) +# error Add -DWINVER=_WIN32_WINNT_WINXP to compiler options +#endif + +#include <windows.h> + +#endif /* QEMU_WINAPI_H */
include/sysemu/os-win32.h +1 -1
@@ -26,7 +26,7 @@#ifndef QEMU_OS_WIN32_H #define QEMU_OS_WIN32_H -#include <windows.h> +#include "qemu/winapi.h" #include <winsock2.h> /* Workaround for older versions of MinGW. */
net/tap-win32.c +1 -1
@@ -35,7 +35,7 @@#include "sysemu/sysemu.h" #include "qemu/error-report.h" #include <stdio.h> -#include <windows.h> +#include "qemu/winapi.h" #include <winioctl.h> //=============
os-win32.c +1 -1
@@ -22,7 +22,7 @@* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include <windows.h> +#include "qemu/winapi.h" #include <mmsystem.h> #include <unistd.h> #include <fcntl.h>
qga/channel-win32.c +1 -1
@@ -2,7 +2,7 @@#include <stdio.h> #include <stdbool.h> #include <glib.h> -#include <windows.h> +#include "qemu/winapi.h" #include <errno.h> #include <io.h> #include "qga/guest-agent-core.h"
qga/commands-win32.c +1 -1
@@ -11,8 +11,8 @@* See the COPYING file in the top-level directory. */ +#include "qemu/winapi.h" /* OpenProcessToken, ... */ #include <glib.h> -#include <wtypes.h> #include <powrprof.h> #include "qga/guest-agent-core.h" #include "qga/vss-win32.h"
qga/service-win32.c +1 -1
@@ -13,7 +13,7 @@#include <stdlib.h> #include <stdio.h> #include <glib.h> -#include <windows.h> +#include "qemu/winapi.h" #include "qga/service-win32.h" static int printf_win_error (const char *text)
qga/service-win32.h +1 -1
@@ -13,7 +13,7 @@#ifndef QGA_SERVICE_H #define QGA_SERVICE_H -#include <windows.h> +#include "qemu/winapi.h" #define QGA_SERVICE_DISPLAY_NAME "QEMU Guest Agent"#define QGA_SERVICE_NAME "qemu-ga"
qga/vss-win32.c +1 -1
@@ -11,7 +11,7 @@*/ #include <stdio.h> -#include <windows.h> +#include "qemu/winapi.h" #include "qga/guest-agent-core.h" #include "qga/vss-win32.h" #include "qga/vss-win32/requester.h"
qga/vss-win32/vss-common.h +1 -1
@@ -15,7 +15,7 @@#define __MIDL_user_allocate_free_DEFINED__#include "config-host.h" -#include <windows.h> +#include "qemu/winapi.h" #include <shlwapi.h> /* Reduce warnings to include vss.h */
slirp/slirp.h +1 -1
@@ -9,7 +9,7 @@typedef char *caddr_t ; -# include <windows.h> +# include "qemu/winapi.h" # include <winsock2.h> # include <ws2tcpip.h> # include <sys/timeb.h>
translate-all.c +1 -1
@@ -17,7 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifdef _WIN32 -#include <windows.h> +#include "qemu/winapi.h" #else #include <sys/types.h> #include <sys/mman.h>
ui/sdl.c +0 -3
@@ -22,9 +22,6 @@* THE SOFTWARE. */ -/* Avoid compiler warning because macro is redefined in SDL_syswm.h. */ -#undef WIN32_LEAN_AND_MEAN -#include <SDL.h> #if SDL_MAJOR_VERSION ==1
util/oslib-win32.c +1 -1
@@ -25,7 +25,7 @@* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include <windows.h> +#include "qemu/winapi.h" #include <glib.h> #include <stdlib.h> #include "config-host.h"
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files
In reply to Stefan WeilThese header files are used by most QEMU source files. If they depend on windows.h, all those source files do so, too.
All Windows specific data types which are replaced use identical definitions for the 32 and 64 bit Windows APIs. HANDLE, LONG and CRITICAL_SECTION are replaced by the compatible types WinHandle, WinLong and WinCriticalSection.
Add an explicit dependency on qemu/winapi.h for some files which need it. These sources use the Windows API (see comment after include statement) and no longer get windows.h indirectly from other header files.
A workaround which was added in the previous patch is no longer needed.
Now 175 *.o files remain which still depend on windows.h.
--- cpus.c | 4 +++- hw/intc/apic.c | 3 ++- include/qemu/event_notifier.h | 8 ++------ include/qemu/main-loop.h | 4 ++-- include/qemu/thread-win32.h | 29 ++++++++++++++++++++--------- include/qom/cpu.h | 2 +- include/sysemu/os-win32.h | 7 +++++++ ui/vnc-enc-tight.c | 5 ----- util/event_notifier-win32.c | 1 + util/qemu-thread-win32.c | 17 +++++++++-------- 10 files changed, 47 insertions(+), 33 deletions(-)
cpus.c +3 -1
@@ -39,7 +39,9 @@#include "qemu/bitmap.h" #include "qemu/seqlock.h" -#ifndef _WIN32 +#ifdef _WIN32 +#include "qemu/winapi.h" /* SuspendThread, ... */ +#else #include "qemu/compatfd.h" #endif
hw/intc/apic.c +2 -1
@@ -16,12 +16,13 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/> */ -#include "qemu/thread.h" +#include "hw/i386/apic_internal.h" #include "hw/i386/apic.h" #include "hw/i386/ioapic.h" #include "hw/pci/msi.h" #include "qemu/host-utils.h" +#include "qemu/thread.h" #include "trace.h" #include "hw/i386/pc.h" #include "hw/i386/apic-msidef.h"
include/qemu/event_notifier.h +2 -6
@@ -15,13 +15,9 @@#include "qemu-common.h" -#ifdef _WIN32 -#include "qemu/winapi.h" -#endif -struct EventNotifier {#ifdef _WIN32 -HANDLE event; +WinHandle event;#else int rfd;int wfd;
@@ -40,7 +36,7 @@ int event_notifier_set_handler(EventNotifier *, EventNotifierHandler *);void event_notifier_init_fd (EventNotifier *,int fd);int event_notifier_get_fd (EventNotifier *);#else -HANDLE event_notifier_get_handle (EventNotifier *); +WinHandle event_notifier_get_handle (EventNotifier *);#endif #endif
include/qemu/main-loop.h +2 -2
@@ -152,7 +152,7 @@ typedef void WaitObjectFunc(void *opaque);* @func: A function to be called when @handle is in a signaled state. * @opaque: A pointer-size value that is passed to @func. */ -int qemu_add_wait_object (HANDLE handle,WaitObjectFunc *func,void *opaque); +int qemu_add_wait_object (WinHandle handle,WaitObjectFunc *func,void *opaque);/** * qemu_del_wait_object: Unregister a callback for a Windows handle
@@ -163,7 +163,7 @@ int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);* @func: The function that was passed to qemu_add_wait_object. * @opaque: A pointer-size value that was passed to qemu_add_wait_object. */ -void qemu_del_wait_object (HANDLE handle,WaitObjectFunc *func,void *opaque); +void qemu_del_wait_object (WinHandle handle,WaitObjectFunc *func,void *opaque);#endif /* async I/O support */
include/qemu/thread-win32.h +20 -9
@@ -1,24 +1,35 @@#ifndef __QEMU_THREAD_WIN32_H#define __QEMU_THREAD_WIN32_H 1 -#include "qemu/winapi.h" + +/* WinCriticalSection is a substitute for CRITICAL_SECTION and +* introduced here to avoid dependencies on windows.h. */ + +typedef struct { +WinHandle DebugInfo; +WinLong LockCount; +WinLong RecursionCount; +WinHandle OwningThread; +WinHandle LockSemaphore; +WinULong *SpinCount; +}WinCriticalSection ;struct QemuMutex { -CRITICAL_SECTION lock; -LONG owner; +WinCriticalSection lock; +WinLong owner; };struct QemuCond { -LONG waiters, target; -HANDLE sema; -HANDLE continue_event; +WinLong waiters, target; +WinHandle sema; +WinHandle continue_event; };struct QemuSemaphore { -HANDLE sema; +WinHandle sema; };struct QemuEvent { -HANDLE event; +WinHandle event; };typedef struct QemuThreadData QemuThreadData ;
@@ -28,6 +39,6 @@ struct QemuThread { };/* Only valid for joinable threads. */ -HANDLE qemu_thread_get_handle (QemuThread *thread); +WinHandle qemu_thread_get_handle (QemuThread *thread);#endif
include/qom/cpu.h +1 -1
@@ -215,7 +215,7 @@ struct CPUState {struct QemuThread *thread;#ifdef _WIN32 -HANDLE hThread; +WinHandle hThread;#endif int thread_id;uint32_t host_tid;
include/sysemu/os-win32.h +7 -0
@@ -54,6 +54,13 @@# define EWOULDBLOCK WSAEWOULDBLOCK#endif +/* Define substitutes for the Win API types HANDLE, LONG, ULONG. +* These types are used to avoid dependencies on windows.h. */ + +typedef void *WinHandle ; +typedef long WinLong ; +typedef unsigned long WinULong ; +#if defined(_WIN64)/* On w64, setjmp is implemented by _setjmp which needs a second parameter. * If this parameter is NULL, longjump does no stack unwinding.
ui/vnc-enc-tight.c +0 -5
@@ -27,11 +27,6 @@*/ #include "config-host.h" - -/* This needs to be before jpeglib.h line because of conflict with -INT32 definitions between jmorecfg.h (included by jpeglib.h) and -Win32 basetsd.h (included by windows.h). */ -#include "qemu/winapi.h" /* TODO: workaround, remove */ #include "qemu-common.h" #ifdef CONFIG_VNC_PNG
util/event_notifier-win32.c +1 -0
@@ -13,6 +13,7 @@#include "qemu-common.h" #include "qemu/event_notifier.h" #include "qemu/main-loop.h" +#include "qemu/winapi.h" /* CreateEvent, ... */ int event_notifier_init (EventNotifier *e,int active) {
util/qemu-thread-win32.c +9 -8
@@ -10,11 +10,10 @@* See the COPYING file in the top-level directory. * */ + +#include "qemu/winapi.h" /* LocalFree, ... */ #include "qemu-common.h" #include "qemu/thread.h" -#include <process.h> -#include <assert.h> -#include <limits.h> static bool name_threads;
@@ -38,18 +37,20 @@ static void error_exit(int err, const char *msg)void qemu_mutex_init (QemuMutex *mutex) { mutex->owner =0 ; -InitializeCriticalSection (&mutex->lock); +/* mutex->lock uses a data type which must fit CRITICAL_SECTION. */ +g_assert (sizeof (mutex->lock) ==sizeof (CRITICAL_SECTION )); +InitializeCriticalSection ((CRITICAL_SECTION *)&mutex->lock); }void qemu_mutex_destroy (QemuMutex *mutex) {assert (mutex->owner ==0 ); -DeleteCriticalSection (&mutex->lock); +DeleteCriticalSection ((CRITICAL_SECTION *)&mutex->lock); }void qemu_mutex_lock (QemuMutex *mutex) { -EnterCriticalSection (&mutex->lock); +EnterCriticalSection ((CRITICAL_SECTION *)&mutex->lock);/* Win32 CRITICAL_SECTIONs are recursive. Assert that we're not * using them as such.
@@ -62,7 +63,7 @@ int qemu_mutex_trylock(QemuMutex *mutex) {int owned; - owned =TryEnterCriticalSection (&mutex->lock); + owned =TryEnterCriticalSection ((CRITICAL_SECTION *)&mutex->lock);if (owned) {assert (mutex->owner ==0 ); mutex->owner =GetCurrentThreadId ();
@@ -74,7 +75,7 @@ void qemu_mutex_unlock(QemuMutex *mutex) {assert (mutex->owner ==GetCurrentThreadId ()); mutex->owner =0 ; -LeaveCriticalSection (&mutex->lock); +LeaveCriticalSection ((CRITICAL_SECTION *)&mutex->lock); }void qemu_cond_init (QemuCond *cond)
Signature · 1 line
1.7.10.4
Re: [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files
Am 20.03.2014 07:25, schrieb Stefan Weil:
Quoted 14 lines
These header files are used by most QEMU source files. If they depend on
windows.h, all those source files do so, too.All Windows specific data types which are replaced use identical definitions for the 32 and 64 bit Windows APIs. HANDLE, LONG and
CRITICAL_SECTIONare replaced by the compatible types WinHandle, WinLong and WinCriticalSection.Add an explicit dependency on
qemu/winapi.hfor some files which need it. These sources use the Windows API (see comment after include statement) and no longer getwindows.hindirectly from other header files.A workaround which was added in the previous patch is no longer needed.
Quoted 7 lines
Now 175 *.o files remain which still depend on
windows.h.Cc Anthony Liguori <[email protected]>Cc Stefan Hajnoczi <[email protected]>Cc Andreas Färber <[email protected]>Signed-off-by Stefan Weil <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>
For the record, I'm okay with WinHandle. I thought someone had objections against some struct, but seems I missed either a discussion or a respin.
Regards,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
[Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE
In reply to Stefan WeilGTK without VTE is needed for hosts which don't support VTE (for example all variants of MinGW), but it can also be reasonable for other hosts.
--- configure | 54 +++++++++++++++++++++++++++++++++++++----------------- ui/gtk.c | 17 ++++++++++++++++- 2 files changed, 53 insertions(+), 18 deletions(-)
configure +37 -17
@@ -318,6 +318,7 @@ glusterfs_zerofill="no" virtio_blk_data_plane="" gtk="" gtkabi="2.0" +vte="" tpm="no" libssh2="" vhdx=""
@@ -1063,6 +1064,10 @@ for opt do ;; --with-gtkabi=*) gtkabi="$optarg" ;; + --disable-vte) vte="no" + ;; + --enable-vte) vte="yes" + ;; --enable-tpm) tpm="yes" ;; --disable-libssh2) libssh2="no"
@@ -1946,30 +1951,41 @@ if test "$gtk" != "no"; then gtkpackage="gtk+-$gtkabi" if test "$gtkabi" = "3.0" ; then gtkversion="3.0.0" + else + gtkversion="2.18.0" + fi + if $pkg_config --exists "$gtkpackage >= $gtkversion"; then + gtk_cflags=`$pkg_config --cflags $gtkpackage` + gtk_libs=`$pkg_config --libs $gtkpackage` + libs_softmmu="$gtk_libs $libs_softmmu" + gtk="yes" + elif test "$gtk" = "yes"; then + feature_not_found "gtk" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel" + else + gtk="no" + fi +fi + +########################################## +# VTE probe + +if test "$vte" != "no"; then + if test "$gtkabi" = "3.0"; then 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" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel" - 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" + 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" "Install libvte or libvte-2.90 (requires --with-gtkabi=3.0 option to configure) devel" else - gtk_cflags=`$pkg_config --cflags $gtkpackage` - gtk_libs=`$pkg_config --libs $gtkpackage` - vte_cflags=`$pkg_config --cflags $vtepackage` - vte_libs=`$pkg_config --libs $vtepackage` - libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" - gtk="yes" + vte="no" fi fi
@@ -4053,6 +4069,7 @@ fi 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"
@@ -4381,6 +4398,9 @@ echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak 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
ui/gtk.c +16 -1
@@ -54,7 +54,9 @@#include <gdk/gdkkeysyms.h> #include <glib/gi18n.h> #include <locale.h> +#if defined(CONFIG_VTE )#include <vte/vte.h> +#endif #include <math.h> #include "trace.h"
@@ -68,6 +70,9 @@#define MAX_VCS 10 +#if !defined(CONFIG_VTE ) +# define VTE_CHECK_VERSION (a, b, c) 0 +#endif /* Compatibility define to let us build on both Gtk2 and Gtk3 */ #if GTK_CHECK_VERSION (3 ,0 ,0 )
@@ -105,8 +110,10 @@ typedef struct VirtualConsole {GtkWidget *menu_item;GtkWidget *terminal; +#if defined(CONFIG_VTE )GtkWidget *scrolled_window;CharDriverState *chr; +#endif int fd; } VirtualConsole;
@@ -1063,6 +1070,7 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,if (arg2 ==0 ) {gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (s->vga_item), TRUE); }else { +#if defined(CONFIG_VTE )VirtualConsole *vc = &s->vc[arg2 -1 ];VteTerminal *term =VTE_TERMINAL (vc->terminal);int width, height;
@@ -1072,6 +1080,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (vc->menu_item), TRUE);gtk_widget_set_size_request (vc->terminal, width, height); +#else +g_assert_not_reached (); +#endif }gtk_widget_set_sensitive (s->grab_item, on_vga);
@@ -1117,7 +1128,7 @@ static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len) {VirtualConsole *vc = chr->opaque; -return write (vc->fd, buf, len); +return vc ?write (vc->fd, buf, len) : len; }static int nb_vcs;
@@ -1142,6 +1153,7 @@ void early_gtk_display_init(void)register_vc_handler (gd_vc_handler); } +#if defined(CONFIG_VTE )static gboolean gd_vc_in (GIOChannel *chan,GIOCondition cond,void *opaque) {VirtualConsole *vc = opaque;
@@ -1157,10 +1169,12 @@ static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque) 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 ];
@@ -1230,6 +1244,7 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL chan =g_io_channel_unix_new (vc->fd);g_io_add_watch (chan,G_IO_IN , gd_vc_in, vc); +#endif /* CONFIG_VTE */ return group; }
Signature · 1 line
1.7.10.4
Am 20.03.2014 07:25, schrieb Stefan Weil:
Quoted 4 lines
This includes a patch for GTK (needed for MinGW, but not restricted to it) and most of the patches which restructure the includes for the Win API. I ommitted the last optional block patch.
Quoted 8 lines
Stefan
[PULL for 2.0 1/5] gtk: Support GTK without VTE
[PULL for 2.0 2/5] w32: Add and use intermediate include file for [PULL for 2.0 3/5] w32: Move inline function from header file to C [PULL for 2.0 4/5] w32: Reduce dependencies insysemu/os-win32.h[PULL for 2.0 5/5] w32: Replace Windows specific data types in
The most important part was missing, sorry:
The following changes since commit 06c1bee85a7def8d0139ee6829728a891efe623f:
Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into
staging (2014-03-19 23:34:43 +0000)
are available in the git repository at:
git://qemu.weilnetz.de/qemu.git qemu-2.0
for you to fetch changes up to 66fd5183a49af4da5e873ec7a5e308f4226e9987:
w32: Replace Windows specific data types in common header files
(2014-03-20 06:48:03 +0100)
----------------------------------------------------------------
Stefan Weil (5):
gtk: Support GTK without VTE
w32: Add and use intermediate include file for windows.h
w32: Move inline function from header file to C source
w32: Reduce dependencies in sysemu/os-win32.h
w32: Replace Windows specific data types in common header files
audio/audio_win_int.c | 2 +- audio/dsoundaudio.c | 2 +- audio/winwaveaudio.c | 2 +- block.c | 2 +- block/raw-win32.c | 2 +- block/win32-aio.c | 2 +- configure | 56 ++++++++++++++++++++++++++++------------- coroutine-win32.c | 1 + cpus.c | 4 ++- hw/intc/apic.c | 3 ++- include/net/eth.h | 2 +- include/qemu/event_notifier.h | 8 ++---- include/qemu/main-loop.h | 4 +-- include/qemu/sockets.h | 2 +- include/qemu/thread-win32.h | 29 ++++++++++++++------- include/qemu/timer.h | 8 +----- include/qemu/winapi.h | 22 ++++++++++++++++ include/qom/cpu.h | 2 +- include/sysemu/os-win32.h | 10 ++++++-- net/tap-win32.c | 2 +- os-win32.c | 2 +- qga/channel-win32.c | 2 +- qga/commands-win32.c | 2 +- qga/service-win32.c | 2 +- qga/service-win32.h | 2 +- qga/vss-win32.c | 2 +- qga/vss-win32/vss-common.h | 2 +- slirp/slirp.h | 2 +- target-xtensa/xtensa-semi.c | 1 + translate-all.c | 2 +- ui/gtk.c | 17 ++++++++++++- ui/sdl.c | 3 --- ui/vnc-enc-tight.c | 4 --- util/event_notifier-win32.c | 1 + util/oslib-win32.c | 2 +- util/qemu-thread-win32.c | 17 +++++++------ util/qemu-timer-common.c | 11 +++++++- 37 files changed, 156 insertions(+), 83 deletions(-) create mode 100644 include/qemu/winapi.h
Quoted 18 lines · Stefan Weil
Am 20.03.2014 07:25, schrieb Stefan Weil:
Quoted 4 lines
This includes a patch for GTK (needed for MinGW, but not restricted to it) and most of the patches which restructure the includes for the Win API. I ommitted the last optional block patch.
Quoted 8 lines
Stefan
[PULL for 2.0 1/5] gtk: Support GTK without VTE
[PULL for 2.0 2/5] w32: Add and use intermediate include file for [PULL for 2.0 3/5] w32: Move inline function from header file to C [PULL for 2.0 4/5] w32: Reduce dependencies insysemu/os-win32.h[PULL for 2.0 5/5] w32: Replace Windows specific data types inThe most important part was missing, sorry:
The following changes since commit
06c1bee85a7def8d0139ee6829728a891efe623f:
Quoted 7 lines
Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into
staging (2014-03-19 23:34:43 +0000)are available in the git repository at:
git://qemu.weilnetz.de/qemu.gitqemu-2.0
I'm afraid this doesn't build on my mingw32 setup:
CC util/rfifolock.o
In file included from /home/petmay01/linaro/qemu-for-merges/include/qemu/thread.h:14,
from/home/petmay01/linaro/qemu-for-merges/include/qemu/rfifolock.h:17,
from /home/petmay01/linaro/qemu-for-merges/util/rfifolock.c:15:/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:8:
error: expected specifier-qualifier-list before ‘WinHandle’ /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:18:
error: expected specifier-qualifier-list before ‘WinLong’ /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:22:
error: expected specifier-qualifier-list before ‘WinLong’ /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:28:
error: expected specifier-qualifier-list before ‘WinHandle’ /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:32:
error: expected specifier-qualifier-list before ‘WinHandle’ /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:42:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘qemu_thread_get_handle’
make: *** [util/rfifolock.o] Error 1
thanks
-- PMM
Am 20.03.2014 13:45, schrieb Peter Maydell:
Quoted 50 lines · Stefan Weil
Quoted 18 lines
Am 20.03.2014 07:25, schrieb Stefan Weil:
Quoted 4 lines
This includes a patch for GTK (needed for MinGW, but not restricted to it) and most of the patches which restructure the includes for the Win API. I ommitted the last optional block patch.
Quoted 8 lines
Stefan
[PULL for 2.0 1/5] gtk: Support GTK without VTE
[PULL for 2.0 2/5] w32: Add and use intermediate include file for [PULL for 2.0 3/5] w32: Move inline function from header file to C [PULL for 2.0 4/5] w32: Reduce dependencies insysemu/os-win32.h[PULL for 2.0 5/5] w32: Replace Windows specific data types inThe most important part was missing, sorry:
The following changes since commit
06c1bee85a7def8d0139ee6829728a891efe623f:Quoted 7 lines
Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into
staging (2014-03-19 23:34:43 +0000)are available in the git repository at:
git://qemu.weilnetz.de/qemu.gitqemu-2.0I'm afraid this doesn't build on my mingw32 setup:
CC
util/rfifolock.o
In file included from/home/petmay01/linaro/qemu-for-merges/include/qemu/thread.h:14,
from/home/petmay01/linaro/qemu-for-merges/include/qemu/rfifolock.h:17,
from/home/petmay01/linaro/qemu-for-merges/util/rfifolock.c:15:/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:8:
error: expected specifier-qualifier-list before ‘WinHandle’/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:18:
error: expected specifier-qualifier-list before ‘WinLong’/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:22:
error: expected specifier-qualifier-list before ‘WinLong’/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:28:
error: expected specifier-qualifier-list before ‘WinHandle’/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:32:
error: expected specifier-qualifier-list before ‘WinHandle’/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:42:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘qemu_thread_get_handle’
make: *** [util/rfifolock.o] Error 1
Quoted 3 lines
thanks
-- PMM
Unfortunately a recent commit added new code in util/, and that code needs a modification of patch 5/5. I really should have re-run the compile test :-(
Peter, is it possible to pull only patches 1-4? They compile and are fine, and we'd save mail bandwidth if I don't have to send them again. You could also apply only patch 1. It is the only really important one because it adds GTK for Windows users. The other ones can also be applied after QEMU 2.0, if you prefer that.
I'll send an updated patch 5, and because it is modified, it will need a new review.
Cheers,
Stefan
Quoted 9 lines · Stefan Weil
Unfortunately a recent commit added new code in util/, and that code needs a modification of patch 5/5. I really should have re-run the compile test :-(
Peter, is it possible to pull only patches 1-4? They compile and are fine, and we'd save mail bandwidth if I don't have to send them again. You could also apply only patch 1. It is the only really important one because it adds GTK for Windows users. The other ones can also be applied after QEMU 2.0, if you prefer that.
I'm afraid I can only either apply or not apply pullrequests. You can always resend just the cover letter if the only thing you're doing is dropping some patches from it.
thanks
-- PMM