README-linux.txt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. You may generate GNU makefiles for building SDL2 and its related test suite by
  2. using the gmake shell script in the Linux/build-scripts folder.
  3. Linux support is currently experimental for the meta-build system. Most of the
  4. progress made on this support happened toward the end of the meta-build system
  5. project, so there is a lot currently missing that could be added in the future.
  6. For the most part, the Linux support works well, but there is a significant
  7. amount of testing needed to verify it can be built in many different
  8. environments.
  9. The Linux project does not target every dependency it should (as seen in the
  10. autotools configure script or in the CMake script), but it does target the
  11. following dependencies:
  12. -D-Bus (required to build Linux at all)
  13. -DLOpen (most of the other dependencies are dependent on this)
  14. -ALSA
  15. -PulseAudio
  16. -ESD
  17. -NAS
  18. -OSS
  19. -X11
  20. -OpenGL
  21. Also, the Linux system should be building the SDL2 library as a shared library,
  22. but it builds it as a static library because of a few premake-related issues.
  23. This is because when the makefile generated by premake tells the linker where to
  24. find the definitions library (libSDL2.o), it also gives a hint to the loader to
  25. find libSDL2.so in the same place, with a relative path. This means in order to
  26. execute the program dynamically linked to SDL2, it's looking in some path like:
  27. "../../SDL2/Build/Debug"
  28. Now, while this path works at the location of the makefile (such as
  29. ./tests/testsprite), it does not make sense from the actual location of the
  30. executable (./tests/testsprite/Build/Debug). Furthermore, it's just massively
  31. inconvenient to have a relative path to look for the shared object. Moving
  32. libSDL2.so into the same directory as the executable does not solve this issue.
  33. Unfortunately, premake also does not allow an install target to be created for
  34. the makefiles, which is another one of the major issues related to building SDL2
  35. as a shared library on Linux. Once these problems are solved, this support
  36. should be very straightforward to add to this system in the future.
  37. The Linux system does have both an automated test and cleaning shell files for
  38. running through the entire supported test suite and cleaning up the generated
  39. and built files, respectively.