[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/21] qom: add make infrastructure
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 01/21] qom: add make infrastructure |
Date: |
Sun, 24 Jul 2011 20:44:33 -0500 |
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 <address@hidden>
---
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
diff --git a/Makefile.objs b/Makefile.objs
index 6991a9f..9cc87fd 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/Makefile.qom b/Makefile.qom
new file mode 100644
index 0000000..8b14952
--- /dev/null
+++ b/Makefile.qom
@@ -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
+
diff --git a/Qconfig b/Qconfig
new file mode 100644
index 0000000..62b15d7
--- /dev/null
+++ b/Qconfig
@@ -0,0 +1 @@
+# Do nothing for now
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
new file mode 100755
index 0000000..14fef23
--- /dev/null
+++ b/scripts/genconfig.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Simple Qconfig parser
+#
+# Copyright IBM, Corp. 2011
+#
+# Authors:
+# Anthony Liguori <address@hidden>
+#
+# 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"
--
1.7.4.1
- [Qemu-devel] [RFC][PATCH 0/21] QEMU Object Model, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 02/21] qom: convert QAPI to use Qconfig build system, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 04/21] qom: add Plug class, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 06/21] plug: add socket property type, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 01/21] qom: add make infrastructure,
Anthony Liguori <=
- [Qemu-devel] [PATCH 07/21] plug: add generated property types, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 03/21] qom: Add core type system, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 05/21] plug: add Plug property type, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 10/21] qom: add plug_get QMP command, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 11/21] qom: add plug_set QMP command, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 08/21] qom: add plug_create QMP command, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 13/21] qom: add plug_destroy command, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 16/21] qom-devices: add a Pin class, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 17/21] qom: add CharDriver class, Anthony Liguori, 2011/07/24
- [Qemu-devel] [PATCH 12/21] qom: add plug_list_props QMP command, Anthony Liguori, 2011/07/24