Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl2.m4: Call $PKG_CONFIG rather than hard-coding pkg-config #8766

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

smcv
Copy link
Contributor

@smcv smcv commented Jan 1, 2024

When cross-compiling, pkg.m4 will set the PKG_CONFIG variable to a suitable pkg-config executable, which might be a host-architecture-prefixed name like aarch64-linux-gnu-pkg-config. This ensures that we will use a suitable search path that is suitable for the host architecture (the machine we are compiling for) rather than the build architecture (the machine we are compiling on) to find dependency libraries like SDL. When using pkg-config as a substitute for sdl2-config, we will similarly need to use the host-architecture-prefixed pkg-config.

Setting the PKG_CONFIG environment variable is also the canonical way to request that a different pkg-config implementation be used, if that becomes necessary for some reason.

Bug-Debian: https://bugs.debian.org/1059749


Please also apply to 2.28.x if accepted. SDL2 version of libsdl-org/sdl12-compat#326; not needed in SDL 3, which no longer ships custom m4 macros at all, and relies on pkg-config (or CMake) instead.

When cross-compiling, pkg.m4 will set the PKG_CONFIG variable
to a suitable pkg-config executable, which might be a
host-architecture-prefixed name like aarch64-linux-gnu-pkg-config. This
ensures that we will use a suitable search path that is suitable for
the host architecture (the machine we are compiling for) rather than
the build architecture (the machine we are compiling on) to find
dependency libraries like SDL. When using pkg-config as a substitute
for sdl2-config, we will similarly need to use the
host-architecture-prefixed pkg-config.

Setting the PKG_CONFIG environment variable is also the canonical way to
request that a different pkg-config implementation be used, if that
becomes necessary for some reason.

Co-authored-by: Helmut Grohne <[email protected]>
Bug-Debian: https://bugs.debian.org/1059749
Signed-off-by: Simon McVittie <[email protected]>
@smcv
Copy link
Contributor Author

smcv commented Jan 1, 2024

Based on a patch from @helmutg for sdl12-compat.

@slouken slouken merged commit b02c826 into libsdl-org:SDL2 Jan 1, 2024
37 checks passed
@slouken
Copy link
Collaborator

slouken commented Jan 1, 2024

SDL 2.30 is the next SDL2 release, so I think we're good now, unless you specifically need it downstream in the 2.28.x branch.

@sezero
Copy link
Contributor

sezero commented Jan 1, 2024

Apply this to sdl2-compat too.

@slouken
Copy link
Collaborator

slouken commented Jan 1, 2024

Added in 38d4f5a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants