From a7503e2be290b2de6e440d3ec1fff172326330b9 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 27 May 2018 19:28:47 +0200 Subject: [PATCH] Make pkg-config substitutable This helps with cross-compilation. When cross-compiling, the environment variable PKG_CONFIG is typically set to a version of pkg-config that is configured to look in appropriate locations for the cross architecture. For example, a build for 64-bit ARM might use: make \ CC=aarch64-linux-gnu-gcc \ STRIP=aarch64-linux-gnu-strip \ PKG_CONFIG=aarch64-linux-gnu-pkg-config \ release On a Debian system, this would look in /usr/lib/aarch64-linux-gnu/pkgconfig for details of 64-bit ARM Opus libraries. Bug-Debian: https://bugs.debian.org/900217 --- Quake/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Quake/Makefile b/Quake/Makefile index fe1ae833..a74b102d 100644 --- a/Quake/Makefile +++ b/Quake/Makefile @@ -46,6 +46,7 @@ CC ?= gcc LINKER = $(CC) STRIP ?= strip +PKG_CONFIG ?= pkg-config #CPUFLAGS= -mtune=i686 #CPUFLAGS= -march=pentium4 @@ -153,8 +154,8 @@ ifeq ($(USE_CODEC_OPUS),1) # but they include the headers without the opus directory # prefix and rely on pkg-config. ewww... CFLAGS+= -DUSE_CODEC_OPUS -CFLAGS+= $(shell pkg-config --cflags opusfile) -CODECLIBS+= $(shell pkg-config --libs opusfile) +CFLAGS+= $(shell $(PKG_CONFIG) --cflags opusfile) +CODECLIBS+= $(shell $(PKG_CONFIG) --libs opusfile) endif ifeq ($(USE_CODEC_VORBIS),1) CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)