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.
This commit is contained in:
Oliver Jowett 2015-05-31 11:34:42 +01:00
parent 069ebf37c7
commit 9aa60c46ef
6 changed files with 9 additions and 8 deletions

View File

@ -29,6 +29,7 @@
//
#include "coaa.h"
#include "dump1090.h"
#include "rtl-sdr.h"
//
// ============================= Utility functions ==========================
//

View File

@ -57,11 +57,9 @@
#include <ctype.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#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

View File

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

View File

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

View File

@ -52,7 +52,6 @@
#include <fcntl.h>
#include <ctype.h>
#include <sys/stat.h>
#include "rtl-sdr.h"
#include "anet.h"
#include <netdb.h>
#else

View File

@ -51,7 +51,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "rtl-sdr.h"
#include "anet.h"
#else
#include "winstubs.h" //Put everything Windows specific in here