We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4879 - Build fails with DRM/KMS backend on X11-less distribution
Summary: Build fails with DRM/KMS backend on X11-less distribution
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-27 23:07 UTC by Paul Cercueil
Modified: 2020-03-02 23:15 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix bug 4879 (1007 bytes, patch)
2019-12-06 14:10 UTC, Paul Cercueil
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Cercueil 2019-11-27 23:07:52 UTC
On a distribution where X11 is not available, but KMS can be used, SDL2 fails to build.

This is due to the fact that <EGL/eglplatform.h> from Mesa will include <X11/Xlib.h> unless the EGL_NO_X11 macro is set (or MESA_EGL_NO_X11_HEADERS which is deprecated and will trigger a warning).

I believe that if the DRM/KMS backend is enabled, but X11 is not found, the macro should be defined in the CFLAGS. Doing so results in SDL2 compiling and working fine.
Comment 1 Sam Lantinga 2019-12-03 15:21:49 UTC
That sounds reasonable. Do you have a tested patch that does this?
Comment 2 Paul Cercueil 2019-12-06 14:10:15 UTC
Created attachment 4090 [details]
Patch to fix bug 4879