[OE-core] [PATCH 2/2] mesa-demos: provide option for disabling GLX demos

Awais Belal awais_belal at mentor.com
Fri Apr 22 13:24:49 UTC 2016


There are platforms that default to EGL only configurations
in which case the GLX applications are not required
at all. Allow the user to control generation of these
demos as needed through a configure switch.

Signed-off-by: Awais Belal <awais_belal at mentor.com>
---
 .../0012-only-build-GLX-demos-if-needed.patch      | 62 ++++++++++++++++++++++
 meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb     |  4 +-
 2 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/mesa/mesa-demos/0012-only-build-GLX-demos-if-needed.patch

diff --git a/meta/recipes-graphics/mesa/mesa-demos/0012-only-build-GLX-demos-if-needed.patch b/meta/recipes-graphics/mesa/mesa-demos/0012-only-build-GLX-demos-if-needed.patch
new file mode 100644
index 0000000..e7be4df
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0012-only-build-GLX-demos-if-needed.patch
@@ -0,0 +1,62 @@
+From 322af294390a7f4e1524c5a79312be6cbebce988 Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal at mentor.com>
+Date: Wed, 11 Nov 2015 17:22:12 +0500
+Subject: [PATCH] only build GLX demos if needed
+
+There are platforms that default to EGL only configurations
+in which case the GLX applications are not required
+at all. Allow the user to control generation of these
+demos as needed through a configure switch.
+
+Signed-off-by: Awais Belal <awais_belal at mentor.com>
+Upstream-Status: Pending
+---
+ configure.ac    | 9 +++++++++
+ src/Makefile.am | 6 +++++-
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index f8ec7e3..1a4d96d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,6 +132,11 @@ if test "x$enable_glu" = xyes; then
+     DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
+ fi
+ 
++AC_ARG_ENABLE([glx-demos],
++    [AS_HELP_STRING([--enable-glx-demos],
++        [enable GLX demos @<:@default=auto@:>@])],
++    [glx_demos_enabled="$enableval"],
++    [glx_demos_enabled=yes])
+ AC_ARG_ENABLE([egl],
+     [AS_HELP_STRING([--enable-egl],
+         [enable EGL library @<:@default=auto@:>@])],
+@@ -325,6 +333,7 @@ AC_SUBST([WAYLAND_LIBS])
+ 
+ AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLX, test "x$glx_demos_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8b89dee..a4d7e8f 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,8 +44,12 @@ SUBDIRS = \
+ 	slang \
+ 	tests \
+ 	tools \
+-	wgl \
++	wgl
++
++if HAVE_GLX
++SUBDIRS += \
+ 	xdemos
++endif
+ 
+ if HAVE_GLEW
+ SUBDIRS += \
+-- 
+1.9.1
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
index 2df9bba..a32a073 100644
--- a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
+++ b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
@@ -21,6 +21,7 @@ SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
     file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
     file://0010-sharedtex_mt-fix-rendering-thread-hang.patch \
     file://0011-drop-demos-dependant-on-obsolete-MESA_screen_surface.patch \
+    file://0012-only-build-GLX-demos-if-needed.patch \
 "
 SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
 SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"
@@ -29,7 +30,7 @@ inherit autotools pkgconfig distro_features_check
 # depends on virtual/egl, virtual/libgl ...
 REQUIRED_DISTRO_FEATURES = "opengl"
 
-PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
+PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 glx \
                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glew glu', '', d)}"
 
 # The Wayland code doesn't work with Wayland 1.0, so disable it for now
@@ -50,6 +51,7 @@ PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayla
 PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
 PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew"
 PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl"
+PACKAGECONFIG[glx] = "--enable-glx-demos,--disable-glx-demos"
 
 do_install_append() {
 	# it can be completely empty when all PACKAGECONFIG options are disabled
-- 
1.9.1




More information about the Openembedded-core mailing list