mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
build: Merge pkg-config Libs.private into Libs for static-only builds
A project being built entirely statically will call pkg-config with --static, which utilises the Libs.private field. Conversely it will not use --static when not being built entirely statically, even if there is only a static build of SDL available. This will most likely cause the build to fail due to underlinking unless we merge the Libs fields. This is what the Meson build system does when it generates pkg-config files. This also also follows the behaviour of sdl2-config. At the same time, the runtime linker flags are not applicable to static-only builds so only add them for shared builds.
This commit is contained in:
6
configure
vendored
6
configure
vendored
@@ -647,6 +647,7 @@ ENABLE_STATIC_FALSE
|
||||
ENABLE_STATIC_TRUE
|
||||
ENABLE_SHARED_FALSE
|
||||
ENABLE_SHARED_TRUE
|
||||
PKG_CONFIG_LIBS_PRIV
|
||||
SDL_RLD_FLAGS
|
||||
SDL_STATIC_LIBS
|
||||
SDL_LIBS
|
||||
@@ -25675,7 +25676,7 @@ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\
|
||||
|
||||
# Set runtime shared library paths as needed
|
||||
|
||||
if test "x$enable_rpath" = "xyes"; then
|
||||
if test "x$enable_rpath" = "xyes" -a "x$enable_shared" = "xyes"; then
|
||||
if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
|
||||
SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
|
||||
|
||||
@@ -25723,9 +25724,12 @@ SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
|
||||
|
||||
|
||||
if test x$enable_shared = xyes; then
|
||||
PKG_CONFIG_LIBS_PRIV="
|
||||
Libs.private:"
|
||||
ENABLE_SHARED_TRUE=
|
||||
ENABLE_SHARED_FALSE="#"
|
||||
else
|
||||
PKG_CONFIG_LIBS_PRIV=
|
||||
ENABLE_SHARED_TRUE="#"
|
||||
ENABLE_SHARED_FALSE=
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user