Merge pull request #303 from smcv/overridable-pkg-config

Make uses of pkg-config cross-compilation-friendly
This commit is contained in:
Yamagi 2018-06-12 13:45:29 +02:00 committed by GitHub
commit 3f935bba79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -133,6 +133,10 @@ else
COMPILER := unknown
endif
# Used to detect libraries. Override to foobar-linux-gnu-pkg-config when
# cross-compiling.
PKG_CONFIG ?= pkg-config
# Disable CDA for SDL2
ifeq ($(WITH_SDL2),yes)
ifeq ($(WITH_CDA),yes)
@ -254,8 +258,8 @@ endif # SDL2
ifneq ($(YQ2_OSTYPE), Windows)
ifneq ($(YQ2_OSTYPE), Darwin)
ifeq ($(WITH_X11GAMMA),yes)
X11CFLAGS := $(shell pkg-config x11 --cflags)
X11CFLAGS += $(shell pkg-config xxf86vm --cflags)
X11CFLAGS := $(shell $(PKG_CONFIG) x11 --cflags)
X11CFLAGS += $(shell $(PKG_CONFIG) xxf86vm --cflags)
endif
endif
endif
@ -324,9 +328,9 @@ endif # Darwin
ifneq ($(YQ2_OSTYPE), Windows)
ifneq ($(YQ2_OSTYPE), Darwin)
ifeq ($(WITH_X11GAMMA),yes)
X11LDFLAGS := $(shell pkg-config x11 --libs)
X11LDFLAGS += $(shell pkg-config xxf86vm --libs)
X11LDFLAGS += $(shell pkg-config xrandr --libs)
X11LDFLAGS := $(shell $(PKG_CONFIG) x11 --libs)
X11LDFLAGS += $(shell $(PKG_CONFIG) xxf86vm --libs)
X11LDFLAGS += $(shell $(PKG_CONFIG) xrandr --libs)
endif
endif
endif