PageRenderTime 52ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/source/docs/README-linux.md

https://bitbucket.org/liflg/library-sdl2
Markdown | 90 lines | 62 code | 28 blank | 0 comment | 0 complexity | 75d8e6f8ebc88b658ac47a5fe68650ef MD5 | raw file
  1. Linux
  2. ================================================================================
  3. By default SDL will only link against glibc, the rest of the features will be
  4. enabled dynamically at runtime depending on the available features on the target
  5. system. So, for example if you built SDL with Xinerama support and the target
  6. system does not have the Xinerama libraries installed, it will be disabled
  7. at runtime, and you won't get a missing library error, at least with the
  8. default configuration parameters.
  9. ================================================================================
  10. Build Dependencies
  11. ================================================================================
  12. Ubuntu 13.04, all available features enabled:
  13. sudo apt-get install build-essential mercurial make cmake autoconf automake \
  14. libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
  15. libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
  16. libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
  17. libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
  18. fcitx-libs-dev libsamplerate0-dev libsndio-dev
  19. Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
  20. to that command line for Wayland support.
  21. Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
  22. line for Mir support.
  23. NOTES:
  24. - This includes all the audio targets except arts, because Ubuntu pulled the
  25. artsc0-dev package, but in theory SDL still supports it.
  26. - libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
  27. for higher-quality audio resampling. SDL will work without it if the library
  28. is missing, so it's safe to build in support even if the end user doesn't
  29. have this library installed.
  30. - DirectFB isn't included because the configure script (currently) fails to find
  31. it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
  32. configure script to include DirectFB support. Send patches. :)
  33. ================================================================================
  34. Joystick does not work
  35. ================================================================================
  36. If you compiled or are using a version of SDL with udev support (and you should!)
  37. there's a few issues that may cause SDL to fail to detect your joystick. To
  38. debug this, start by installing the evtest utility. On Ubuntu/Debian:
  39. sudo apt-get install evtest
  40. Then run:
  41. sudo evtest
  42. You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
  43. Now run:
  44. cat /dev/input/event/XX
  45. If you get a permission error, you need to set a udev rule to change the mode of
  46. your device (see below)
  47. Also, try:
  48. sudo udevadm info --query=all --name=input/eventXX
  49. If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
  50. you need to set up an udev rule to force this variable.
  51. A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
  52. like:
  53. SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
  54. SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
  55. You can set up similar rules for your device by changing the values listed in
  56. idProduct and idVendor. To obtain these values, try:
  57. sudo udevadm info -a --name=input/eventXX | grep idVendor
  58. sudo udevadm info -a --name=input/eventXX | grep idProduct
  59. If multiple values come up for each of these, the one you want is the first one of each.
  60. On other systems which ship with an older udev (such as CentOS), you may need
  61. to set up a rule such as:
  62. SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"