premake/README-linux.txt
author Ryan C. Gordon <icculus@icculus.org>
Fri, 12 Aug 2016 19:59:00 -0400
changeset 10266 c09f06c4e8c8
parent 7925 f090a47eb7f7
permissions -rwxr-xr-x
emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7925
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
You may generate GNU makefiles for building SDL2 and its related test suite by
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
using the gmake shell script in the Linux/build-scripts folder.
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
Linux support is currently experimental for the meta-build system. Most of the
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
progress made on this support happened toward the end of the meta-build system
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
project, so there is a lot currently missing that could be added in the future.
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
For the most part, the Linux support works well, but there is a significant
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
amount of testing needed to verify it can be built in many different
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
environments.
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
The Linux project does not target every dependency it should (as seen in the
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
autotools configure script or in the CMake script), but it does target the
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
following dependencies:
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
  -D-Bus (required to build Linux at all)
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
  -DLOpen (most of the other dependencies are dependent on this)
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
  -ALSA
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
  -PulseAudio
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
  -ESD
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
  -NAS
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
  -OSS
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
  -X11
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
  -OpenGL
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
Also, the Linux system should be building the SDL2 library as a shared library,
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
but it builds it as a static library because of a few premake-related issues.
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
This is because when the makefile generated by premake tells the linker where to
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
find the definitions library (libSDL2.o), it also gives a hint to the loader to
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
find libSDL2.so in the same place, with a relative path. This means in order to
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
execute the program dynamically linked to SDL2, it's looking in some path like:
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
  "../../SDL2/Build/Debug"
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
Now, while this path works at the location of the makefile (such as
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
./tests/testsprite), it does not make sense from the actual location of the
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
executable (./tests/testsprite/Build/Debug). Furthermore, it's just massively
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
inconvenient to have a relative path to look for the shared object. Moving
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
libSDL2.so into the same directory as the executable does not solve this issue.
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
Unfortunately, premake also does not allow an install target to be created for
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
the makefiles, which is another one of the major issues related to building SDL2
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
as a shared library on Linux. Once these problems are solved, this support
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
should be very straightforward to add to this system in the future.
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
The Linux system does have both an automated test and cleaning shell files for
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
running through the entire supported test suite and cleaning up the generated
f090a47eb7f7 Added Ben Henning's GSoC2013 work: premake build system.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
and built files, respectively.