Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[NEEDS INFO] Building on Mac M1

#1
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
Reply

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

#3
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?
Reply

#4
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
Reply

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



Possibly Related Threads…
Thread Author Replies Views Last Post
  [NEED HELP] Running On Mac jpumroy 2 6,876 01-04-2024, 09:04 PM
Last Post: jpumroy
  [NEED HELP] NetRadiant crashes on Build - Mac (10.12.6) Space Ace 0 3,091 04-24-2019, 10:41 PM
Last Post: Space Ace
  [NEED HELP] NetRadiant doesn't compile on Mac nokko 3 5,071 03-29-2019, 11:19 AM
Last Post: Freddy
  [BUG] Fkeys F-keys F keys not working Mac OS Sierra 0.8.22 Space Ace 8 7,806 10-02-2017, 10:04 PM
Last Post: Space Ace
  [NEED HELP] Mac OSX Crashing very often and randomly -MCSquare- 0 3,526 01-30-2016, 12:08 AM
Last Post: -MCSquare-
  [SOLVED] Trouble with launch Xonotic on Mac OS X kanatov 6 16,770 10-03-2015, 10:49 AM
Last Post: SomeGuy
  [NEED HELP] Xonotic 0.8 completely froze my Mac a few times Player110 0 3,323 06-23-2015, 02:16 PM
Last Post: Player110
  [SOLVED] [Autobuild] Note to Mac users Mario 0 4,562 10-17-2014, 12:47 AM
Last Post: Mario
  [SOLVED] Minimizing Xonotic on a Mac imsoclever 3 4,915 11-13-2013, 10:14 PM
Last Post: imsoclever
  [BUG] Mac OSX 10.9 (Possibly 10.8 as well) Video Issue sirdavesmith 0 4,511 10-24-2013, 09:07 AM
Last Post: sirdavesmith

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-