William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 1 | From bb9765a926588ebfe1eb324fbbe8fc22d419eebe Mon Sep 17 00:00:00 2001 |
| 2 | From: Max Krummenacher <max.krummenacher@toradex.com> |
| 3 | Date: Thu, 25 Jun 2020 11:27:40 +0000 |
| 4 | Subject: [PATCH] configure.ac: don't require eglmesaext.h |
| 5 | |
| 6 | E.g. the Vivante EGL implementation does not provide eglmesaext.h. |
| 7 | |
| 8 | The commit moves the check for header file existence outside of the |
| 9 | check for existence of a egl packageconfig and makes the existence |
| 10 | of eglmesaext.h optional. |
| 11 | |
| 12 | fixes commit fb1acfec ("Fix building against libglvnd-provided EGL headers") |
| 13 | Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> |
| 14 | |
| 15 | Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/cogl/-/merge_requests/28] |
| 16 | Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> |
| 17 | --- |
| 18 | configure.ac | 51 ++++++++++++++++++++++++++++++++------------------- |
| 19 | 1 file changed, 32 insertions(+), 19 deletions(-) |
| 20 | |
| 21 | diff --git a/configure.ac b/configure.ac |
| 22 | index b7ba95d..0d1d8de 100644 |
| 23 | --- a/configure.ac |
| 24 | +++ b/configure.ac |
| 25 | @@ -1212,22 +1212,6 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"], |
| 26 | PKG_CHECK_EXISTS([egl], |
| 27 | [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"], |
| 28 | [ |
| 29 | - AC_CHECK_HEADERS( |
| 30 | - [EGL/egl.h], |
| 31 | - [], |
| 32 | - [AC_MSG_ERROR([Unable to locate required EGL headers])]) |
| 33 | - AC_CHECK_HEADERS( |
| 34 | - [EGL/eglext.h], |
| 35 | - [], |
| 36 | - [AC_MSG_ERROR([Unable to locate required EGL headers])], |
| 37 | - [#include <EGL/egl.h>]) |
| 38 | - AC_CHECK_HEADERS( |
| 39 | - [EGL/eglmesaext.h], |
| 40 | - [], |
| 41 | - [AC_MSG_ERROR([Unable to locate required EGL headers])], |
| 42 | - [#include <EGL/egl.h> |
| 43 | -#include <EGL/eglext.h>]) |
| 44 | - |
| 45 | AC_CHECK_LIB(EGL, [eglInitialize], |
| 46 | [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"], |
| 47 | [AC_MSG_ERROR([Unable to locate required EGL library])]) |
| 48 | @@ -1236,9 +1220,38 @@ AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"], |
| 49 | ] |
| 50 | ) |
| 51 | |
| 52 | - COGL_EGL_INCLUDES="#include <EGL/egl.h> |
| 53 | -#include <EGL/eglext.h> |
| 54 | -#include <EGL/eglmesaext.h>" |
| 55 | +dnl Test for the existence of egl headers. |
| 56 | +dnl egl*.h includes eglplatform.h which on __unix__ defaults to a X11 platform. |
| 57 | +dnl In that case AC_CHECK_HEADERS failes if X11 headers are not available. |
| 58 | +dnl Set the usual include guard define and, if the EGL implementation doesn't |
| 59 | +dnl use that guard fall back to USE_OZONE and EGL_NO_X11 platforms which don't |
| 60 | +dnl require additional headers. |
| 61 | + AC_CHECK_HEADERS( |
| 62 | + [EGL/egl.h], |
| 63 | + [COGL_EGL_INCLUDES="#include <EGL/egl.h>"], |
| 64 | + [AC_MSG_ERROR([Unable to locate required EGL headers])], |
| 65 | + [#define __egl_h_ |
| 66 | + #define USE_OZONE |
| 67 | + #define EGL_NO_X11]) |
| 68 | + AC_CHECK_HEADERS( |
| 69 | + [EGL/eglext.h], |
| 70 | + [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES |
| 71 | +#include <EGL/eglext.h>"], |
| 72 | + [AC_MSG_ERROR([Unable to locate required EGL headers])], |
| 73 | + [#define __eglext_h_ |
| 74 | + #define USE_OZONE |
| 75 | + #define EGL_NO_X11 |
| 76 | +$COGL_EGL_INCLUDES]) |
| 77 | + AC_CHECK_HEADERS( |
| 78 | + [EGL/eglmesaext.h], |
| 79 | + [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDES |
| 80 | +#include <EGL/eglmesaext.h>"], |
| 81 | + [], |
| 82 | + [#define __eglmesaext_h_ |
| 83 | +#define USE_OZONE |
| 84 | +#define EGL_NO_X11 |
| 85 | +$COGL_EGL_INCLUDES]) |
| 86 | + |
| 87 | AC_SUBST([COGL_EGL_INCLUDES]) |
| 88 | ]) |
| 89 | |
| 90 | -- |
| 91 | 2.20.1 |
| 92 | |