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