author Sam Lantinga
Sun, 13 Aug 2017 18:12:06 -0700
changeset 11263 f85618f8ba81
parent 11194 3d0bbfe683a8
child 11365 a9bd2625fa01
permissions -rw-r--r--
Fixed bug 2812 - Make libSDL2main.a usable on Android via a dummy symbol

Jonas Kulla

This eliminates the need to manually compile in SDL_main_android.c.
Instead, add "-lSDL2main -Wl,-u,SDL_main_dummy" when linking.

I don't know how the nkd-build process works, but unless it was
for some reason linking libSDL2main.a it should be unaffected.
     1 Linux
     2 ================================================================================
     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.
    12 ================================================================================
    13 Build Dependencies
    14 ================================================================================
    16 Ubuntu 13.04, all available features enabled:
    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 fcitx-libs-dev libsamplerate0-dev libsndio-dev
    25 Ubuntu 16.04 can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
    26 to that command line for Wayland support.
    28 Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
    29 line for Mir support.
    31 NOTES:
    32 - This includes all the audio targets except arts, because Ubuntu pulled the 
    33   artsc0-dev package, but in theory SDL still supports it.
    34 - libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
    35   for higher-quality audio resampling. SDL will work without it if the library
    36   is missing, so it's safe to build in support even if the end user doesn't
    37   have this library installed.
    38 - DirectFB isn't included because the configure script (currently) fails to find
    39   it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the 
    40   configure script to include DirectFB support. Send patches.  :)
    43 ================================================================================
    44 Joystick does not work
    45 ================================================================================
    47 If you compiled or are using a version of SDL with udev support (and you should!)
    48 there's a few issues that may cause SDL to fail to detect your joystick. To
    49 debug this, start by installing the evtest utility. On Ubuntu/Debian:
    51     sudo apt-get install evtest
    53 Then run:
    55     sudo evtest
    57 You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
    58 Now run:
    60     cat /dev/input/event/XX
    62 If you get a permission error, you need to set a udev rule to change the mode of
    63 your device (see below)    
    65 Also, try:
    67     sudo udevadm info --query=all --name=input/eventXX
    69 If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
    70 you need to set up an udev rule to force this variable.
    72 A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks 
    73 like:
    75    SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
    76    SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
    78 You can set up similar rules for your device by changing the values listed in
    79 idProduct and idVendor. To obtain these values, try:
    81     sudo udevadm info -a --name=input/eventXX | grep idVendor
    82     sudo udevadm info -a --name=input/eventXX | grep idProduct
    84 If multiple values come up for each of these, the one you want is the first one of each.    
    86 On other systems which ship with an older udev (such as CentOS), you may need
    87 to set up a rule such as:
    89     SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"