godot-docs/reference/compiling_for_linux.rst

99 lines
2.6 KiB
ReStructuredText
Raw Normal View History

2016-02-08 23:45:57 +01:00
.. _doc_compiling_for_linux:
2015-12-12 17:57:44 +01:00
Compiling for Linux
===================
.. highlight:: shell
2015-12-12 17:57:44 +01:00
Requirements
------------
For compiling under Linux or other Unix variants, the following is
required:
2016-02-11 22:03:01 +01:00
- GCC (G++) or Clang
- Python 2.7+ (3.0 is untested as of now)
- SCons build system
- X11 and Mesa development libraries
- Xinerama libraries
2015-12-12 17:57:44 +01:00
- ALSA development libraries
- PulseAudio development libraries (for sound support)
2015-12-12 17:57:44 +01:00
- Freetype (for the editor)
- OpenSSL (for HTTPS and TLS)
2016-02-11 22:03:01 +01:00
- libudev-dev (optional, for gamepad support)
- pkg-config (used to detect the above dependencies)
2015-12-12 17:57:44 +01:00
For Ubuntu users:
::
sudo apt-get install scons pkg-config libx11-dev libxcursor-dev build-essential libasound2-dev libpulse-dev libfreetype6-dev libgl1-mesa-dev libglu-dev libssl-dev libxinerama-dev libudev-dev
2015-12-12 17:57:44 +01:00
Compiling
---------
Start a terminal, go to the root dir of the engine source code and type:
::
user@host:~/godot$ scons platform=x11
If all goes well, the resulting binary executable will be placed in the
2016-02-06 01:54:33 +01:00
"bin" subdirectory. This executable file contains the whole engine and
runs without any dependencies. Executing it will bring up the project
manager.
2015-12-12 17:57:44 +01:00
Building export templates
-------------------------
To build Linux export templates, run the build system with the following
parameters:
2016-02-11 22:03:01 +01:00
- (32 bits)
2015-12-12 17:57:44 +01:00
::
user@host:~/godot$ scons platform=x11 tools=no target=release bits=32
user@host:~/godot$ scons platform=x11 tools=no target=release_debug bits=32
2016-02-11 22:03:01 +01:00
- (64 bits)
2015-12-12 17:57:44 +01:00
::
user@host:~/godot$ scons platform=x11 tools=no target=release bits=64
user@host:~/godot$ scons platform=x11 tools=no target=release_debug bits=64
Note that cross compiling for the opposite bits (64/32) as your host
platform in linux is quite difficult and might need a chroot
environment.
In Ubuntu, compilation works without a chroot but some libraries (.so)
2016-02-11 22:03:01 +01:00
might be missing from ``/usr/lib32``. Symlinking the missing .so files from
``/usr/lib`` results in a working build.
2015-12-12 17:57:44 +01:00
To create standard export templates, the resulting files must be copied
to:
::
/home/youruser/.godot/templates
and named like this:
::
linux_x11_32_debug
linux_x11_32_release
linux_x11_64_debug
linux_x11_64_release
However, if you are writing your custom modules or custom C++ code, you
might instead want to configure your binaries as custom export templates
here:
.. image:: /img/lintemplates.png
You don't even need to copy them, you can just reference the resulting
files in the bin/ directory of your Godot source folder, so the next
time you build you automatically have the custom templates referenced.