Allow building with a specific pkg-config given by PKG_CONFIG
authorJames Le Cuirot <chewi@gentoo.org>
Sat, 31 Aug 2019 13:49:03 +0000 (14:49 +0100)
committerJames Le Cuirot <chewi@gentoo.org>
Sat, 31 Aug 2019 14:13:18 +0000 (15:13 +0100)
Sometimes wrappers around pkg-config are used for cross-compiling.

Makefile
src/sdl/Makefile

index 1e0ff1a6ce986afa1b1c7f9561e889dace2e09fd..9064c129440888a7b4d4223f196227c65c7f0aea 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -130,6 +130,7 @@ LDFLAGS += -L$(LIBDIR)
 
 RANLIB ?= $(shell which ranlib)
 AR ?= $(shell which ar)
+PKG_CONFIG ?= pkg-config
 
 export CC
 export CFLAGS
@@ -219,7 +220,7 @@ endif
 SDL_DIR = $(SRCDIR)/sdl
 SDL_LIB = $(SDL_DIR)/frotz_sdl.a
 export SDL_PKGS = libpng libjpeg sdl2 SDL2_mixer freetype2 zlib
-SDL_LDFLAGS += `pkg-config $(SDL_PKGS) --libs` -lm
+SDL_LDFLAGS += `$(PKG_CONFIG) $(SDL_PKGS) --libs` -lm
 
 DOS_DIR = $(SRCDIR)/dos
 
index 0756bc479171b96626c5a4369f7eea04c24e3410..d8043ef3c72aba21777c3a107de57171a6528f8a 100644 (file)
@@ -7,7 +7,8 @@ SDL_PKGS ?= libpng libjpeg sdl2 SDL2_mixer freetype2 zlib
 CC = gcc
 #CC = clang
 
-override CFLAGS += `pkg-config $(SDL_PKGS) --cflags`
+PKG_CONFIG ?= pkg-config
+override CFLAGS += `$(PKG_CONFIG) $(SDL_PKGS) --cflags`
 
 SOURCES = sf_fonts.c sf_msg_en.c sf_resource.c sf_util.c \
        sf_deffont.c sf_ftype.c sf_osfdlg.c sf_sig.c sf_video.c \