Bug 9936

Summary: Host QEMU does not build with SDL support because of pkg-config
Product: buildroot Reporter: Ciro Santilli <ciro.santilli>
Component: OtherAssignee: unassigned
Status: RESOLVED WONTFIX    
Severity: normal CC: buildroot
Priority: P5    
Version: 2017.02   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Ciro Santilli 2017-06-03 02:59:01 UTC
I enable:

BR2_PACKAGE_HOST_QEMU=y
BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE=y
BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
BR2_PACKAGE_HOST_QEMU_VDE2=y

on the config.

Host QEMU builds and works with VNC, but "-display sdl" is not available.

The configuration logs say:

SDL support       no

However, if I do ./configure directly from host on the QEMU tree, SDL support is available, and builds with it, since I do have the libsdl2-dev package installed in Ubuntu 17.04.

I think the problem is the:

PKG_CONFIG="/home/ciro/bak/git/linux-kernel-module-cheat/buildroot/output/host/usr/bin/pkg-config"

and:

/home/ciro/bak/git/linux-kernel-module-cheat/buildroot/output/host/usr/bin/pkg-config sdl2

is wrongly false, while on host:

pkg-config sdl2

is true.

A dirty workaround is:

diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 66efcba..1e09ea4 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -74,6 +74,7 @@ HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH)

 ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
 HOST_QEMU_TARGETS += $(HOST_QEMU_SYS_ARCH)-softmmu
+HOST_QEMU_OPTS += --enable-sdl --with-sdlabi=2.0
 HOST_QEMU_OPTS += --enable-system --enable-fdt
 HOST_QEMU_DEPENDENCIES += host-dtc
 else
Comment 1 Ciro Santilli 2017-06-03 03:00:11 UTC
qemu_x86_64_defconfig is the base config.
Comment 2 Thomas Petazzoni 2017-06-03 08:02:43 UTC
We don't want to do this, because it would mean host-qemu would rely on your host installed SDL libraries, which is not what we want. In the current state of things, I don't think we are going to provide a host-qemu package that has SDL/graphics support as that would require to package too many host libraries in Buildroot.