Reinstate the freebsd pkg-config workaround in another form

This commit is contained in:
Oliver Jowett 2020-08-07 14:43:44 +08:00
parent c3017cc0a4
commit 74e11bd26f
1 changed files with 7 additions and 1 deletions

View File

@ -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)