From 2eef202ee1476b613944c4709f366edcf40f0716 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 14 Oct 2019 09:46:39 +1030 Subject: [PATCH] Use pkg-config to get CFLAGS & LDFLAGS for libftdi1 Pull request #535 --- src/platforms/libftdi/Makefile.inc | 3 ++- src/platforms/pc-hosted/Makefile.inc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platforms/libftdi/Makefile.inc b/src/platforms/libftdi/Makefile.inc index b890e86..d48a5a7 100644 --- a/src/platforms/libftdi/Makefile.inc +++ b/src/platforms/libftdi/Makefile.inc @@ -1,6 +1,7 @@ SYS = $(shell $(CC) -dumpmachine) CFLAGS += -DPC_HOSTED -DNO_LIBOPENCM3 -DENABLE_DEBUG -LDFLAGS += -lftdi1 +CFLAGS += $(shell pkg-config --cflags libftdi1) +LDFLAGS += $(shell pkg-config --libs libftdi1) ifneq (, $(findstring mingw, $(SYS))) LDFLAGS += -lusb-1.0 -lws2_32 else ifneq (, $(findstring cygwin, $(SYS))) diff --git a/src/platforms/pc-hosted/Makefile.inc b/src/platforms/pc-hosted/Makefile.inc index 14106e9..7af7743 100644 --- a/src/platforms/pc-hosted/Makefile.inc +++ b/src/platforms/pc-hosted/Makefile.inc @@ -1,7 +1,8 @@ TARGET=blackmagic_hosted SYS = $(shell $(CC) -dumpmachine) CFLAGS += -DPC_HOSTED -DNO_LIBOPENCM3 -DENABLE_DEBUG -LDFLAGS += -lftdi1 +CFLAGS += $(shell pkg-config --cflags libftdi1) +LDFLAGS += $(shell pkg-config --libs libftdi1) ifneq (, $(findstring mingw, $(SYS))) LDFLAGS += -lusb-1.0 -lws2_32 CFLAGS += -Wno-cast-function-type