Compiling On Mac

Everything todo with programming goes HERE.
Post Reply
|Cow
Posts: 2
Joined: Sun Feb 02, 2014 4:30 am

Compiling On Mac

Post by |Cow »

Hello guys, this is my first post on the forum, I was wondering if someone could explain to me how I recompile the game engine, on operating system X.
Thanks in advance.

|Cow
Posts: 2
Joined: Sun Feb 02, 2014 4:30 am

Re: Compiling On Mac

Post by |Cow »

I am still looking for help.
Thanks

User avatar
LOVER$BOY
Match Winner
Posts: 725
Joined: Thu Jan 24, 2008 12:46 pm
Contact:

Re: Compiling On Mac

Post by LOVER$BOY »

Well please be patient. I'm sure some of the dev members will help you out with that. Unfortunately I'm windows based and I too am looking for a way to compile my server stuff in mac but to no avail.

Good luck! ;)
Image

User avatar
delinquent
Match Winner
Posts: 728
Joined: Sat Jul 07, 2012 3:07 am

Re: Compiling On Mac

Post by delinquent »

If you're familiar with automake, the source files can be found here:

https://code.launchpad.net/~dlh/armaget ... rge/152075

As for actually doing it... erm... hmm.

sab24
Posts: 2
Joined: Thu Apr 09, 2020 2:14 pm

Re: Compiling On Mac

Post by sab24 »

Hi,

It's not that hard at all.

1. Download the source code
2. extract the tar.gz
3. open terminal
4. cd into the directory where you extracted the source
5. run ./configure
6. run make
7. fix the command that fails on macos by adding -framework OpenGL -framework GLUT to the command that fails. Or you can edit the makefile, actually developers should do this
8. open the src/armagetronad_main file

I compiled this morning, it works for me. If you need help let me know.

sab24
Posts: 2
Joined: Thu Apr 09, 2020 2:14 pm

Re: Compiling On Mac

Post by sab24 »

And to compile the latest source from launchpad you need to change two commands:

g++ -iquote ./tools -iquote ./tools/values -iquote ./resource -iquote ./thirdparty/mathexpr -iquote ./thirdparty/utf8 -iquote ./protobuf -iquote protobuf -iquote ./render -iquote ./ui -iquote ./thirdparty/shttpd -iquote ./thirdparty/scrap -iquote ./network -iquote ./engine -iquote ./engine/sound -iquote ./engine/sound/sdl_mixer -iquote ./thirdparty/particles -iquote ./tron -iquote ./tron/cockpit -iquote ./tron/zone -O2 -std=c++11 -D_THREAD_SAFE -o armagetronad_main tron/armagetronad_main-gFloor.o tron/cockpit/armagetronad_main-cCockpit.o tron/cockpit/armagetronad_main-cMap.o tron/cockpit/armagetronad_main-cCamview.o tron/zone/armagetronad_main-zFortress.o libtron.a libenginecore.a libengine.a libnetwork.a libui.a librender.a libtools.a protobuf/libprotobuf.a thirdparty/mathexpr/libmathexpr.a thirdparty/particles/libparticles.a thirdparty/scrap/libscrap.a -lSDL2_image -lSDL2_mixer -L/usr/local/lib -lSDL2 -lprotobuf -lpthread -lxml2 -lpng16 -L/usr/local/Cellar/ftgl/2.1.3-rc5/lib -lftgl -L/usr/local/opt/freetype/lib -lfreetype -framework OpenGL -framework GLUT -framework CoreFoundation -framework CoreServices




g++ -iquote ./tools -iquote ./tools/values -iquote ./resource -iquote ./thirdparty/mathexpr -iquote ./thirdparty/utf8 -iquote ./protobuf -iquote protobuf -iquote ./render -iquote ./ui -iquote ./thirdparty/shttpd -iquote ./thirdparty/scrap -iquote ./network -iquote ./engine -iquote ./engine/sound -iquote ./engine/sound/sdl_mixer -iquote ./thirdparty/particles -iquote ./tron -iquote ./tron/cockpit -iquote ./tron/zone -O2 -std=c++11 -D_THREAD_SAFE -o armagetronad_main tron/armagetronad_main-gFloor.o tron/cockpit/armagetronad_main-cCockpit.o tron/cockpit/armagetronad_main-cMap.o tron/cockpit/armagetronad_main-cCamview.o tron/zone/armagetronad_main-zFortress.o libtron.a libenginecore.a libengine.a libnetwork.a libui.a librender.a libtools.a protobuf/libprotobuf.a thirdparty/mathexpr/libmathexpr.a thirdparty/particles/libparticles.a thirdparty/scrap/libscrap.a -lSDL2_image -lSDL2_mixer -L/usr/local/lib -lSDL2 -lprotobuf -lpthread -lxml2 -lpng16 -L/usr/local/Cellar/ftgl/2.1.3-rc5/lib -lftgl -L/usr/local/opt/freetype/lib -lfreetype -framework OpenGL -framework GLUT -framework CoreFoundation -framework CoreServices



just run them in the src directory and load the executable armagetronad_main from the directory a level above

User avatar
Z-Man
God & Project Admin
Posts: 11424
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Compiling On Mac

Post by Z-Man »

sab24 wrote:
Thu Apr 09, 2020 2:17 pm
7. fix the command that fails on macos by adding -framework OpenGL -framework GLUT to the command that fails. Or you can edit the makefile, actually developers should do this
Patches/Pull requests welcome. None of us here have a mac any more, and previously, we have been using XCode, not the automake files for official builds.

User avatar
Z-Man
God & Project Admin
Posts: 11424
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Compiling On Mac

Post by Z-Man »

EEEAAARRRGHAllright. After some nudging on Discord and a new (to me) way to get an macOS virtual machine that works reasonably well, we got the Unix way of building the game working out of the box. The crucial bit was indeed just a -framework addition. And some other changes that simply make the build more robust, which should benefit everyone. The short version of the instructions are:
- get dependencies via macbrew or macports
- follow the Unix instructions

The long version will go to the Wiki sometime, after I'm done experimenting. It'll only be of interest for people who want to do development, because the important bit is that
Christian Mäder is providing a brew tap for convenient single line installation: https://github.com/cimnine/homebrew-armagetronad
All the instructions are there. The downside of this approach is that you don't get any proper macOS integration, you need to run the game from the command line. And the dependencies and build tools take up quite a bit of hard drive space, so now is the time to kick yourself for only getting the model with the tiny SSD (The VM is reporting 21GB used in total, including Catalina, so it's not that bad).

I'll see whether it's possible to bundle apps from there; that depends on whether some bundling tools work and whether the libraries can be bundled. Fingers crossed.

Post Reply