docs/README-linux.md
author Ryan C. Gordon <icculus@icculus.org>
Thu, 19 Feb 2015 23:52:10 -0500
changeset 9370 795d4866e4db
parent 9106 d1d0a67ca6c8
child 10134 723bdcbb53f7
permissions -rw-r--r--
Mac OS X: Better way to stop duplicate joystick reports (thanks, Kyungdahm!).

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