compiling_for_linux.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. .. _doc_compiling_for_linux:
  2. Compiling for Linux
  3. ===================
  4. .. highlight:: shell
  5. Requirements
  6. ------------
  7. For compiling under Linux or other Unix variants, the following is
  8. required:
  9. - GCC (G++) or Clang
  10. - Python 2.7+ (3.0 is untested as of now)
  11. - SCons build system
  12. - X11 and Mesa development libraries
  13. - Xinerama libraries
  14. - ALSA development libraries
  15. - PulseAudio development libraries (for sound support)
  16. - Freetype (for the editor)
  17. - OpenSSL (for HTTPS and TLS)
  18. - libudev-dev (optional, for gamepad support)
  19. - pkg-config (used to detect the above dependencies)
  20. For Ubuntu users:
  21. ::
  22. 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
  23. Compiling
  24. ---------
  25. Start a terminal, go to the root dir of the engine source code and type:
  26. ::
  27. user@host:~/godot$ scons platform=x11
  28. If all goes well, the resulting binary executable will be placed in the
  29. "bin" subdirectory. This executable file contains the whole engine and
  30. runs without any dependencies. Executing it will bring up the project
  31. manager.
  32. Building export templates
  33. -------------------------
  34. To build Linux export templates, run the build system with the following
  35. parameters:
  36. - (32 bits)
  37. ::
  38. user@host:~/godot$ scons platform=x11 tools=no target=release bits=32
  39. user@host:~/godot$ scons platform=x11 tools=no target=release_debug bits=32
  40. - (64 bits)
  41. ::
  42. user@host:~/godot$ scons platform=x11 tools=no target=release bits=64
  43. user@host:~/godot$ scons platform=x11 tools=no target=release_debug bits=64
  44. Note that cross compiling for the opposite bits (64/32) as your host
  45. platform in linux is quite difficult and might need a chroot
  46. environment.
  47. In Ubuntu, compilation works without a chroot but some libraries (.so)
  48. might be missing from ``/usr/lib32``. Symlinking the missing .so files from
  49. ``/usr/lib`` results in a working build.
  50. To create standard export templates, the resulting files must be copied
  51. to:
  52. ::
  53. /home/youruser/.godot/templates
  54. and named like this:
  55. ::
  56. linux_x11_32_debug
  57. linux_x11_32_release
  58. linux_x11_64_debug
  59. linux_x11_64_release
  60. However, if you are writing your custom modules or custom C++ code, you
  61. might instead want to configure your binaries as custom export templates
  62. here:
  63. .. image:: /img/lintemplates.png
  64. You don't even need to copy them, you can just reference the resulting
  65. files in the bin/ directory of your Godot source folder, so the next
  66. time you build you automatically have the custom templates referenced.