From 1679444dceb2fb9b299463699e344a79d3e984a3 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 10 May 2020 07:13:35 +0000 Subject: [PATCH] Improve cross-building by honoring PKG_CONFIG from environment This is in response to Debian bug #960165 by Helmut Grohne. When cross-building, another pkg-config is used that accounts for the target architecture. The patch makes it possible to supply that via the PKG_CONFIG environment variable and defaults to 'pkg-config' so no such variable defaults to native build. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 797aaac..640d7cd 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ CC ?= gcc +PKG_CONFIG ?= pkg-config PREFIX ?= /usr/local VERSION = $(shell git describe --always | tail -c +2) LIBS = -lpcap @@ -6,8 +7,8 @@ CFLAGS += -Wall -g -DNMRPFLASH_VERSION=\"$(VERSION)\" LDFLAGS += $(LIBS) ifeq ($(shell uname -s),Linux) - CFLAGS += $(shell pkg-config libnl-route-3.0 --cflags) - LIBS += $(shell pkg-config libnl-route-3.0 --libs) + CFLAGS += $(shell $(PKG_CONFIG) libnl-route-3.0 --cflags) + LIBS += $(shell $(PKG_CONFIG) libnl-route-3.0 --libs) endif nmrpflash_OBJ = nmrp.o tftp.o ethsock.o main.o util.o -- 2.25.1