Compiling Linux games for other distributions than Ubuntu

E

erazor

Guest
GM Version: 1.4.1763
Target Platform: Linux
Download: N/A
Links: N/A

Summary:
Here's what I do to export a GameMaker game on/for Fedora. This needs a bit handywork because distributions differ in folders and library names.

Tutorial:

1. Configure your Linux box. Activate SSH access. Note that the user account on the target machine needs a bash as login shell. Along with make and gcc install at least the following 32bit libraries:
  • openal-soft.i686
  • openssl.i686
  • mesa-libGLU.i686
  • libcurl.i686
  • libXxf86vm.i686
  • libXrandr.i686
  • libX11.i686
  • libXext.i686
2. Configure your SSH connection to your Linux box in GameMaker.

3. Select Linux as Target and compile. This will copy, along with other files, an assets folder and the precompiled GMStudio_runner to the target machine. Starting the game will fail because GMStudio_runner is compiled for Ubuntu and won't find some libraries.

4. Select Linux (yyc) as Target and compile again. This creates, along with others, a yyc/PROJECTNAME folder and tries to compile some code. This fails because of wrong folder and library names.

5. Login to your Linux machine and enter the forementioned ~/GameMaker-Studio/yyc/PROJECTNAME folder and execute the following script:
Code:
#!/bin/sh

sed -i.bak "s/^COMPILER\s\+=\s\+.*/COMPILER = gcc/g" makefile
sed -i.bak "s/^LINUX_LIBDIR_USR\s\+=\s\+.*/LINUX_LIBDIR_USR = \/usr\/lib/g" makefile
sed -i.bak "s/^LINUX_LIBDIR\s\+=\s\+.*/LINUX_LIBDIR = \/lib/g" makefile
sed -i.bak "s/libcurl.so.3/libcurl.so.4/g" makefile
sed -i.bak "s/\/mesa\/libGL.so.1/\/libGL.so.1/g" makefile
sed -i.bak "s/libcrypto.so/libcrypt.so/g" makefile
sed -i.bak "s/-Wno-deprecated-writable-strings//g" makefile
sed -i.bak "s/libssl.so/libssl.so.10/g" makefile
This changes the makefile by replacing the compiler with gcc and correcting the library folders and library names. Try to compile again with make which results in an executable file called PROJECTNAME. Copy this file two folders down and start it there.
The special executable and the assets folder are everything needed to run your game.
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
I am surprised that Yoyo Games didn't include this in their export module for Linux.
It isn't surprising at all if you read this line:
This needs a bit handywork because distributions differ in folders and library names.
YoYo simply doesn't have the time to support people using all sorts of potentially incompatible distros and environments, so they settled down on officially supporting just the biggest consumer-oriented one. If you go off this beaten track, nobody said it's impossible but you have to save yourself.
 
Top