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 5342

Summary: Failure to build on arm64-apple-darwin (ARM macOS Big Sur)
Product: SDL Reporter: fxcoudert
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.12   
Hardware: x86   
OS: Other   

Description fxcoudert 2020-11-08 15:24:07 UTC
SDL 2.0.12 fails to build on macOS Big Sur for ARM (Apple Silicon). When trying to build, I get:

In file included from /private/tmp/sdl2-20201108-12176-1btpgc2/SDL2-2.0.12/src/render/opengles/SDL_render_gles.c:27:
include/SDL_opengles.h:33:10: fatal error: 'GLES/gl.h' file not found
#include <GLES/gl.h>
         ^~~~~~~~~~~

The reason lies in the configure.ac code, which assumes that arm*-darwin* is the same as iOS. This was true before, but now more specific checks are needed. This happens in two places:

        # libusb does not support iOS
        arm*-apple-darwin* | *-ios-* )
            skiplibusb=yes
            ;;

and

    arm*-apple-darwin*|*-ios-*)
        ARCH=ios

which sets ARCH to ios instead of macosx on ARM Big Sur. Removing the arm-darwin part in both cases (and regenerating configure) allows to successful compilation of SDL.
Comment 1 Sam Lantinga 2020-11-12 03:32:59 UTC
This is fixed for the 2.0.14 release, thanks!