diff mbox

[03/29] package/qemu: add basic target selection

Message ID 333827ac19a2c39c08f387b846078441478d87af.1359498903.git.yann.morin.1998@free.fr
State Changes Requested
Headers show

Commit Message

Yann E. MORIN Jan. 29, 2013, 10:43 p.m. UTC
qemu-1.2.1 requires that at least one target emulation be enabled, so
we use some kconfig-tricks to force at least the systems emulations to
be enabled if user emulation is not selected.

This limitation will be lifted in the upcoming qemu-1.3.x

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/qemu/Config.in |   32 ++++++++++++++++++++++++++++++++
 package/qemu/qemu.mk   |   14 ++++++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni Jan. 30, 2013, 8:32 a.m. UTC | #1
Dear Yann E. MORIN,

On Tue, 29 Jan 2013 23:43:47 +0100, Yann E. MORIN wrote:
> qemu-1.2.1 requires that at least one target emulation be enabled, so
> we use some kconfig-tricks to force at least the systems emulations to
> be enabled if user emulation is not selected.
> 
> This limitation will be lifted in the upcoming qemu-1.3.x

Humm, the qemu package actually uses version 1.3.1, as per "[PATCH
01/29] package/qemu: bump version to 1.3.1" :-)

You also have the comment related to 1.2.x in the patch itself.

Best regards,

Thomas
Yann E. MORIN Jan. 30, 2013, 6:48 p.m. UTC | #2
Thomas, All,

On Wednesday 30 January 2013 Thomas Petazzoni wrote:
> On Tue, 29 Jan 2013 23:43:47 +0100, Yann E. MORIN wrote:
> > qemu-1.2.1 requires that at least one target emulation be enabled, so
> > we use some kconfig-tricks to force at least the systems emulations to
> > be enabled if user emulation is not selected.
> > 
> > This limitation will be lifted in the upcoming qemu-1.3.x
> 
> Humm, the qemu package actually uses version 1.3.1, as per "[PATCH
> 01/29] package/qemu: bump version to 1.3.1" :-)
> 
> You also have the comment related to 1.2.x in the patch itself.

Arg. I'll fix that. Thanks.

Regards,
Yann E. MORIN.
diff mbox

Patch

diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index b0ed279..9bfe37d 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -24,3 +24,35 @@  config BR2_PACKAGE_QEMU
 	  server and embedded PowerPC, and S390 guests.
 	  
 	  http://qemu.org/
+
+if BR2_PACKAGE_QEMU
+
+comment "Emulators selection"
+
+# QEMU 1.2.x requires that at least one target emulation be selected, so
+# we use the following two symbols to force systems emulation if user
+# emulation is not selected. This limitation will be lifted when qemu-1.3.0
+# is out.
+config BR2_PACKAGE_QEMU_EMUL_SET
+	bool
+
+config BR2_PACKAGE_QEMU_FORCE_SYSTEM
+	bool
+	default n if BR2_PACKAGE_QEMU_EMUL_SET
+	default y if ! BR2_PACKAGE_QEMU_EMUL_SET
+	select BR2_PACKAGE_QEMU_SYSTEM
+
+config BR2_PACKAGE_QEMU_SYSTEM
+	bool "Enable all systems emulation"
+	help
+	  Say 'y' to build all system emulators/virtualisers that QEMU supports.
+
+config BR2_PACKAGE_QEMU_LINUX_USER
+	bool "Enable all Linux user-land emulation"
+	select BR2_PACKAGE_QEMU_EMUL_SET
+	help
+	  Say 'y' to build all Linux user-land emulators that QEMU supports.
+
+# Note: bsd-user can not be build on Linux
+
+endif # BR2_PACKAGE_QEMU
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 6dfcdd9..c2302fa 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -97,6 +97,18 @@  QEMU_VARS =
     PYTHON=$(HOST_DIR)/usr/bin/python                                               \
     PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages    \
 
+ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y)
+QEMU_OPTS += --enable-system
+else
+QEMU_OPTS += --disable-system
+endif
+
+ifeq ($(BR2_PACKAGE_QEMU_LINUX_USER),y)
+QEMU_OPTS += --enable-linux-user
+else
+QEMU_OPTS += --disable-linux-user
+endif
+
 # Note: although QEMU uses a ./configure script, it is not compatible with
 #       the traditional autotools options (eg. --target et al.), so we have
 #       to override the default provided by the autotools-package infra, and
@@ -118,8 +130,6 @@  define QEMU_CONFIGURE_CMDS
 	        --enable-nptl                       \
 	        --enable-attr                       \
 	        --enable-vhost-net                  \
-	        --enable-system                     \
-	        --enable-linux-user                 \
 	        --disable-bsd-user                  \
 	        --disable-xen                       \
 	        --disable-slirp                     \