1. Hey! Guest! The 31st GMC Jam will take place between Nov 16th, 12:00 UTC (Friday noon) and Nov 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Compiling Linux games for other distributions than Ubuntu

Discussion in 'Tutorials' started by erazor, Oct 12, 2016.

Tags:
  1. erazor

    erazor Member

    Joined:
    Oct 12, 2016
    Posts:
    1
    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: Oct 12, 2016
  2. acidemic

    acidemic Member

    Joined:
    Jul 23, 2016
    Posts:
    109
    I am surprised that Yoyo Games didn't include this in their export module for Linux.
     
  3. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    3,148
    It isn't surprising at all if you read this line:
    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.
     
    Galladhan likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice