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