docs/README-linux.md
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 25 Jun 2016 19:40:02 +0200
changeset 10184 cb09212d4480
parent 10134 723bdcbb53f7
child 10376 a18a3cd50984
permissions -rw-r--r--
Mac: Updated file name in README.
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
philipp@10134
    24
Ubuntu 14.04 can also add "libwayland-dev libxkbcommon-dev" to that command line
philipp@10134
    25
for Wayland support.
philipp@10134
    26
philipp@10134
    27
Ubuntu 15.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev" to
philipp@10134
    28
that command line for Wayland and Mir support.
gabomdq@9023
    29
gabomdq@9023
    30
NOTES:
gabomdq@9023
    31
- This includes all the audio targets except arts, because Ubuntu pulled the 
gabomdq@9023
    32
  artsc0-dev package, but in theory SDL still supports it.
gabomdq@9023
    33
- DirectFB isn't included because the configure script (currently) fails to find
gabomdq@9023
    34
  it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the 
gabomdq@9023
    35
  configure script to include DirectFB support. Send patches.  :)
gabomdq@9023
    36
gabomdq@9023
    37
gabomdq@9023
    38
================================================================================
gabomdq@9023
    39
Joystick does not work
gabomdq@9023
    40
================================================================================
gabomdq@9023
    41
gabomdq@9023
    42
If you compiled or are using a version of SDL with udev support (and you should!)
gabomdq@9023
    43
there's a few issues that may cause SDL to fail to detect your joystick. To
gabomdq@9023
    44
debug this, start by installing the evtest utility. On Ubuntu/Debian:
gabomdq@9023
    45
gabomdq@9023
    46
    sudo apt-get install evtest
gabomdq@9023
    47
    
gabomdq@9023
    48
Then run:
gabomdq@9023
    49
    
gabomdq@9023
    50
    sudo evtest
gabomdq@9023
    51
    
gabomdq@9023
    52
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
gabomdq@9023
    53
Now run:
gabomdq@9023
    54
    
gabomdq@9023
    55
    cat /dev/input/event/XX
gabomdq@9023
    56
gabomdq@9023
    57
If you get a permission error, you need to set a udev rule to change the mode of
gabomdq@9023
    58
your device (see below)    
gabomdq@9023
    59
    
gabomdq@9023
    60
Also, try:
gabomdq@9023
    61
    
gabomdq@9023
    62
    sudo udevadm info --query=all --name=input/eventXX
gabomdq@9023
    63
    
gabomdq@9023
    64
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
gabomdq@9023
    65
you need to set up an udev rule to force this variable.
gabomdq@9023
    66
gabomdq@9023
    67
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks 
gabomdq@9023
    68
like:
gabomdq@9023
    69
    
gabomdq@9023
    70
   SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
gabomdq@9023
    71
   SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
gabomdq@9023
    72
   
gabomdq@9023
    73
You can set up similar rules for your device by changing the values listed in
gabomdq@9023
    74
idProduct and idVendor. To obtain these values, try:
gabomdq@9023
    75
    
gabomdq@9023
    76
    sudo udevadm info -a --name=input/eventXX | grep idVendor
gabomdq@9023
    77
    sudo udevadm info -a --name=input/eventXX | grep idProduct
gabomdq@9023
    78
    
gabomdq@9023
    79
If multiple values come up for each of these, the one you want is the first one of each.    
gabomdq@9023
    80
gabomdq@9023
    81
On other systems which ship with an older udev (such as CentOS), you may need
gabomdq@9023
    82
to set up a rule such as:
gabomdq@9023
    83
    
gabomdq@9023
    84
    SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
gabomdq@9023
    85