From 74e11bd26f057a3fc13d72a92a40980e12c6629e Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 7 Aug 2020 14:43:44 +0800 Subject: [PATCH] Reinstate the freebsd pkg-config workaround in another form --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0f59bbd..6c99b3f 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,14 @@ ifeq ($(RTLSDR), yes) LIBS_SDR += -L$(RTLSDR_PREFIX)/lib -lrtlsdr $(LIBS_USB) endif else - CFLAGS += $(shell pkg-config --cflags librtlsdr) # some packaged .pc files are massively broken, try to handle it + + # FreeBSD's librtlsdr.pc includes -std=gnu89 in cflags + RTLSDR_CFLAGS := $(shell pkg-config --cflags librtlsdr) + CFLAGS += $(filter-out -std=%,$(RTLSDR_CFLAGS)) + + # some linux librtlsdr packages return a bare -L with no path in --libs + # which horribly confuses things because it eats the next option on the command line RTLSDR_LFLAGS := $(shell pkg-config --libs-only-L librtlsdr) ifeq ($(RTLSDR_LFLAGS),-L) LIBS_SDR += $(shell pkg-config --libs-only-l --libs-only-other librtlsdr)