From 19c3957ee4ee113681c95c17a4857b9db69d9764 Mon Sep 17 00:00:00 2001 From: QC Date: Sun, 20 Jan 2013 11:13:20 +0100 Subject: [PATCH] Check pkg-config result before compiling. --- config.mk | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index ec8fa91..ea3c3b3 100644 --- a/config.mk +++ b/config.mk @@ -19,9 +19,19 @@ XINERAMAFLAGS = -DXINERAMA # inih flags INIFLAGS = -DINI_ALLOW_MULTILINE=0 + +PKG_CONFIG=$(shell which pkg-config) +ifeq (${PKG_CONFIG}, ${EMPTY}) + $(error "Failed to find pkg-config, please make sure it is installed) +endif + # includes and libs -INCS = $(shell pkg-config --cflags dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver) -LIBS = -lm -L${X11LIB} -lXss ${XINERAMALIBS} $(shell pkg-config --libs dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver) +INCS = $(shell ${PKG_CONFIG} --cflags dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver) +LIBS = -lm -L${X11LIB} -lXss ${XINERAMALIBS} $(shell ${PKG_CONFIG} --libs dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver) + +ifeq (${INCS}, ${EMPTY}) + $(error Failed to find one ore move required dependencies: dbus-1 libxdg-basedir x11 freetype2 xext xft xscrnsaver) +endif # flags CPPFLAGS += -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} ${INIFLAGS}