[OE-core] [Consolidated Pull 4/5] qemu: Add an option to remove host sdl/gl checking

2012-05-23 Thread Saul Wold
From: Zhai Edwin edwin.z...@intel.com

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.

Signed-off-by: Zhai Edwin edwin.z...@intel.com
---
 .../qemu/qemu-0.15.1/opengl-disable-option.patch   |  172 
 meta/recipes-devtools/qemu/qemu.inc|   23 +---
 meta/recipes-devtools/qemu/qemu_0.15.1.bb  |1 +
 3 files changed, 176 insertions(+), 20 deletions(-)
 create mode 100644 
meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch

diff --git a/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch 
b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch
new file mode 100644
index 000..d0c5f23
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch
@@ -0,0 +1,172 @@
+Add an option gl-accel to disable GL acceleration:
+* When enabled, configure try best to enable GL acceleration and fail when
+  missing host dependency(libSDL and libGL), which is the default.
+* When disabled, end user choose to turn off GL capability, thus remove the
+  host dependence in building.
+
+Upstream-Status: Inappropriate [other] - depends on GL patch
+
+Signed-off-by: Zhai Edwin edwin.z...@intel.com
+
+Index: qemu-0.15.1/Makefile.target
+===
+--- qemu-0.15.1.orig/Makefile.target   2012-05-14 21:23:36.0 +0800
 qemu-0.15.1/Makefile.target2012-05-14 21:26:19.0 +0800
+@@ -79,15 +79,20 @@
+ libobj-y += cpuid.o
+ endif
+ libobj-$(CONFIG_NEED_MMU) += mmu.o
++
+ ifndef CONFIG_LINUX_USER
++ifdef CONFIG_GL_ACCEL
+ libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
+ libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+ else
+-ifdef CONFIG_SDL
+ libobj-$(TARGET_I386) += dummygl.o
+ libobj-$(TARGET_X86_64) += dummygl.o
+-endif
++endif #CONFIG_GL_ACCEL
++else
++libobj-$(TARGET_I386) += dummygl.o
++libobj-$(TARGET_X86_64) += dummygl.o
+ endif #CONFIG_LINUX_USER
++
+ libobj-$(TARGET_ARM) += dummygl.o
+ libobj-$(TARGET_MIPS) += dummygl.o
+ libobj-$(TARGET_MIPS64) += dummygl.o
+@@ -262,8 +267,10 @@
+ obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
+ 
+ ifeq ($(TARGET_BASE_ARCH), i386)
++ifdef CONFIG_GL_ACCEL
+ QEMU_CFLAGS += -DTARGET_OPENGL_OK
+ endif
++endif
+ 
+ # shared objects
+ obj-ppc-y = ppc.o
+@@ -409,8 +416,6 @@
+ 
+ monitor.o: hmp-commands.h qmp-commands.h
+ 
+-LIBS += -lGL -lGLU
+-
+ $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
+ 
+ obj-y += $(addprefix ../, $(common-obj-y))
+Index: qemu-0.15.1/configure
+===
+--- qemu-0.15.1.orig/configure 2012-05-14 21:23:34.0 +0800
 qemu-0.15.1/configure  2012-05-14 21:23:36.0 +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
+@@ -2016,6 +2021,39 @@
+   fi
+ fi
+ 
++#
++# GL acceleration probe depending on gl, glu and sdl
++if test $gl_accel != no ; then
++  if test $sdl = no ; then
++gl_accel=no
++echo libSDL and header no found to build opengl acceleration for 
qemu-native.
++Ubuntu package names are: libsdl1.2-dev.
++Fedora package names are: SDL-devel.
++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=yes
++libs_softmmu=$gl_accel_libs $libs_softmmu
++  else
++feature_not_found gl_accel
++gl_accel=no
++gl_accel_libs=
++echo libGL.so and libGLU.so not found to build opengl acceleration for 
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
++fi
++
+ #
+ # Check for xxxat() functions when we are building linux-user
+ # emulator.  This is done because older glibc versions don't
+@@ -2717,6 +2755,7 @@
+ echo nss used  $smartcard_nss
+ echo usb net redir $usb_redir
+ echo OpenGL support$opengl
++echo GL acceleration support$gl_accel
+ echo build guest agent $guest_agent
+ 
+ if test $sdl_too_old = yes; then
+@@ -3020,6 +3059,10 @@
+   echo CONFIG_OPENGL=y  $config_host_mak
+ fi
+ 
++if test $gl_accel = yes ; then
++  echo CONFIG_GL_ACCEL=y  $config_host_mak
++fi
++
+ # XXX: suppress that
+ if [ $bsd = yes ] ; then
+ 

Re: [OE-core] [Consolidated Pull 4/5] qemu: Add an option to remove host sdl/gl checking

2012-05-23 Thread Saul Wold

On 05/23/2012 03:46 PM, Saul Wold wrote:

From: Zhai Edwinedwin.z...@intel.com

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.

I think I found a problem with this when building for the target, so I 
pulled it from the branch.


Sau!

Signed-off-by: Zhai Edwinedwin.z...@intel.com
---
  .../qemu/qemu-0.15.1/opengl-disable-option.patch   |  172 
  meta/recipes-devtools/qemu/qemu.inc|   23 +---
  meta/recipes-devtools/qemu/qemu_0.15.1.bb  |1 +
  3 files changed, 176 insertions(+), 20 deletions(-)
  create mode 100644 
meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch

diff --git a/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch 
b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch
new file mode 100644
index 000..d0c5f23
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-0.15.1/opengl-disable-option.patch
@@ -0,0 +1,172 @@
+Add an option gl-accel to disable GL acceleration:
+* When enabled, configure try best to enable GL acceleration and fail when
+  missing host dependency(libSDL and libGL), which is the default.
+* When disabled, end user choose to turn off GL capability, thus remove the
+  host dependence in building.
+
+Upstream-Status: Inappropriate [other] - depends on GL patch
+
+Signed-off-by: Zhai Edwinedwin.z...@intel.com
+
+Index: qemu-0.15.1/Makefile.target
+===
+--- qemu-0.15.1.orig/Makefile.target   2012-05-14 21:23:36.0 +0800
 qemu-0.15.1/Makefile.target2012-05-14 21:26:19.0 +0800
+@@ -79,15 +79,20 @@
+ libobj-y += cpuid.o
+ endif
+ libobj-$(CONFIG_NEED_MMU) += mmu.o
++
+ ifndef CONFIG_LINUX_USER
++ifdef CONFIG_GL_ACCEL
+ libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
+ libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
+ else
+-ifdef CONFIG_SDL
+ libobj-$(TARGET_I386) += dummygl.o
+ libobj-$(TARGET_X86_64) += dummygl.o
+-endif
++endif #CONFIG_GL_ACCEL
++else
++libobj-$(TARGET_I386) += dummygl.o
++libobj-$(TARGET_X86_64) += dummygl.o
+ endif #CONFIG_LINUX_USER
++
+ libobj-$(TARGET_ARM) += dummygl.o
+ libobj-$(TARGET_MIPS) += dummygl.o
+ libobj-$(TARGET_MIPS64) += dummygl.o
+@@ -262,8 +267,10 @@
+ obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
+
+ ifeq ($(TARGET_BASE_ARCH), i386)
++ifdef CONFIG_GL_ACCEL
+ QEMU_CFLAGS += -DTARGET_OPENGL_OK
+ endif
++endif
+
+ # shared objects
+ obj-ppc-y = ppc.o
+@@ -409,8 +416,6 @@
+
+ monitor.o: hmp-commands.h qmp-commands.h
+
+-LIBS += -lGL -lGLU
+-
+ $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
+
+ obj-y += $(addprefix ../, $(common-obj-y))
+Index: qemu-0.15.1/configure
+===
+--- qemu-0.15.1.orig/configure 2012-05-14 21:23:34.0 +0800
 qemu-0.15.1/configure  2012-05-14 21:23:36.0 +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
+@@ -2016,6 +2021,39 @@
+   fi
+ fi
+
++#
++# GL acceleration probe depending on gl, glu and sdl
++if test $gl_accel != no ; then
++  if test $sdl = no ; then
++gl_accel=no
++echo libSDL and header no found to build opengl acceleration for 
qemu-native.
++Ubuntu package names are: libsdl1.2-dev.
++Fedora package names are: SDL-devel.
++exit 1;
++  fi
++
++  gl_accel_libs=-lGL -lGLU
++  cat  $TMPC  EOF
++#includeX11/Xlib.h
++#includeGL/gl.h
++#includeGL/glx.h
++#includeGL/glu.h
++int main(void) { GL_VERSION; return 0; }
++EOF
++  if compile_prog  -lGL -lGLU ; then
++gl_accel=yes
++libs_softmmu=$gl_accel_libs $libs_softmmu
++  else
++feature_not_found gl_accel
++gl_accel=no
++gl_accel_libs=
++echo libGL.so and libGLU.so not found to build opengl acceleration for 
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
++fi
++
+ #
+ # Check for xxxat() functions when we are building linux-user
+ # emulator.  This is done because older glibc versions don't
+@@ -2717,6 +2755,7 @@
+ echo nss used  $smartcard_nss
+ echo usb net redir $usb_redir
+ echo OpenGL support$opengl
++echo GL acceleration support$gl_accel
+ echo build guest agent $guest_agent
+
+ if test $sdl_too_old = yes; then
+@@ -3020,6 +3059,10 @@
+   echo CONFIG_OPENGL=y  $config_host_mak
+ 

Re: [OE-core] [Consolidated Pull 4/5] qemu: Add an option to remove host sdl/gl checking

2012-05-23 Thread Zhai, Edwin

On 05/24/2012 11:44 AM, Saul Wold wrote:

On 05/23/2012 03:46 PM, Saul Wold wrote:

From: Zhai Edwinedwin.z...@intel.com

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.


I think I found a problem with this when building for the target, so I
pulled it from the branch.



Which target? Can you attach build log?




Sau!



___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [Consolidated Pull 4/5] qemu: Add an option to remove host sdl/gl checking

2012-05-23 Thread Saul Wold

On 05/23/2012 09:28 PM, Zhai, Edwin wrote:

On 05/24/2012 11:44 AM, Saul Wold wrote:

On 05/23/2012 03:46 PM, Saul Wold wrote:

From: Zhai Edwinedwin.z...@intel.com

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.


I think I found a problem with this when building for the target, so I
pulled it from the branch.



Which target? Can you attach build log?


I am seeing 2 different failures.

MACHINE=beagleboard
Target: qemu (target device not native)
ERROR: Function failed: do_configure (see 
/srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/qemu-0.15.1-r7/temp/log.do_configure.20469 
for further information)
ERROR: Logfile of failure stored in: 
/srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/qemu-0.15.1-r7/temp/log.do_configure.20469

Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 
'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']

| DEBUG: Executing shell function do_configure
| ERROR: unknown option --enable-gl-accel
|
| Usage: configure [options]
| Options: [defaults in brackets after descriptions


MACHINE=qemuarm
Target meta-toolchain-gmae:
ERROR: Command Error: exit status: 1  Output:
Applying patch glflags.patch
patching file Makefile.target
Hunk #1 FAILED at 362.
1 out of 1 hunk FAILED -- rejects in file Makefile.target
Patch glflags.patch does not apply (enforce with -f)
ERROR: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: 
/srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/qemu-nativesdk-0.15.1-r7/temp/log.do_patch.2







Sau!






___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core