diff mbox series

configure: Do not require GBM for OpenGL

Message ID 20210219113152.35384-1-akihiko.odaki@gmail.com (mailing list archive)
State New, archived
Headers show
Series configure: Do not require GBM for OpenGL | expand

Commit Message

Akihiko Odaki Feb. 19, 2021, 11:31 a.m. UTC
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 configure                | 11 +++++------
 include/ui/egl-helpers.h |  2 ++
 ui/meson.build           |  1 +
 3 files changed, 8 insertions(+), 6 deletions(-)

Comments

Gerd Hoffmann Feb. 22, 2021, 10:28 a.m. UTC | #1
On Fri, Feb 19, 2021 at 08:31:52PM +0900, Akihiko Odaki wrote:
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>

Breaks windows build: https://gitlab.com/kraxel/qemu/-/jobs/1046112682

# ls /usr/x86_64-w64-mingw32/sys-root/mingw/include/epoxy/
common.h  gl.h  gl_generated.h  wgl.h  wgl_generated.h

Seems windows has no egl support, and so far the gbm requirement
prevented opengl getting enabled on windows.  Seems we need to add
an explicit egl test ...

take care,
  Gerd
diff mbox series

Patch

diff --git a/configure b/configure
index 9f016b06b54..bd96929d7b4 100755
--- a/configure
+++ b/configure
@@ -3576,14 +3576,13 @@  if $pkg_config gbm; then
 fi
 
 if test "$opengl" != "no" ; then
-  opengl_pkgs="epoxy gbm"
-  if $pkg_config $opengl_pkgs; then
-    opengl_cflags="$($pkg_config --cflags $opengl_pkgs)"
-    opengl_libs="$($pkg_config --libs $opengl_pkgs)"
+  if $pkg_config epoxy; then
+    opengl_cflags="$($pkg_config --cflags epoxy)"
+    opengl_libs="$($pkg_config --libs epoxy)"
     opengl=yes
   else
     if test "$opengl" = "yes" ; then
-      feature_not_found "opengl" "Please install opengl (mesa) devel pkgs: $opengl_pkgs"
+      feature_not_found "opengl" "Please install epoxy"
     fi
     opengl_cflags=""
     opengl_libs=""
@@ -3591,7 +3590,7 @@  if test "$opengl" != "no" ; then
   fi
 fi
 
-if test "$opengl" = "yes"; then
+if test "$gbm" = "yes" && test "$opengl" = "yes"; then
   cat > $TMPC << EOF
 #include <epoxy/egl.h>
 #ifndef EGL_MESA_image_dma_buf_export
diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h
index 94a4b3e6f3b..cc12761c53b 100644
--- a/include/ui/egl-helpers.h
+++ b/include/ui/egl-helpers.h
@@ -3,7 +3,9 @@ 
 
 #include <epoxy/gl.h>
 #include <epoxy/egl.h>
+#ifdef CONFIG_OPENGL_DMABUF
 #include <gbm.h>
+#endif
 #include "ui/console.h"
 #include "ui/shader.h"
 
diff --git a/ui/meson.build b/ui/meson.build
index 634fabab0d5..33aa514cad0 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -45,6 +45,7 @@  endif
 
 if config_host.has_key('CONFIG_OPENGL')
   opengl_ss = ss.source_set()
+  opengl_ss.add(gbm)
   opengl_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL'],
                if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c'))
   ui_modules += {'opengl' : opengl_ss}