summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-04-01 12:02:05 +0200
committerraveit65 <[email protected]>2020-04-03 16:27:59 +0200
commitcbbf133bd515bab90a338e235438acd324d6713f (patch)
tree2803644258cf05d5a7aaeb87e70de45fe6bb8449
parent212df6c3085bf020ec9e4b9c0aee30d35f547ccc (diff)
downloadmate-session-manager-cbbf133bd515bab90a338e235438acd324d6713f.tar.bz2
mate-session-manager-cbbf133bd515bab90a338e235438acd324d6713f.tar.xz
build: make libglesv2 optional
-rw-r--r--configure.ac15
-rw-r--r--tools/Makefile.am7
-rw-r--r--tools/mate-session-check-accelerated.c18
3 files changed, 35 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 55e09cc..bd38f11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,12 +63,24 @@ PKG_CHECK_MODULES(ICE, ice)
PKG_CHECK_MODULES(XEXT, xext xau)
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= $GTK_REQUIRED)
PKG_CHECK_MODULES(GL_TEST, xcomposite gl glib-2.0 epoxy)
-PKG_CHECK_MODULES(GLES_TEST, egl glesv2)
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-3.0)
+dnl ====================================================================
+dnl GLESV2 (optional)
+dnl ====================================================================
+
+AC_ARG_WITH([libglesv2], AC_HELP_STRING([--without-libglesv2], [disable GLESV2 support]))
+have_glesv2=no
+if test x$with_libglesv2 != xno; then
+ PKG_CHECK_MODULES(GLES_TEST, egl glesv2, have_glesv2=yes, have_glesv2=no)
+fi
+if test "x$have_glesv2" = "xyes"; then
+ AC_DEFINE(HAVE_GLESV2, 1, [GLESV2 Support.])
+fi
+AM_CONDITIONAL([HAVE_GLESV2], [test "x$have_glesv2" = "xyes"])
dnl ====================================================================
dnl Option to set the default window manager
@@ -356,6 +368,7 @@ echo "
Default WM: ${with_default_wm}
Systemd support: ${use_systemd}
Elogind support: ${use_elogind}
+ GLES2 support: ${have_glesv2}
IPv6 support: ${have_full_ipv6}
Backtrace support: ${have_backtrace}
XRender support: ${have_xrender}
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 3948006..92222ff 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,8 +1,7 @@
bin_PROGRAMS = mate-session-save mate-session-inhibit
libexec_PROGRAMS = \
mate-session-check-accelerated \
- mate-session-check-accelerated-gl-helper \
- mate-session-check-accelerated-gles-helper
+ mate-session-check-accelerated-gl-helper
AM_CPPFLAGS = \
$(MATE_SESSION_CFLAGS) \
@@ -31,6 +30,9 @@ mate_session_inhibit_CPPFLAGS = \
mate_session_inhibit_LDADD = \
$(MATE_SESSION_LIBS)
+if HAVE_GLESV2
+libexec_PROGRAMS += mate-session-check-accelerated-gles-helper
+
mate_session_check_accelerated_gles_helper_SOURCES = \
mate-session-check-accelerated-common.h \
mate-session-check-accelerated-gles-helper.c
@@ -46,6 +48,7 @@ mate_session_check_accelerated_gles_helper_LDADD = \
$(GLES_TEST_LIBS) \
$(GTK3_LIBS) \
$(X11_LIBS)
+endif
mate_session_check_accelerated_gl_helper_SOURCES = \
mate-session-check-accelerated-common.h \
diff --git a/tools/mate-session-check-accelerated.c b/tools/mate-session-check-accelerated.c
index 3c0d4bd..d264953 100644
--- a/tools/mate-session-check-accelerated.c
+++ b/tools/mate-session-check-accelerated.c
@@ -21,6 +21,8 @@
* Colin Walters <[email protected]>
*/
+#include <config.h>
+
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
@@ -131,13 +133,17 @@ main (int argc, char **argv)
GdkDisplay *display = NULL;
int estatus;
char *gl_helper_argv[] = { LIBEXECDIR "/mate-session-check-accelerated-gl-helper", "--print-renderer", NULL };
+#ifdef HAVE_GLESV2
char *gles_helper_argv[] = { LIBEXECDIR "/mate-session-check-accelerated-gles-helper", "--print-renderer", NULL };
+ GError *gles_error = NULL;
+ char *gles_renderer_string = NULL;
+#endif
char *renderer_string = NULL;
- char *gl_renderer_string = NULL, *gles_renderer_string = NULL;
+ char *gl_renderer_string = NULL;
gboolean gl_software_rendering = FALSE, gles_software_rendering = FALSE;
Window rootwin;
glong is_accelerated, is_software_rendering;
- GError *gl_error = NULL, *gles_error = NULL;
+ GError *gl_error = NULL;
gtk_init (NULL, NULL);
@@ -241,6 +247,7 @@ main (int argc, char **argv)
g_printerr ("mate-session-check-accelerated: GL Helper exited with code %d\n", estatus);
}
+#ifdef HAVE_GLESV2
/* Then, try the GLES helper */
if (g_spawn_sync (NULL, (char **) gles_helper_argv, NULL, 0,
NULL, NULL, &gles_renderer_string, NULL, &estatus, &gles_error)) {
@@ -253,6 +260,7 @@ main (int argc, char **argv)
g_printerr ("mate-session-check-accelerated: GLES Helper exited with code %d\n", estatus);
}
+#endif
/* If we got here, GL software rendering is our best bet */
if (gl_software_rendering || gles_software_rendering) {
@@ -261,8 +269,10 @@ main (int argc, char **argv)
if (gl_software_rendering)
renderer_string = gl_renderer_string;
+#ifdef HAVE_GLESV2
else if (gles_software_rendering)
renderer_string = gles_renderer_string;
+#endif
goto finish;
}
@@ -273,10 +283,12 @@ main (int argc, char **argv)
g_clear_error (&gl_error);
}
+#ifdef HAVE_GLESV2
if (gles_error != NULL) {
g_printerr ("mate-session-check-accelerated: Failed to run GLES helper: %s\n", gles_error->message);
g_clear_error (&gles_error);
}
+#endif
finish:
if (is_accelerated) {
@@ -306,7 +318,9 @@ main (int argc, char **argv)
gdk_display_sync (display);
g_free (gl_renderer_string);
+#ifdef HAVE_GLESV2
g_free (gles_renderer_string);
+#endif
return is_accelerated ? 0 : 1;
}