From 9aa60c46ef347629396f88e0648d7ee4108ea047 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 31 May 2015 11:34:42 +0100 Subject: [PATCH] Avoid librtlsdr dependency for utilities that don't use it. Tne only place that really needs the rtlsdr headers/libs is dump1090.c itself. There is a dependency on rtlsdr_dev_t in the shared Modes struct in dump1090.h, but this is a pointer type so we can just use a dummy struct definition there to avoid the header dependency. This lets us build faup1090 (for the piaware package) without needing a useless librtlsdr-dev build-time dependency. --- dump1090.c | 1 + dump1090.h | 6 ++++-- makeppup1090 | 4 ++-- makeview1090 | 4 ++-- ppup1090.h | 1 - view1090.h | 1 - 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dump1090.c b/dump1090.c index 0c09300..f7ddc45 100644 --- a/dump1090.c +++ b/dump1090.c @@ -29,6 +29,7 @@ // #include "coaa.h" #include "dump1090.h" +#include "rtl-sdr.h" // // ============================= Utility functions ========================== // diff --git a/dump1090.h b/dump1090.h index 85f8aec..30b29a7 100644 --- a/dump1090.h +++ b/dump1090.h @@ -57,11 +57,9 @@ #include #include #include - #include "rtl-sdr.h" #include "anet.h" #else #include "winstubs.h" //Put everything Windows specific in here - #include "rtl-sdr.h" #include "anet.h" #endif @@ -187,6 +185,10 @@ //======================== structure declarations ========================= +// forward declaration of RTL-SDR device struct to avoid a dependency +// on RTL-SDR for those utils that don't actually use it +typedef struct rtlsdr_dev rtlsdr_dev_t; + // Structure used to describe a networking client struct client { struct client* next; // Pointer to next client diff --git a/makeppup1090 b/makeppup1090 index 9df60aa..70d837a 100644 --- a/makeppup1090 +++ b/makeppup1090 @@ -10,8 +10,8 @@ SHAREDIR=$(PREFIX)/share/$(PROGNAME) EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\" endif -CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr` -LIBS=`pkg-config --libs librtlsdr` -lpthread -lm +CFLAGS=-O2 -g -Wall -W +LIBS=-lpthread -lm CC=gcc diff --git a/makeview1090 b/makeview1090 index 6cb76af..b749c8f 100644 --- a/makeview1090 +++ b/makeview1090 @@ -10,8 +10,8 @@ SHAREDIR=$(PREFIX)/share/$(PROGNAME) EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\" endif -CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr` -LIBS=`pkg-config --libs librtlsdr` -lpthread -lm +CFLAGS=-O2 -g -Wall -W +LIBS=-lpthread -lm CC=gcc diff --git a/ppup1090.h b/ppup1090.h index f7ac643..5d3a55f 100644 --- a/ppup1090.h +++ b/ppup1090.h @@ -52,7 +52,6 @@ #include #include #include - #include "rtl-sdr.h" #include "anet.h" #include #else diff --git a/view1090.h b/view1090.h index 05a9ebf..3d9fa02 100644 --- a/view1090.h +++ b/view1090.h @@ -51,7 +51,6 @@ #include #include #include - #include "rtl-sdr.h" #include "anet.h" #else #include "winstubs.h" //Put everything Windows specific in here