Rework use of pkg-config to work around librtlsdr packaging bugs in ubuntu disco

This commit is contained in:
Oliver Jowett 2019-04-17 11:58:59 +08:00
parent f13f8dfce8
commit 34bfe10317

View file

@ -15,16 +15,20 @@ ifeq ($(RTLSDR), yes)
ifdef RTLSDR_PREFIX ifdef RTLSDR_PREFIX
CPPFLAGS += -I$(RTLSDR_PREFIX)/include CPPFLAGS += -I$(RTLSDR_PREFIX)/include
LDFLAGS += -L$(RTLSDR_PREFIX)/lib ifeq ($(STATIC), yes)
LIBS_SDR += -L$(RTLSDR_PREFIX)/lib -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
else
LIBS_SDR += -L$(RTLSDR_PREFIX)/lib -lrtlsdr -lusb-1.0
endif
else else
CFLAGS += $(shell pkg-config --cflags librtlsdr) CFLAGS += $(shell pkg-config --cflags librtlsdr)
LDFLAGS += $(shell pkg-config --libs-only-L librtlsdr) # some packaged .pc files are massively broken, try to handle it
endif RTLSDR_LFLAGS := $(shell pkg-config --libs-only-L librtlsdr)
ifeq ($(RTLSDR_LFLAGS),-L)
ifeq ($(STATIC), yes) LIBS_SDR += $(shell pkg-config --libs-only-l --libs-only-other librtlsdr)
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0 else
else LIBS_SDR += $(shell pkg-config --libs librtlsdr)
LIBS_SDR += -lrtlsdr -lusb-1.0 endif
endif endif
endif endif