Heya guys,

Here is a patch that allows compilation on MingW (Windows). [To allow
cygwin compilation, only the addition of -mno-cygwin on the CFLAGS will
suffice, as per http://www.h7.dion.ne.jp/~qemu-win/qemu-cygwin.txt].

Specifically it allows the console output on the command line (so,
executing qemu without any arguments shows usage), and specifies include
and lib paths to find zlib correctly.  This is adapted from
[http://lists.gnu.org/archive/html/qemu-devel/2004-07/msg00151.html].

Cheers,

Damien
--- Makefile.orig       Sun Apr 24 01:42:13 2005
+++ Makefile    Tue Apr 26 16:03:56 2005
@@ -4,8 +4,14 @@
 ifdef CONFIG_DARWIN
 CFLAGS+= -mdynamic-no-pic
 endif
+ifdef CONFIG_WIN32
+CFLAGS+=-I/usr/local/include -I/usr/include
+endif
 LDFLAGS=-g
 LIBS=
+ifdef CONFIG_WIN32
+LIBS+=-lwinmm -lws2_32 -liphlpapi -mconsole -L/usr/local/lib -L/usr/lib
+endif
 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 TOOLS=qemu-img$(EXESUF)
 ifdef CONFIG_STATIC
--- Makefile.target.orig        Sun Apr 24 02:25:40 2005
+++ Makefile.target     Tue Apr 26 16:03:56 2005
@@ -16,8 +16,14 @@
 endif
 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
 #CFLAGS+=-Werror
+ifdef CONFIG_WIN32
+CFLAGS+=-I/usr/local/include -I/usr/include
+endif
 LDFLAGS=-g
 LIBS=
+ifdef CONFIG_WIN32
+LIBS+=-lwinmm -lws2_32 -liphlpapi -mconsole -L/usr/local/lib -L/usr/lib
+endif
 HELPER_CFLAGS=$(CFLAGS)
 DYNGEN=../dyngen$(EXESUF)
 # user emulator name
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to