Xonotic Forums
[NEEDS INFO] Building on Mac M1 - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Help & Troubleshooting (https://forums.xonotic.org/forumdisplay.php?fid=4)
+--- Thread: [NEEDS INFO] Building on Mac M1 (/showthread.php?tid=9920)



Building on Mac M1 - claymore - 09-16-2024

Hi folks, had a quick shot at building on an M1 Macbook and its failing to find gmplib during ./configure

It looks like it needs to include homebrew directories /opt/homebrew/[lib,bin] instead of (or as well as?) /usr/local/[lib,bin]

Before I disappear down a rabbit warren, is this a known issue?

Many thanks
Claymore


RE: Building on Mac M1 - ballerburg9005 - 10-12-2024

Unfortunately, no serious devs use MacOS, so you will probably not find any good support ever.


RE: Building on Mac M1 - laurennjames10 - 04-03-2025

Guess I have to turn in my developer badge now Big Grin . Jokes aside, has anyone managed to get around this on an M1 Mac?


RE: Building on Mac M1 - cracked - 10-20-2026

Hi,

Serious developer on Mac here. We do exist, most of us don't just don't really care that much about silly open source games. We're mostly too busy doing super serious development stuff that only serious developers will understand. Getting this game to run on Mac, or any machine that can compile C, is simply a matter of linking against the correct libraries for your system. These will depend on your system to some extent, but I was able to get the game to compile on an M1 Mac with the following steps. I would encourage you to try them one at a time and watch how the error messages change, and try to learn what each of the files is compiling. The process of debugging these errors helped me get acquainted with the codebase and is actually kind of fun.

To include libraries installed via homebrew, you can run the following command in your terminal.
Code:
export CFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib"


In gmqcc/Makefile, look for the following line and replace --gc-sections with -dead-strip (around line 137)
Code:
LDFLAGS += -Wl,--gc-sections


In darkplaces/makefile.inc, find the following line and replace SDLCONFIG_STATICLIBS with SDLCONFIG_UNIXLIBS (around line 277)
Code:
LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS) #../../../SDLMain.m


In xonotic/misc/tools/all/release.su, find the following line and replace LDFLAGS_UNIXSDL WITH SDLCONFIG_UNIXLIBS (around line 339)
Code:
sed -i 's/LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_STATICLIBS)/LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl -framework IOKit $(SDLCONFIG_UNIXLIBS)/' Xonotic/source/darkplaces/makefile.inc



RE: Building on Mac M1 - bones_was_here - 10-21-2026

FYI the current autobuilds include native arm64 mac support (as fat binaries aka universal bins).