From 0511fc56e7017209ad18d16551ccaad05de9486c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 8 May 2017 23:12:49 +0200 Subject: Make EGL support optional It is perfectly possible to build Mesa3D with just OpenGL support, and use with GLX in X.org, without having EGL/OpenGLES support. However, libepoxy currently unconditionally requires EGL support in its configure.ac, which causes a build failure when Mesa3D only provides full OpenGL support: checking for EGL... no configure: error: Package requirements (egl) were not met: Package egl was not found in the pkg-config search path. Perhaps you should add the directory containing `egl.pc' to the PKG_CONFIG_PATH environment variable Package 'egl', required by 'world', not found This commit fixes that by: - Adjusting the configure.ac to add a --{enable,disable}-egl option handled in the exact same way as --{enable,disable}-glx - Adjusting the meson build logic in the same way. - Adjusting src/dispatch_common.h to define PLATFORM_HAS_EGL correctly, which allows to not include any EGL related header file if EGL support is not enabled. Signed-off-by: Thomas Petazzoni --- meson.build | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 5435f45..226152e 100644 --- a/meson.build +++ b/meson.build @@ -51,26 +51,41 @@ elif enable_glx == 'no' build_glx = false endif +enable_egl = get_option('enable-egl') +if enable_egl == 'auto' + if host_system == 'windows' + build_egl = false + elif host_system == 'darwin' + build_egl = false + elif host_system == 'android' + build_egl = false + else + build_egl = true + endif +elif enable_egl == 'yes' + build_egl = true +elif enable_egl == 'no' + build_egl = false +endif + # The remaining platform specific API for GL/GLES are enabled # depending on the platform we're building for if host_system == 'windows' - build_egl = false build_apple = false build_wgl = true has_znow = true elif host_system == 'darwin' - build_egl = false build_apple = true build_wgl = false has_znow = false else - build_egl = true build_apple = false build_wgl = false has_znow = true endif conf.set10('ENABLE_GLX', build_glx) +conf.set10('ENABLE_EGL', build_egl) # Compiler flags, taken from the Xorg macros if cc.get_id() == 'msvc' -- cgit v1.2.1