wg: abstract pkg-config to PKG_CONFIG

Distros like Exherbo have multitarget setups with toolnames prefixed by
the arch.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2016-11-02 11:50:52 +01:00
parent 971c792ba9
commit a97901e4fd

View file

@ -4,6 +4,7 @@ BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib LIBDIR ?= $(PREFIX)/lib
MANDIR ?= $(PREFIX)/share/man MANDIR ?= $(PREFIX)/share/man
RUNSTATEDIR ?= /var/run RUNSTATEDIR ?= /var/run
PKG_CONFIG ?= pkg-config
CFLAGS ?= -O3 CFLAGS ?= -O3
CFLAGS += -std=gnu11 CFLAGS += -std=gnu11
@ -12,8 +13,8 @@ CFLAGS += -MMD -MP
CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR)\"" CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR)\""
LDLIBS += -lresolv LDLIBS += -lresolv
ifeq ($(shell uname -s),Linux) ifeq ($(shell uname -s),Linux)
LIBMNL_CFLAGS := $(shell pkg-config --cflags libmnl 2>/dev/null) LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null)
LIBMNL_LDLIBS := $(shell pkg-config --libs libmnl 2>/dev/null || echo -lmnl) LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
CFLAGS += $(LIBMNL_CFLAGS) CFLAGS += $(LIBMNL_CFLAGS)
LDLIBS += $(LIBMNL_LDLIBS) LDLIBS += $(LIBMNL_LDLIBS)
endif endif