compiling_for_linux.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 or LLVM
  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. - Freetype (for the editor)
  16. - OpenSSL (for HTTPS and TLS)
  17. - pkg-config (used to detect the above three)
  18. - libevdev-dev and libudev-dev (for facultative joypad support)
  19. For Ubuntu users:
  20. ::
  21. apt-get install scons pkg-config libx11-dev libxcursor-dev build-essential libasound2-dev libfreetype6-dev libgl1-mesa-dev libglu-dev libssl-dev libxinerama-dev
  22. If you wish to have Joypad support, libevdev-dev and libudev-dev are
  23. required.
  24. ::
  25. apt-get install libevdev-dev libudev-dev
  26. Compiling
  27. ---------
  28. Start a terminal, go to the root dir of the engine source code and type:
  29. ::
  30. user@host:~/godot$ scons platform=x11
  31. If all goes well, the resulting binary executable will be placed in the
  32. "bin" subdirectory. This executable file contains the whole engine and
  33. runs without any dependencies. Executing it will bring up the project
  34. manager.
  35. Building export templates
  36. -------------------------
  37. To build Linux export templates, run the build system with the following
  38. parameters:
  39. (32 bits)
  40. ::
  41. user@host:~/godot$ scons platform=x11 tools=no target=release bits=32
  42. user@host:~/godot$ scons platform=x11 tools=no target=release_debug bits=32
  43. (64 bits)
  44. ::
  45. user@host:~/godot$ scons platform=x11 tools=no target=release bits=64
  46. user@host:~/godot$ scons platform=x11 tools=no target=release_debug bits=64
  47. Note that cross compiling for the opposite bits (64/32) as your host
  48. platform in linux is quite difficult and might need a chroot
  49. environment.
  50. In Ubuntu, compilation works without a chroot but some libraries (.so)
  51. might be missing from /usr/lib32. Symlinking the missing .so files from
  52. /usr/lib results in a working build.
  53. To create standard export templates, the resulting files must be copied
  54. to:
  55. ::
  56. /home/youruser/.godot/templates
  57. and named like this:
  58. ::
  59. linux_x11_32_debug
  60. linux_x11_32_release
  61. linux_x11_64_debug
  62. linux_x11_64_release
  63. However, if you are writing your custom modules or custom C++ code, you
  64. might instead want to configure your binaries as custom export templates
  65. here:
  66. .. image:: /img/lintemplates.png
  67. You don't even need to copy them, you can just reference the resulting
  68. files in the bin/ directory of your Godot source folder, so the next
  69. time you build you automatically have the custom templates referenced.