[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Small patch for Makefile variations
From: |
Nathan Kunkee |
Subject: |
[Qemu-devel] Small patch for Makefile variations |
Date: |
Fri, 22 Oct 2004 23:31:34 -0500 |
Hi!
Thank you all for such a cool program. It provides endless hours of fun...
I work with Qemu on Win32 with mingw, and the change for compressed cow
disks broke my compile. When I installed the zlib headers/libraries, the
installed to /usr/local/. I made the following changes to the Makefiles so
that I could build qemu. This allows changes to CFLAGS or LDFLAGS via the
configure options to carry down to the subdirectories. It also groups debug
options more modularly for when you need them. (Debug symbols are turned on
by default, as done currently.)
--------------8<----------------------------------------------
Index: Makefile
===================================================================
RCS file: /cvsroot/qemu/qemu/Makefile,v
retrieving revision 1.73
diff -u -r1.73 Makefile
--- Makefile 4 Oct 2004 21:23:09 -0000 1.73
+++ Makefile 23 Oct 2004 04:20:29 -0000
@@ -1,13 +1,16 @@
-include config-host.mak
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+CFLAGS+=-Wall -O2 -fno-strict-aliasing
ifdef CONFIG_DARWIN
CFLAGS+= -mdynamic-no-pic
endif
ifdef CONFIG_WIN32
CFLAGS+=-fpack-struct
endif
-LDFLAGS=-g
+ifdef CONFIG_DEBUG
+CFLAGS+=-g
+LDFLAGS+=-g
+endif
LIBS=
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
TOOLS=qemu-img
Index: Makefile.target
===================================================================
RCS file: /cvsroot/qemu/qemu/Makefile.target,v
retrieving revision 1.43
diff -u -r1.43 Makefile.target
--- Makefile.target 4 Oct 2004 21:23:09 -0000 1.43
+++ Makefile.target 23 Oct 2004 04:20:29 -0000
@@ -1,5 +1,9 @@
include config.mak
+ifdef CONFIG_DEBUG
+CFLAGS+=-g
+LDFLAGS+=-g
+endif
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
@@ -7,8 +11,7 @@
VPATH+=:$(SRC_PATH)/linux-user
DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
endif
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
-LDFLAGS=-g
+CFLAGS+=-Wall -O2 -fno-strict-aliasing
LIBS=
HELPER_CFLAGS=$(CFLAGS)
DYNGEN=../dyngen$(EXESUF)
Index: configure
===================================================================
RCS file: /cvsroot/qemu/qemu/configure,v
retrieving revision 1.44
diff -u -r1.44 configure
--- configure 30 Sep 2004 22:22:08 -0000 1.44
+++ configure 23 Oct 2004 04:21:58 -0000
@@ -72,6 +72,7 @@
EXESUF=""
gdbstub="yes"
slirp="yes"
+debug="yes"
# OS specific
targetos=`uname -s`
@@ -147,6 +148,8 @@
;;
--disable-slirp) slirp="no"
;;
+ --disable-debug) debug="no"
+ ;;
esac
done
@@ -275,6 +278,9 @@
echo " --make=MAKE use specified make [$make]"
echo " --static enable static build [$static]"
echo " --enable-mingw32 enable Win32 cross compilation with
mingw32"
+echo " --extra-cflags extra flags passed to compiler"
+echo " --extra-ldflags extra flags passed to linker"
+echo " --disable-debug production release/turn off debug symbols"
echo ""
echo "NOTE: The object files are build at the place where configure is
launched"
exit 1
@@ -416,6 +422,11 @@
echo "CONFIG_SLIRP=yes" >> $config_mak
echo "#define CONFIG_SLIRP 1" >> $config_h
fi
+if test "$debug" = "yes" ; then
+ echo "CONFIG_DEBUG=yes" >> $config_mak
+ echo "#define CONFIG_DEBUG 1" >> $config_h
+# other debug defines could be included here
+fi
echo -n "VERSION=" >>$config_mak
head $source_path/VERSION >>$config_mak
echo "" >>$config_mak
--------------------------->8---------------------------------------
I hope some others may find it useful!
Nathan
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
- [Qemu-devel] Small patch for Makefile variations,
Nathan Kunkee <=