qemu: Add an option to remove host sdl/gl checking
v2 cover qemu: Add an option to remove host sdl/gl checking
From: Zhai Edwin <[email protected]>
Saul,
This is the V2 version to fix build error for qemu and qemu-nativesdk.
Add an PACKAGECONFIG in qemu to disable GL acceleration:
* By default configure try best to enable GL acceleration and fail when missing host dependency(libSDL and libGL).
* End user can also choose to turn off GL capability, thus remove the host dependence in building.
[YOCTO #2407] got fixed.
Thanks,
Edwin
The following changes since commit 54f38111868775c85bfe921592d8443a61952c62:
pango: Fix modules load failure in multilib environment (2012-05-14 21:50:55 +0800)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib gzhai/fix2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix2
Zhai Edwin (1):
qemu: Add an option to remove host sdl/gl checking
.../qemu/qemu-0.15.1/dummy-gl-config.patch | 31 +++++ .../qemu/qemu-0.15.1/glflags.patch | 40 ++++-- .../qemu/qemu-0.15.1/opengl-disable-option.patch | 137 ++++++++++++++++++++ meta/recipes-devtools/qemu/qemu.inc | 23 +--- meta/recipes-devtools/qemu/qemu_0.15.1.bb | 4 +- 5 files changed, 203 insertions(+), 32 deletions(-) create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/dummy-gl-config.patch create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch
PATCH v2 1/1 qemu: Add an option to remove host sdl/gl checking
From: Zhai Edwin <[email protected]>
Add an PACKAGECONFIG in qemu to disable GL acceleration:
* By default configure try best to enable GL acceleration and fail when missing host dependency(libSDL and libGL).
* End user can also choose to turn off GL capability, thus remove the host dependence in building.
[YOCTO #2407] got fixed.
--- .../qemu/qemu-0.15.1/dummy-gl-config.patch | 31 +++++ .../qemu/qemu-0.15.1/glflags.patch | 40 ++++-- .../qemu/qemu-0.15.1/opengl-disable-option.patch | 137 ++++++++++++++++++++ meta/recipes-devtools/qemu/qemu.inc | 23 +--- meta/recipes-devtools/qemu/qemu_0.15.1.bb | 4 +- 5 files changed, 203 insertions(+), 32 deletions(-) create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/dummy-gl-config.patch create mode 100644 meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch
meta/recipes-devtools/qemu/qemu-0.15.1/dummy-gl-config.patch new file +31 -0
@@ -0,0 +1,31 @@ +Add a dummy option for GL acceleration to pass the configure when there is no +GL acceleration patch. The parsing function will be filled by following +opengl-disable-option.patch. + +Upstream-Status: Inappropriate [other] - depends on GL patch + +Signed-off-by: Zhai Edwin <[email protected]> + +Index: qemu-0.15.1/configure +=================================================================== +--- qemu-0.15.1.orig/configure 2012-05-14 21:23:34.000000000 +0800 ++++ qemu-0.15.1/configure 2012-05-14 21:23:36.000000000 +0800 +@@ -179,6 +179,7 @@ + smartcard_nss="" + usb_redir="" + opengl="" ++gl_accel="yes" + guest_agent="yes" + + # parse CC options first +@@ -739,6 +740,10 @@ + ;; + --enable-opengl) opengl="yes" + ;; ++ --disable-gl-accel) gl_accel="no" ++ ;; ++ --enable-gl-accel) gl_accel="yes" ++ ;; + --*dir) + ;; + --disable-rbd) rbd="no"
meta/recipes-devtools/qemu/qemu-0.15.1/glflags.patch +29 -11
@@ -1,15 +1,33 @@ +Considering relocation, qemu-nativesdk is independent of host library except +libGL. Normal method like 'cat > $TMPC' doesn't work, so we check the library +directly. + Upstream-Status: Inappropriate [configuration] -Index: qemu-0.14.0/Makefile.target +Index: qemu-0.15.1/configure =================================================================== ---- qemu-0.14.0.orig/Makefile.target 2011-04-04 12:12:19.142871742 +0100 -+++ qemu-0.14.0/Makefile.target 2011-04-04 12:12:21.772871742 +0100 -@@ -362,7 +362,7 @@ - - monitor.o: hmp-commands.h qmp-commands.h - --LIBS += -lGL -lGLU -+LIBS += -lGL - - $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) +--- qemu-0.15.1.orig/configure 2012-05-25 18:26:05.000000000 +0800 ++++ qemu-0.15.1/configure 2012-05-29 09:43:27.000000000 +0800 +@@ -2032,15 +2032,13 @@ + exit 1; + fi +- gl_accel_libs="-lGL -lGLU" +- cat > $TMPC << EOF +-#include <X11/Xlib.h> +-#include <GL/gl.h> +-#include <GL/glx.h> +-#include <GL/glu.h> +-int main(void) { GL_VERSION; return 0; } +-EOF +- if compile_prog "" "-lGL -lGLU" ; then ++ gl_accel_libs="-lGL" ++ libgl='no' ++ test -e /usr/lib/libGL.so && libgl='yes' ++ test -e /usr/lib64/libGL.so && libgl='yes' ++ test -e /usr/lib/*-linux-gnu/libGL.so && libgl='yes' ++ ++ if test "$libgl" = "yes" ; then + gl_accel=yes + libs_softmmu="$gl_accel_libs $libs_softmmu" + else
meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch new file +137 -0
137 lines not on this page · raw message
meta/recipes-devtools/qemu/qemu.inc +3 -20
@@ -19,26 +19,6 @@ EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --di inherit autotools -# For our gl powered QEMU you need libGL and SDL headers -do_configure_prepend_virtclass-native() { - libgl='no' - libsdl='no' - - test -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so && libgl='yes' - test -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so && libgl='yes' - test -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so && libgl='yes' - - test -e /usr/lib/pkgconfig/sdl.pc -o -e /usr/lib64/pkgconfig/sdl.pc -o -e /usr/include/SDL/SDL.h && libsdl='yes' - - - if [ "$libsdl" != 'yes' -o "$libgl" != 'yes' ]; then - echo "You need libGL.so and libGLU.so to exist in your library path and the development headers for SDL installed to build qemu-native. - Ubuntu package names are: libgl1-mesa-dev, libglu1-mesa-dev and libsdl1.2-dev. - Fedora package names are: mesa-libGL mesa-libGLU SDL-devel." - exit 1; - fi -} - do_configure() { # Handle distros such as CentOS 5 32-bit that do not have kvm support KVMOPTS="--disable-kvm"
@@ -57,6 +37,9 @@ do_install () { install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu } +PACKAGECONFIG ??= "gl" +PACKAGECONFIG[gl] = "--enable-gl-accel,--disable-gl-accel,," + DEPENDS_virtclass-native = "zlib-native alsa-lib-native glib-2.0-native" DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk glib-2.0-nativesdk \ ${@base_contains('DISTRO_FEATURES', 'x11', 'qemugl-nativesdk', '', d)}"
meta/recipes-devtools/qemu/qemu_0.15.1.bb +3 -1
@@ -3,7 +3,7 @@ require qemu.inc LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" -PR = "r6" +PR = "r7" FILESPATH = "${FILE_DIRNAME}/qemu-${PV}" FILESDIR = "${WORKDIR}"
@@ -19,6 +19,7 @@ SRC_URI = "\ file://larger_default_ram_size.patch \ file://arm-bgr.patch \ file://a4d1f142542935b90d2eb30f3aead4edcf455fe6.patch \ + file://dummy-gl-config.patch \ " # Only use the GL passthrough patches for native/nativesdk versions
@@ -31,6 +32,7 @@ QEMUGLPATCHES = "\ file://qemugl-fix.patch \ file://opengl-sdl-fix.patch \ file://opengl-args-copy-fix.patch \ + file://opengl-disable-option.patch \ " SRC_URI_append_virtclass-native = "\
Signature · 1 line
1.7.1
Richard Purdie
AppliedQuoted 18 lines · On Tue, 2012-05-29 at 16:30 +0800, [email protected] wrote:
From: Zhai Edwin <[email protected]>
Saul,
This is the V2 version to fix build error for qemu and qemu-nativesdk.Add an PACKAGECONFIG in qemu to disable GL acceleration:
* By default configure try best to enable GL acceleration and fail when missing host dependency(libSDL and libGL).
* End user can also choose to turn off GL capability, thus remove the host dependence in building.[YOCTO #2407] got fixed.
Thanks,
EdwinThe following changes since commit
54f38111868775c85bfe921592d8443a61952c62:
Quoted 8 lines
pango: Fix modules load failure in multilib environment (2012-05-14 21:50:55 +0800)
are available in the git repository at:
git://git.pokylinux.org/poky-contribgzhai/fix2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix2Zhai Edwin (1):
qemu: Add an option to remove host sdl/gl checking
Merged to master, thanks.
Richard