From 1ed36d21b079f40ea606d827f8936123c2a74109 Mon Sep 17 00:00:00 2001
From: Brian Kubisiak <brian@kubisiak.com>
Date: Sun, 15 Nov 2020 04:10:02 +0300
Subject: [PATCH] egl: Fix detection in configure script on systems without X11
 (bug #5270)

In recent versions of EGL headers on Linux, the MESA_EGL_NO_X11_HEADERS macro is
deprecated and has been replaced with EGL_NO_X11. As a result, the configure
script would fail the compilation check for EGL headers and disable EGL (and by
extension, Wayland) support when X11 headers are not installed. Fix this by
adding the correct macro to disable X11 support in the headers.
---
 configure    | 1 +
 configure.ac | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configure b/configure
index e7444da86..7cb5d5303 100755
--- a/configure
+++ b/configure
@@ -22307,6 +22307,7 @@ $as_echo_n "checking for EGL support... " >&6; }
           #define LINUX
           #define EGL_API_FB
           #define MESA_EGL_NO_X11_HEADERS
+          #define EGL_NO_X11
           #include <EGL/egl.h>
           #include <EGL/eglext.h>
 
diff --git a/configure.ac b/configure.ac
index 76393e607..0cd62a980 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2374,6 +2374,7 @@ CheckOpenGLESX11()
           #define LINUX
           #define EGL_API_FB
           #define MESA_EGL_NO_X11_HEADERS
+          #define EGL_NO_X11
           #include <EGL/egl.h>
           #include <EGL/eglext.h>
         ],[