From patchwork Mon Jul 25 01:44:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 106593 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0F057B6F7D for ; Mon, 25 Jul 2011 12:23:14 +1000 (EST) Received: from localhost ([::1]:55452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlAEs-0005it-B3 for incoming@patchwork.ozlabs.org; Sun, 24 Jul 2011 21:45:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]:42264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlAEB-0003j3-QS for qemu-devel@nongnu.org; Sun, 24 Jul 2011 21:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlAE7-0005R3-6U for qemu-devel@nongnu.org; Sun, 24 Jul 2011 21:45:03 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:43447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlAE7-0005QQ-1J for qemu-devel@nongnu.org; Sun, 24 Jul 2011 21:44:59 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p6P1LKSI004663 for ; Sun, 24 Jul 2011 21:21:20 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6P1ivQc441002 for ; Sun, 24 Jul 2011 21:44:57 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p6P1iu6F006851 for ; Sun, 24 Jul 2011 21:44:56 -0400 Received: from titi.austin.rr.com (sig-9-65-207-230.mts.ibm.com [9.65.207.230]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p6P1itKg006824; Sun, 24 Jul 2011 21:44:56 -0400 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Sun, 24 Jul 2011 20:44:33 -0500 Message-Id: <1311558293-5855-2-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1311558293-5855-1-git-send-email-aliguori@us.ibm.com> References: <1311558293-5855-1-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.182.143 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH 01/21] qom: add make infrastructure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 +# +# 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"