Compile macOS universal?

How does one compile SDL2 to be a fat library?
I tried:
CXXFLAGS="-arch arm64 -arch x86_64" CFLAGS="-arch arm64 -arch x86_64" ./configure

But no dice.

You can use the lipo command after configuring and building each architecture separately, to combine them. Maybe the configure toolset provides alternatives as well, but that should work.

If you build using the xcode project (xcodebuild command, if you prefer the command line) it should do it automatically for you.

Please check the docs, there’s a section on Makefiles and it requires a third step after building for each separately. It also gives alternatives.