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

Summary: Build fails with DRM/KMS backend on X11-less distribution
Product: SDL Reporter: Paul Cercueil <paul>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: HG 2.1   
Hardware: All   
OS: Linux   
Attachments: Patch to fix bug 4879

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