1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
From: Simon McVittie <smcv@debian.org>
Date: Wed, 17 Sep 2025 11:09:14 +0100
Subject: build: Don't hard-code a specific pkg-config executable
When cross-compiling we'll need to use a pkgconf or pkg-config suitable
for the host architecture, for example aarch64-linux-gnu-pkgconf.
OS distributions typically expect to do this by setting the environment
variable PKG_CONFIG, as used in Autotools.
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://github.com/yquake2/yquake2/pull/1250
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 1703dc0..c16c946 100644
--- a/Makefile
+++ b/Makefile
@@ -141,6 +141,9 @@ ifdef UBSAN
DEBUG=1
endif
+# Used to detect SDL, needs to be overridable for cross-compilation
+PKG_CONFIG ?= pkgconf
+
# ----------
# Base CFLAGS. These may be overridden by the environment.
@@ -284,7 +287,7 @@ endif
# Extra CFLAGS for SDL.
ifeq ($(WITH_SDL3),yes)
-SDLCFLAGS := $(shell pkgconf --cflags sdl3)
+SDLCFLAGS := $(shell $(PKG_CONFIG) --cflags sdl3)
SDLCFLAGS += -DUSE_SDL3
else
SDLCFLAGS := $(shell sdl2-config --cflags)
@@ -377,7 +380,7 @@ ifeq ($(WITH_SDL3),yes)
ifeq ($(YQ2_OSTYPE), Darwin)
SDLLDFLAGS := -lSDL3
else
-SDLLDFLAGS := $(shell pkgconf --libs sdl3)
+SDLLDFLAGS := $(shell $(PKG_CONFIG) --libs sdl3)
endif
else
ifeq ($(YQ2_OSTYPE), Darwin)
|