From eb2e44e0eb590a0c39c39798e9d84a46916f511a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 18 Feb 2018 15:43:28 +1100 Subject: [PATCH] Makefile: use PKG_CONFIG to get static compilation flags as well --- src/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Makefile b/src/Makefile index f315d007..83284128 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,6 +26,11 @@ deps := $(addprefix ., $(sources:.cc=$(suffix).d)) PKG_CONFIG ?= $(shell command -v pkg-config 2>/dev/null) +ifeq ($(static),yes) + PKG_CONFIG_FLAGS += -static + LDFLAGS += -static -pthread +endif + PREFIX ?= /usr/local DESTDIR ?= # root dir @@ -58,16 +63,11 @@ else $(error "pkg-config not found in PATH") endif - LIBS += $(shell $(PKG_CONFIG) --libs ncursesw) - CPPFLAGS += $(shell $(PKG_CONFIG) --cflags ncursesw) + LIBS += $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs ncursesw) + CPPFLAGS += $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags ncursesw) LDFLAGS += -rdynamic endif -ifeq ($(static),yes) - LIBS += -ltinfo -lgpm - LDFLAGS += -static -pthread -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