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

sdl.m4: Call $PKG_CONFIG rather than hard-coding pkg-config #326

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

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

This sdl.m4 could also be copied into https://github.com/libsdl-org/SDL-1.2 if desired.

@smcv
Copy link
Contributor Author

smcv commented Jan 1, 2024

Based on a patch from @helmutg.

@slouken slouken merged commit bc081fd into libsdl-org:main Jan 1, 2024
5 checks passed
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.

2 participants