Skip to content

Commit b02c826

Browse files
smcvhelmutg
authored andcommitted
sdl2.m4: Call $PKG_CONFIG rather than hard-coding pkg-config
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]>
1 parent 0f8f4f6 commit b02c826

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdl2.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
# * also look for SDL2.framework under Mac OS X
1010
# * removed HP/UX 9 support.
1111
# * updated for newer autoconf.
12+
# * (v3) use $PKG_CONFIG for pkg-config cross-compiling support
1213

13-
# serial 2
14+
# serial 3
1415

1516
dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1617
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
@@ -54,7 +55,7 @@ AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework])
5455
5556
if test "x$sdl_pc" = xyes ; then
5657
no_sdl=""
57-
SDL2_CONFIG="pkg-config sdl2"
58+
SDL2_CONFIG="$PKG_CONFIG sdl2"
5859
else
5960
as_save_PATH="$PATH"
6061
if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then

0 commit comments

Comments
 (0)