Skip to content

Commit

Permalink
sdl.m4: Call $PKG_CONFIG rather than hard-coding pkg-config
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
smcv and helmutg committed Jan 1, 2024
1 parent c810b6a commit 6f08a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor

# serial 2
# serial 3

dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
Expand Down Expand Up @@ -45,7 +45,7 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run
if test "x$sdl_pc" = xyes ; then
no_sdl=""
SDL_CONFIG="pkg-config sdl"
SDL_CONFIG="$PKG_CONFIG sdl"
else
as_save_PATH="$PATH"
if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
Expand Down

0 comments on commit 6f08a85

Please sign in to comment.