Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make EGL support optional #123

Merged
merged 1 commit into from
Jun 6, 2017
Merged

Conversation

tpetazzoni
Copy link
Contributor

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

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>
Copy link
Collaborator

@ebassi ebassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good, with some minor nitpick.

AS_CASE([$host_os],
[mingw*], [build_egl=no],
[darwin*], [build_egl=no],
[android*], [build_egl=no],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure Android only has EGL, so it should not be listed there.

elif host_system == 'darwin'
build_egl = false
elif host_system == 'android'
build_egl = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: Android should have EGL built by default.

@ebassi
Copy link
Collaborator

ebassi commented May 22, 2017

As an addition, it would be great if your pull request also modified the .travis.yml file to include a build of Epoxy with -Denable-egl=false, just like we test the build without GLX. This would allow us to test the newly added configuration switch and ensure it's not breaking.

ebassi added a commit to ebassi/libepoxy that referenced this pull request Jun 6, 2017
Allow optionally disabling EGL support, just like we allow disabling GLX
support.

Closes anholt#123
@ebassi ebassi merged commit 0511fc5 into anholt:master Jun 6, 2017
@ebassi
Copy link
Collaborator

ebassi commented Jun 6, 2017

Thanks for working on this! I merged your branch and fixed the issues above.

@tpetazzoni
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants