Skip to contentSkip to conversation

Windows compile patch

PATCH New Damien Mascord 1 participant 1 message Apr 26, 2005 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Windows compile patch

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 renamed from Makefile.orig +6 -0
@@ -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 renamed from Makefile.target.orig +6 -0
@@ -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