@@ -158,6 +158,9 @@ common-obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
+# QEMU Object Model
+include $(SRC_PATH)/Makefile.qom
+
######################################################################
# libuser
new file mode 100644
@@ -0,0 +1,9 @@
+QEMU_CFLAGS += -I$(SRC_PATH)/include
+
+QCONFIGS = $(shell find $(SRC_PATH) -name "Qconfig" -print)
+
+config-qom.mak: $(SRC_PATH)/Qconfig $(QCONFIGS)
+ $(SRC_PATH)/scripts/genconfig.sh $< > $@
+
+-include config-qom.mak
+
new file mode 100644
@@ -0,0 +1 @@
+# Do nothing for now
new file mode 100755
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Simple Qconfig parser
+#
+# Copyright IBM, Corp. 2011
+#
+# Authors:
+# Anthony Liguori <aliguori@us.ibm.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2. See
+# the COPYING file in the top-level directory.
+#
+
+# This is just intended as a placeholder. Please do not enhance this script.
+# Instead, please try to port the Linux kernel's Kconfig parser.
+
+process() {
+ local basedir=`dirname $1`
+ cat "$1" | while read LINE; do
+ local first_word=`echo $LINE | cut -f1 -d' '`
+ if test "$first_word" = "config"; then
+ echo $LINE | sed -e 's:^config \(.*\):CONFIG_\1=y:g'
+ elif test "$first_word" = "source"; then
+ local rest=`echo $LINE | cut -f2- -d' '`
+ process "$basedir/$rest"
+ fi
+ done
+}
+
+process "$1"
QOM provides a unified model for separating modules into independently buildable components. To fully take advantage of this, we need a bit more make infrastructure that lets us describe these modules and their dependencies. Ultimately this will enable us to support tristate modules that can be demand loaded as shared libraries. For now, only support boolean modules and don't do any dependency resolution. I expect that we'll figure out how to borrow the kernel's Kconfig processing scripts to make this all work. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- Makefile.objs | 3 +++ Makefile.qom | 9 +++++++++ Qconfig | 1 + scripts/genconfig.sh | 30 ++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 Makefile.qom create mode 100644 Qconfig create mode 100755 scripts/genconfig.sh