* [PATCH] glew: build for EGL in non-X11 distros
@ 2016-12-18 17:02 Andre McCurdy
2016-12-19 11:46 ` Burton, Ross
2016-12-20 10:23 ` Burton, Ross
0 siblings, 2 replies; 5+ messages in thread
From: Andre McCurdy @ 2016-12-18 17:02 UTC (permalink / raw)
To: openembedded-core
The glew 2.0.0 release added support for building for EGL:
http://glew.sourceforge.net/log.html
Add PACKAGECONFIG options for 'opengl' (ie the previous default, with
dependencies on opengl and X11) and 'egl', which depends on EGL only
and allows glew to be built for non-X11 distros.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
.../glew/glew/linux-egl-no-libGL.patch | 38 ++++++++++++++++++++++
meta/recipes-graphics/glew/glew_2.0.0.bb | 22 ++++++++-----
2 files changed, 51 insertions(+), 9 deletions(-)
create mode 100644 meta/recipes-graphics/glew/glew/linux-egl-no-libGL.patch
diff --git a/meta/recipes-graphics/glew/glew/linux-egl-no-libGL.patch b/meta/recipes-graphics/glew/glew/linux-egl-no-libGL.patch
new file mode 100644
index 0000000..48fab16
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew/linux-egl-no-libGL.patch
@@ -0,0 +1,38 @@
+From b1317a2faff15ba91b38c2fe5fed24e18003c198 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Sun, 18 Dec 2016 07:01:12 -0800
+Subject: [PATCH] linux-egl no libGL
+
+libGL is not required when building with -DGLEW_EGL
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ config/Makefile.linux-clang-egl | 2 +-
+ config/Makefile.linux-egl | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config/Makefile.linux-clang-egl b/config/Makefile.linux-clang-egl
+index ca06419..ea8c703 100644
+--- a/config/Makefile.linux-clang-egl
++++ b/config/Makefile.linux-clang-egl
+@@ -1,4 +1,4 @@
+ include config/Makefile.linux-clang
+
+-LDFLAGS.GL = -lEGL -lGL
++LDFLAGS.GL = -lEGL
+ CFLAGS.EXTRA += -DGLEW_EGL
+diff --git a/config/Makefile.linux-egl b/config/Makefile.linux-egl
+index bcdc3cb..3bee77b 100644
+--- a/config/Makefile.linux-egl
++++ b/config/Makefile.linux-egl
+@@ -1,4 +1,4 @@
+ include config/Makefile.linux
+
+-LDFLAGS.GL = -lEGL -lGL
++LDFLAGS.GL = -lEGL
+ CFLAGS.EXTRA += -DGLEW_EGL
+--
+1.9.1
+
diff --git a/meta/recipes-graphics/glew/glew_2.0.0.bb b/meta/recipes-graphics/glew/glew_2.0.0.bb
index 489dd7c..e5bf3cb 100644
--- a/meta/recipes-graphics/glew/glew_2.0.0.bb
+++ b/meta/recipes-graphics/glew/glew_2.0.0.bb
@@ -2,14 +2,13 @@ SUMMARY = "OpenGL extension loading library"
DESCRIPTION = "The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library."
HOMEPAGE = "http://glew.sourceforge.net/"
BUGTRACKER = "http://sourceforge.net/tracker/?group_id=67586"
-SECTION = "x11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
-DEPENDS = "virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
-
SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \
- file://no-strip.patch"
+ file://no-strip.patch \
+ file://linux-egl-no-libGL.patch \
+"
SRC_URI[md5sum] = "2a2cd7c98f13854d2fcddae0d2b20411"
SRC_URI[sha256sum] = "c572c30a4e64689c342ba1624130ac98936d7af90c3103f9ce12b8a0c5736764"
@@ -19,12 +18,17 @@ UPSTREAM_CHECK_REGEX = "/glew/(?P<pver>(\d+[\.\-_]*)+)/"
inherit lib_package pkgconfig distro_features_check
-REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'opengl', 'egl', d)}"
+
+PACKAGECONFIG[opengl] = "SYSTEM='linux',,virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
+PACKAGECONFIG[egl] = "SYSTEM='linux-egl' GLEW_NO_GLU='-DGLEW_NO_GLU',,virtual/egl"
-# Override SYSTEM to avoid calling config.guess, we're cross-compiling. Pass
-# our CFLAGS via POPT as that's the optimisation variable and safely
-# overwritten.
-EXTRA_OEMAKE = "SYSTEM='linux' \
+# Override SYSTEM (via PACKAGECONFIG_CONFARGS) to avoid calling config.guess,
+# we're cross-compiling. Pass our CFLAGS via POPT as that's the optimisation
+# variable and safely overwritten.
+EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS} \
CC='${CC}' LD='${CC}' STRIP='' \
LDFLAGS.EXTRA='${LDFLAGS}' \
POPT='${CFLAGS}' \
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] glew: build for EGL in non-X11 distros
2016-12-18 17:02 [PATCH] glew: build for EGL in non-X11 distros Andre McCurdy
@ 2016-12-19 11:46 ` Burton, Ross
2016-12-19 11:51 ` Andre McCurdy
2016-12-20 10:23 ` Burton, Ross
1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-12-19 11:46 UTC (permalink / raw)
To: Andre McCurdy; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
On 18 December 2016 at 17:02, Andre McCurdy <armccurdy@gmail.com> wrote:
> Add PACKAGECONFIG options for 'opengl' (ie the previous default, with
> dependencies on opengl and X11) and 'egl', which depends on EGL only
> and allows glew to be built for non-X11 distros.
>
Can it build both or is this definitely a build time choice?
Ross
[-- Attachment #2: Type: text/html, Size: 774 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] glew: build for EGL in non-X11 distros
2016-12-19 11:46 ` Burton, Ross
@ 2016-12-19 11:51 ` Andre McCurdy
0 siblings, 0 replies; 5+ messages in thread
From: Andre McCurdy @ 2016-12-19 11:51 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
On Mon, Dec 19, 2016 at 3:46 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 18 December 2016 at 17:02, Andre McCurdy <armccurdy@gmail.com> wrote:
>>
>> Add PACKAGECONFIG options for 'opengl' (ie the previous default, with
>> dependencies on opengl and X11) and 'egl', which depends on EGL only
>> and allows glew to be built for non-X11 distros.
>
> Can it build both or is this definitely a build time choice?
Build time choice, one or the other.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] glew: build for EGL in non-X11 distros
2016-12-18 17:02 [PATCH] glew: build for EGL in non-X11 distros Andre McCurdy
2016-12-19 11:46 ` Burton, Ross
@ 2016-12-20 10:23 ` Burton, Ross
2016-12-20 11:20 ` Andre McCurdy
1 sibling, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-12-20 10:23 UTC (permalink / raw)
To: Andre McCurdy; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
On 18 December 2016 at 17:02, Andre McCurdy <armccurdy@gmail.com> wrote:
> The glew 2.0.0 release added support for building for EGL:
>
> http://glew.sourceforge.net/log.html
>
> Add PACKAGECONFIG options for 'opengl' (ie the previous default, with
> dependencies on opengl and X11) and 'egl', which depends on EGL only
> and allows glew to be built for non-X11 distros.
>
This failed on the nightly-no-x11 build on the AB:
tmp/linux-egl/default/shared/visualinfo.o: In function `main':
/usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:177: undefined
reference to `glGetString'
/usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:178: undefined
reference to `glGetString'
/usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:179: undefined
reference to `glGetString'
/usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:181: undefined
reference to `glGetString'
collect2: error: ld returned 1 exit status
(which is DISTRO=poky, DISTRO_FEATURES_remove=x11)
Ross
[-- Attachment #2: Type: text/html, Size: 1863 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] glew: build for EGL in non-X11 distros
2016-12-20 10:23 ` Burton, Ross
@ 2016-12-20 11:20 ` Andre McCurdy
0 siblings, 0 replies; 5+ messages in thread
From: Andre McCurdy @ 2016-12-20 11:20 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
On Tue, Dec 20, 2016 at 2:23 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 18 December 2016 at 17:02, Andre McCurdy <armccurdy@gmail.com> wrote:
>>
>> The glew 2.0.0 release added support for building for EGL:
>>
>> http://glew.sourceforge.net/log.html
>>
>> Add PACKAGECONFIG options for 'opengl' (ie the previous default, with
>> dependencies on opengl and X11) and 'egl', which depends on EGL only
>> and allows glew to be built for non-X11 distros.
>
> This failed on the nightly-no-x11 build on the AB:
>
> tmp/linux-egl/default/shared/visualinfo.o: In function `main':
> /usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:177: undefined
> reference to `glGetString'
> /usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:178: undefined
> reference to `glGetString'
> /usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:179: undefined
> reference to `glGetString'
> /usr/src/debug/glew/2.0.0-r0/glew-2.0.0/src/visualinfo.c:181: undefined
> reference to `glGetString'
> collect2: error: ld returned 1 exit status
>
> (which is DISTRO=poky, DISTRO_FEATURES_remove=x11)
Sorry about that. I was testing against an embedded 3D driver which
blurs the lines a little between libEGL and libGLESv2. With mesa
LDFLAGS needs to explicitly include either libGL, libGLESv1, libGLESv2
or libGLESv3. I'll send a v2 patch which adds PACKAGECONFIG options
for each case.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-20 11:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-18 17:02 [PATCH] glew: build for EGL in non-X11 distros Andre McCurdy
2016-12-19 11:46 ` Burton, Ross
2016-12-19 11:51 ` Andre McCurdy
2016-12-20 10:23 ` Burton, Ross
2016-12-20 11:20 ` Andre McCurdy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox