package/mesa3d: make it aware of libglvnd and support it when present

When libglvnd is enabled, mesa3d must be told so, so as it installs its
libraries with the vendor suffix (e.g. libEGL_mesa.so instead of
libEGL.so).

Additionally, the provider (in Buildroot parlance) is libglvnd, not mesa3d.

Signed-off-by: Jakub Skrzypnik <jskrzypnik@novomatic-tech.com>
[yann.morin.1998@free.fr:
  - don't override the _PROVIDES variable, only assign when needed
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Jakub Skrzypnik 2020-07-27 10:47:02 +02:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 0378e2e5d9
commit 3f8fd984d8
2 changed files with 20 additions and 10 deletions

View File

@ -423,7 +423,8 @@ comment "gbm support needs a dri driver or a gallium driver w/ EGL support."
config BR2_PACKAGE_MESA3D_OPENGL_GLX
bool "OpenGL GLX"
depends on BR2_PACKAGE_XORG7
select BR2_PACKAGE_HAS_LIBGL
select BR2_PACKAGE_HAS_LIBGL if !BR2_PACKAGE_LIBGLVND
select BR2_PACKAGE_LIBGLVND_DISPATCH_GL if BR2_PACKAGE_LIBGLVND
select BR2_PACKAGE_MESA3D_NEEDS_X11
help
Enable GLX graphic acceleration (OpenGL + X11).
@ -433,7 +434,8 @@ comment "OpenGL GLX support needs X11"
config BR2_PACKAGE_MESA3D_OPENGL_EGL
bool "OpenGL EGL"
select BR2_PACKAGE_HAS_LIBEGL
select BR2_PACKAGE_HAS_LIBEGL if !BR2_PACKAGE_LIBGLVND
select BR2_PACKAGE_LIBGLVND_DISPATCH_EGL if BR2_PACKAGE_LIBGLVND
select BR2_PACKAGE_HAS_LIBEGL_WAYLAND
select BR2_PACKAGE_MESA3D_GBM
help
@ -442,7 +444,8 @@ config BR2_PACKAGE_MESA3D_OPENGL_EGL
config BR2_PACKAGE_MESA3D_OPENGL_ES
bool "OpenGL ES"
select BR2_PACKAGE_HAS_LIBGLES
select BR2_PACKAGE_HAS_LIBGLES if !BR2_PACKAGE_LIBGLVND
select BR2_PACKAGE_LIBGLVND_DISPATCH_GLES if BR2_PACKAGE_LIBGLVND
help
Use the Khronos OpenGL ES APIs. This is commonly used on
embedded systems and represents a subset of the OpenGL API.
@ -453,13 +456,13 @@ config BR2_PACKAGE_PROVIDES_LIBGBM
default "mesa3d" if BR2_PACKAGE_MESA3D_GBM
config BR2_PACKAGE_PROVIDES_LIBGL
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_GLX
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_GLX && !BR2_PACKAGE_LIBGLVND
config BR2_PACKAGE_PROVIDES_LIBEGL
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_EGL
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_EGL && !BR2_PACKAGE_LIBGLVND
config BR2_PACKAGE_PROVIDES_LIBGLES
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_ES
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_ES && !BR2_PACKAGE_LIBGLVND
config BR2_PACKAGE_PROVIDES_LIBOPENCL
default "mesa3d" if BR2_PACKAGE_MESA3D_OPENCL

View File

@ -167,9 +167,9 @@ MESA3D_CONF_OPTS += -Dopengl=true
# we do not need libva support in mesa3d, therefore disable this option
MESA3D_CONF_OPTS += -Dgallium-va=disabled
# libGL is only provided for a full xorg stack
# libGL is only provided for a full xorg stack, without libglvnd
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y)
MESA3D_PROVIDES += libgl
MESA3D_PROVIDES += $(if $(BR2_PACKAGE_LIBGLVND),,libgl)
else
define MESA3D_REMOVE_OPENGL_HEADERS
rm -rf $(STAGING_DIR)/usr/include/GL/
@ -207,7 +207,7 @@ MESA3D_CONF_OPTS += \
endif
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
MESA3D_PROVIDES += libegl
MESA3D_PROVIDES += $(if $(BR2_PACKAGE_LIBGLVND),,libegl)
MESA3D_CONF_OPTS += \
-Degl=enabled
else
@ -216,7 +216,7 @@ MESA3D_CONF_OPTS += \
endif
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
MESA3D_PROVIDES += libgles
MESA3D_PROVIDES += $(if $(BR2_PACKAGE_LIBGLVND),,libgles)
MESA3D_CONF_OPTS += -Dgles1=enabled -Dgles2=enabled
else
MESA3D_CONF_OPTS += -Dgles1=disabled -Dgles2=disabled
@ -271,4 +271,11 @@ ifeq ($(BR2_m68k),y)
MESA3D_CFLAGS += -mlong-jump-table-offsets
endif
ifeq ($(BR2_PACKAGE_LIBGLVND),y)
MESA3D_DEPENDENCIES += libglvnd
MESA3D_CONF_OPTS += -Dglvnd=true
else
MESA3D_CONF_OPTS += -Dglvnd=false
endif
$(eval $(meson-package))