From 202c977b3d4005430fe33212a1778b75e11d102c Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Thu, 11 Jan 2018 10:40:38 +0300 Subject: [PATCH] src makefile: Abort compilation when `pkg-config` is not in PATH Fixes #1792 --- src/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4649717a..3a115c29 100644 --- a/src/Makefile +++ b/src/Makefile @@ -24,7 +24,7 @@ sources := $(sort $(wildcard *.cc)) objects := $(addprefix ., $(sources:.cc=$(suffix).o)) deps := $(addprefix ., $(sources:.cc=$(suffix).d)) -PKG_CONFIG ?= pkg-config +PKG_CONFIG ?= $(shell command -v pkg-config 2>/dev/null) PREFIX ?= /usr/local DESTDIR ?= # root dir @@ -66,7 +66,12 @@ endif CXXFLAGS += -pedantic -std=gnu++14 -g -Wall -Wextra -Wno-unused-parameter -Wno-reorder -Wno-sign-compare -Wno-address -Wno-noexcept-type -Wno-unknown-attributes -Wno-unknown-warning-option -all : kak +all : check_pkg_config kak + +check_pkg_config: +ifeq ($(PKG_CONFIG),) + $(error "pkg-config not found in PATH") +endif kak : kak$(suffix) ln -sf $< $@