Add FreeBSD support
FreeBSD support, reworked from earlier pr by @neveragainde
This commit is contained in:
parent
a2480a2769
commit
f497d7481f
26
Makefile
26
Makefile
|
|
@ -1,8 +1,5 @@
|
|||
PROGNAME=dump1090
|
||||
|
||||
RTLSDR ?= yes
|
||||
BLADERF ?= yes
|
||||
|
||||
CPPFLAGS += -DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\"
|
||||
|
||||
DIALECT = -std=c11
|
||||
|
|
@ -12,8 +9,9 @@ LIBS = -lpthread -lm
|
|||
UNAME := $(shell uname)
|
||||
|
||||
ifeq ($(UNAME), Linux)
|
||||
LIBS += -lrt
|
||||
CFLAGS += -D_DEFAULT_SOURCE
|
||||
LIBS += -lrt
|
||||
LIBS_USB += -lusb-1.0
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME), Darwin)
|
||||
|
|
@ -23,13 +21,27 @@ ifeq ($(UNAME), Darwin)
|
|||
endif
|
||||
CFLAGS += -DMISSING_NANOSLEEP
|
||||
COMPAT += compat/clock_nanosleep/clock_nanosleep.o
|
||||
LIBS_USB += -lusb-1.0
|
||||
BLADERF ?= no
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME), OpenBSD)
|
||||
CFLAGS += -DMISSING_NANOSLEEP
|
||||
COMPAT += compat/clock_nanosleep/clock_nanosleep.o
|
||||
LIBS_USB += -lusb-1.0
|
||||
BLADERF ?= no
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME), FreeBSD)
|
||||
CFLAGS += -D_DEFAULT_SOURCE
|
||||
LIBS += -lrt
|
||||
LIBS_USB += -lusb
|
||||
BLADERF ?= no
|
||||
endif
|
||||
|
||||
RTLSDR ?= yes
|
||||
BLADERF ?= yes
|
||||
|
||||
ifeq ($(RTLSDR), yes)
|
||||
SDR_OBJ += sdr_rtlsdr.o
|
||||
CPPFLAGS += -DENABLE_RTLSDR
|
||||
|
|
@ -38,14 +50,14 @@ ifeq ($(RTLSDR), yes)
|
|||
CPPFLAGS += -I$(RTLSDR_PREFIX)/include
|
||||
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
|
||||
else
|
||||
CFLAGS += $(shell pkg-config --cflags librtlsdr)
|
||||
CFLAGS += $(shell pkg-config --cflags-only-I librtlsdr)
|
||||
LDFLAGS += $(shell pkg-config --libs-only-L librtlsdr)
|
||||
endif
|
||||
|
||||
ifeq ($(STATIC), yes)
|
||||
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
|
||||
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic $(LIBS_USB)
|
||||
else
|
||||
LIBS_SDR += -lrtlsdr -lusb-1.0
|
||||
LIBS_SDR += -lrtlsdr $(LIBS_USB)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ Binaries are built in the source directory; you will need to arrange to
|
|||
install them (and a method for starting them) yourself.
|
||||
|
||||
"make BLADERF=no" will disable bladeRF support and remove the dependency on
|
||||
libbladeRF. This may be required on some platforms (e.g. MacOS).
|
||||
libbladeRF. Default is yes on Linux, no on other platforms.
|
||||
|
||||
"make RTLSDR=no" will disable rtl-sdr support and remove the dependency on
|
||||
librtlsdr.
|
||||
librtlsdr. Default is yes.
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
# define le16toh(x) OSSwapLittleToHostInt16(x)
|
||||
# define le32toh(x) OSSwapLittleToHostInt32(x)
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/endian.h>
|
||||
|
||||
#else // other platforms
|
||||
|
||||
# include <endian.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue