mirror of https://github.com/encounter/SDL.git
e0d904e90b
Library-specific foo-config scripts duplicate very similar logic across various different projects, and tend to break cross-compiling, multilib (gcc -m32), Debian/Ubuntu multiarch and so on by only being able to have one sdl2-config at a time as the first one in the PATH. The direct replacement is pkg-config(1) or a compatible reimplementation like pkgconf(1), which relies on each library installing declarative metadata, like SDL's sdl2.pc (available since at least 2.0.0) and centralizes the logic into the pkg-config/pkgconf tool. Most uses of `sdl2-config --foo` can be replaced by something similar to `${PKG_CONFIG:-pkg-config} --foo sdl2`. Instead of adding a custom sdl2-config to the PATH or using its --prefix or --exec-prefix options, users of a custom installation prefix can use any of pkg-config's non-SDL-specific ways to influence the result, for example setting PKG_CONFIG_PATH, PKG_CONFIG_SYSROOT_DIR or PKG_CONFIG_LIBDIR environment variables, or setting the PKG_CONFIG environment variable to point to a wrapper script. For Autotools specifically, the replacement for AM_PATH_SDL2 (which will be officially deprecated in a subsequent commit) is PKG_CHECK_MODULES. CMake has its own semi-declarative mechanism for dependency discovery, "config packages", and the SDL build already installs a config package. There's a good example of using a config package to discover SDL in `cmake/test/`. Meson natively supports pkg-config, and already uses it in preference to sdl2-config. Other build systems can run pkg-config instead of sdl2-config, preferably checking the PKG_CONFIG environment variable first. https://github.com/ioquake/ioq3 is a good example of a project doing this correctly. Helps: #6140, #3516 Signed-off-by: Simon McVittie <smcv@collabora.com> |
||
---|---|---|
.github | ||
VisualC | ||
VisualC-GDK | ||
VisualC-WinRT | ||
Xcode | ||
Xcode-iOS/Demos | ||
acinclude | ||
android-project | ||
android-project-ant | ||
build-scripts | ||
cmake | ||
docs | ||
include | ||
mingw/pkg-support/cmake | ||
src | ||
test | ||
visualtest | ||
wayland-protocols | ||
.clang-format | ||
.editorconfig | ||
.gitignore | ||
.wikiheaders-options | ||
Android.mk | ||
BUGS.txt | ||
CMakeLists.txt | ||
CREDITS.txt | ||
INSTALL.txt | ||
LICENSE.txt | ||
Makefile.in | ||
Makefile.minimal | ||
Makefile.os2 | ||
Makefile.pandora | ||
Makefile.w32 | ||
README-SDL.txt | ||
README.md | ||
SDL2.spec.in | ||
SDL2Config.cmake.in | ||
TODO.txt | ||
WhatsNew.txt | ||
autogen.sh | ||
cmake_uninstall.cmake.in | ||
configure | ||
configure.ac | ||
sdl2-config-version.cmake.in | ||
sdl2-config.cmake.in | ||
sdl2-config.in | ||
sdl2.m4 | ||
sdl2.pc.in |
README.md
Simple DirectMedia Layer (SDL) Version 2.0
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting with README.md
Enjoy!
Sam Lantinga (slouken@libsdl.org)