| Summary: | pkg-config file suboptimal when SDL built with --disable-shared or -DSDL_SHARED=no | ||
|---|---|---|---|
| Product: | SDL | Reporter: | James Le Cuirot <chewi> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
build: Merge pkg-config Libs.private into Libs for static-only builds
build: Don't duplicate Libs in Libs.private in pkg-config file |
||
Created attachment 4302 [details]
build: Don't duplicate Libs in Libs.private in pkg-config file
A second closely-related patch:
pkg-config already prepends Libs to Libs.private when you specify --static so there's no need to duplicate them. Most other projects don't do this.
These patches are in, thanks! https://hg.libsdl.org/SDL/rev/89a457159af4 https://hg.libsdl.org/SDL/rev/fc03d19926ed |
Created attachment 4301 [details] 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.