| Summary: | Configure uses wrong pkg-config when cross compiling | ||
|---|---|---|---|
| Product: | SDL | Reporter: | zub |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | hugh.mcmaster |
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | Use host system pkg-config when (cross-)compiling | ||
Can you provide a tested patch that implements this? Thanks! Created attachment 3595 [details]
Use host system pkg-config when (cross-)compiling
Since this is still a problem, I've prepared a patch so that libsdl2 uses the host system's pkg-config when compiling.
The patch also converts the existing pkg-config calls to use the PKG_CHECK_MODULES macro.
Hi Sam, Any chance of a review on this patch? Thank you Would it be more helpful if I submitted an archive of patches for each PKG_CHECK_MODULES conversion instead of one large patch? Your patch is in: https://hg.libsdl.org/SDL/rev/df6da910d4d8 I added the pkg-config macros here: https://hg.libsdl.org/SDL/rev/1e4dd5933351 Thanks! |
SDL's configure script is hardcoded to use "pkg-config" when searching for packages. This can break cross compilation. It is the case when e.g. cross-compiling on Debian: the native libraries can be found via pkg-config, and the target libraries can be found via ${HOST}-pkg-config. Using pkg-config in this case pulls in native (build system's) libraries. Ideally SDL would use PKG_CHECK_MODULES Autotools macro. If this is not possible, please consider searching for "${HOST}-pkg-config" first and only then fall back to "pkg-config". The issue can be seen for example here: http://hg.libsdl.org/SDL/file/c63a2f755921/configure.in#l888 It's possible to work around this issue by setting the environment variable PKG_CONFIG to the full path to the pkg-config executable to use.