qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/4] Introduce global .config to selectively enable


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 4/4] Introduce global .config to selectively enable compile features
Date: Mon, 11 May 2009 09:26:49 -0500

Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/Makefile b/Makefile
index 24b8c0d..845c965 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,16 @@ ifdef CONFIG_WIN32
 LIBS+=-lwinmm -lws2_32 -liphlpapi
 endif
 
-all: $(TOOLS) $(DOCS) recurse-all
+ifdef CONFIG_WIN32
+DEFCONFIG=$(SRC_PATH)/configs/win32/defconfig
+else
+DEFCONFIG=$(SRC_PATH)/configs/unix/defconfig
+endif
+
+all: .config $(TOOLS) $(DOCS) recurse-all
+
+.config: $(DEFCONFIG)
+       $(call quiet-command,cp $< $@,)
 
 config-host.mak: configure
 ifneq ($(wildcard config-host.mak),)
@@ -60,22 +69,22 @@ $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
 
 recurse-all: $(SUBDIR_RULES)
 
+-include .config
+
 #######################################################################
 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
 
-BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o module.o
-BLOCK_OBJS+=block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o
-BLOCK_OBJS+=block/dmg.o block/bochs.o block/vpc.o block/vvfat.o
-BLOCK_OBJS+=block/qcow2.o block/parallels.o block/nbd.o
-BLOCK_OBJS+=nbd.o block.o aio.o
+BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o module.o aes.o nbd.o block.o
+BLOCK_OBJS+=aio.o
 
-ifdef CONFIG_WIN32
-BLOCK_OBJS += block/raw-win32.o
-else
+obj-y=
+include $(SRC_PATH)/block/Makefile
+BLOCK_OBJS+=$(addprefix block/, $(obj-y))
+
+ifndef CONFIG_WIN32
 ifdef CONFIG_AIO
 BLOCK_OBJS += posix-aio-compat.o
 endif
-BLOCK_OBJS += block/raw-posix.o
 endif
 
 ######################################################################
diff --git a/block/Makefile b/block/Makefile
new file mode 100644
index 0000000..f33c81d
--- /dev/null
+++ b/block/Makefile
@@ -0,0 +1,13 @@
+obj-$(CONFIG_BDRV_RAW_POSIX)   += raw-posix.o
+obj-$(CONFIG_BDRV_RAW_WIN32)   += raw-win32.o
+obj-$(CONFIG_BDRV_BOCHS)       += bochs.o
+obj-$(CONFIG_BDRV_CLOOP)       += cloop.o
+obj-$(CONFIG_BDRV_COW)         += cow.o
+obj-$(CONFIG_BDRV_DMG)         += dmg.o
+obj-$(CONFIG_BDRV_NBD)         += nbd.o
+obj-$(CONFIG_BDRV_PARALLELS)   += parallels.o
+obj-$(CONFIG_BDRV_QCOW2)       += qcow2.o
+obj-$(CONFIG_BDRV_QCOW)                += qcow.o
+obj-$(CONFIG_BDRV_VMDK)                += vmdk.o
+obj-$(CONFIG_BDRV_VPC)         += vpc.o
+obj-$(CONFIG_BDRV_VVFAT)       += vvfat.o
diff --git a/block/cow.c b/block/cow.c
index 0a49491..bac1f07 100644
--- a/block/cow.c
+++ b/block/cow.c
@@ -21,7 +21,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#ifndef _WIN32
 #include "qemu-common.h"
 #include "block_int.h"
 #include "module.h"
@@ -273,4 +272,3 @@ static int bdrv_cow_init(void)
 }
 
 block_init(bdrv_cow_init);
-#endif
diff --git a/configs/unix/defconfig b/configs/unix/defconfig
new file mode 100644
index 0000000..d897462
--- /dev/null
+++ b/configs/unix/defconfig
@@ -0,0 +1,13 @@
+CONFIG_BDRV_RAW_POSIX=y
+# CONFIG_BDRV_RAW_WIN32 is not set
+CONFIG_BDRV_BOCHS=y
+CONFIG_BDRV_CLOOP=y
+CONFIG_BDRV_COW=y
+CONFIG_BDRV_DMG=y
+CONFIG_BDRV_NBD=y
+CONFIG_BDRV_PARALLELS=y
+CONFIG_BDRV_QCOW2=y
+CONFIG_BDRV_QCOW=y
+CONFIG_BDRV_VMDK=y
+CONFIG_BDRV_VPC=y
+CONFIG_BDRV_VVFAT=y
diff --git a/configs/win32/defconfig b/configs/win32/defconfig
new file mode 100644
index 0000000..29ed483
--- /dev/null
+++ b/configs/win32/defconfig
@@ -0,0 +1,13 @@
+# CONFIG_BDRV_RAW_POSIX is not set
+CONFIG_BDRV_RAW_WIN32=y
+CONFIG_BDRV_BOCHS=y
+CONFIG_BDRV_CLOOP=y
+# CONFIG_BDRV_COW is not set
+CONFIG_BDRV_DMG=y
+CONFIG_BDRV_NBD=y
+CONFIG_BDRV_PARALLELS=y
+CONFIG_BDRV_QCOW2=y
+CONFIG_BDRV_QCOW=y
+CONFIG_BDRV_VMDK=y
+CONFIG_BDRV_VPC=y
+CONFIG_BDRV_VVFAT=y
-- 
1.6.0.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]