|
@@ -1,88 +1,101 @@
|
|
|
-From bb0ffae7164d296d32da24fa5499534de259169a Mon Sep 17 00:00:00 2001
|
|
|
-From: Spenser Gilliland <spenser@gillilanding.com>
|
|
|
-Date: Sat, 24 Feb 2018 11:36:17 +0100
|
|
|
+From 9ec9f7b4d0ef5e799ca4cc5103163e4630d184d8 Mon Sep 17 00:00:00 2001
|
|
|
+From: Julien Olivain <ju.o@free.fr>
|
|
|
+Date: Fri, 16 Sep 2022 22:30:59 +0200
|
|
|
Subject: [PATCH] demos: makes opengl an optional component
|
|
|
|
|
|
-Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
|
|
|
-[Romain: convert to git patch, rebase on 8.4.0]
|
|
|
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
|
|
|
+This patch is a port of [1] for the new meson build system.
|
|
|
+
|
|
|
+[1].
|
|
|
+https://git.busybox.net/buildroot/tree/package/mesa3d-demos/0001-demos-makes-opengl-an-optional-component.patch?h=2022.08
|
|
|
+
|
|
|
+Signed-off-by: Julien Olivain <ju.o@free.fr>
|
|
|
---
|
|
|
- configure.ac | 12 +++++++++++-
|
|
|
- src/egl/opengl/Makefile.am | 2 ++
|
|
|
- src/util/Makefile.am | 2 ++
|
|
|
- 3 files changed, 15 insertions(+), 1 deletion(-)
|
|
|
+ meson.build | 19 ++++++++++++-------
|
|
|
+ meson_options.txt | 1 +
|
|
|
+ src/egl/meson.build | 5 ++++-
|
|
|
+ src/meson.build | 4 +++-
|
|
|
+ 4 files changed, 20 insertions(+), 9 deletions(-)
|
|
|
|
|
|
-diff --git a/configure.ac b/configure.ac
|
|
|
-index 0b5e9a76..24298c44 100644
|
|
|
---- a/configure.ac
|
|
|
-+++ b/configure.ac
|
|
|
-@@ -51,6 +51,14 @@ m4_ifndef([PKG_PROG_PKG_CONFIG],
|
|
|
- ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
|
|
|
- PKG_PROG_PKG_CONFIG()
|
|
|
+diff --git a/meson.build b/meson.build
|
|
|
+index e1968fab..a15699d6 100644
|
|
|
+--- a/meson.build
|
|
|
++++ b/meson.build
|
|
|
+@@ -38,7 +38,10 @@ add_project_arguments(
|
|
|
+ dep_m = cc.find_library('m', required : false)
|
|
|
+ dep_winmm = cc.find_library('winmm', required : false)
|
|
|
|
|
|
-+AC_ARG_ENABLE([gl],
|
|
|
-+ [AS_HELP_STRING([--enable-gl],
|
|
|
-+ [enable GL library @<:@default=no@:>@])],
|
|
|
-+ [gl_enabled="$enableval"],
|
|
|
-+ [gl_enabled=auto])
|
|
|
-+
|
|
|
-+if test "x$gl_enabled" != "xno"; then
|
|
|
-+
|
|
|
- dnl Get the pkg-config definitions for libGL. We include a fallback
|
|
|
- dnl path for GL implementation that don't provide a .pc file
|
|
|
- PKG_CHECK_MODULES(GL, [gl], [], [
|
|
|
-@@ -112,6 +120,8 @@ PKG_CHECK_MODULES(GLU, [glu], [],
|
|
|
- DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
|
|
|
- DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
|
|
|
+-dep_gl = dependency('gl')
|
|
|
++dep_gl = dependency('gl', required : get_option('gl'))
|
|
|
++if not dep_gl.found()
|
|
|
++ add_project_arguments('-DEGL_NO_X11=1', language: 'c')
|
|
|
++endif
|
|
|
|
|
|
-+fi
|
|
|
-+
|
|
|
- AC_ARG_ENABLE([egl],
|
|
|
- [AS_HELP_STRING([--enable-egl],
|
|
|
- [enable EGL library @<:@default=auto@:>@])],
|
|
|
-@@ -302,7 +312,7 @@ AC_SUBST([MESA_GLAPI])
|
|
|
- AC_SUBST([WAYLAND_CFLAGS])
|
|
|
- AC_SUBST([WAYLAND_LIBS])
|
|
|
+ dep_gles1 = dependency('glesv1_cm', required : get_option('gles1'))
|
|
|
+ dep_gles2 = dependency('glesv2', required : get_option('gles2'))
|
|
|
+@@ -75,13 +78,15 @@ endif
|
|
|
|
|
|
--
|
|
|
-+AM_CONDITIONAL(HAVE_GL, test "x$gl_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/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
|
|
|
-index 6d184ff6..219ab850 100644
|
|
|
---- a/src/egl/opengl/Makefile.am
|
|
|
-+++ b/src/egl/opengl/Makefile.am
|
|
|
-@@ -56,6 +56,7 @@ endif
|
|
|
- endif
|
|
|
+ dep_threads = dependency('threads')
|
|
|
|
|
|
- if HAVE_EGL
|
|
|
-+if HAVE_GL
|
|
|
- bin_PROGRAMS = \
|
|
|
- eglinfo
|
|
|
- noinst_PROGRAMS = \
|
|
|
-@@ -64,6 +65,7 @@ noinst_PROGRAMS = \
|
|
|
- $(EGL_X11_DEMOS) \
|
|
|
- $(EGL_WL_DEMOS)
|
|
|
+-dep_glu = dependency('glu', required : dep_x11.found())
|
|
|
+-if not dep_glu.found()
|
|
|
+- _glu_name = 'GLU'
|
|
|
+- if host_machine.system() == 'windows'
|
|
|
+- _glu_name = 'glu32'
|
|
|
++if dep_gl.found()
|
|
|
++ dep_glu = dependency('glu', required : dep_x11.found())
|
|
|
++ if not dep_glu.found()
|
|
|
++ _glu_name = 'GLU'
|
|
|
++ if host_machine.system() == 'windows'
|
|
|
++ _glu_name = 'glu32'
|
|
|
++ endif
|
|
|
++ dep_glu = cc.find_library(_glu_name, has_headers: 'GL/glu.h')
|
|
|
+ endif
|
|
|
+- dep_glu = cc.find_library(_glu_name, has_headers: 'GL/glu.h')
|
|
|
endif
|
|
|
+
|
|
|
+ # GBM is needed for EGL on KMS
|
|
|
+diff --git a/meson_options.txt b/meson_options.txt
|
|
|
+index ddadd2e3..f5405698 100644
|
|
|
+--- a/meson_options.txt
|
|
|
++++ b/meson_options.txt
|
|
|
+@@ -1,5 +1,6 @@
|
|
|
+ option('with-glut', type : 'string')
|
|
|
+ option('egl', type : 'feature')
|
|
|
++option('gl', type : 'feature')
|
|
|
+ option('gles1', type : 'feature')
|
|
|
+ option('gles2', type : 'feature')
|
|
|
+ option('osmesa', type : 'feature')
|
|
|
+diff --git a/src/egl/meson.build b/src/egl/meson.build
|
|
|
+index d1846921..42bf8ecd 100644
|
|
|
+--- a/src/egl/meson.build
|
|
|
++++ b/src/egl/meson.build
|
|
|
+@@ -19,7 +19,10 @@
|
|
|
+ # SOFTWARE.
|
|
|
+
|
|
|
+ subdir('eglut')
|
|
|
+-subdir('opengl')
|
|
|
++
|
|
|
++if dep_gl.found()
|
|
|
++ subdir('opengl')
|
|
|
+endif
|
|
|
|
|
|
- egltri_x11_SOURCES = egltri.c
|
|
|
- eglgears_x11_SOURCES = eglgears.c
|
|
|
-diff --git a/src/util/Makefile.am b/src/util/Makefile.am
|
|
|
-index 759a293a..012b9c75 100644
|
|
|
---- a/src/util/Makefile.am
|
|
|
-+++ b/src/util/Makefile.am
|
|
|
-@@ -27,7 +27,9 @@ AM_CFLAGS = \
|
|
|
- AM_LDFLAGS = \
|
|
|
- $(DEMO_LIBS)
|
|
|
+ if dep_gles1.found()
|
|
|
+ subdir('opengles1')
|
|
|
+diff --git a/src/meson.build b/src/meson.build
|
|
|
+index 39cac78d..7607c6de 100644
|
|
|
+--- a/src/meson.build
|
|
|
++++ b/src/meson.build
|
|
|
+@@ -20,7 +20,9 @@
|
|
|
+
|
|
|
+ subdir('glad')
|
|
|
|
|
|
-+if HAVE_GL
|
|
|
- noinst_LTLIBRARIES = libutil.la
|
|
|
+-subdir('util')
|
|
|
++if dep_gl.found()
|
|
|
++ subdir('util')
|
|
|
+endif
|
|
|
|
|
|
- if HAVE_GLUT
|
|
|
- AM_CFLAGS += \
|
|
|
+ if dep_glut.found()
|
|
|
+ subdir('demos')
|
|
|
--
|
|
|
-2.14.3
|
|
|
+2.37.3
|
|
|
|