Merge pull request #37 from real-dam/cross-pkg-config

Improve cross-building by honoring PKG_CONFIG from environment
This commit is contained in:
Joseph C. Lehner 2020-05-11 16:20:26 +02:00 committed by GitHub
commit 7d901d078f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
CC ?= gcc
PKG_CONFIG ?= pkg-config
PREFIX ?= /usr/local
VERSION := $(shell if [ -d .git ] && which git 2>&1 > /dev/null; then git describe --always | tail -c +2; else echo $$STANDALONE_VERSION; fi)
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