diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-05-08 23:12:49 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-05-17 23:41:59 +0200 |
commit | 0511fc56e7017209ad18d16551ccaad05de9486c (patch) | |
tree | a00b146b6b58204be0f6307b137a6e195e4a05fd /configure.ac | |
parent | 5ef9c5ea24e5a0761baa2abda46c031eb0f6fd0f (diff) | |
download | libepoxy-0511fc56e7017209ad18d16551ccaad05de9486c.tar.gz |
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 <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 31b0985..2dbecd9 100644 --- a/configure.ac +++ b/configure.ac @@ -88,11 +88,35 @@ AS_CASE([$enable_glx], [AC_MSG_ERROR([Invalid value "$enable_glx" for option "--enable-glx"])] ]) -# The remaining platform specific API for GL/GLES are enabled -# depending on the platform we're building for +AC_ARG_ENABLE([egl], + [AC_HELP_STRING([--enable-egl=@<:@auto,yes,no@:>@], [Enable EGL support @<:@default=auto@:>@])], + [enable_egl=$enableval], + [enable_egl=auto]) + +AS_CASE([$enable_egl], + [auto], [ + AS_CASE([$host_os], + [mingw*], [build_egl=no], + [darwin*], [build_egl=no], + [android*], [build_egl=no], + [build_egl=yes]) + ], + + [yes], [ + build_egl=yes + ], + + [no], [ + build_egl=no + ], + + [AC_MSG_ERROR([Invalid value "$enable_egl" for option "--enable-egl"])] +]) + +# The remaining platform specific API are enabled depending on the +# platform we're building for AS_CASE([$host_os], [mingw*], [ - build_egl=no build_wgl=yes has_znow=yes # On windows, the DLL has to have all of its functions @@ -108,7 +132,6 @@ AS_CASE([$host_os], ], [darwin*], [ - build_egl=no build_wgl=no build_apple=yes has_znow=no @@ -116,7 +139,6 @@ AS_CASE([$host_os], ], [ - build_egl=yes build_wgl=no has_znow=yes # On platforms with dlopen, we load everything dynamically and @@ -131,6 +153,7 @@ AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes) if test x$build_egl = xyes; then PKG_CHECK_MODULES(EGL, [egl]) AC_DEFINE([BUILD_EGL], [1], [build EGL tests]) + AC_DEFINE(ENABLE_EGL, [1], [Whether EGL support is enabled]) fi AM_CONDITIONAL(BUILD_GLX, test x$build_glx = xyes) |